I am using stripe.js2 payment element by @copilot for a direct charge on the connected account. The payment intent is created successfully and I have the connected account configured in the payment element. At the moment the payment element won’t load and I get an error that it cannot find the payment intent. I assume it is looking on the platform’s stripe account for the payment intent instead of the connected account.
I have logged several emails with @copilot with no response, even reporting this as a bug with logs etc.
I have even paid $90 to have an online session, but despite many attempts to use the session, I have been unable to get any response from @copilot.
It may be very well that I am doing something wrong, so as a last resort I am checking to see if anyone has the payment element working and can provide a solution.
Thanks in advance of any response.
I am having this exact issue right now.
Have you figured out what was wrong?
I’m also having the same issue. Were you able to figure it out?
Make sure you expose console logs in development mode and send across the logs
I finally figured out what the issue was. When you click the element there’s a field to add the Account ID of the user for Direct payment intent.
If you’re getting a “Payment Method not found” for connected accounts this is most likely the solution.
I’m surprised at how this isn’t covered in any of the courses. I bought two of them and almost paid $90 to have them show me this field. I found this in the code of the plugin lol.
Check out my response. Might be the same issue.
Thanks! I’ll give it a try
Just an update on this.
I get the following error in the logs
-
error:
-
message: “The client_secret provided does not match any associated PaymentIntent on this account.”
-
param: “client_secret”
-
request_log_url: “Stripe Login | Sign in to the Stripe Dashboard”
-
status: 400
-
type: “invalid_request_error”
I can find this request error in the local stripe account.
The payment intent and client secret are on a connected account, when I create the payment element I pass in this client secret and specify the connected account.
It appears that it is looking in the current stripe account rather than the connected account.
For those who posted, was you account in the local stripe account or the connected account?
I retested this with a customer, payment intent in the local stripe account and it works fine, it seems it doesn’t work on connected accounts, or I am doing somethig wrong.
you can always use backend workflows and get it done there. initiate a api worflow in the backend, then ae it a payment intent API worflow, then bac kon your page mae a button to trigger that, then back on backend worflows, create your stripe payment intent using stipe js element, then mae change to yor data and save both payment intent id and payment intent client secret.
Then, back on your page, refer to the saved client secret as " when Search for external api" (stripe.js payment intent) when its client secret is not empty,
create steps …
I found the issue on the stripe.js2 plugin. @copilot missed assigning the value of the account number before calling the the function for “create_payment_with” and “create_setup_with.” Basically, payments and setups will work only for the platform and not the sellers. I do need to mention that the logic created by @copilot is good. It needs a minor tweak for it to work. I have forwarded all the information to copilot via the copilot website.
I created my own plugin to address the issue of the Stripe payment element. I was able to “create a setup with” and “payment intent with” the payment element and get the stripe payment element visible without any issues. No more 400 errors.
Also, I moved the stripe Seller / Account ID to workflow. That way it’s easier to control when a payment / setup will be handled by the platform or the seller account.
Summary: The stripe.js2 is missing the account id when creating a call to Stripe.