#Marminoleo
1 messages ยท Page 1 of 1 (latest)
Please provide the request id req_xxx
Normally it means the PaymentIntent belongs to a different account and you possibly mixing up Direct Charge and Destination Charge
req_4QzM0SVchZdadU
I use this code
$payment_intent = $stripe->paymentIntents->create( [ 'amount' => 1000 'currency' => 'eur', 'automatic_payment_methods' => ['enabled' => true], 'application_fee_amount' => 123, 'transfer_data' => [ 'destination' => 'connected_account_id', ] ] );
I have a response with client_secret but the payment form show me an error that the client_secret doesn't match any paymentIntent on this account
But when I do that
$payment_intent = $stripe->paymentIntents->create( [ 'amount' => (round($price, 2) * 100) + $commission, //Montant 1000 = 10โฌ / 100 = 1โฌ (en centimes) 'currency' => 'eur', 'automatic_payment_methods' => ['enabled' => true], 'application_fee_amount' => round($commission, 2) * 100, //Montant de la commission RP ], ['stripe_account' => 'acct_1MriQuCLpbjdQt6z'] );
Payment work
It looks like the client secret belongs to the Platform, and this req_4QzM0SVchZdadU is a Direct Charge on a Connected Account, so it can't find the PaymentIntent
If you paste here the PaymentIntent Id (pi_xxx) we can show you further
Yep because here you are creating a PaymentIntent on the ConnectedAccount, and this is Direct Charge
pi_3MtR3RFv2J8gIl2V0cv9BGVE
Ok I understand but this is not what I want
When I initialize my payment form, I use Platform ID ?
const stripe = Stripe('pk_xxxxx', { stripeAccount: 'platform_id' });
Because payment go to platform and after the payment is transfered to connected account with transfer_data['destination'] parameter. I'm right ?
๐ taking over for my colleague. Let me catch up.
no you need to pass the connected account ID
This is what I do but I have the error "The client_secret provided does not match any associated PaymentIntent on this account."
you need to pass the Platform's publishable key and the Connected Account ID in stripeAccount
As an object ?
I'm not sure I understand
I pass Platform's publishable key and Connected Account ID in stripeAccount parameter as an object ?
Like that ?
const stripe = Stripe('pk_xxxxxxx', { stripeAccount: 'connected account ID' });
It's what I'm doing and I have the client_secret not corresponding error
let's be clear
you need to use the publishable key of acct_1MojXsFv2J8gIl2V with the stripeAccount acct_1MriQuCLpbjdQt6z
I'm sorry but I don't understand what is this account acct_1MojXsFv2J8gIl2V ?
This account as any link with Platform account ?
acct_1MojXsFv2J8gIl2V is the platform account
Ok I understand
but pk_test_xxxxxx that I use is the publishable key of this account and stripeAccount is the connected account ID no ?
for what request?
for the request req_kvYyWtwamTM2fI
I try :
$payment_intent = $stripe->paymentIntents->create( [ 'amount' => 1000 'currency' => 'eur', 'automatic_payment_methods' => ['enabled' => true], 'application_fee_amount' => 123 'transfer_data' => [ 'destination' => 'acct_1MriQuCLpbjdQt6z', ] ] );
I receive a client_secret based on paymentIntent made on platform account (acct_1MojXsFv2J8gIl2V)
After that I try to load the payment form with
const stripe = Stripe('pk_test_acct_1MojXsFv2J8gIl2V', { stripeAccount: 'acct_1MriQuCLpbjdQt6z' });
And the result is the error "The client_secret provided does not match any associated PaymentIntent on this account." and the payment form is not loaded.
I'm good or not ?
the pk_test is wrong
you need to copy the pk_test from https://dashboard.stripe.com/test/apikeys
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
it's not pk_test_acct_xxx
yes I use the pk_test I found in api_keys I just indicate you this is the pk_test key from the acct_1MojXsFv2J8gIl2V account
I use this key : pk_test_51MojXsFv2J8gIl2VIdiqWQNwJ9tj2iifwuq6umgxUilpQ8un3rH7JA35vAURyp5PlJJ7vyllRo97KJyddb6xxxxxxxxxxxxx
please delete the key from the chat
and even if it's a publishable test key it's better if you roll it
oh I didn't see the xxxxx at the end!
good one! ๐
yes that's the correct publishable key
And the result is the error "The client_secret provided does not match any associated PaymentIntent on this account." and the payment form is not loaded.
would you mind sharing the request ID?
I think it's that pi_3MtRuLFv2J8gIl2V0GsgW1bf
I can show the paymentIntent with this ID in log of platform AND connected account
Hi! I'm taking over my colleague. Please, give me a moment to catch up.
Ok thank you
const stripe = Stripe('pk_test_acct_1MojXsFv2J8gIl2V', {
stripeAccount: 'acct_1MriQuCLpbjdQt6z'
});
This is not right, you should be using your Publishable Key to load Stripe
Instead of the pk_key ?
You can the Publushable Key find it on your dashboard: https://dashboard.stripe.com/test/apikeys
Sorry I meant Publishable Key pk_test_xxx
Because after I do that :
`const options = {
clientSecret: "client_secret_key",
};
const elements = stripe.elements(options);`
Yes, that's right. But you should use the pk_test_xxx to load stripe
I know I use the correct pk_key but in my message I indicate this key to show you I use the pk_key of the acct_1MojXsFv2J8gIl2V account
I think I do all you say but I still have the error "The client_secret provided does not match any associated PaymentIntent on this account."
For this request : req_kvYyWtwamTM2fI
I do :
$payment_intent = $stripe->paymentIntents->create( [ 'amount' => 1000 'currency' => 'eur', 'automatic_payment_methods' => ['enabled' => true], 'application_fee_amount' => 123 'transfer_data' => [ 'destination' => 'acct_1MriQuCLpbjdQt6z', //connected account ] ] );
This return me a client secret key.
I do that to display payment form :
`const stripe = Stripe('pk_test_xxxxxxxx', { //pk_key of platform account
stripeAccount: 'acct_1MriQuCLpbjdQt6z' //connected account id
});
const options = {
clientSecret: "secret_key_xxxxx", //client secret key I receive from paymentIntent
};
const elements = stripe.elements(options);
const paymentElement = elements.create("payment");
paymentElement.mount("#payment-element");`
And the result is the payment form is not display and the error message is : "The client_secret provided does not match any associated PaymentIntent on this account."
You should not use the stripeAccount header, as this PaymentIntent was created on the Platform.
This is a Destination charge: 'transfer_data' => ['destination' ...
And in Destination charges the PI lives on the Platform
So it needs to be confirmed on the Platform too.
Thank you for your response. So if I understand, here :
const stripe = Stripe('pk_test_xxxxxxxx', { //pk_key of platform account stripeAccount: 'acct_1MriQuCLpbjdQt6z' //connected account id });
I just need to do :
const stripe = Stripe('pk_test_xxxxxxxx', {});
I'm right ?
Yes
I try
Sure, please, let me know if you have any other questions.
It work good ! Rally thank you for your help !
Have a good day
Happy to help! You too.