diff --git a/CHANGELOG b/CHANGELOG index e21d900..6a23d3b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,3 +12,6 @@ 5 (01/15) * Fix for invalid URL issue #16. + +6 (07/13) + * Updated to be compatible with both WHMCS versions 5 and 6 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';