John Moore
John Moore

Reputation: 7129

PayPal Braintree integration - what is the access token?

I am trying to use PayPal Express Checkout with the Braintree SDK and unfortunately the documentation is seriously inadequate in some places. I need to generate a client code on the server (with Java), for which I need to use the following code to generate the gateway object according to the docs:

BraintreeGateway gateway = new BraintreeGateway(useYourAccessToken);

Unfortunately it doesn't explain what access token it is referring to. I seem to be able to generate an access token with 'Generate Sandbox Access Token' under 'My Apps & Credentials' in the PayPal dashboard, and this works. But it has an unusably short expiry date, expiring at the end of today, which obviously makes testing problematic if I have to change the code every day.

There seems to be another constructor for BraintreeGateway, allowing me to pass in an environment specifier (e.g. sandbox), merchant ID, public key and private key. I believe that the public key and private key parameters might be what is visible to me as client ID and secret, in 'SANDBOX API CREDENTIALS', but I'm not sure what merchant ID is.

Any help would be most appreciated.

Upvotes: 2

Views: 789

Answers (1)

John Moore
John Moore

Reputation: 7129

Idiocy on my part. I wasn't looking closely enough at the expiry date. It's not today, it's 10 years from today! Duh.

Upvotes: 0

Related Questions