Skip to content

Commit

Permalink
feat(payment): ADYEN-313 improved interface of payment widget
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-koshovyi committed Jan 30, 2023
1 parent e400137 commit 7d36593
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Draft
- 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)
Expand Down
14 changes: 13 additions & 1 deletion assets/js/theme/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,19 @@ export default class Account extends PageManager {
color: 'green',
},
},
countries: this.context.countries,
initializeData: {
countries: this.context.countries,
paymentsUrl: this.context.paymentsUrl,
storeHash: this.context.storeHash,
storeLocale: this.context.storeLocale,
vaultToken: this.context.vaultToken,
shopperId: this.context.shopperId,
customerEmail: this.context.customerEmail,
providerId: this.context.providerId,
currencyCode: this.context.currencyCode,
paymentMethodsUrl: this.context.paymentMethodsUrl,
paymentProviderInitializationData: this.context.paymentProviderInitializationData,
},
});
}

Expand Down
8 changes: 5 additions & 3 deletions templates/pages/account/add-payment-method.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand All @@ -40,9 +45,6 @@ <h2 class="page-heading">{{lang 'forms.payment_methods.add.heading'}}</h2>
{{{ account_payments }}}
<script>
window.BigCommerce = window.BigCommerce || {};
window.BigCommerce.customerEmail = '{{customer.email}}';
window.BigCommerce.providerId = '{{forms.provider}}';
window.BigCommerce.currencyCode = '{{currency_selector.active_currency_code}}';
</script>
{{else}}
<form data-payment-method-form class="form">
Expand Down

0 comments on commit 7d36593

Please sign in to comment.