Auth Api invalid client id

gpseesti
Contributor
Contributor

I implemented paypal express checkout using braintree 

https://developer.paypal.com/docs/accept-payments/express-checkout/ec-braintree-sdk/client-side/java...

 

 

<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

Login to Me Too
1 REPLY 1

MTS_Jennifer
Moderator
Moderator

Hello,

Thank you for posting to the PayPal Sandbox Community.

The Error message you are receiving is that the client token you are passing in is invalid.

The very first step is to generate a Client Token.

Make sure when you are generating that token that you are storing it as a session variable.

You may need to do a var dump to make certain that the correct Client Token is getting passed in to the request.

 

Thank you,

Jennifer

PayPal

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.