From 15a9a4f1a937e6712299a98dfbdec97d5d51a2d6 Mon Sep 17 00:00:00 2001 From: Stefan Maier Date: Fri, 10 May 2019 10:37:22 +0200 Subject: [PATCH] set redirects for sofort payment type --- Action/Api/AuthorizeAction.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Action/Api/AuthorizeAction.php b/Action/Api/AuthorizeAction.php index 065948e..ba65f81 100755 --- a/Action/Api/AuthorizeAction.php +++ b/Action/Api/AuthorizeAction.php @@ -12,6 +12,7 @@ namespace CoreShop\Payum\Payone\Action\Api; +use ArvPayoneApi\Request\PaymentTypes; use ArvPayoneApi\Response\GenericResponse; use ArvPayoneApi\Response\Status; use CoreShop\Payum\Payone\Request\Api\Authorize; @@ -41,6 +42,14 @@ public function execute($request) $this->gateway->execute(new OnSitePayment($this->api->getPaymentType(), $model)); } + $paymentType = $this->api->getPaymentType(); + + if ($paymentType === PaymentTypes::PAYONE_SOFORT) { + $model['successurl'] = $model['redirect']['success']; + $model['errorurl'] = $model['redirect']['error']; + $model['backurl'] = $model['redirect']['back']; + } + $response = $this->api->authorize($model->toUnsafeArray()); if ($response->getSuccess()) {