PayPal Checkout - Tell if Client ID is sandbox or production

GrizzT
Contributor
Contributor

Is there a way to tell if the Client ID or Client Secret is sandbox or production?

 

The reason why is to show a merchant that they are using sandbox credentials and not live ones. Like with Stripe they start with pk_test_ and sk_test_ so you know test credentials are being used?

Login to Me Too
1 REPLY 1

Brisbane22
Contributor
Contributor

Hi,

I'm guessing that your code is not the original source of the client ids. And that you are using V2 in JS e.g. in the html ...

<script src="https://www.paypal.com/sdk/js?currency=AUD&client-id=ShowClientIdHere"></script>

 

In my case, I know the sandbox and production client ids for our shop so it's not an issue. I assume you are receiving them from somewhere else?

 

The only thing I can say to help is that in my case, the sandbox client id includes an underscore and a dash (hyphen), and the production one does not.

Maybe that's a pattern you could use if it applies for your cases too. They are the same string length, so that's not a discriminator.

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.