Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added a check to ensure the insert_id is an integer looking thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Kleeschulte committed Jun 22, 2016
1 parent b5ee207 commit 993116c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions includes/modules/payment/bitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ function before_process() {
// called upon clicking confirm (after before_process and after the order is created)
function after_process() {
global $insert_id, $order, $db;

//$insert_id must resemble an integer or else we can't match it into the db
if (!preg_match('/^\d+$/', $insert_id)) {
$this->log('after_process(). The $insert_id global is not set properly! Please ensure that: includes/modules/checkout_process.php properly sets $insert_id.');
throw new Exception('payment method failed');
}
require_once 'bitpay/bp_lib.php';

// change order status to value selected by merchant
Expand Down

0 comments on commit 993116c

Please sign in to comment.