Hooks
The points in the cart and checkout where Merx lets you run your own code.
- cart.add:after Runs once an item has been added and the cart has been saved.
- cart.add:before Runs before an item is added to the cart. The item is still whatever the caller passed.
- cart.create:after Runs once the cart object exists. Fires on every request that touches the cart.
- cart.create:before Runs while the cart object is being built, before it is read from the session.
- cart.delete:after Runs once the cart has been dropped from the session.
- cart.delete:before Runs before the whole cart is dropped from the session.
- cart.remove:after Runs once an item has been removed and the cart has been saved.
- cart.remove:before Runs before an item is removed from the cart.
- cart.updateItem:after Runs once a cart item has been changed and the cart has been saved.
- cart.updateItem:before Runs before the quantity or data of a cart item is changed.
- createOrder:after Runs once the order page has been written. A written order is not necessarily a paid one.
- createOrder:before Runs when the customer comes back from the payment provider, before the payment is captured.
- initializeOrder:after Runs once the virtual order page is in the session and the payment has been started.
- initializeOrder:before Runs when the checkout is submitted, before the data is validated. The last point at which you can refuse an order.
- orderPaid Runs once per order, when it becomes paid — at creation for an immediate payment, later for one a webhook confirms or a Panel user marks as paid.
- stripe-hooks Runs for every Stripe webhook event Merx does not handle itself.