Skip to content

Commit

Permalink
Improved logging, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pieter Poorthuis committed Jan 23, 2018
1 parent cfd6269 commit e9a34a3
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

* Last Version Tested: 6.2.2
* Last Version Tested: 7.4.2

You must have a BitPay merchant account to use this plugin. It's free and easy to [sign-up for a BitPay merchant account](https://bitpay.com/start).

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2011-2015 BitPay
Copyright (c) 2011-2018 BitPay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To get up and running with our plugin quickly, see the GUIDE here: https://githu

**BitPay Support:**

* Last Version Tested: 7.1.2
* Last Version Tested: 7.4.2
* [GitHub Issues](https://github.com/bitpay/whmcs-plugin/issues)
* Open an issue if you are having issues with this plugin
* [Support](https://help.bitpay.com)
Expand All @@ -26,26 +26,16 @@ To get up and running with our plugin quickly, see the GUIDE here: https://githu

## Troubleshooting

0. Sometimes a download can become corrupted for various reasons. However, you can verify that the release package you downloaded is correct by checking the md5 checksum "fingerprint" of your download against the md5 checksum value shown on the Releases page. Even the smallest change in the downloaded release package will cause a different value to be shown!
* If you are using Windows, you can download a checksum verifier tool and instructions directly from Microsoft here: http://www.microsoft.com/en-us/download/details.aspx?id=11533
* If you are using Linux or OS X, you already have the software installed on your system.
* On Linux systems use the md5sum program. For example:
* md5sum filename
* On OS X use the md5 program. For example:
* md5 filename
1. Ensure a valid SSL certificate is installed on your server. Also ensure your root CA cert is updated. If your CA cert is not current, you will see curl SSL verification errors.
2. Verify that your web server is not blocking POSTs from servers it may not recognize. Double check this on your firewall as well, if one is being used.
3. Check the version of this plugin against the official plugin repository to ensure you are using the latest version. Your issue might have been addressed in a newer version! See the [Releases](https://github.com/bitpay/whmcs-plugin/releases/latest) page for the latest.
4. If all else fails, contact us using one of the methods described in the Support section above.
0. Ensure a valid SSL certificate is installed on your server. Also ensure your root CA cert is updated. If your CA cert is not current, you will see curl SSL verification errors.
1. Verify that your web server is not blocking POSTs from servers it may not recognize. Double check this on your firewall as well, if one is being used.
2. Check the version of this plugin against the official plugin repository to ensure you are using the latest version. Your issue might have been addressed in a newer version! See the [Releases](https://github.com/bitpay/whmcs-plugin/releases/latest) page for the latest.
3. If all else fails, contact us using one of the methods described in the Support section above.

**TIP**: When contacting support it will help us is you provide:

* WHMCS and BitPay Plugin Version
* Other plugins you have installed
* Some plugins do not play nice
* Configuration settings for the plugin (Most merchants take screen grabs)
* Any log files that will help
* Web server error logs
* WHMCS logs and Web server error logs
* Screen grabs of error message if applicable.

## Contribute
Expand Down
5 changes: 3 additions & 2 deletions modules/gateways/bit-pay/bp_lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2011-2015 BitPay
* Copyright (c) 2011-2018 BitPay
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,6 +24,7 @@
*/

require_once 'bp_options.php';
require_once '../../version.php';

/**
* @param string $contents
Expand Down Expand Up @@ -57,7 +58,7 @@ function bpCurl($url, $apiKey, $post = false)
'Content-Type: application/json',
'Content-Length: ' . $length,
'Authorization: Basic ' . $uname,
'X-BitPay-Plugin-Info: whmcs3',
'X-BitPay-Plugin-Info: whmcs'. $version,
);

curl_setopt($curl, CURLOPT_PORT, 443);
Expand Down
8 changes: 4 additions & 4 deletions modules/gateways/bit-pay/createinvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2011-2015 BitPay
* Copyright (c) 2011-2018 BitPay
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -29,6 +29,8 @@
include '../../../includes/gatewayfunctions.php';
include '../../../includes/invoicefunctions.php';

require 'bp_lib.php';

if (file_exists('../../../dbconnect.php')) {
include '../../../dbconnect.php';
} else if (file_exists('../../../init.php')) {
Expand All @@ -38,8 +40,6 @@
die('[ERROR] In modules/gateways/bitpay/createinvoice.php: include error: Cannot find dbconnect.php or init.php');
}

require 'bp_lib.php';

$gatewaymodule = 'bitpay';

$GATEWAY = getGatewayVariables($gatewaymodule);
Expand Down Expand Up @@ -114,7 +114,7 @@

if (isset($invoice['error'])) {
bpLog('[ERROR] In modules/gateways/bitpay/createinvoice.php: Invoice error: ' . var_export($invoice['error'], true));
die('[ERROR] In modules/gateways/bitpay/createinvoice.php: Invoice error: ' . var_export($invoice['error']['message'], true));
die('[ERROR] In modules/gateways/bitpay/createinvoice.php: Invoice error: ' . var_export($invoice['error'], true));
} else {
header('Location: ' . $invoice['url']);
}
2 changes: 1 addition & 1 deletion modules/gateways/bitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* The MIT License (MIT)
*
* Copyright (c) 2011-2015 BitPay
* Copyright (c) 2011-2018 BitPay
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions modules/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

global $version;
$version = "7.1.1";

0 comments on commit e9a34a3

Please sign in to comment.