#_nerder
1 messages ยท Page 1 of 1 (latest)
What are you trying to do? How are you collecting the mandate information?
i'm using checkout in setup mode
then I want to setup a direct debit with SEPA
the subscription get's created, but i'm not able to confirm the payment intent in the client due to this error
Wait
Okay so you are using Checkout to create the Payment Method and then you are trying to use the payment method to create a subscription off-session?
yes basically
i create the setup session with checkout, collect the payment method (SEPA via iDeal in this case)
and then with the payment method on file, i try to setup a subscription for that customer
but i'm not able to confirm the payment intent
When confirming a PaymentIntent with a PaymentMethod sepa_debit and setup_future_usage, mandate_data is required
Can you share the request ID where you create the Checkout Session?
yes give me a sec
req_5StQfGPfMQSt12
should be this one
this is how i create a subscription:
const stripeSub: Stripe.Subscription = await this.stripe.subscriptions.create(
{
customer: customerId,
items: [
{
price: subscriptionPlan.code,
},
],
cancel_at_period_end: subscriptionPlan.oneOff,
application_fee_percent: gym.transactionFee.percent,
trial_period_days: subscriptionPlan.freeTrial?.days ?? 0,
payment_behavior: 'default_incomplete',
payment_settings: {
payment_method_types: ['card', 'sepa_debit'],
},
expand: ['latest_invoice.payment_intent', 'pending_setup_intent'],
metadata: {
profileId,
},
},
{
stripeAccount: gym.accountId.value,
},
);
and this is how i confirm the payment intent:
@override
Future<void> confirmPayment({
required User profile,
required String clientSecret,
required String paymentMethodId,
String? onBehalfOf,
}) async {
_setupConnectedAccount(onBehalfOf);
await _stripe.confirmPayment(
paymentIntentClientSecret: clientSecret,
data: PaymentMethodParams.cardFromMethodId(
paymentMethodData: PaymentMethodDataCardFromMethod(
paymentMethodId: paymentMethodId,
),
),
);
}
Yeah, none of that should matter. As the error states we want to know when you are supposed to get the mandate set on your SEPA DD PM
umm, I was under the impression that checkout will do that for me
Yes, it should. Which is why I'm looking here https://stripe.com/docs/payments/sepa-debit/set-up-payment
Oh great
Okay I'm trying to reproduce this error, give me a minute
no luck, i'm very confused
Okay I just went through creating a SEPA debit PM using Checkout
And it created a Payment Method with a related mandate
ok, did you try with iDeal?
my suspect is that with iDeal the pm is that generated_sepa_debit which might not have the mandate
i'll try with sepa in the mean time
I've tested with sepa_debit without passing trough iDeal and still the same error
but the mandate is there indeed
I just used IDEAL in my test integration and it still returned a SEPA DD PM with a related mandate
yes, for me too
Can you share the PM id?
pm_1O0oiELAVB3C1lDIkXVlwcY5
this one is the last one
and the mandate is there
Yes I see the mandate on that one. I didn't see this on the first PM of yours i looked at. What happens when you try to create a subscription with this?
the subscription get's created, but the PI not confirmed with the same error
Can you share the PI id?
yes, one sec
pi_3O0orVLAVB3C1lDI0FX5WJMr_secret_l6MTTLhq4i5uxPUE4qJrTdfEv
the req is here: req_PoHmkjmw71RYFI
I'm looking at the request to create a Subsription. I think you need to pass the off-session parameter: https://stripe.com/docs/api/subscriptions/create#create_subscription-off_session
This PI is in a status of requires_confirmation which assumes the customer is on-session and can confirm the purchase
oooh I see
Let me check real quick
A M A Z I N G
โค๏ธ
It was actually that
Hooray ๐ I'm glad we reached a solution ๐
Thank you so much @rough vault
i don't think I would have been able to spot this one
I got very confused on how off session work
now it's super clear how this is expected to work