Skip to content

Commit

Permalink
Check status from Api request
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinverschoor committed Dec 16, 2024
1 parent c3b8345 commit f28c3f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions upload/catalog/controller/extension/payment/paynl_ideal.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ public function exchangeFastCheckout()
$apiInfo->setApiToken($apiToken);
$apiInfo->setServiceId($serviceId);
$apiInfo->setTransactionId($transactionId);
$apiInfo->doRequest();
$infoResult = $apiInfo->doRequest();
$status = Pay_Helper::getStatus($infoResult['paymentDetails']['state']);
} catch (\Exception $e) {
die('FALSE| Error fetching transaction. ' . $e->getMessage());
}

$status = Pay_Helper::getStatus($webhookData['object']['status']['code']);
}

$this->load->model('extension/payment/' . $this->_paymentMethodName);
$modelName = 'model_extension_payment_' . $this->_paymentMethodName;
Expand Down
11 changes: 5 additions & 6 deletions upload/catalog/controller/extension/payment/paynl_paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,16 @@ public function exchangeFastCheckout() {
$serviceId = $this->model_setting_setting->getSettingValue('payment_paynl_general_serviceid');
$transactionId = $webhookData['object']['orderId'];

try {
try {
$apiInfo = new Pay_Api_Info();
$apiInfo->setApiToken($apiToken);
$apiInfo->setServiceId($serviceId);
$apiInfo->setTransactionId($transactionId);
$apiInfo->doRequest();
$infoResult = $apiInfo->doRequest();
$status = Pay_Helper::getStatus($infoResult['paymentDetails']['state']);
} catch (\Exception $e) {
die('FALSE| Error fetching transaction. ' . $e->getMessage());
}
die('FALSE| Error fetching transaction. ' . $e->getMessage());
}

$accessToken = $this->getAccessToken();
$paypalOrderDetails = $this->getOrderDetails($orderId, $accessToken);
Expand All @@ -188,8 +189,6 @@ public function exchangeFastCheckout() {

$order_id = $webhookData['object']['reference'];

$status = Pay_Helper::getStatus($webhookData['object']['status']['code']);

$this->load->model('extension/payment/' . $this->_paymentMethodName);
$modelName = 'model_extension_payment_' . $this->_paymentMethodName;

Expand Down

0 comments on commit f28c3f6

Please sign in to comment.