Skip to content

Commit

Permalink
Log into model
Browse files Browse the repository at this point in the history
  • Loading branch information
toooni committed Mar 14, 2019
1 parent 70b62af commit 24752aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Action/AuthorizeAction.php
Expand Up @@ -6,6 +6,7 @@

use Checkout\CheckoutApi;
use Checkout\Library\Exceptions\CheckoutException;
use Checkout\Library\Exceptions\CheckoutHttpException;
use Checkout\Models\Payments\Payment;
use Checkout\Models\Payments\TokenSource;
use Payum\Checkoutcom\Action\Api\BaseApiAwareAction;
Expand Down Expand Up @@ -66,6 +67,9 @@ public function execute($request)
try {
$details = $checkoutApi->payments()->request($payment);
$model->replace((array) $details);
} catch (CheckoutHttpException $e) {
$model['error'] = $e->getBody();
throw new InvalidArgumentException($e->getMessage(), $e->getCode());
} catch (CheckoutException $e) {
throw new InvalidArgumentException($e->getMessage(), $e->getCode());
}
Expand Down

0 comments on commit 24752aa

Please sign in to comment.