/** * {@inheritDoc} */ public function execute($request) { /* @var $request Capture */ RequestNotSupportedException::assertSupports($this, $request); $details = ArrayObject::ensureArrayObject($request->getModel()); $details['service_id'] = $this->api->getServiceId(); $details['payment_method_id'] = $this->api->getPaymentMethodId(); $details['hash'] = $this->api->sing($details->toUnsafeArray()); $details->validatedKeysSet(array('service_id', 'payment_method_id', 'order_id', 'customer_id', 'hash')); throw new HttpPostRedirect($this->api->getPaymentPageUrl(), $details->toUnsafeArray()); }
/** * {@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->query)) { throw new HttpResponse('The notification is invalid', 400); } $details->replace($httpRequest->query); throw new HttpResponse('', 200); }
/** * {@inheritDoc} * * @param FillOrderDetails $request */ public function execute($request) { RequestNotSupportedException::assertSupports($this, $request); $order = $request->getOrder(); $details = ArrayObject::ensureArrayObject($order->getDetails()); if ($this->api->isSandbox()) { $details['payment_method_id'] = Api::PAYMENT_METHOD_TEST; } $details['order_id'] = $order->getNumber(); $details['customer_id'] = $order->getClientEmail(); if ($order->getTotalAmount()) { $details['summ'] = (double) $order->getTotalAmount() / 100; $details['currency'] = $order->getCurrencyCode(); } $details->validateNotEmpty('order_id', 'customer_id'); $order->setDetails($details); }