diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b56c2534..6e07921d37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed en-CA translation warning in terminal. [#2278][https://github.com/bigcommerce/cornerstone/pull/2278] - Added manual captcha to Contact Us form for additional spam protection. [#2290](https://github.com/bigcommerce/cornerstone/pull/2290) - Fixed PDP not respecting "quantity box" display settings. [#2291](https://github.com/bigcommerce/cornerstone/pull/2291) +- Added integrarion of storefront-account-payments lib [#2288][https://github.com/bigcommerce/cornerstone/pull/2288] ## 6.7.0 (11-03-2022) - Fixed escaping on created store account confirm message. [#2265]https://github.com/bigcommerce/cornerstone/pull/2265 diff --git a/assets/js/theme/account.js b/assets/js/theme/account.js index 608dc7883b..860d5a2e84 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,31 @@ export default class Account extends PageManager { this.initReorderForm($reorderForm); } + if ($bigCommerce && $bigCommerce.accountPayments) { + 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..5edfa30693 100644 --- a/templates/pages/account/add-payment-method.html +++ b/templates/pages/account/add-payment-method.html @@ -36,76 +36,85 @@