enable loginseller endpoint to switch between sandbox and live

This commit is contained in:
David Remer 2020-09-24 10:29:09 +03:00
parent 6f870ec7a5
commit 09a5f0e466
3 changed files with 63 additions and 18 deletions

View file

@ -1,4 +1,5 @@
function onboardingCallback(authCode, sharedId) {
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on')
fetch(
PayPalCommerceGatewayOnboarding.endpoint,
{
@ -10,7 +11,8 @@ function onboardingCallback(authCode, sharedId) {
{
authCode: authCode,
sharedId: sharedId,
nonce: PayPalCommerceGatewayOnboarding.nonce
nonce: PayPalCommerceGatewayOnboarding.nonce,
env: sandboxSwitchElement && sandboxSwitchElement.checked ? 'sandbox' : 'production'
}
)
}