#_nerder

1 messages ยท Page 1 of 1 (latest)

arctic violetBOT
rough vault
#

What are you trying to do? How are you collecting the mandate information?

gentle fulcrum
#

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

rough vault
#

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?

gentle fulcrum
#

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

rough vault
#

Can you share the request ID where you create the Checkout Session?

gentle fulcrum
#

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,
        ),
      ),
    );
  }
rough vault
#

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

gentle fulcrum
#

umm, I was under the impression that checkout will do that for me

rough vault
gentle fulcrum
#

Oh great

rough vault
#

Okay I'm trying to reproduce this error, give me a minute

gentle fulcrum
#

thank you so much

#

i'm trying something too

gentle fulcrum
#

no luck, i'm very confused

rough vault
#

Okay I just went through creating a SEPA debit PM using Checkout

#

And it created a Payment Method with a related mandate

gentle fulcrum
#

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

rough vault
#

I just used IDEAL in my test integration and it still returned a SEPA DD PM with a related mandate

gentle fulcrum
#

yes, for me too

rough vault
#

Can you share the PM id?

gentle fulcrum
#

pm_1O0oiELAVB3C1lDIkXVlwcY5

#

this one is the last one

#

and the mandate is there

rough vault
#

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?

gentle fulcrum
#

the subscription get's created, but the PI not confirmed with the same error

rough vault
#

Can you share the PI id?

gentle fulcrum
#

yes, one sec

#

pi_3O0orVLAVB3C1lDI0FX5WJMr_secret_l6MTTLhq4i5uxPUE4qJrTdfEv

#

the req is here: req_PoHmkjmw71RYFI

rough vault
#

This PI is in a status of requires_confirmation which assumes the customer is on-session and can confirm the purchase

gentle fulcrum
#

oooh I see

#

Let me check real quick

#

A M A Z I N G

#

โค๏ธ

#

It was actually that

rough vault
#

Hooray ๐ŸŽ‰ I'm glad we reached a solution ๐Ÿ™‚

gentle fulcrum
#

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

rough vault
#

That's why we're here. And it'll become more natural once you break it a few more times

#

๐Ÿ˜…

gentle fulcrum
#

eheh

#

you folks are the best really

#

i'm sorry to bother every so often

rough vault
#

No worries.

#

I'm going to close this thread out since we appear to have resolved the issue.