#tehalsingh_22956

1 messages ยท Page 1 of 1 (latest)

valid viperBOT
torpid vigil
#

๐Ÿ‘‹ happy to help

#

if you create a subscription with a trial period or a 100% discount you will get a null latest_invoice.payment_intent

#

in these case you need to use subscription.pending_setup_intent

tranquil pivot
#

i need to implement 3d secure payment method.

#

I'm not using Trail or coupon.

torpid vigil
#

would you mind sharing an example?

tranquil pivot
#

I'm using php code

        $data['customer'] = $user->stripe->stripe_customer_id;
        $data['items'] = [
            [
                'price' => $selectedPlan->stripe_plan_id
            ],
        ];
        
        $data['expand'] = ['latest_invoice.payment_intent'];
        $data['off_session'] = true;
        $data['payment_behavior'] = "allow_incomplete";
        $subscription = \Stripe\Subscription::create($data);
#

Subscription object suppose to have latest_invoice.payment_intent in the response

valid viperBOT
remote knoll
#

Can you share the subscription ID that you're working with?

tranquil pivot
#

yes, sure

#

sub_1NaHsfCDMd8oJhR4s49ip7Cv

remote knoll
#

I see that the subscription does have an invoice attached, can you share the response you're getting from the API request?

tranquil pivot
#

yes sure

remote knoll
#

Looks like the invoice was created for 0 amount

tranquil pivot
remote knoll
#

Because the subscription when its created won't have any usage reported

#

You can look at the invoice itself, since there no usage, there won't be any billing

#

Hence subscription has "pending_setup_intent": "seti_1NaHsgCDMd8oJhR4fzf4TpfE"

#

This allows you to collect payment method

#

using elements

tranquil pivot
#

okey, in this case do we need to cancel the subscription if card authencation is failed.

remote knoll
#

It is upto you. You as a merchant control the whole flow/experience ๐Ÿ™‚

tranquil pivot
#

I mean it's required or not.

remote knoll
#

Depends on your usecase.

tranquil pivot
#

okey

#

can you suggest the laravel laravel/cashier version.

#

As i have to retreive the setupintent

My laravel version is 5.7 and laravel/cashier: 7.0

#

in the current version of my stripe sdk SetuIpntent class is missing

remote knoll
#

What version of Stripe SDK are you running? The SetupIntents have been present since many versions

Also, our team on discord won't know a ton about the specific version you need with laravel. You'd need to look at the documentation we have available and decide accordingly.