Skip to content

Commit

Permalink
PAYMENTS-4944 update payment methods list to show all stored instrume…
Browse files Browse the repository at this point in the history
…nt types
  • Loading branch information
leeBigCommerce committed Dec 24, 2019
1 parent 5f1d5c5 commit 27b0c2b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

.paymentMethodName {
margin-top: 0;
padding: 0 spacing("half");
padding: 0;
text-transform: none;
}

Expand Down Expand Up @@ -98,6 +98,8 @@
}

.paymentMethod-card {
justify-content: space-between;
flex-flow: row;
align-items: center;
background: white;
padding: spacing("half");
Expand Down Expand Up @@ -126,7 +128,10 @@
}

.paymentMethod-meta {
padding-left: spacing("half");
margin-left: auto;
display: flex;
flex-wrap: nowrap;
}

.paymentMethod-default {
Expand Down
19 changes: 10 additions & 9 deletions templates/components/account/payment-methods-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{{> components/common/alert-info (lang 'account.payment_methods.no_methods')}}
{{/unless}}

<ul class="paymentMethodList">
{{#each customer.payment_methods}}
{{#if @key '!==' 'selected_payment_method'}}
<h4 class="paymentMethodName">
{{display_name}}
</h4>
{{#each customer.payment_methods}}
{{#if @key '!==' 'selected_payment_method'}}
<h4 class="paymentMethodName">
{{display_name}}
</h4>
<ul class="paymentMethodList">
{{#each stored_instruments}}
{{!-- Check that the current instrument type is within our whitelist to stop future ones automagically coming through --}}
{{#inArray ../../../theme_settings.supported_instrument_types ../type}}
Expand Down Expand Up @@ -82,6 +82,7 @@ <h5 class="paymentMethod-title">{{lang 'account.payment_methods.new_payment_meth
</a>
</li>
{{/if}}
{{/if}}
{{/each}}
</ul>
</ul>
{{/if}}
{{/each}}

3 changes: 1 addition & 2 deletions templates/pages/account/edit-payment-method.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ <h3 class="paymentMethodForm-heading">{{lang 'account.payment_methods.billing_ad
{{/if}}
<div class="form-actions">
<input type="submit" class="button button--primary" value="{{lang 'forms.payment_methods.submit_value'}}">
<a href="{{urls.account.payment_methods.all}}" class="button">{{lang 'common.cancel'}}</a>
<a href="{{../urls.account.payment_methods.all}}" class="button">{{lang 'common.cancel'}}</a>
{{inject 'required' (lang 'common.required')}}
{{inject 'state_error' (lang 'errors.state_error')}}
</div>
</form>
{{/with}}
</div>

{{/partial}}
{{> layout/base}}

0 comments on commit 27b0c2b

Please sign in to comment.