1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

- Only show save card component if token billing isn't always

- Only show "Refunded" if amount is > 0
- Stripe: Grab only :checked checkbox
This commit is contained in:
Benjamin Beganović 2021-01-26 17:21:12 +01:00
parent a31477584e
commit 9f8df64289
6 changed files with 29 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=edc30120fdc238cd15ea",
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=c4012ad90f17d60432ad",
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=6dbe9316b98deea55421",
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=82ef694ae181badd4ffe",
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=9418a9c5c137994c4bd8",
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=9b9fd56d655ad238f149",
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=1b8f9325aa6e8595e7fa",
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",

View File

@ -90,7 +90,7 @@ class StripeCreditCard {
).value = JSON.stringify(result.paymentIntent);
let tokenBillingCheckbox = document.querySelector(
'input[name="token-billing-checkbox"]'
'input[name="token-billing-checkbox"]:checked'
);
if (tokenBillingCheckbox) {

View File

@ -1,17 +1,28 @@
@unless(isset($show_save) && $show_save == false)
<div class="{{ ($gateway->token_billing == 'optin' || $gateway->token_billing == 'optout') ? 'sm:grid' : 'hidden' }} px-4 py-5 sm:grid-cols-3 sm:gap-4 sm:px-6" id="save-card--container">
@if($gateway->company_gateway->token_billing !== 'always')
<div class="sm:grid px-4 py-5 sm:grid-cols-3 sm:gap-4 sm:px-6" id="save-card--container">
<dt class="text-sm leading-5 font-medium text-gray-500">
{{ ctrans('texts.save_payment_method_details') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<label class="mr-4">
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" id="proxy_is_default" value="true" {{ ($gateway->token_billing == 'always' || $gateway->token_billing == 'optout') ? 'checked' : '' }} />
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default"
value="true"/>
<span class="ml-1 cursor-pointer">{{ ctrans('texts.yes') }}</span>
</label>
<label>
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox" id="proxy_is_default" value="false" {{ ($gateway->token_billing == 'off' || $gateway->token_billing == 'optin') ? 'checked' : '' }} />
<input type="radio" class="form-radio cursor-pointer" name="token-billing-checkbox"
id="proxy_is_default"
value="false" checked />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.no') }}</span>
</label>
</dd>
</div>
@endunless
@else
<div id="save-card--container" class="hidden" style="display: none !important;">
<input type="radio" class="form-radio cursor-pointer hidden" style="display: none !important;"
name="token-billing-checkbox"
id="proxy_is_default"
value="true" checked hidden disabled/>
</div>
@endif

View File

@ -48,7 +48,7 @@
document
.querySelector('div[data-ref="gateway-container"]')
.scrollIntoView({ behavior: "smooth" });
.scrollIntoView({behavior: "smooth"});
});
</script>
@endpush

View File

@ -70,14 +70,16 @@
</div>
</div>
<div class="px-4 py-5 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium leading-5 text-gray-500">
{{ ctrans('texts.refunded') }}
</dt>
<div class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ \App\Utils\Number::formatMoney($payment->refunded, $payment->client) }}
@if($payment->refunded > 0)
<div class="px-4 py-5 bg-white sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
<dt class="text-sm font-medium leading-5 text-gray-500">
{{ ctrans('texts.refunded') }}
</dt>
<div class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ \App\Utils\Number::formatMoney($payment->refunded, $payment->client) }}
</div>
</div>
</div>
@endif
@endif
</dl>
</div>