#subhan_22659

1 messages · Page 1 of 1 (latest)

late kindleBOT
pale night
#

What's the specific issue

unkempt wind
#

A return_url must be specified because this Setup Intent is configured to automatically accept the payment methods enabled in the Dashboard, some of which may require a full page redirect to succeed. If you do not want to accept redirect-based payment methods, set automatic_payment_methods[allow_redirects] to never when creating Setup Intents and Payment Intents.

pale night
unkempt wind
#

Google bard give me this solution
is it fine

$setupIntent = $this->stripe->setupIntents->create([
'customer' => $customer,
'usage' => 'off_session',
'automatic_payment_methods' => [
'enabled' => true,
],
'return_url' => route('stripe.setup.intent.success')
]);

pale night
#

Did you try it? return_url needs to be an absolute URL, not a relative path

#

I've no idea what route('stripe.setup.intent.success') is

unkempt wind
#

I am trying will update you in a while
however what should be my return_url according to you

pale night
#

A URL where you want to return your customer to after they complete any additional payment steps

unkempt wind
#

Should it be mobile route or API webhook
'return_url'

pale night
#

It should be an absolute URL (https://your.website.com/return)

unkempt wind
#

But I don't want to redirect it anywhere as Mobile developers opens sheet on basis of setupIntent creates

pale night
#

If you're using AutoPM, which you are, then it's required as the customer may checkout/pay using a PM which requires a redirect

unkempt wind
#

can it be static website url
will it effect any flow

pale night
#

The URL to redirect your customer back to after they authenticate on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods.

#

So imagine a checkout flow, your customer is redirected to their bank to confirm/authenticate the payment. This is the URL that we will send them back to after they complete the confirmation/authentication

unkempt wind
#

After setting return_url
$setupIntent = $this->stripe->setupIntents->create([
'customer' => $customer,
'usage' => 'off_session',
'automatic_payment_methods' => [
'enabled' => true,
],
'return_url' => 'https://cedrics.se'
]);
I got this msg

"message":"The parameter return_url cannot be passed when creating a SetupIntent unless confirm is set to true."

pale night
#

You pass it on confirmation

unkempt wind
#

Should I pass it on $this->stripe->setupIntents->confirm($obj['id']);

Or any where else?

pale night
#

Yes

unkempt wind
#

How please provide code modified

pale night