Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PP-11602 enable wallet config for stripe test gateways #4139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/utils/display-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ module.exports = function (req, data, template) {
convertedData.isTestGateway = _.get(convertedData, 'currentGatewayAccount.type') === 'test'
convertedData.isSandbox = paymentProvider === 'sandbox'
convertedData.isDigitalWalletSupported = paymentProvider === 'worldpay' ||
(paymentProvider === 'stripe' && process.env.ALLOW_ENABLING_DIGITAL_WALLETS_FOR_STRIPE_ACCOUNT === 'true')
(paymentProvider === 'stripe' && process.env.ALLOW_ENABLING_DIGITAL_WALLETS_FOR_STRIPE_ACCOUNT === 'true') ||
(paymentProvider === 'stripe' && convertedData.isTestGateway === true)
convertedData.currentService = service
convertedData.isLive = req.isLive
convertedData.humanReadableEnvironment = convertedData.isLive ? 'Live' : 'Test'
Expand Down
11 changes: 11 additions & 0 deletions app/utils/display-converter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,15 @@ describe('Display converter', function () {
}, {}, {})
expect(data.isDigitalWalletSupported).to.equal(true)
})

it('should return isDigitalWalletSupported=true for Stripe account when gateway type is test and ALLOW_ENABLING_DIGITAL_WALLETS_FOR_STRIPE_ACCOUNT is false', () => {
process.env.ALLOW_ENABLING_DIGITAL_WALLETS_FOR_STRIPE_ACCOUNT = 'false'
const data = displayConverter({
account: {
type: 'test',
payment_provider: 'stripe'
}
}, {}, {})
expect(data.isDigitalWalletSupported).to.equal(true)
})
})