diff --git a/CHANGELOG.md b/CHANGELOG.md index 9679fe2131..f384eccb00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix sold-out badge appearance [#2315](https://github.com/bigcommerce/cornerstone/pull/2315) - Remove xlink attributes on svg [#2322](https://github.com/bigcommerce/cornerstone/pull/2322) - form.serialize() ignores dropdown option elements that have the disabled attribute [#2326](https://github.com/bigcommerce/cornerstone/pull/2326) +- Extended BigCommerce.accountPayments app initialization interface [#2317](https://github.com/bigcommerce/cornerstone/pull/2317) ## 6.8.0 (01-26-2023) - Add remote_api_scripts into cart/preview template to let GA3 snippet to fire the Product Added event, when clicking Add to cart button on Product detail page and rendering the response in popup. [#2281](https://github.com/bigcommerce/cornerstone/pull/2281) diff --git a/assets/js/theme/account.js b/assets/js/theme/account.js index 860d5a2e84..6b3906232a 100644 --- a/assets/js/theme/account.js +++ b/assets/js/theme/account.js @@ -84,6 +84,20 @@ export default class Account extends PageManager { } if ($bigCommerce && $bigCommerce.accountPayments) { + const { + countries, + paymentsUrl, + storeHash, + storeLocale, + vaultToken, + shopperId, + customerEmail, + providerId, + currencyCode, + paymentMethodsUrl, + paymentProviderInitializationData, + } = this.context; + window.BigCommerce.accountPayments({ widgetStyles: { base: { @@ -104,7 +118,19 @@ export default class Account extends PageManager { color: 'green', }, }, - countries: this.context.countries, + initializeData: { + countries, + paymentsUrl, + storeHash, + storeLocale, + vaultToken, + shopperId, + customerEmail, + providerId, + currencyCode, + paymentMethodsUrl, + paymentProviderInitializationData, + }, }); } diff --git a/templates/pages/account/add-payment-method.html b/templates/pages/account/add-payment-method.html index 523a61f602..f018919985 100644 --- a/templates/pages/account/add-payment-method.html +++ b/templates/pages/account/add-payment-method.html @@ -23,6 +23,11 @@ {{inject 'vaultToken' vault.access_token}} {{inject 'shopperId' customer.id}} {{inject 'countries' countries}} + {{inject 'customerEmail' customer.email}} + {{inject 'providerId' forms.provider}} + {{inject 'currencyCode' currency_selector.active_currency_code}} + {{inject 'paymentProviderInitializationData' initialization_data}} + {{{inject 'storeLocale' settings.request.locale }}} {{> components/common/breadcrumbs breadcrumbs=breadcrumbs}} @@ -40,9 +45,6 @@

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

{{{ account_payments }}} {{else}}