mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
27 lines
502 B
JavaScript
27 lines
502 B
JavaScript
function onboardingCallback(authCode, sharedId) {
|
|
fetch(
|
|
PayPalCommerceGatewayOnboarding.endpoint,
|
|
{
|
|
method: 'POST',
|
|
headers: {
|
|
'content-type': 'application/json'
|
|
},
|
|
body: JSON.stringify(
|
|
{
|
|
authCode: authCode,
|
|
sharedId: sharedId,
|
|
nonce: PayPalCommerceGatewayOnboarding.nonce
|
|
}
|
|
)
|
|
}
|
|
)
|
|
.then( response => response.json() )
|
|
.then(
|
|
(data) => {
|
|
if (data.success) {
|
|
return;
|
|
}
|
|
alert( PayPalCommerceGatewayOnboarding.error )
|
|
}
|
|
);
|
|
}
|