Skip to content

Commit

Permalink
set redirects for sofort payment type
Browse files Browse the repository at this point in the history
  • Loading branch information
smaier committed May 10, 2019
1 parent 020d3c1 commit 15a9a4f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Action/Api/AuthorizeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 15a9a4f

Please sign in to comment.