Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
HamedDarragi committed Apr 30, 2020
1 parent 37742a3 commit b9f4d11
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/PaypalPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ public function executePayment()
}

$request = Request::getInstance();
$paymentId = $request->get('paymentId');
$payerID = $request->get('PayerID');
$paymentId = $request->query->get('paymentId');
$payerID = $request->query->get('PayerID');
if (!$paymentId || !$payerID) {
$this->error->add(t('Invalid Payment Request'));

Expand All @@ -342,11 +342,8 @@ public function executePayment()

try {
return $payment->execute($execute, $apiContext);
} catch (Exception $exc) {
$data = json_decode($exc->getData(), false);
$this->error->add(new Exception(t($data->message) . ' (' . $data->name . ') ', $exc->getCode()));

return $this->error;
} catch (Exception $ex) {
return $this->error->add($ex);
}
}

Expand Down

0 comments on commit b9f4d11

Please sign in to comment.