I implemented paypal express checkout using braintree https://developer.paypal.com/docs/accept-payments/express-checkout/ec-braintree-sdk/client-side/javascript/v3/ <script>
var config = {
braintree: braintree,
// Configure environment
env : '{$Payment->env}',
client : {
sandbox : '{$Payment->paypalClientToken}', //this is generated in server using BrainTree PHP SDK
production: '{$Payment->paypalClientToken}'
},
// Customize button (optional)
locale : 'en_EE',
style : {
size : 'medium',
color : 'gold',
label : "pay",
shape : 'pill',
tagline: false
},
commit : true,
// Set up a payment
payment: function (data, actions)
{
return actions.braintree.create({
flow : 'checkout', // Required
amount : {$Payment->Order->orderSumGross->formatPrice()->replace(",",".")}, // Required
currency : 'EUR', // Required
enableShippingAddress : false,
shippingAddressEditable: false
});
},
// Execute the payment
onAuthorize: function (payload)
{
$("#paypalWrapper").html("Palun oota.. töötlen makset");
Php.Order.validatePaypal(payload.nonce,{$Payment->Order->orderID}).call(function (goToUrl)
{
window.location = goToUrl;
});
},
};
paypal.Button.render(config, '#paypalWrapper');
</script> And i get get error "Auth Api invalid client id" Screenshot : https://tppr.me/bQhZZ Few weeks ago it worked fine. I have correct access tokens for both poruction and sandbox envinronment's
... View more