Closed malcolmhmaclean closed 9 months ago
Hi @malcolmhmaclean You override the cancel_url
via the beforeCreateSession
event, additionally you can add/override any Stripe Checkout session available here
use enupal\stripe\services\Checkout;
use enupal\stripe\events\CheckoutEvent;
use enupal\stripe\Stripe;
use craft\base\Plugin;
use Craft;
class YourPlugin extends Plugin
{
public function init()
{
....
....
Event::on(Checkout::class, Checkout::EVENT_BEFORE_CREATE_SESSION, function(CheckoutEvent $e) {
$isCart = $e->isCart;
$sessionParams = $e->sessionParams;
//overwrite $sessionParams
$sessionParams['cancel_url'] = 'https://yoursite.com/cancel';
$e->sessionParams = $sessionParams;
});
...
...
}
}
Description
Hi there, is there any way to set a cancel url (and success url) for the Checkout Twig Tag?
Steps to reproduce
I am just testing the simple/standard checkout link for now (https://docs.enupal.com/stripe-payments/pro/checkout.html) but wondered if it was possible to override the one from the admin? I need to make the payment page go back to the previous page
Malcolm