#Sumit Mitra-PaymentMethod

1 messages · Page 1 of 1 (latest)

solar kiln
#

Let's clarify a bit. Is above code your client code or server code?

#

Publishable Key is only for client. Secret key is for your server. There are Test mode secret key and Live mode secret key

wispy gorge
#

Ok so in front end I have a publishable key starting with pk

#

and in our server backend we have a key starting with sk

solar kiln
#

yes, that's correct

wispy gorge
#

it is in node

#

I am creating a payment method with card element in our frontend

#

and sending it to our back end where i am trying to attach it to a customer with pm id and customer id

solar kiln
#

Ah that's reasonable. The PaymentMethod you created in client using stripe.js?

wispy gorge
#

yes the react-stripe

solar kiln
#

In your client you have pk_text_xxx, right?

wispy gorge
#

Yes

solar kiln
#

that would be a test Publisable key

wispy gorge
#

in client pk key is there

solar kiln
#

in Node do you use a Live mode key? like sk_live_xxx?

wispy gorge
#

Yes in node sk key there

solar kiln
#

So a test pk key can only be used with a test sk key, and a live pk should be used with a live sk

wispy gorge
#

ok so how where do i get test sk key and test pk

solar kiln
wispy gorge
#

and can you help me in knowing if i can update the default paymethod of an already created customer

solar kiln
#

I believe you can, one sec

#

You can update the invoice_settings.default_payment_method to set the default payment