If you are using the stripe.js 2 plugin and you run into the error “no such payment method” or the error “this payment method might be for a connected account” then this might help.
I created a marketplace platform where I have sellers and end users. I wanted to add a feature to allow sellers to charge customer directly in case an end user calls the seller directly to make a reservation or buy a product.
The workflow is something like this:
- button confirm is clicked
- create a payment method using the stripe element
- create a customer
- attach payment method to customer
- update customer
- create payment intent
But I would always get an error.
The reason I was getting an error is because the connected account was creating the payment method, however, I wanted to create the customer on the platform side in Stripe (the owner account in stripe) and not on the connected account. Stripe is creating the PM on the connected account but I was leaving the connect account blank to create the customer on my platform account so Stripe throws an error saying the pm doesn’t exist or that the PM exists but it might be for a connected account.
So if ever you get this error, this might help.
Payment Intent Create Action
Another issue you might run into is on the Create Payment Intent Action
. If the PI is created by a connected account, make sure to choose Direct
in the transaction type under the Connect Section. Otherwise you might get an error saying that the PM, Customer, etc. doesn’t exist and it might be created for a connected account.
I sent an emailed Copilot to ask if it’s possible to add a “connect” section in the create a payment method action. Maybe there will be an update for this. → Update June 5 2023 - No answer from @copilot.
Little disclaimer
There could be other reasons why you might get this error, but if it seems like you set everything up correctly and you can see the PM is generated in the debugger, I’m just saying that this might be a path to look into.
Hope this helps!