#tianyouli-cloning-pm
1 messages ยท Page 1 of 1 (latest)
Hello ๐
You seem to be passing pm_card_visa_debit as a parameter when you're running the code.
You'd need to pass an actual payment method ID instead.
Can you share the request ID that's seeing this error? (i.e. req_xxx)
req_hJgjOsQfIGgGFW
(I was trying direct charge on a test Standard connected account)
It was working when using pm_card_visa_debit for payment intent API testing for destination charge but for direct charge the payment method need to be cloned so I was trying to mimic that
I think the pm_card_visa_debit payment method may only work with PaymentIntent API and creating a new payment method
It might not work with cloning
Have you tried passing in an actual payment method ID?
Not yet. I'm trying to set up API (or backend) testing for successful/failure cases. How can I mimic create new Customer, create a Payment Method, clone it to test direct charge code with pre-defined transaction results (success, dispute, requires action, charge declined etc)?
How can I mimic create new Customer, create a Payment Method, clone it to test direct charge code with pre-defined transaction results (success, dispute, requires action, charge declined etc)?
What do you mean by mimic? Can you share a little bit about your usecase?
If we can't use payment methods like pm_card_visa_debit then we have to add a card manually from the Stripe dashboard or from front-end integration, right? I was able to use pm_card_visa_debit to create payment intent directly when testing destination charge with Custom connected account. Now we are trying to test direct charge with Standard connected account.
If we can't use payment methods like pm_card_visa_debit then we have to add a card manually from the Stripe dashboard or from front-end integration, right?
that's correct
I was able to use pm_card_visa_debit to create payment intent directly when testing destination charge with Custom connected account. Now we are trying to test direct charge with Standard connected account.
As far as my understanding goes, you need to create the PaymentMethod and attach it to a customer before you can clone it.
There's no way to create payment methods using API calls only, right? I guess I'll have to create customer and their success/disputed payment methods via Stripe dashboard with test card numbers before hand and use them for testing?
While you can create a PaymentMethod by calling the API, we recommend that you don't use it for production and rely on Stripe.js to collect payment method information
https://stripe.com/docs/api/payment_methods/create
If this is purely for testing then you can use the API to create PaymentMethods
Let me know if that helps @storm oasis