diff --git a/app/assets/javascripts/browsered/web-payments/helpers.js b/app/assets/javascripts/browsered/web-payments/helpers.js index f5d50484a..96672e742 100644 --- a/app/assets/javascripts/browsered/web-payments/helpers.js +++ b/app/assets/javascripts/browsered/web-payments/helpers.js @@ -87,8 +87,8 @@ const getGooglePaymentsConfiguration = (paymentProvider) => { gateway: 'worldpay', gatewayMerchantId: window.googlePayGatewayMerchantID }), - // Providing 'worldpay' as the gateway with a blank gatewayMerchantId allows us to initiate a Google Pay payment - // when we're using the Google Pay test environment, which allows us to complete a Google Pay payment for sandbox + // In order to initiate a Google Pay payment in the Google Pay test environment without going to a real payment + // provider, the workaround is to specify ‘worldpay’ without a merchant id. ...(paymentProvider === 'sandbox' && { gateway: 'worldpay', gatewayMerchantId: '' diff --git a/test/unit/clients/connector-client-sandbox-google-pay-authentication.pact.test.js b/test/unit/clients/connector-client-sandbox-google-pay-authentication.pact.test.js index b08bc0670..922fca78f 100644 --- a/test/unit/clients/connector-client-sandbox-google-pay-authentication.pact.test.js +++ b/test/unit/clients/connector-client-sandbox-google-pay-authentication.pact.test.js @@ -55,8 +55,7 @@ describe('Connector Client - Google Pay authorisation API - Sandbox payment', fu connectorClient({ baseUrl: BASEURL }).chargeAuthWithWallet({ chargeId: TEST_CHARGE_ID, wallet: 'google', - payload: payload, - paymentProvider: 'worldpay' + payload: payload }).then(res => { expect(res.body.status).to.be.equal('AUTHORISATION SUCCESS') done() diff --git a/test/unit/clients/connector-client-worldpay-google-pay-authorisation.pact.test.js b/test/unit/clients/connector-client-worldpay-google-pay-authorisation.pact.test.js index 378973805..a15802512 100644 --- a/test/unit/clients/connector-client-worldpay-google-pay-authorisation.pact.test.js +++ b/test/unit/clients/connector-client-worldpay-google-pay-authorisation.pact.test.js @@ -63,8 +63,7 @@ describe('Connector Client - Google Pay authorisation API - Worldpay payment', f connectorClient({ baseUrl: BASEURL }).chargeAuthWithWallet({ chargeId: TEST_CHARGE_ID, wallet: 'google', - payload: payload, - paymentProvider: 'worldpay' + payload: payload }).then(res => { expect(res.body.status).to.be.equal('AUTHORISATION SUCCESS') done() @@ -98,8 +97,7 @@ describe('Connector Client - Google Pay authorisation API - Worldpay payment', f connectorClient({ baseUrl: BASEURL }).chargeAuthWithWallet({ chargeId: TEST_CHARGE_ID, wallet: 'google', - payload: payload, - paymentProvider: 'worldpay' + payload: payload }).then(res => { expect(res.body.status).to.be.equal('AUTHORISATION SUCCESS') done() @@ -130,8 +128,7 @@ describe('Connector Client - Google Pay authorisation API - Worldpay payment', f connectorClient({ baseUrl: BASEURL }).chargeAuthWithWallet({ chargeId: TEST_CHARGE_ID, wallet: 'google', - payload: payload, - paymentProvider: 'worldpay' + payload: payload }).then(res => { expect(res.body.status).to.be.equal('AUTHORISATION SUCCESS') done()