user16897456
user16897456

Reputation:

API integration related problem in Stripe

In Payment Intent API (https://stripe.com/docs/api/payment_intents/object) , Many of the places it is written "RETRIEVABLE WITH PUBLISHABLE KEY" fo ex- id, currency, payment_method, what does it mean?

Whether it means that we can retrieve these value when we integrating the client SDK?

Upvotes: 0

Views: 125

Answers (1)

os4m37
os4m37

Reputation: 1133

The publishable key is used in your client-side code https://stripe.com/docs/keys#:~:text=On%20the%20client%2Dside.%20Can%20be%20publicly%2Daccessible%20in%20your%20web%20or%20mobile%20app%E2%80%99s%20client%2Dside%20code

So yes, when using Stripe SDK on your client-side using the publishable key (pk_xxx) you can retrieve only the fields that mention “retrievable with publishable key” in the doc.

If you use your secret key (sk_xxx) to retrieve a PaymentIntent, you will get access to all its properties. Also, if you want to create a PaymentIntent you must use the secret key in your backend.

Upvotes: 0

Related Questions