protected function paymentSuccess(CoreShopPayment $payment) { $paymentSuccessHandled = false; $result = \CoreShop\Plugin::getEventManager()->trigger('payment.success', $this, array("payment" => $payment, "language" => $this->language), function ($v) { return is_bool($v); }); if ($result->stopped()) { $paymentSuccessHandled = $result->last(); } if (!$paymentSuccessHandled) { $order = $payment->getOrder(); if ($order instanceof CoreShopOrder) { $stateAccepted = CoreShopOrderState::getByPath("/coreshop/order-states/01-order-accepted"); //TODO: Make Order State per Type Configurable $stateAccepted->processStep($order); $statePaied = CoreShopOrderState::getByPath("/coreshop/order-states/02-payment-received"); //TODO: Make Order State per Type Configurable $statePaied->processStep($order); } } }
/** * @see Object\ClassDefinition\Data::getDataFromResource * @param integer $data * @return Country */ public function getDataFromResource($data) { if (intval($data) > 0) { return Object\CoreShopOrderState::getById($data); } return null; }