From e2f5a66c5941620e3e5ac90219eb2a21ba025091 Mon Sep 17 00:00:00 2001 From: Lee Dunkley Date: Wed, 27 Nov 2019 15:25:20 +1100 Subject: [PATCH] PAYMENTS-4975 update edit saved payment page to allow for paypal instruments --- .../pages/account/edit-payment-method.html | 86 +++++++++++-------- 1 file changed, 52 insertions(+), 34 deletions(-) diff --git a/templates/pages/account/edit-payment-method.html b/templates/pages/account/edit-payment-method.html index 7b581e735a..4e1384b695 100644 --- a/templates/pages/account/edit-payment-method.html +++ b/templates/pages/account/edit-payment-method.html @@ -12,43 +12,61 @@

{{lang 'forms.payment_methods.edit.heading'}}

{{> components/common/alert-error customer.payment_methods.selected_payment_method.forms.error}} {{/if}} -
- - - -

{{lang 'account.payment_methods.payment_method'}}

- -
-
-
{{lang 'account.payment_methods.credit_card_number'}}
-
**** **** **** {{customer.payment_methods.selected_payment_method.last_4}}
-
-
-
{{lang 'account.payment_methods.expiration'}}
-
{{customer.payment_methods.selected_payment_method.expiry_month}}/{{customer.payment_methods.selected_payment_method.expiry_year}}
-
-
- - -
-
+ {{#with customer.payment_methods.selected_payment_method}} + + + + {{!-- TODO: if this is empty/unset the endpoint should validate as if card for backwards compatability --}} + -

{{lang 'account.payment_methods.billing_address'}}

+

{{lang 'account.payment_methods.payment_method'}}

-
-
- {{#each customer.payment_methods.selected_payment_method.forms.billing_fields}} - {{{dynamicComponent 'components/common/forms'}}} - {{/each}} +
+ {{#if type '===' 'card'}} +
+
{{lang 'account.payment_methods.credit_card_number'}}
+
**** **** **** {{last_4}}
+
+
+
{{lang 'account.payment_methods.expiration'}}
+
{{expiry_month}}/{{expiry_year}}
+
+ {{/if}} + {{#if type '===' 'paypal'}} +
+

+ {{lang 'account.payment_methods.paypal'}} {{lang 'common.account'}} +

+

+ {{email}} +

+
+ {{/if}} +
+ + +
-
-
- - {{lang 'common.cancel'}} - {{inject 'required' (lang 'common.required')}} - {{inject 'state_error' (lang 'errors.state_error')}} -
-
+ + {{#if type '===' 'card'}} +

{{lang 'account.payment_methods.billing_address'}}

+ +
+
+ {{#each forms.billing_fields}} + {{{dynamicComponent 'components/common/forms'}}} + {{/each}} +
+
+
+ + {{lang 'common.cancel'}} + {{inject 'required' (lang 'common.required')}} + {{inject 'state_error' (lang 'errors.state_error')}} +
+ {{/if}} + + {{/with}} {{/partial}}