#LucaW-3DS-Subscriptions
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Hi,
I get the setup intent with this function(CheckoutApi.getSetupIntent):
Return \Stripe\SetupIntent::create([
'customer' => $customer->id,
'payment_method_types' => ['card'],
'usage' => 'off_session',
]);
CheckoutApi.getSetupIntent(
this.state.userData.email
).then(setupIntentResponse => {
this.props.stripe.confirmCardSetup(setupIntentResponse.client_secret, {
payment_method: {
card: cardElement,
},
}).then(cardSetupResponse => {
const paymentMethodId = cardSetupResponse.setupIntent.payment_method;
โฆ.
$subscription = \Stripe\Subscription::create([
'customer' => $customer->id,
'default_payment_method' => $paymentMethodId,
'items' => [
[
'price_data' => [
'unit_amount' => $monthlyAmount->asCents(),
'currency' => 'eur',
'product' => $product_id,
'recurring' =>
['interval' => 'month']
],
]
],
"application_fee_percent" => $totalPercentage,
"transfer_data" => [
"destination" => $partnerStripeAccount->getStripeUserId(),
],
"metadata" => $metadata,
]);
โฆ.
})
})
Let me know if this is clear
I see you're setting usage on the setup intent to off_session, but I'm not seeing you set the off_session parameter when creating the subscription:
https://stripe.com/docs/api/subscriptions/create#create_subscription-off_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.