関数
AmazonPay::initCheckoutHooks()
This function loads all hooks associated with the checkout process. Note that because of when Welcart’s main class and subsequent checkout hooks are loaded, our implementation of them MUST be initialized in this hook. Wordpresses “init” hook, for example, if used, will result in these hooks not being called at all.
戻り値 戻り値
ファイル: src/AmazonPay.php
public function initCheckoutHooks() { $this->checkout = new Checkout($this); $this->checkout->init()->addHooks(); usces_register_action( 'wcexaapCompletePurchase', 'get', 'wcexaapCompletePurchase', null, function () { // route guards $routeGuards = new Routing\RedirectRouteGuards( $this, new Routing\RestRouteGuards($this) ); $amazonRouteGuards = new Routing\AmazonRedirectRouteGuards($this); call_user_func($amazonRouteGuards->sessionIdExistsOrExit()); call_user_func($routeGuards->cartNotEmptyOrExit()); call_user_func($routeGuards->itemsInStockOrCartRedirect()); $this->checkout->handleCheckoutResult(); } ); }