From 0d00f2662a509e6876a823eadcb9927c90ea85eb Mon Sep 17 00:00:00 2001 From: Alex Leitner Date: Mon, 13 Jul 2015 09:52:13 -0500 Subject: [PATCH] Added cross compatibility for versions 5 and 6 --- modules/gateways/bit-pay/createinvoice.php | 10 +++++++++- modules/gateways/callback/bitpay.php | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/gateways/bit-pay/createinvoice.php b/modules/gateways/bit-pay/createinvoice.php index e3b8a9d..523d380 100755 --- a/modules/gateways/bit-pay/createinvoice.php +++ b/modules/gateways/bit-pay/createinvoice.php @@ -23,11 +23,19 @@ * THE SOFTWARE. */ -include '../../../dbconnect.php'; include '../../../includes/functions.php'; include '../../../includes/gatewayfunctions.php'; include '../../../includes/invoicefunctions.php'; +if (file_exists('../../../dbconnect.php')) { + include '../../../dbconnect.php'; +} else if (file_exists('../../../init.php')) { + include '../../../init.php'; +} else { + bpLog('[ERROR] In modules/gateways/bitpay/createinvoice.php: include error: Cannot find dbconnect.php or init.php'); + die('[ERROR] In modules/gateways/bitpay/createinvoice.php: include error: Cannot find dbconnect.php or init.php'); +} + require 'bp_lib.php'; $gatewaymodule = 'bitpay'; diff --git a/modules/gateways/callback/bitpay.php b/modules/gateways/callback/bitpay.php index e364282..bb93b3c 100644 --- a/modules/gateways/callback/bitpay.php +++ b/modules/gateways/callback/bitpay.php @@ -24,11 +24,19 @@ */ // Required File Includes -include '../../../dbconnect.php'; include '../../../includes/functions.php'; include '../../../includes/gatewayfunctions.php'; include '../../../includes/invoicefunctions.php'; +if (file_exists('../../../dbconnect.php')) { + include '../../../dbconnect.php'; +} else if (file_exists('../../../init.php')) { + include '../../../init.php'; +} else { + bpLog('[ERROR] In modules/gateways/bitpay/createinvoice.php: include error: Cannot find dbconnect.php or init.php'); + die('[ERROR] In modules/gateways/bitpay/createinvoice.php: include error: Cannot find dbconnect.php or init.php'); +} + require_once '../bit-pay/bp_lib.php'; $gatewaymodule = 'bitpay';