Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created August 18, 2019 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/db8a7884182b8c98258e2917123d616d to your computer and use it in GitHub Desktop.
Save uno-de-piera/db8a7884182b8c98258e2917123d616d to your computer and use it in GitHub Desktop.
<?php
use Laravel\Cashier\Exceptions\IncompletePayment;
try {
$subscription = $user->newSubscription('default', $planId)->create($paymentMethod);
} catch (IncompletePayment $exception) {
return redirect()->route(
'cashier.payment',
[$exception->payment->id, 'redirect' => route('home')]
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment