From f43c3bac6cb33e240c64477b94b779035ba7a633 Mon Sep 17 00:00:00 2001 From: Pieter Poorthuis Date: Mon, 19 Mar 2018 14:55:39 +0100 Subject: [PATCH] Simplified plugin configuration, improved error messages --- .../Bitpay/Core/Model/Config/PairingCode.php | 2 +- app/code/community/Bitpay/Core/etc/config.xml | 10 +- app/code/community/Bitpay/Core/etc/system.xml | 123 +++++++++--------- 3 files changed, 70 insertions(+), 65 deletions(-) diff --git a/app/code/community/Bitpay/Core/Model/Config/PairingCode.php b/app/code/community/Bitpay/Core/Model/Config/PairingCode.php index 16a9cbf..4526fc2 100644 --- a/app/code/community/Bitpay/Core/Model/Config/PairingCode.php +++ b/app/code/community/Bitpay/Core/Model/Config/PairingCode.php @@ -33,7 +33,7 @@ class Bitpay_Core_Model_Config_PairingCode extends Mage_Core_Model_Config_Data \Mage::helper('bitpay')->sendPairingRequest($pairingCode); } catch (\Exception $e) { \Mage::helper('bitpay')->debugData(sprintf('[ERROR] Exception thrown while calling the sendPairingRequest() function. The specific error message is: "%s"', $e->getMessage())); - \Mage::getSingleton('core/session')->addError('There was an error while trying to pair with BitPay using the pairing code '.$pairingCode.'. Please try again or enable debug mode and send the "payment_bitpay.log" file to support@bitpay.com for more help.'); + \Mage::getSingleton('core/session')->addError('There was an error while trying to pair with BitPay using the pairing code '.$pairingCode.'. Please make sure you select the correct Network (Livenet vs Testnet) and try again with a new 7 character pairing code or enable debug mode and send the "payment_bitpay.log" file to support@bitpay.com for more help.'); return; } diff --git a/app/code/community/Bitpay/Core/etc/config.xml b/app/code/community/Bitpay/Core/etc/config.xml index 6e0bd45..50e5a2c 100644 --- a/app/code/community/Bitpay/Core/etc/config.xml +++ b/app/code/community/Bitpay/Core/etc/config.xml @@ -132,17 +132,17 @@ new authorize 0 - Bitcoin - test - testnet + Bitcoin and Bitcoin Cash + test + livenet 0 bitpay/ipn checkout/onepage/success - checkout/cart + checkout/cart medium 0 new - processing + pending processing complete canceled diff --git a/app/code/community/Bitpay/Core/etc/system.xml b/app/code/community/Bitpay/Core/etc/system.xml index 0bb34b2..0451d35 100644 --- a/app/code/community/Bitpay/Core/etc/system.xml +++ b/app/code/community/Bitpay/Core/etc/system.xml @@ -28,8 +28,8 @@ - https://bitpay.com/api-tokens and copy/paste - that code here. Once you have successfully paired this Magento store with your BitPay Merchant account, you can begin accepting Bitcoins as payment.]]> + https://bitpay.com/api-tokens -> Add New Token -> Add Token and copy/paste + the 7 character pairing code here.]]> text bitpay/config_pairingCode @@ -38,6 +38,15 @@ 1 1 + + + select + adminhtml/system_config_source_yesno + 2 + 1 + 1 + 1 + select @@ -106,27 +115,66 @@ 1 1 - - - select - adminhtml/system_config_source_yesno - 2 - 1 - 1 - 0 - - - - select - bitpay/transactionSpeed + + + + + adminhtml/system_config_form_field_heading 70 1 1 1 + + + + + + + select + adminhtml/system_config_source_order_status + 71 + 1 + 1 + 1 + + + + + + + select + adminhtml/system_config_source_order_status + 72 + 1 + 1 + 1 + + + + + + + select + adminhtml/system_config_source_order_status + 73 + 1 + 1 + 1 + + + + + select + bitpay/transactionSpeed + 74 + 0 + 0 + 0 High: an invoice is confirmed immediately when payment received.
Medium: an invoice is confirmed after 1 block confirmation by the Bitcoin network (~10 mins).
Low: an invoice is confirmed after 6 block confirmations by the Bitcoin network (~1 hour).
The default and safest setting is "Low". A "High" setting is quicker to generate a payment confirmation but is riskier since the transaction could have not been officially confirmed by the Bitcoin network itself.]]>
+ adminhtml/system_config_form_field_heading @@ -178,50 +226,7 @@ 0 validate-number - - - adminhtml/system_config_form_field_heading - 100 - 1 - 1 - 1 - - - - - - - select - adminhtml/system_config_source_order_status - 120 - 1 - 1 - 1 - - - - - - - select - adminhtml/system_config_source_order_status - 130 - 1 - 1 - 1 - - - - - - - select - adminhtml/system_config_source_order_status - 140 - 1 - 1 - 1 - + adminhtml/system_config_form_field_heading