#Marminoleo

1 messages ยท Page 1 of 1 (latest)

wild plumeBOT
past notch
#

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

frank osprey
#

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

wild plumeBOT
frank osprey
#

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

past notch
#

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

past notch
frank osprey
#

pi_3MtR3RFv2J8gIl2V0cv9BGVE

frank osprey
frank osprey
#

Because payment go to platform and after the payment is transfered to connected account with transfer_data['destination'] parameter. I'm right ?

limber horizon
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

limber horizon
frank osprey
#

This is what I do but I have the error "The client_secret provided does not match any associated PaymentIntent on this account."

limber horizon
#

you need to pass the Platform's publishable key and the Connected Account ID in stripeAccount

frank osprey
#

As an object ?

limber horizon
#

I'm not sure I understand

frank osprey
#

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

limber horizon
#

let's be clear

#

you need to use the publishable key of acct_1MojXsFv2J8gIl2V with the stripeAccount acct_1MriQuCLpbjdQt6z

frank osprey
#

I'm sorry but I don't understand what is this account acct_1MojXsFv2J8gIl2V ?
This account as any link with Platform account ?

limber horizon
#

acct_1MojXsFv2J8gIl2V is the platform account

frank osprey
#

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 ?

limber horizon
#

for what request?

frank osprey
#

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 ?

limber horizon
#

the pk_test is wrong

#

it's not pk_test_acct_xxx

frank osprey
#

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

limber horizon
#

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?

wild plumeBOT
frank osprey
#

I think it's that pi_3MtRuLFv2J8gIl2V0GsgW1bf

#

I can show the paymentIntent with this ID in log of platform AND connected account

stone pine
#

Hi! I'm taking over my colleague. Please, give me a moment to catch up.

frank osprey
#

Ok thank you

stone pine
#
const stripe = Stripe('pk_test_acct_1MojXsFv2J8gIl2V', {
       stripeAccount: 'acct_1MriQuCLpbjdQt6z'
 });
#

This is not right, you should be using your Publishable Key to load Stripe

frank osprey
#

Instead of the pk_key ?

stone pine
#

Sorry I meant Publishable Key pk_test_xxx

frank osprey
#

Because after I do that :

`const options = {
clientSecret: "client_secret_key",
};

const elements = stripe.elements(options);`

stone pine
#

Yes, that's right. But you should use the pk_test_xxx to load stripe

frank osprey
#

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."

stone pine
#

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.

frank osprey
#

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 ?

stone pine
#

Yes

frank osprey
#

I try

stone pine
#

Sure, please, let me know if you have any other questions.

frank osprey
#

It work good ! Rally thank you for your help !
Have a good day

stone pine
#

Happy to help! You too.