Skip to content

Commit

Permalink
fix(payment): PI-1958 added country code
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalii-koshovyi committed May 9, 2024
1 parent 6bacb06 commit e91de66
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ describe('GooglePayGateway', () => {
describe('#getTransactionInfo', () => {
it('should return ESTIMATED transaction info', async () => {
const expectedInfo = {
countryCode: 'US',
currencyCode: 'USD',
totalPriceStatus: 'ESTIMATED',
totalPrice: '0',
Expand All @@ -115,6 +116,7 @@ describe('GooglePayGateway', () => {

it('should return transaction info (Buy Now Flow)', async () => {
const expectedInfo = {
countryCode: 'US',
currencyCode: 'USD',
totalPriceStatus: 'ESTIMATED',
totalPrice: '0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@ export default class GooglePayGateway {
currencyCode = getCartOrThrow().currency.code;
}

const countryCode = this.getGooglePayInitializationData().storeCountry;

return {
...(countryCode && { countryCode }),
currencyCode,
totalPriceStatus: TotalPriceStatusType.ESTIMATED,
totalPrice: '0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ describe('GooglePayPaymentProcessor', () => {
merchantName: 'Example Merchant',
},
transactionInfo: {
countryCode: 'US',
currencyCode: 'USD',
totalPrice: '0',
totalPriceStatus: 'ESTIMATED',
Expand Down Expand Up @@ -313,6 +314,7 @@ describe('GooglePayPaymentProcessor', () => {
merchantName: 'Example Merchant',
},
transactionInfo: {
countryCode: 'US',
currencyCode: 'USD',
totalPrice: '0',
totalPriceStatus: 'ESTIMATED',
Expand Down

0 comments on commit e91de66

Please sign in to comment.