Skip to content

Commit

Permalink
Revision: 11 - Payment confirmation by status and not status code.
Browse files Browse the repository at this point in the history
- Fix issue #33
  • Loading branch information
presteamshop committed Jun 17, 2024
1 parent 7bcc37c commit 941fb3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/front/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function displayAjaxConvert()
}

// Check payment (FROM API call, not callback)
if ($payment_from_api->getStatusCode() === 'E000') {
if ($payment_from_api->getStatus() === $this->module::MONEI_STATUS_SUCCEEDED) {
$payment_status = (int)Configuration::get('MONEI_STATUS_SUCCEEDED');
$lbl_monei->status = pSQL($payment_from_api->getStatus());
} else {
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function postProcess()
}

// Check payment (FROM API call, not callback)
if ($payment_from_api->getStatusCode() === 'E000') {
if ($payment_from_api->getStatus() === $this->module::MONEI_STATUS_SUCCEEDED) {
$payment_status = (int)Configuration::get('MONEI_STATUS_SUCCEEDED');
$lbl_monei->status = pSQL($payment_callback->getStatus());
} else {
Expand Down
5 changes: 5 additions & 0 deletions monei.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class Monei extends PaymentModule

protected $config_form = false;

const MONEI_STATUS_SUCCEEDED = 'SUCCEEDED';
const MONEI_STATUS_AUTHORIZED = 'AUTHORIZED';
const MONEI_STATUS_PENDING = 'PENDING';
const MONEI_STATUS_PENDING_PROCESSING = 'PENDING_PROCESSING';

public function __construct()
{
$this->displayName = 'MONEI Payments';
Expand Down

0 comments on commit 941fb3b

Please sign in to comment.