laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 671 forks source link

What is the purpose of the built in payment page? #795

Closed thomseddon closed 4 years ago

thomseddon commented 4 years ago

Description:

The documentation says:

SCA regulations often require extra verification in order to confirm and process a payment. When this happens, Cashier will throw an IncompletePayment exception that informs you that this extra verification is needed. ... First, you could redirect your customer to the dedicated payment confirmation page which is included with Cashier.

However I'm struggling to understand the circumstances under which this would be needed.

The only way to create a payment via Cashier is firstly create a payment method using the stripe javascript client, so all cashier users are definitely using the stripe js client. However, any extra auth requirements will be handled by this client (e.g. 3D secure popups etc.) and the payment page just seems to be an implementation of that client.

So, as I'm using the stripe client, under what circumstances would I need to redirect to this page? I'd prefer to implement it myself if required, but I'm not sure what scenario I should be handling?

Many thanks!

driesvints commented 4 years ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.

thomseddon commented 4 years ago

Ah! I consider this a bug in the implementation as the whole incomplete payment flow and payment page now seem at best unnecessary and at worst confusing!

I will try to raise it on one of the support channels....

netpok commented 4 years ago

@thomseddon Long story short: as far as I know a bank can ask for confirmation any time even if you set subscription as off session. This means you can't really make a set up and forget subscription. Stripe also provides an option for this, but you can implement on your side if you want to send more customized emails or use other notification channels.

thomseddon commented 4 years ago

That makes sense, the documentation has two scenarios:

And of course you're quite right, the payments page is used and needed for the off-session scenario :)

However I'm not sure on the first case, the example given:

try {
    $subscription = $user->newSubscription('default', $planId)
                            ->create($paymentMethod);
} catch (IncompletePayment $exception) {
    return redirect()->route(
        'cashier.payment',
        [$exception->payment->id, 'redirect' => route('home')]
    );
}

Could this exception ever be thrown?