Merx

Hooks

Hooks can be useful if you want to send confirmation emails or log certain events.

initializePayment:before

site/config.php

return [
  'hooks' => [
    'ww.merx.initializePayment:before' => function ($data, $cart) {
      // your code goes here
    },
  ],
];

initializePayment:after

site/config.php

return [
  'hooks' => [
    'ww.merx.initializePayment:after' => function ($virtualOrderPage, $redirect) {
      // your code goes here
    },
  ],
];

Be careful! Updating $virtualOrderPage does not have any effect.

completePayment:before

site/config.php

return [
  'hooks' => [
    'ww.merx.completePayment:before' => function ($virtualOrderPage, $gateway, $data) {
      // your code goes here
    },
  ],
];

completePayment:after

site/config.php

return [
  'hooks' => [
    'ww.merx.completePayment:after' => function ($orderPage) {
      // your code goes here
    },
  ],
];