Skip to content

Commit

Permalink
refactor(app/checkout): not auto-selecting subscription periodicity a…
Browse files Browse the repository at this point in the history
…nymore

rendering subscription periodicity as required and labeled <select> by default on credit card form

new opt prop `gatewayOptionsLabel` on <CreditCardForm>
  • Loading branch information
leomp12 committed Sep 21, 2023
1 parent f62d234 commit 5c17404
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions @ecomplus/storefront-app/src/components/html/CreditCardForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,22 @@
v-if="gatewayOptions && gatewayOptions.length"
class="form-group"
>
<label
v-if="gatewayOptionsLabel"
for="credit-card-gateway"
>
{{ gatewayOptionsLabel }}
</label>
<select
class="custom-select"
id="credit-card-gateway"
@change="ev => $emit('select-gateway', gatewayOptions[ev.target.value])"
required
>
<option
v-if="gatewayOptionsLabel"
value=""
>--</option>
<option
v-for="({ label }, i) in gatewayOptions"
:value="i"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<credit-card-form
v-if="shouldUseCardForm"
:gateway-options="cardFormGatewayOptions"
:gateway-options-label="i19chooseSubscriptionPeriod"
@select-gateway="onCardFormSelectGateway"
:amount="amount"
:check-holder="customerName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default {
isCompany: Boolean,
installmentOptions: Array,
gatewayOptions: Array,
gatewayOptionsLabel: String,
jsClient: Object,
jsClientLoad: Promise,
isPayerDocRequired: {
Expand Down
2 changes: 2 additions & 0 deletions @ecomplus/storefront-app/src/components/js/PaymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
i19anyPaymentMethodMsg,
i19changePaymentMethod,
i19checkout,
i19chooseSubscriptionPeriod,
i19generateBillet,
i19interestFree,
i19ofDiscount,
Expand Down Expand Up @@ -90,6 +91,7 @@ export default {
computed: {
i19anyPaymentMethodMsg: () => i18n(i19anyPaymentMethodMsg),
i19changePaymentMethod: () => i18n(i19changePaymentMethod),
i19chooseSubscriptionPeriod: () => i18n(i19chooseSubscriptionPeriod),
i19checkout: () => i18n(i19checkout),
i19generateBillet: () => i18n(i19generateBillet),
i19interestFree: () => i18n(i19interestFree),
Expand Down

0 comments on commit 5c17404

Please sign in to comment.