#cac3a-new-pm
1 messages ยท Page 1 of 1 (latest)
Hey there! This isn't possible but you don't really need to do this.
You can pass card objects to the payment_method param
is it as card[token] = card_x123 ?
I've been trying and can't seem to get it working
What language are you using and what exactly are you trying to do?
Also if you are hitting a certain error message then that would be helpful as well
I have stripe working under my account without issue. However, I have a customer that I have integrated through stripe connected accounts to charge under their account for some of our services. The issue is that all of their customers have card_ objects and our integration is based on payment methods.
Gotcha. So yeah you can pass the card object (card_xxxx) into the PaymentIntent's payment_method param just like you would with a paymentmethod object (pm_xxxx). That param is here: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so something like this curl https://api.stripe.com/v1/payment_intents
-u sk_tess sj00APexo3qc:
-d amount=2000
-d currency=usd
-d "payment_method"="card_zxcq23"
?
Yep exactly
Also please delete that key
Even if it is a test key that is sensitive data that someone could use to get control of your account.
I'd recommend rolling your keys as well.
thanks
so got the request built up
and getting the following error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such PaymentMethod: 'card_434343432N1CUn'",
"param": "payment_method",
"type": "invalid_request_error"
simply means that the card is not there ?
๐ @bismark had to step away but I can help -do you have the request ID (req_xxx) that resulted in that error?
I didn't see request id in the response
You should be able to find it in your dashboard at https://dashboard.stripe.com/test/logs
this one wasn't in test
Let's approach this from a different angle then - is card_434343432N1CUn the exact object ID you got back from the error message? Or did you change it at all before pasting it here?
yeah
i was using wrong card
customer just updated it
how would this work if i have payment method and they change a card after pm has been established. Will it still work >
under new card
or I need to generate new pm each time card is added
What did they update about it?
I dunno, but I looked at their profile and it was different card_id and expiration was different. But maybe I used a wrong before (it was my assumption that card has changed).
So now with pi -> how do I go to pm ?
my ultimate original goal was to arrive at payment method
and my understanding (perhaps wrong) was that i need pi first
I am a bit unclear on your question. Is this still related to your question on creating the PaymentIntent?
From my understanding, you have these card_ objects and can pass their ID in to anything that is requesting a payment method ID. You shouldn't need to create a separate payment method for these.
The "No such PaymentMethod" error could be coming from a couple of places but it is hard to tell without the specific request ID from when you got that error. Do you have the full response that you got this error from?
Sorry for confusing you and others.
My original goal is to be able to use card_ object and establish payment method. I have established payment intent successfuly, but now not sure how to go from pi_ to pm_.
You would Check the PaymentIntent's payment_method property https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you are using a card, that will also have the card_123 ID because you can use those IDs interchangeably here
so am i understanding you correctly that on the payment intent object for payment_method you can use card_ or pm_ objects without any issues.
Correct. You can use either
ok thank you. In which cases card_ object id would change ?