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?
CodePudding user response:
The publishable key is used in your client-side code https://stripe.com/docs/keys#:~:text=On the client-side. Can be publicly-accessible in your web or mobile app’s client-side code
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.