/** * {@inheritDoc} * * @param Notify $request */ public function execute($request) { RequestNotSupportedException::assertSupports($this, $request); $details = ArrayObject::ensureArrayObject($request->getModel()); $this->payment->execute($httpRequest = new GetHttpRequest()); if (false == $this->api->validateNotificationSignature($httpRequest->request)) { throw new HttpResponse('The notification is invalid', 400); } $details['Status'] = $httpRequest->request['Status']; throw new HttpResponse('', 200); }
/** * {@inheritDoc} */ public function execute($request) { /* @var $request Capture */ RequestNotSupportedException::assertSupports($this, $request); $details = ArrayObject::ensureArrayObject($request->getModel()); if (null === $details['URL_RETURN'] && $request->getToken()) { $details['URL_RETURN'] = $request->getToken()->getAfterUrl(); } $details['Shop_IDP'] = $this->api->getShopId(); $details['Signature'] = $this->api->sing($details->toUnsafeArray()); $details->validatedKeysSet(array('Shop_IDP', 'Order_IDP', 'Subtotal_P', 'Signature', 'Currency', 'Signature')); throw new HttpPostRedirect($this->api->getPaymentPageUrl(), $details->toUnsafeArray()); }
/** * {@inheritDoc} * * @param FillOrderDetails $request */ public function execute($request) { RequestNotSupportedException::assertSupports($this, $request); $order = $request->getOrder(); $details = ArrayObject::ensureArrayObject($order->getDetails()); $details->defaults(array('Lifetime' => Api::DEFAULT_PAYMENT_FORM_LIFETIME, 'OrderLifetime' => Api::DEFAULT_ORDER_LIFETIME, 'Language' => Api::PAYMENT_PAGE_LANGUAGE_RU, 'MeanType' => Api::MEAN_TYPE_ANY, 'EMoneyType' => Api::EMONEY_TYPE_ANY)); if ($this->api->isSandbox()) { unset($details['OrderLifetime']); unset($details['MeanType']); unset($details['EMoneyType']); } $details['Order_IDP'] = $this->api->validateOrderNumber($order->getNumber()); $details['Subtotal_P'] = (double) $order->getTotalAmount() / 100; $details['Currency'] = $this->api->validateOrderCurrency($order->getCurrencyCode()); $details['Comment'] = $order->getDescription(); $details['Customer_IDP'] = $order->getClientId(); $details['Email'] = $order->getClientEmail(); $details->validateNotEmpty('Order_IDP', 'Subtotal_P', 'Currency'); $order->setDetails($details); }