Skip to content

Commit

Permalink
DT-22841 - fix currency switch
Browse files Browse the repository at this point in the history
  • Loading branch information
robin.ott committed Nov 19, 2024
1 parent b44fa4e commit cbbd70c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const consoleOutput = (e, response) => {
document.querySelector('.console-content').scrollTop = document.querySelector('.console-content').scrollHeight;
};

let taxItem = {
label: 'Tax',
amount: { value: '2.50', currency: 'USD' }
};

const payment = {
// W3C spec
details: {
Expand All @@ -27,10 +32,7 @@ const payment = {
amount: { value: '4', currency: 'USD' },
},
displayItems: [
{
label: 'Tax',
amount: { value: '2.50', currency: 'USD' },
},
taxItem
],
},
// W3C spec
Expand Down Expand Up @@ -89,6 +91,7 @@ $(document).ready(function () {

if (data.target.id === 'currency') {
payment.details.total.amount.currency = data.target.value;
taxItem.amount.currency = data.target.value;
PaymentButton.create(document.getElementById('paybutton'), payment);
}

Expand Down

0 comments on commit cbbd70c

Please sign in to comment.