diff --git a/assets/js/theme/account.js b/assets/js/theme/account.js index 608dc7883b..90d62a06b9 100644 --- a/assets/js/theme/account.js +++ b/assets/js/theme/account.js @@ -32,6 +32,7 @@ export default class Account extends PageManager { const $paymentMethodForm = classifyForm('form[data-payment-method-form]'); const $reorderForm = classifyForm('[data-account-reorder-form]'); const $invoiceButton = $('[data-print-invoice]'); + const $bigCommerce = window.BigCommerce; compareProducts(this.context); @@ -82,6 +83,32 @@ export default class Account extends PageManager { this.initReorderForm($reorderForm); } + if ($bigCommerce && $bigCommerce.accountPayments) { + console.log(this.context); + window.BigCommerce.accountPayments({ + widgetStyles: { + base: { + color: '#666666', + cursor: 'pointer', + display: 'block', + fontSize: '1rem', + lineHeight: '1.5', + marginBottom: '0.5rem', + }, + error: { + color: 'red', + }, + placeholder: { + color: '#d8d8d8', + }, + validated: { + color: 'green', + }, + }, + countries: this.context.countries, + }); + } + this.bindDeleteAddress(); this.bindDeletePaymentMethod(); } diff --git a/templates/pages/account/add-payment-method.html b/templates/pages/account/add-payment-method.html index 832c9234ab..1808ff072d 100644 --- a/templates/pages/account/add-payment-method.html +++ b/templates/pages/account/add-payment-method.html @@ -36,76 +36,85 @@