#dbjpanda

1 messages · Page 1 of 1 (latest)

graceful eagleBOT
shut phoenix
#

Hi
Can you share the Subscription Id please ?

radiant harbor
#

sub_1Mskf0SBUAj5B2VAhg4XH3Kq

#

It seems I need to add a customer authentication confirmation. But I am confused how to redirect user to that page.

shut phoenix
radiant harbor
#

This is my code where I charge a customer for first time.

return await stripe.checkout.sessions.create({
            line_items: [{
                price: price_id,
                quantity: 1
            }],
            mode: 'subscription',
            success_url: 'https://example.com/success',
            client_reference_id: uid,
            ...(stripeCustomerId ?
                {customer: stripeCustomerId} :
                {customer_email: context.auth.token.email}),
            subscription_data:{
                metadata:{
                    uid:uid
                }
            }
        });
graceful eagleBOT
radiant harbor
#

I am already adding mode: 'subscription',

#

Do I need to add anything else?

gaunt meadow
#

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

radiant harbor
#

Sure @gaunt meadow

gaunt meadow
radiant harbor
#

It didn't help me

gaunt meadow
#

As suggested, if you need to have the amount updated, it's best to delete the old Subscription and create a new one so the a mandate with a new amount can be generated.

radiant harbor
#

well, let me try again. Please stay tuned

radiant harbor
#

it seems, I tried 4242 4242 4242 4242 that does not simulate emadate.

#

But I tried with 4000003560000008 and I get following error

Only active mandates can be used with PaymentIntents

gaunt meadow
#

Where did you see the other card number?

radiant harbor
#

Check the testing section

#

This is the subscription id sub_1MsmIASBUAj5B2VAaAKG6hFh which says, payment incomplete with additional authentication required.

#

Do I need any additional permission while creating the subscription for first time?

gaunt meadow
#

payment incomplete with additional authentication required
Where do you see this message?

radiant harbor
#

I see this in stripe dashboard

#

And this is the error message I get from subscription_update() method that Only active mandates can be used with PaymentIntents

gaunt meadow
#

Could you please share a screenshot?

radiant harbor
#

@gaunt meadow here are few screenshots

graceful eagleBOT
glad mural
#

Thank you for the screenshots. vanya had to step out but I can help. Getting caught up here...

radiant harbor
#

@glad mural I already mentioned where do I see this. It is on stripe dashboard.

#

From the test logs, I get this error

payment_intent_mandate_invalid
Only active mandates can be used with PaymentIntents.

glad mural
#

Can you send me the ID of the request where you got that error message? (req_123)

#

I more meant what code are you calling when you get that error

radiant harbor
#

@glad mural here it is req_b5QxM97ve92jNq

glad mural
#

Thank you, checking in to that

#

Interesting, how did you get that request ID for that error? I see that request as being successful in our logs

radiant harbor
#

Ignore the error. I tried another test and the response was successful. But the payment is still not received.

#

Payment says, incomplete.

#

As you see here.

#

request body


{
  "payment_behavior": "pending_if_incomplete",
  "proration_behavior": "always_invoice",
  "items": {
    "0": {
      "id": "si_Ne5fxhjdodvYG1",
      "price": "price_1Ms90JSBUAj5B2VA0UQ8jmmh"
    }
  }
}

#

@glad mural I am stuck with this since 3 hrs. Any idea what is happening?

glad mural
#

Have you checked if that payment needs 3DS authentication? That is what it sounds lik

#

Incomplete isn't an error here by the way, it is the default state for payments and it will stay that way until the payment is cancelled or paid

radiant harbor
#

I already completed 3D secure. And initial payment was successful. But when trying to update the subscription to a higher tier, I get this payment incomplete (Requires user action).

glad mural
#

Yes, it sounds like the update payment needs 3DS as well

#

This is likely a test environment thing but in live mode a bank always can ask for 3DS on any payment so it is good to be prepared

radiant harbor
#

If the update payment needs 3D, then how can I display this 3d popup?

glad mural
#

You have three main options:

  1. Direct user to your custom page and present the modal there
  2. Send the user to the Stripe-hosted invoice page for the subscription's latest invoice
  3. Configure Stripe to send your user an email about this and Stripe will direct them to the invoice page
radiant harbor
#

So, I need to check if payment is incomplete after subscription update, I have to generate the 3d authentication url

glad mural
#

Yes, check if the invoice's payment intent's status is requires_action. If so, you need to use that URL or direct them to your custom page for showing 3DS

radiant harbor
#

Where can I check that?

#

Do I get the url in response of update_subscription()

glad mural