#Kromolabs Developer-setup intent
1 messages · Page 1 of 1 (latest)
yes
that's one of the setup intent i'm testing seti_1KtSpaEWpJyoCJo9Pcbyf2Oj_secret_Lae7bIARiDqOVfGmE559jpZhUURwFB9
can you share your code please?
on the front end you're using the Stripe object which has the Stripe-Account header of the merchant right?
basically what I'm trying to say is that you created the Setup Intent using your Platform Account and you're trying to confirm it using the Connected Account
trying
Serverside i think it's on Connected Account, otherwise it shouldn't recognise cus_, right?
Client side this is the stripe object
var stripe = Stripe("pk_test_51Hf0wyG1EiuzslYuJQo2F40g95vVzyRzO6phUaJJJbYRNJ2C53vBlFUy4OPtwoWdTTxTF3FZAUWrCJsT6AaKXswH00MLeSoTis", {
stripeAccount: "acct_1HSeQmEWpJyoCJo9"
});
on the backend you're not using this header
stripeAccount: "acct_1HSeQmEWpJyoCJo9"
so basically the SetupIntent is created on the Platform
$stripe = new \Stripe\StripeClient(sk_test_51HSeQmEWpJyoCJo9qz8K7TioJUWZoJXUjB0WEGEYASKbumWPbT64hWFL6VekGRssG5pDAqjOHP6CyXAFe0CliLXe00EZ1TyNd5);
$setup_intent=$stripe->setupIntents->create([
'payment_method_types' => ['sepa_debit'],
'customer' => $_SESSION['loggato']['stripe_cus'],
]);
that's seti creation by backend
You created the SetupIntent using the Connect Account secret key, so this object belongs only to that Account which means when you're trying to confirm on the Front-End you're using both of the Platform Account and the Connect Account to authenticate the client_secret which means that there is going to be a mismatch
basically to fix that you need to instantiate your StripeClient on the backend the same way you did on the frontend with the secret key of the platform and passing the Stripe-Account header
oh, understood
\Stripe\SetupIntent::create(
$object->payment_intent,
[
'payment_method_types' => ['sepa_debit'],
'customer' => $_SESSION['loggato']['stripe_cus'],
], array('stripe_account' => acct_1HSeQmEWpJyoCJo9)
);
Something like that, correct?
\Stripe\Stripe::setApiKey(); with platform Api key
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so you can update the secret key here $stripe = new \Stripe\StripeClient(sk_test_xxxx); with the secret key of the platform
and then use stripe_account as mentioned here https://stripe.com/docs/api/connected_accounts?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Beautiful, thanks a lot!