-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAYMENTS-4944 update payment methods list to show all stored instrume…
…nt types
- Loading branch information
1 parent
0a4f0b0
commit 35360c6
Showing
7 changed files
with
146 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,87 @@ | ||
{{#unless customer.payment_methods}} | ||
{{#unless customer.payment_methods_v2}} | ||
{{> components/common/alert-info (lang 'account.payment_methods.no_methods')}} | ||
{{/unless}} | ||
|
||
<ul class="paymentMethodList"> | ||
{{#each customer.payment_methods}} | ||
{{#each customer.payment_methods_v2}} | ||
{{#if @key '!==' 'selected_payment_method'}} | ||
<h4 class="paymentMethodName">{{display_name}}</h4> | ||
{{#each methods}} | ||
<li class="paymentMethod"> | ||
<div class="panel panel--paymentMethod"> | ||
<div class="panel-body"> | ||
<div class="paymentMethod-card"> | ||
{{#if brand}} | ||
{{#inArray ../../../../theme_settings.supported_card_type_icons brand}} | ||
<img class="paymentMethod-icon" src="{{cdn (concat (concat 'img/payment-methods/' brand) '.svg')}}" alt="{{lang (concat 'account.payment_methods.card_types.' brand)}}" title="{{lang (concat 'account.payment_methods.card_types.' brand)}}"> | ||
{{/inArray}} | ||
<span class="paymentMethod-brand">{{lang (concat 'account.payment_methods.card_types.' brand)}} {{lang 'account.payment_methods.card_ending_in' last_four=last_4}}</span> | ||
{{else}} | ||
<img class="paymentMethod-icon" src="{{cdn 'img/payment-methods/card.svg'}}" alt="{{lang 'account.payment_methods.card_types.credit_card'}}" title="{{lang 'account.payment_methods.card_types.credit_card'}}"> | ||
<span class="paymentMethod-brand">{{lang 'account.payment_methods.card_types.credit_card'}} {{lang 'account.payment_methods.card_ending_in' last_four=last_4}}</span> | ||
{{/if}} | ||
<span class="paymentMethod-expiry">{{lang 'account.payment_methods.card_expiry' month=expiry_month year=expiry_year}}</span> | ||
{{#if default_instrument}} | ||
<svg class="paymentMethod-default icon"> | ||
<use xlink:href="#icon-star" /> | ||
</svg> | ||
{{/if}} | ||
</div> | ||
<dl class="paymentMethod-details"> | ||
<dt class="paymentMethod-label">{{lang 'account.payment_methods.billing_address'}}:</dt> | ||
<dd class="paymentMethod-description">{{billing_address.address_line_1}}, {{billing_address.address_line_2}}, {{billing_address.city}}, {{billing_address.state}}, {{billing_address.postal_code}}, {{billing_address.country_name}}</dd> | ||
</dl> | ||
<form class="paymentMethod-form" action="{{delete_url}}" method="post" data-delete-payment-method="{{lang 'forms.payment_methods.confirm_delete'}}"> | ||
<div class="form-actions"> | ||
<a class="button button--primary button--small" href="{{edit_url}}">{{lang 'common.edit' }}</a> | ||
<button type="submit" class="button button--small">{{lang 'common.delete' }}</button> | ||
<h4 class="paymentMethodName"> | ||
{{display_name}} | ||
</h4> | ||
{{#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}} | ||
<li class="paymentMethod"> | ||
<div class="panel panel--paymentMethod"> | ||
<div class="panel-body"> | ||
<div class="paymentMethod-card"> | ||
{{#if ../../type '===' 'card'}} | ||
{{!-- If credit card STARTS --}} | ||
{{#if brand}} | ||
{{#inArray ../../../../../../theme_settings.supported_card_type_icons brand}} | ||
<img class="paymentMethod-icon" src="{{cdn (concat (concat 'img/payment-methods/' brand) '.svg')}}" alt="{{lang (concat 'account.payment_methods.card_types.' brand)}}" title="{{lang (concat 'account.payment_methods.card_types.' brand)}}"> | ||
{{/inArray}} | ||
<span class="paymentMethod-brand">{{lang (concat 'account.payment_methods.card_types.' brand)}} {{lang 'account.payment_methods.card_ending_in' last_four=last_4}}</span> | ||
{{else}} | ||
<img class="paymentMethod-icon" src="{{cdn 'img/payment-methods/card.svg'}}" alt="{{lang 'account.payment_methods.card_types.credit_card'}}" title="{{lang 'account.payment_methods.card_types.credit_card'}}"> | ||
<span class="paymentMethod-brand">{{lang 'account.payment_methods.card_types.credit_card'}} {{lang 'account.payment_methods.card_ending_in' last_four=last_4}}</span> | ||
{{/if}} | ||
{{!-- If credit card ENDS --}} | ||
{{/if}} | ||
{{#if ../../type '===' 'paypal'}} | ||
{{!-- If paypal STARTS --}} | ||
<img class="paymentMethod-icon" src="{{cdn (concat (concat 'img/payment-methods/' ../../../type) '.svg')}}" alt="{{lang 'account.payment_methods.paypal'}}" title="{{lang 'account.payment_methods.paypal'}}"> | ||
<span class="paymentMethod-brand"> | ||
{{email}} | ||
</span> | ||
{{!-- If paypal ENDS --}} | ||
{{/if}} | ||
<div class="paymentMethod-meta"> | ||
{{#if expiry_year}} | ||
<span class="paymentMethod-expiry">{{lang 'account.payment_methods.card_expiry' month=expiry_month year=expiry_year}}</span> | ||
{{/if}} | ||
{{#if is_default}} | ||
<svg class="paymentMethod-default icon"> | ||
<use xlink:href="#icon-star" /> | ||
</svg> | ||
{{/if}} | ||
</div> | ||
</div> | ||
{{#if billing_address}} | ||
{{!-- If there is an address STARTS --}} | ||
<dl class="paymentMethod-details"> | ||
<dt class="paymentMethod-label">{{lang 'account.payment_methods.billing_address'}}:</dt> | ||
<dd class="paymentMethod-description">{{billing_address.address_line_1}}, {{billing_address.address_line_2}}, {{billing_address.city}}, {{billing_address.state}}, {{billing_address.postal_code}}, {{billing_address.country_name}}</dd> | ||
</dl> | ||
{{!-- If there is an address ENDS --}} | ||
{{/if}} | ||
<form class="paymentMethod-form" action="{{delete_url}}" method="post" data-delete-payment-method="{{lang 'forms.payment_methods.confirm_delete'}}"> | ||
<div class="form-actions"> | ||
{{#if edit_url}} | ||
<a class="button button--primary button--small" href="{{edit_url}}">{{lang 'common.edit' }}</a> | ||
{{/if}} | ||
{{#if delete_url}} | ||
<button type="submit" class="button button--small">{{lang 'common.delete' }}</button> | ||
{{/if}} | ||
</div> | ||
</form> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</li> | ||
</div> | ||
</li> | ||
{{/inArray}} | ||
{{/each}} | ||
<li class="paymentMethod"> | ||
<a class="panel panel--paymentMethod panel--newPaymentMethod" href="{{add_url}}"> | ||
<div class="panel-body"> | ||
<span class="paymentMethod-addNew"> | ||
<span class="paymentMethod-symbol">+</span> | ||
<h5 class="paymentMethod-title">{{lang 'account.payment_methods.new_payment_method' }}</h5> | ||
</span> | ||
</div> | ||
</a> | ||
</li> | ||
{{#if add_url}} | ||
<li class="paymentMethod"> | ||
<a class="panel panel--paymentMethod panel--newPaymentMethod" href="{{add_url}}"> | ||
<div class="panel-body"> | ||
<span class="paymentMethod-addNew"> | ||
<span class="paymentMethod-symbol">+</span> | ||
<h5 class="paymentMethod-title">{{lang 'account.payment_methods.new_payment_method' }}</h5> | ||
</span> | ||
</div> | ||
</a> | ||
</li> | ||
{{/if}} | ||
{{/if}} | ||
{{/each}} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters