#andonz

1 messages ยท Page 1 of 1 (latest)

fresh tigerBOT
fierce marten
#

That doesn't look right for a correct billing integration. How are you creating your Subscriptions?

formal burrow
#

Im using Stripe PHP Sdk, to ummarize shortly , first I create the payment intent from which I pass the intent_id param and data-secret

            'amount' => $data->amount == 0 ? 50 : floatval(number_format($data->amount, 2) * 100),
            'currency' => strtolower($data->currency),
            'payment_method_types' => ['card'],
            'confirm' => false,
            'setup_future_usage' => 'off_session',
          ]);```

and after capturing the payment, (based on the response from the api) if success I then create the subscription
fierce marten
#

You shouldn't be creating a Payment Intent and a Subscription

#

The Subscription will automatically create a Payment Intent if required, as you're experiencing above

formal burrow
#

okay, then how to handle 3ds scenarios? without creating a payment intent its not possible

fierce marten
fierce marten
#

As I stated, the Subscription will create an initial invoice which will include a Payment Intent if there's a payment required. You pass that from your backend to your front-end and call confirmPayment which handles 3DS/auth

formal burrow
#

Thank you, I will have a look ๐Ÿ™‚

undone skiff
#

๐Ÿ‘‹ how may I help?

formal burrow
#

Hi Tarzan, your colleague said that I dont need to create a payment intent and a subscription, how can I get the clientSecret without creating a payment intent?

#

from what I checked the client secret is retrieved $intent->client_secret after creating the intent

undone skiff
formal burrow
#

do i need to create the customer/ price/ subscription before capturing the payment?

#

so that I get the client secret > subscription.latest_invoice.payment_intent.client_secret

#

?

formal burrow
fresh tigerBOT
fierce marten
#

Pass payment_behavior: 'default_incomplete' when you create your Subscription, as per the guide we linked