From a5f870510c34bbea583c17e424a07e2fb89603f3 Mon Sep 17 00:00:00 2001 From: Joshua Lewis Date: Mon, 16 Aug 2021 10:51:28 -0400 Subject: [PATCH] added Declined state --- modules/gateways/bitpaycheckout.php | 4 ++-- .../gateways/bitpaycheckout/bitpaycheckout.php | 4 ++-- .../bitpaycheckout/bitpaycheckout_callback.php | 2 +- .../bitpaycheckout/bitpaycheckout_ipn.php | 16 +++++++--------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/modules/gateways/bitpaycheckout.php b/modules/gateways/bitpaycheckout.php index bc133eb..4a0a09e 100644 --- a/modules/gateways/bitpaycheckout.php +++ b/modules/gateways/bitpaycheckout.php @@ -1,6 +1,6 @@ 'BitPay_Checkout_WHMCS', - 'APIVersion' => '3.1.1.0', // Use API Version 1.1 + 'APIVersion' => '4.0.1', // Use API Version 1.1 'DisableLocalCreditCardInput' => false, 'TokenisedStorage' => false, ); diff --git a/modules/gateways/bitpaycheckout/bitpaycheckout.php b/modules/gateways/bitpaycheckout/bitpaycheckout.php index bc133eb..4a0a09e 100644 --- a/modules/gateways/bitpaycheckout/bitpaycheckout.php +++ b/modules/gateways/bitpaycheckout/bitpaycheckout.php @@ -1,6 +1,6 @@ 'BitPay_Checkout_WHMCS', - 'APIVersion' => '3.1.1.0', // Use API Version 1.1 + 'APIVersion' => '4.0.1', // Use API Version 1.1 'DisableLocalCreditCardInput' => false, 'TokenisedStorage' => false, ); diff --git a/modules/gateways/bitpaycheckout/bitpaycheckout_callback.php b/modules/gateways/bitpaycheckout/bitpaycheckout_callback.php index e7c687d..d1fee90 100644 --- a/modules/gateways/bitpaycheckout/bitpaycheckout_callback.php +++ b/modules/gateways/bitpaycheckout/bitpaycheckout_callback.php @@ -1,7 +1,7 @@ 'Paid','datepaid' => date("Y-m-d H:i:s")); @@ -84,7 +83,7 @@ function checkInvoiceStatus($url){ update_query($table, $update, $where); } catch (Exception $e ){ - file_put_contents($file,$e,FILE_APPEND); + file_put_contents($err,$e,FILE_APPEND); } #update the bitpay_invoice table @@ -94,7 +93,7 @@ function checkInvoiceStatus($url){ try{ update_query($table, $update, $where); }catch (Exception $e ){ - file_put_contents($file,$e,FILE_APPEND); + file_put_contents($err,$e,FILE_APPEND); } addInvoicePayment( @@ -104,9 +103,6 @@ function checkInvoiceStatus($url){ 0, 'bitpaycheckout' ); - endif; - - break; #processing - put in Payment Pending @@ -133,6 +129,8 @@ function checkInvoiceStatus($url){ #confirmation error - put in Unpaid case 'invoice_failedToConfirm': + case 'invoice_declined': + $table = "tblinvoices"; $update = array("status" => 'Unpaid'); $where = array("id" => $orderid, "paymentmethod" => "bitpaycheckout");