Version Notes
Download this release
Release Info
Developer | Integrations Team |
Extension | Bitpay_Core |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- app/code/community/Bitpay/Core/Block/Adminhtml/System/Config/Form/Field/Extension.php +6 -1
- app/code/community/Bitpay/Core/Block/Adminhtml/System/Config/Form/Field/Header.php +5 -0
- app/code/community/Bitpay/Core/Block/Form/Bitpay.php +4 -1
- app/code/community/Bitpay/Core/Block/Iframe.php +35 -14
- app/code/community/Bitpay/Core/Block/Info.php +13 -2
- app/code/community/Bitpay/Core/Helper/Data.php +193 -58
- app/code/community/Bitpay/Core/LICENSE +0 -21
- app/code/community/Bitpay/Core/Model/Config/PairingCode.php +7 -11
- app/code/community/Bitpay/Core/Model/Invoice.php +10 -4
- app/code/community/Bitpay/Core/Model/Method/Bitcoin.php +127 -42
- app/code/community/Bitpay/Core/Model/Network.php +2 -2
- app/code/community/Bitpay/Core/Model/Observer.php +24 -23
- app/code/community/Bitpay/Core/Model/Status.php +6 -6
- app/code/community/Bitpay/Core/Model/TransactionSpeed.php +3 -3
- app/code/community/Bitpay/Core/README.md +0 -204
- app/code/community/Bitpay/Core/controllers/IndexController.php +11 -9
- app/code/community/Bitpay/Core/controllers/IpnController.php +65 -40
- app/code/community/Bitpay/Core/etc/system.xml +14 -15
- app/design/adminhtml/default/default/template/bitpay/info/default.phtml +8 -9
- app/design/adminhtml/default/default/template/bitpay/system/config/field/header.phtml +9 -8
- app/design/frontend/base/default/template/bitpay/form/bitpay.phtml +7 -10
- app/design/frontend/base/default/template/bitpay/iframe.phtml +1 -1
- app/design/frontend/base/default/template/bitpay/info/default.phtml +4 -3
- app/etc/modules/Bitpay_Core.xml +9 -9
- lib/Bitpay/Client/Adapter/CurlAdapter.php +1 -1
- lib/Bitpay/Client/ArgumentException.php +8 -0
- lib/Bitpay/Client/BitpayException.php +8 -0
- lib/Bitpay/Client/Client.php +10 -2
- lib/Bitpay/Client/ConnectionException.php +8 -0
- lib/Bitpay/Currency.php +3 -1
- lib/Bitpay/Item.php +5 -0
- lib/Bitpay/Math/BcEngine.php +5 -1
- lib/Bitpay/Math/GmpEngine.php +0 -5
- lib/Bitpay/Storage/MagentoStorage.php +14 -4
- lib/Bitpay/Util/Util.php +6 -3
- lib/Symfony/Component/Config/Definition/ArrayNode.php +1 -1
- lib/Symfony/Component/Config/Definition/BaseNode.php +3 -2
- lib/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/ExprBuilder.php +6 -4
- lib/Symfony/Component/Config/Definition/Builder/MergeBuilder.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/NodeBuilder.php +1 -2
- lib/Symfony/Component/Config/Definition/Builder/NodeDefinition.php +2 -2
- lib/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php +1 -1
- lib/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php +1 -1
- lib/Symfony/Component/Config/Definition/ConfigurationInterface.php +1 -1
- lib/Symfony/Component/Config/Definition/Exception/Exception.php +1 -1
- lib/Symfony/Component/Config/Definition/NodeInterface.php +2 -1
- lib/Symfony/Component/Config/Definition/NumericNode.php +1 -1
- lib/Symfony/Component/Config/Definition/PrototypedArrayNode.php +1 -1
- lib/Symfony/Component/Config/Definition/VariableNode.php +3 -1
- lib/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php +1 -1
- lib/Symfony/Component/Config/LICENSE +1 -1
- lib/Symfony/Component/Config/Resource/DirectoryResource.php +1 -1
- lib/Symfony/Component/Config/Util/XmlUtils.php +1 -1
- lib/Symfony/Component/Config/phpunit.xml.dist +4 -0
- lib/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php +0 -1
- lib/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/PassConfig.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php +2 -3
- lib/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php +2 -2
- lib/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php +1 -1
- lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php +3 -3
- lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php +1 -1
- lib/Symfony/Component/DependencyInjection/Container.php +4 -4
- lib/Symfony/Component/DependencyInjection/ContainerBuilder.php +4 -5
- lib/Symfony/Component/DependencyInjection/ContainerInterface.php +4 -4
- lib/Symfony/Component/DependencyInjection/Definition.php +6 -6
- lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php +2 -1
- lib/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php +2 -2
- lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +39 -20
- lib/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php +2 -2
- lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php +7 -7
- lib/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php +1 -1
- lib/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php +0 -2
- lib/Symfony/Component/DependencyInjection/LICENSE +1 -1
- lib/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +5 -5
- lib/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +3 -3
- lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php +1 -1
- lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php +2 -2
- lib/Symfony/Component/DependencyInjection/Reference.php +1 -1
- lib/Symfony/Component/DependencyInjection/Variable.php +2 -2
- lib/Symfony/Component/DependencyInjection/composer.json +2 -2
- lib/Symfony/Component/DependencyInjection/phpunit.xml.dist +4 -0
- lib/Symfony/Component/Filesystem/Exception/IOException.php +1 -1
- lib/Symfony/Component/Filesystem/Filesystem.php +9 -9
- lib/Symfony/Component/Filesystem/LICENSE +1 -1
- lib/Symfony/Component/Filesystem/phpunit.xml.dist +4 -0
- package.xml +1 -1
app/code/community/Bitpay/Core/Block/Adminhtml/System/Config/Form/Field/Extension.php
CHANGED
@@ -15,9 +15,14 @@ class Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Extension extends Mag
|
|
15 |
*/
|
16 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
17 |
{
|
|
|
|
|
|
|
|
|
|
|
18 |
$phpExtension = $element->getFieldConfig()->php_extension;
|
19 |
|
20 |
-
if (in_array($phpExtension, get_loaded_extensions())) {
|
21 |
return 'Installed';
|
22 |
}
|
23 |
|
15 |
*/
|
16 |
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
|
17 |
{
|
18 |
+
if (false === isset($element) || true === empty($element)) {
|
19 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Extension::_getElementHtml(): Missing or invalid $element parameter passed to function.');
|
20 |
+
throw new \Exception('In Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Extension::_getElementHtml(): Missing or invalid $element parameter passed to function.');
|
21 |
+
}
|
22 |
+
|
23 |
$phpExtension = $element->getFieldConfig()->php_extension;
|
24 |
|
25 |
+
if (true === in_array($phpExtension, get_loaded_extensions())) {
|
26 |
return 'Installed';
|
27 |
}
|
28 |
|
app/code/community/Bitpay/Core/Block/Adminhtml/System/Config/Form/Field/Header.php
CHANGED
@@ -23,6 +23,11 @@ class Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Header extends Mage_A
|
|
23 |
*/
|
24 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
25 |
{
|
|
|
|
|
|
|
|
|
|
|
26 |
return $this->toHtml();
|
27 |
}
|
28 |
}
|
23 |
*/
|
24 |
public function render(Varien_Data_Form_Element_Abstract $element)
|
25 |
{
|
26 |
+
if (false === isset($element) || true === empty($element)) {
|
27 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Header::render(): Missing or invalid $element parameter passed to function.');
|
28 |
+
throw new \Exception('In Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Header::render(): Missing or invalid $element parameter passed to function.');
|
29 |
+
}
|
30 |
+
|
31 |
return $this->toHtml();
|
32 |
}
|
33 |
}
|
app/code/community/Bitpay/Core/Block/Form/Bitpay.php
CHANGED
@@ -8,7 +8,10 @@ class Bitpay_Core_Block_Form_Bitpay extends Mage_Payment_Block_Form
|
|
8 |
{
|
9 |
protected function _construct()
|
10 |
{
|
|
|
|
|
11 |
parent::_construct();
|
12 |
-
|
|
|
13 |
}
|
14 |
}
|
8 |
{
|
9 |
protected function _construct()
|
10 |
{
|
11 |
+
$payment_template = 'bitpay/form/bitpay.phtml';
|
12 |
+
|
13 |
parent::_construct();
|
14 |
+
|
15 |
+
$this->setTemplate($payment_template);
|
16 |
}
|
17 |
}
|
app/code/community/Bitpay/Core/Block/Iframe.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
/**
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
|
|
|
|
5 |
*/
|
6 |
|
7 |
class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
@@ -21,48 +23,67 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|
21 |
*/
|
22 |
public function getIframeUrl()
|
23 |
{
|
24 |
-
if (Mage::getModel('bitpay/ipn')->getQuotePaid($this->getQuote()->getId())) {
|
25 |
return 'paid'; // quote's already paid, so don't show the iframe
|
26 |
}
|
27 |
|
28 |
/*** @var Bitpay_Core_Model_PaymentMethod ***/
|
29 |
$method = $this->getQuote()->getPayment()->getMethodInstance();
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
$options = array_merge(
|
31 |
array(
|
32 |
'currency' => $this->getQuote()->getQuoteCurrencyCode(),
|
33 |
'fullNotifications' => 'true',
|
34 |
-
'notificationURL' => Mage::getUrl('bitpay/ipn'),
|
35 |
-
'redirectURL' => Mage::getUrl('checkout/onepage/success'),
|
36 |
-
'transactionSpeed' => Mage::getStoreConfig('payment/bitpay/speed'),
|
37 |
),
|
38 |
$method->extractAddress($this->getQuote()->getShippingAddress())
|
39 |
);
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
// Mage doesn't round the total until saving and it can have more precision
|
43 |
// at this point which would be bad for later comparing records w/ bitpay.
|
44 |
// So round here to match what the price will be saved as:
|
45 |
$price = round($this->getQuote()->getGrandTotal(), 4);
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
//serialize info about the quote to detect changes
|
48 |
$hash = $method->getQuoteHash($this->getQuote()->getId());
|
49 |
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
//$invoice = bpCreateInvoice($quoteId, $price, array('quoteId' => $quoteId, 'quoteHash' => $hash), $options);
|
52 |
$invoice = array('url' => 'https://test.bitpay.com/invoice?id=5NxFkXcJbCSivtQRJa4kHP');
|
53 |
|
54 |
if (array_key_exists('error', $invoice)) {
|
55 |
-
Mage::helper('bitpay')->debugData(
|
56 |
-
|
57 |
-
'Error creating bitpay invoice',
|
58 |
-
$invoice['error'],
|
59 |
-
)
|
60 |
-
);
|
61 |
-
Mage::throwException("Error creating BitPay invoice. Please try again or use another payment option.");
|
62 |
|
63 |
return false;
|
64 |
}
|
65 |
|
66 |
-
return $invoice['url'].'&view=iframe';
|
|
|
67 |
}
|
68 |
}
|
2 |
/**
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
+
*
|
6 |
+
* TODO: Finish this iFrame implemenation... :/
|
7 |
*/
|
8 |
|
9 |
class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
23 |
*/
|
24 |
public function getIframeUrl()
|
25 |
{
|
26 |
+
if (\Mage::getModel('bitpay/ipn')->getQuotePaid($this->getQuote()->getId())) {
|
27 |
return 'paid'; // quote's already paid, so don't show the iframe
|
28 |
}
|
29 |
|
30 |
/*** @var Bitpay_Core_Model_PaymentMethod ***/
|
31 |
$method = $this->getQuote()->getPayment()->getMethodInstance();
|
32 |
+
|
33 |
+
if (false === isset($method) || true === empty($method)) {
|
34 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');
|
35 |
+
throw new \Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');
|
36 |
+
}
|
37 |
+
|
38 |
$options = array_merge(
|
39 |
array(
|
40 |
'currency' => $this->getQuote()->getQuoteCurrencyCode(),
|
41 |
'fullNotifications' => 'true',
|
42 |
+
'notificationURL' => \Mage::getUrl('bitpay/ipn'),
|
43 |
+
'redirectURL' => \Mage::getUrl('checkout/onepage/success'),
|
44 |
+
'transactionSpeed' => \Mage::getStoreConfig('payment/bitpay/speed'),
|
45 |
),
|
46 |
$method->extractAddress($this->getQuote()->getShippingAddress())
|
47 |
);
|
48 |
+
|
49 |
+
if (false === isset($options) || true === empty($options)) {
|
50 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
|
51 |
+
throw new \Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
|
52 |
+
} else {
|
53 |
+
\Mage::helper('bitpay')->debugData($options);
|
54 |
+
}
|
55 |
|
56 |
// Mage doesn't round the total until saving and it can have more precision
|
57 |
// at this point which would be bad for later comparing records w/ bitpay.
|
58 |
// So round here to match what the price will be saved as:
|
59 |
$price = round($this->getQuote()->getGrandTotal(), 4);
|
60 |
|
61 |
+
if (false === isset($price) || true === empty($price)) {
|
62 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the new rounded price.');
|
63 |
+
throw new \Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the new rounded price.');
|
64 |
+
}
|
65 |
+
|
66 |
//serialize info about the quote to detect changes
|
67 |
$hash = $method->getQuoteHash($this->getQuote()->getId());
|
68 |
|
69 |
+
if (false === isset($hash) || true === empty($hash)) {
|
70 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the quote hash.');
|
71 |
+
throw new \Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the quote hash.');
|
72 |
+
}
|
73 |
+
|
74 |
+
\Mage::helper('bitpay')->registerAutoloader();
|
75 |
+
|
76 |
//$invoice = bpCreateInvoice($quoteId, $price, array('quoteId' => $quoteId, 'quoteHash' => $hash), $options);
|
77 |
$invoice = array('url' => 'https://test.bitpay.com/invoice?id=5NxFkXcJbCSivtQRJa4kHP');
|
78 |
|
79 |
if (array_key_exists('error', $invoice)) {
|
80 |
+
\Mage::helper('bitpay')->debugData(array('Error creating bitpay invoice', $invoice['error'],));
|
81 |
+
\Mage::throwException("Error creating BitPay invoice. Please try again or use another payment option.");
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
return false;
|
84 |
}
|
85 |
|
86 |
+
//return $invoice['url'].'&view=iframe';
|
87 |
+
return false;
|
88 |
}
|
89 |
}
|
app/code/community/Bitpay/Core/Block/Info.php
CHANGED
@@ -15,11 +15,22 @@ class Bitpay_Core_Block_Info extends Mage_Payment_Block_Info
|
|
15 |
public function getBitpayInvoiceUrl()
|
16 |
{
|
17 |
$order = $this->getInfo()->getOrder();
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
$incrementId = $order->getIncrementId();
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
if ($bitpayInvoice) {
|
23 |
return $bitpayInvoice->getUrl();
|
24 |
}
|
25 |
}
|
15 |
public function getBitpayInvoiceUrl()
|
16 |
{
|
17 |
$order = $this->getInfo()->getOrder();
|
18 |
+
|
19 |
+
if (false === isset($order) || true === empty($order)) {
|
20 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Info::getBitpayInvoiceUrl(): could not obtain the order.');
|
21 |
+
throw new \Exception('In Bitpay_Core_Block_Info::getBitpayInvoiceUrl(): could not obtain the order.');
|
22 |
+
}
|
23 |
+
|
24 |
$incrementId = $order->getIncrementId();
|
25 |
|
26 |
+
if (false === isset($incrementId) || true === empty($incrementId)) {
|
27 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Info::getBitpayInvoiceUrl(): could not obtain the incrementId.');
|
28 |
+
throw new \Exception('In Bitpay_Core_Block_Info::getBitpayInvoiceUrl(): could not obtain the incrementId.');
|
29 |
+
}
|
30 |
+
|
31 |
+
$bitpayInvoice = \Mage::getModel('bitpay/invoice')->load($incrementId, 'increment_id');
|
32 |
|
33 |
+
if (true === isset($bitpayInvoice) && false === empty($bitpayInvoice)) {
|
34 |
return $bitpayInvoice->getUrl();
|
35 |
}
|
36 |
}
|
app/code/community/Bitpay/Core/Helper/Data.php
CHANGED
@@ -21,7 +21,9 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
21 |
*/
|
22 |
public function debugData($debugData)
|
23 |
{
|
24 |
-
|
|
|
|
|
25 |
}
|
26 |
|
27 |
/**
|
@@ -29,7 +31,7 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
29 |
*/
|
30 |
public function isDebug()
|
31 |
{
|
32 |
-
return (boolean) Mage::getStoreConfig('payment/bitpay/debug');
|
33 |
}
|
34 |
|
35 |
/**
|
@@ -39,7 +41,7 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
39 |
*/
|
40 |
public function hasTransactionSpeed()
|
41 |
{
|
42 |
-
$speed = Mage::getStoreConfig('payment/bitpay/speed');
|
43 |
|
44 |
return !empty($speed);
|
45 |
}
|
@@ -51,7 +53,7 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
51 |
*/
|
52 |
public function getNotificationUrl()
|
53 |
{
|
54 |
-
return Mage::getUrl(Mage::getStoreConfig('payment/bitpay/notification_url'));
|
55 |
}
|
56 |
|
57 |
/**
|
@@ -61,7 +63,7 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
61 |
*/
|
62 |
public function getRedirectUrl()
|
63 |
{
|
64 |
-
return Mage::getUrl(Mage::getStoreConfig('payment/bitpay/redirect_url'));
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -70,11 +72,19 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
70 |
*/
|
71 |
public function registerAutoloader()
|
72 |
{
|
73 |
-
if (
|
74 |
-
|
75 |
-
|
76 |
-
$
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
}
|
80 |
|
@@ -84,21 +94,36 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
84 |
*/
|
85 |
public function generateAndSaveKeys()
|
86 |
{
|
87 |
-
$this->debugData('
|
88 |
-
|
|
|
|
|
|
|
89 |
|
90 |
$this->_privateKey = new Bitpay\PrivateKey('payment/bitpay/private_key');
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
$this->_publicKey = new Bitpay\PublicKey('payment/bitpay/public_key');
|
94 |
-
|
95 |
-
|
96 |
-
->
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
$this->getKeyManager()->persist($this->_publicKey);
|
99 |
$this->getKeyManager()->persist($this->_privateKey);
|
100 |
|
101 |
-
$this->debugData('
|
102 |
}
|
103 |
|
104 |
/**
|
@@ -106,36 +131,62 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
106 |
*/
|
107 |
public function sendPairingRequest($pairingCode)
|
108 |
{
|
109 |
-
$
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
// Generate/Regenerate keys
|
114 |
$this->generateAndSaveKeys();
|
115 |
$sin = $this->getSinKey();
|
116 |
|
117 |
-
$
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
120 |
|
121 |
// Sanitize label
|
122 |
-
$label = preg_replace('/[^a-zA-Z0-9
|
123 |
-
$label = substr('Magento
|
124 |
|
125 |
-
$
|
126 |
-
array(
|
127 |
-
'id' => (string) $sin,
|
128 |
-
'pairingCode' => $pairingCode,
|
129 |
-
'label' => $label,
|
130 |
-
)
|
131 |
-
);
|
132 |
|
133 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
$config = new \Mage_Core_Model_Config();
|
136 |
-
$config->saveConfig('payment/bitpay/token', $token->getToken());
|
137 |
|
138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
140 |
|
141 |
/**
|
@@ -143,53 +194,97 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
143 |
*/
|
144 |
public function getSinKey()
|
145 |
{
|
146 |
-
if (
|
147 |
return $this->_sin;
|
148 |
}
|
149 |
|
150 |
-
$this->debugData('
|
|
|
|
|
|
|
|
|
151 |
|
152 |
-
$this->registerAutoloader();
|
153 |
$this->_sin = new Bitpay\SinKey();
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
$this->_sin
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
return $this->_sin;
|
159 |
}
|
160 |
|
161 |
public function getPublicKey()
|
162 |
{
|
163 |
-
if (
|
|
|
164 |
return $this->_publicKey;
|
165 |
}
|
166 |
|
167 |
-
$this->
|
|
|
|
|
|
|
|
|
168 |
|
169 |
$this->_publicKey = $this->getKeyManager()->load('payment/bitpay/public_key');
|
170 |
|
171 |
-
if (
|
|
|
172 |
$this->generateAndSaveKeys();
|
|
|
|
|
|
|
173 |
}
|
174 |
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
|
178 |
public function getPrivateKey()
|
179 |
{
|
180 |
-
if (
|
|
|
181 |
return $this->_privateKey;
|
182 |
}
|
183 |
|
184 |
-
$this->
|
|
|
|
|
|
|
|
|
185 |
|
186 |
$this->_privateKey = $this->getKeyManager()->load('payment/bitpay/private_key');
|
187 |
|
188 |
-
if (
|
|
|
189 |
$this->generateAndSaveKeys();
|
|
|
|
|
|
|
190 |
}
|
191 |
|
192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
|
195 |
/**
|
@@ -197,10 +292,19 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
197 |
*/
|
198 |
public function getKeyManager()
|
199 |
{
|
200 |
-
if (
|
201 |
-
$this->
|
202 |
-
|
|
|
|
|
203 |
$this->_keyManager = new Bitpay\KeyManager(new Bitpay\Storage\MagentoStorage());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
|
206 |
return $this->_keyManager;
|
@@ -214,9 +318,19 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
214 |
*/
|
215 |
public function getBitpay()
|
216 |
{
|
217 |
-
if (
|
218 |
-
$this->
|
|
|
|
|
|
|
219 |
$this->_bitpay = new Bitpay\Bitpay(array('bitpay' => $this->getBitpayConfig()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
}
|
221 |
|
222 |
return $this->_bitpay;
|
@@ -232,7 +346,7 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
232 |
return array(
|
233 |
'public_key' => 'payment/bitpay/public_key',
|
234 |
'private_key' => 'payment/bitpay/private_key',
|
235 |
-
'network' => Mage::getStoreConfig('payment/bitpay/network'),
|
236 |
'key_storage' => '\\Bitpay\\Storage\\MagentoStorage',
|
237 |
);
|
238 |
}
|
@@ -242,13 +356,23 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
242 |
*/
|
243 |
public function getBitpayClient()
|
244 |
{
|
245 |
-
if (
|
246 |
return $this->_client;
|
247 |
}
|
248 |
|
249 |
-
$this->
|
|
|
|
|
250 |
|
251 |
$this->_client = new Bitpay\Client\Client();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
$this->_client->setPublicKey($this->getPublicKey());
|
253 |
$this->_client->setPrivateKey($this->getPrivateKey());
|
254 |
$this->_client->setNetwork($this->getBitpay()->get('network'));
|
@@ -260,9 +384,20 @@ class Bitpay_Core_Helper_Data extends Mage_Core_Helper_Abstract
|
|
260 |
|
261 |
public function getToken()
|
262 |
{
|
263 |
-
$this->
|
|
|
|
|
|
|
264 |
$token = new Bitpay\Token();
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
266 |
|
267 |
return $token;
|
268 |
}
|
21 |
*/
|
22 |
public function debugData($debugData)
|
23 |
{
|
24 |
+
if (true === isset($debugData) && false === empty($debugData)) {
|
25 |
+
\Mage::getModel('bitpay/method_bitcoin')->debugData($debugData);
|
26 |
+
}
|
27 |
}
|
28 |
|
29 |
/**
|
31 |
*/
|
32 |
public function isDebug()
|
33 |
{
|
34 |
+
return (boolean) \Mage::getStoreConfig('payment/bitpay/debug');
|
35 |
}
|
36 |
|
37 |
/**
|
41 |
*/
|
42 |
public function hasTransactionSpeed()
|
43 |
{
|
44 |
+
$speed = \Mage::getStoreConfig('payment/bitpay/speed');
|
45 |
|
46 |
return !empty($speed);
|
47 |
}
|
53 |
*/
|
54 |
public function getNotificationUrl()
|
55 |
{
|
56 |
+
return \Mage::getUrl(\Mage::getStoreConfig('payment/bitpay/notification_url'));
|
57 |
}
|
58 |
|
59 |
/**
|
63 |
*/
|
64 |
public function getRedirectUrl()
|
65 |
{
|
66 |
+
return \Mage::getUrl(\Mage::getStoreConfig('payment/bitpay/redirect_url'));
|
67 |
}
|
68 |
|
69 |
/**
|
72 |
*/
|
73 |
public function registerAutoloader()
|
74 |
{
|
75 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
76 |
+
$autoloader_filename = \Mage::getBaseDir('lib').'/Bitpay/Autoloader.php';
|
77 |
+
|
78 |
+
if (true === is_file($autoloader_filename) && true === is_readable($autoloader_filename)) {
|
79 |
+
require_once $autoloader_filename;
|
80 |
+
\Bitpay\Autoloader::register();
|
81 |
+
$this->_autoloaderRegistered = true;
|
82 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was found and has been registered.');
|
83 |
+
} else {
|
84 |
+
$this->_autoloaderRegistered = false;
|
85 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was not found or is not readable. Cannot continue!');
|
86 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::registerAutoloader(): autoloader file was not found or is not readable. Cannot continue!');
|
87 |
+
}
|
88 |
}
|
89 |
}
|
90 |
|
94 |
*/
|
95 |
public function generateAndSaveKeys()
|
96 |
{
|
97 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::generateAndSaveKeys(): attempting to generate new keypair and save to database.');
|
98 |
+
|
99 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
100 |
+
$this->registerAutoloader();
|
101 |
+
}
|
102 |
|
103 |
$this->_privateKey = new Bitpay\PrivateKey('payment/bitpay/private_key');
|
104 |
+
|
105 |
+
if (false === isset($this->_privateKey) || true === empty($this->_privateKey)) {
|
106 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::generateAndSaveKeys(): could not create new Bitpay private key object. Cannot continue!');
|
107 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::generateAndSaveKeys(): could not create new Bitpay private key object. Cannot continue!');
|
108 |
+
} else {
|
109 |
+
$this->_privateKey->generate();
|
110 |
+
}
|
111 |
|
112 |
$this->_publicKey = new Bitpay\PublicKey('payment/bitpay/public_key');
|
113 |
+
|
114 |
+
if (false === isset($this->_publicKey) || true === empty($this->_publicKey)) {
|
115 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::generateAndSaveKeys(): could not create new Bitpay public key object. Cannot continue!');
|
116 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::generateAndSaveKeys(): could not create new Bitpay public key object. Cannot continue!');
|
117 |
+
} else {
|
118 |
+
$this->_publicKey
|
119 |
+
->setPrivateKey($this->_privateKey)
|
120 |
+
->generate();
|
121 |
+
}
|
122 |
|
123 |
$this->getKeyManager()->persist($this->_publicKey);
|
124 |
$this->getKeyManager()->persist($this->_privateKey);
|
125 |
|
126 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::generateAndSaveKeys(): key manager called to persist keypair to database.');
|
127 |
}
|
128 |
|
129 |
/**
|
131 |
*/
|
132 |
public function sendPairingRequest($pairingCode)
|
133 |
{
|
134 |
+
if (false === isset($pairingCode) || true === empty($pairingCode)) {
|
135 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::sendPairingRequest(): missing or invalid pairingCode parameter.');
|
136 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::sendPairingRequest(): missing or invalid pairingCode parameter.');
|
137 |
+
} else {
|
138 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::sendPairingRequest(): function called with the pairingCode parameter: ' . $pairingCode);
|
139 |
+
}
|
140 |
+
|
141 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
142 |
+
$this->registerAutoloader();
|
143 |
+
}
|
144 |
|
145 |
// Generate/Regenerate keys
|
146 |
$this->generateAndSaveKeys();
|
147 |
$sin = $this->getSinKey();
|
148 |
|
149 |
+
if (false === isset($sin) || true === empty($sin)) {
|
150 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::sendPairingRequest(): could not retrieve the SIN parameter. Cannot continue!');
|
151 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::sendPairingRequest(): could not retrieve the SIN parameter. Cannot continue!');
|
152 |
+
} else {
|
153 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::sendPairingRequest(): attempting to pair with the SIN parameter: ' . $sin);
|
154 |
+
}
|
155 |
|
156 |
// Sanitize label
|
157 |
+
$label = preg_replace('/[^a-zA-Z0-9 ]/', '', \Mage::app()->getStore()->getName());
|
158 |
+
$label = substr('Magento ' . $label, 0, 59);
|
159 |
|
160 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::sendPairingRequest(): using the label "' . $label . '".');
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
+
$token = $this->getBitpayClient()->createToken(
|
163 |
+
array(
|
164 |
+
'id' => (string) $sin,
|
165 |
+
'pairingCode' => (string) $pairingCode,
|
166 |
+
'label' => (string) $label,
|
167 |
+
)
|
168 |
+
);
|
169 |
+
|
170 |
+
if (false === isset($token) || true === empty($token)) {
|
171 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::sendPairingRequest(): could not obtain the token from the pairing process. Cannot continue!');
|
172 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::sendPairingRequest(): could not obtain the token from the pairing process. Cannot continue!');
|
173 |
+
} else {
|
174 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::sendPairingRequest(): token successfully obtained.');
|
175 |
+
}
|
176 |
|
177 |
$config = new \Mage_Core_Model_Config();
|
|
|
178 |
|
179 |
+
if (false === isset($config) || true === empty($config)) {
|
180 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::sendPairingRequest(): could not create new Mage_Core_Model_Config object. Cannot continue!');
|
181 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::sendPairingRequest(): could not create new Mage_Core_Model_Config object. Cannot continue!');
|
182 |
+
}
|
183 |
+
|
184 |
+
if($config->saveConfig('payment/bitpay/token', $token->getToken())) {
|
185 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::sendPairingRequest(): token saved to database.');
|
186 |
+
} else {
|
187 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::sendPairingRequest(): token could not be saved to database.');
|
188 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::sendPairingRequest(): token could not be saved to database.');
|
189 |
+
}
|
190 |
}
|
191 |
|
192 |
/**
|
194 |
*/
|
195 |
public function getSinKey()
|
196 |
{
|
197 |
+
if (false === empty($this->_sin)) {
|
198 |
return $this->_sin;
|
199 |
}
|
200 |
|
201 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getSinKey(): attempting to get the SIN parameter.');
|
202 |
+
|
203 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
204 |
+
$this->registerAutoloader();
|
205 |
+
}
|
206 |
|
|
|
207 |
$this->_sin = new Bitpay\SinKey();
|
208 |
+
|
209 |
+
if (false === isset($this->_sin) || true === empty($this->_sin)) {
|
210 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getSinKey(): could not create new BitPay SinKey object. Cannot continue!');
|
211 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getSinKey(): could not create new BitPay SinKey object. Cannot continue!');
|
212 |
+
}
|
213 |
+
|
214 |
$this->_sin
|
215 |
+
->setPublicKey($this->getPublicKey())
|
216 |
+
->generate();
|
217 |
+
|
218 |
+
if (false === isset($this->_sin) || true === empty($this->_sin)) {
|
219 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getSinKey(): could not generate a new SIN from the public key. Cannot continue!');
|
220 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getSinKey(): could not generate a new SIN from the public key. Cannot continue!');
|
221 |
+
}
|
222 |
|
223 |
return $this->_sin;
|
224 |
}
|
225 |
|
226 |
public function getPublicKey()
|
227 |
{
|
228 |
+
if (true === isset($this->_publicKey) && false === empty($this->_publicKey)) {
|
229 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPublicKey(): found an existing public key, returning that.');
|
230 |
return $this->_publicKey;
|
231 |
}
|
232 |
|
233 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
234 |
+
$this->registerAutoloader();
|
235 |
+
}
|
236 |
+
|
237 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPublicKey(): did not find an existing public key, attempting to load one from the key manager.');
|
238 |
|
239 |
$this->_publicKey = $this->getKeyManager()->load('payment/bitpay/public_key');
|
240 |
|
241 |
+
if (true === empty($this->_publicKey)) {
|
242 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPublicKey(): could not load a public key from the key manager, generating a new one.');
|
243 |
$this->generateAndSaveKeys();
|
244 |
+
} else {
|
245 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPublicKey(): successfully loaded public key from the key manager, returning that.');
|
246 |
+
return $this->_publicKey;
|
247 |
}
|
248 |
|
249 |
+
if (false === empty($this->_publicKey)) {
|
250 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPublicKey(): successfully generated a new public key.');
|
251 |
+
return $this->_publicKey;
|
252 |
+
} else {
|
253 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getPublicKey(): could not load or generate a new public key. Cannot continue!');
|
254 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getPublicKey(): could not load or generate a new public key. Cannot continue!');
|
255 |
+
}
|
256 |
}
|
257 |
|
258 |
public function getPrivateKey()
|
259 |
{
|
260 |
+
if (false === empty($this->_privateKey)) {
|
261 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPrivateKey(): found an existing private key, returning that.');
|
262 |
return $this->_privateKey;
|
263 |
}
|
264 |
|
265 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
266 |
+
$this->registerAutoloader();
|
267 |
+
}
|
268 |
+
|
269 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPrivateKey(): did not find an existing private key, attempting to load one from the key manager.');
|
270 |
|
271 |
$this->_privateKey = $this->getKeyManager()->load('payment/bitpay/private_key');
|
272 |
|
273 |
+
if (true === empty($this->_privateKey)) {
|
274 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPrivateKey(): could not load a private key from the key manager, generating a new one.');
|
275 |
$this->generateAndSaveKeys();
|
276 |
+
} else {
|
277 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPrivateKey(): successfully loaded private key from the key manager, returning that.');
|
278 |
+
return $this->_privateKey;
|
279 |
}
|
280 |
|
281 |
+
if (false === empty($this->_privateKey)) {
|
282 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getPrivateKey(): successfully generated a new private key.');
|
283 |
+
return $this->_privateKey;
|
284 |
+
} else {
|
285 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getPrivateKey(): could not load or generate a new private key. Cannot continue!');
|
286 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getPrivateKey(): could not load or generate a new private key. Cannot continue!');
|
287 |
+
}
|
288 |
}
|
289 |
|
290 |
/**
|
292 |
*/
|
293 |
public function getKeyManager()
|
294 |
{
|
295 |
+
if (true === empty($this->_keyManager)) {
|
296 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
297 |
+
$this->registerAutoloader();
|
298 |
+
}
|
299 |
+
|
300 |
$this->_keyManager = new Bitpay\KeyManager(new Bitpay\Storage\MagentoStorage());
|
301 |
+
|
302 |
+
if (false === isset($this->_keyManager) || true === empty($this->_keyManager)) {
|
303 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getKeyManager(): could not create new BitPay KeyManager object. Cannot continue!');
|
304 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getKeyManager(): could not create new BitPay KeyManager object. Cannot continue!');
|
305 |
+
} else {
|
306 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getKeyManager(): successfully created new BitPay KeyManager object.');
|
307 |
+
}
|
308 |
}
|
309 |
|
310 |
return $this->_keyManager;
|
318 |
*/
|
319 |
public function getBitpay()
|
320 |
{
|
321 |
+
if (true === empty($this->_bitpay)) {
|
322 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
323 |
+
$this->registerAutoloader();
|
324 |
+
}
|
325 |
+
|
326 |
$this->_bitpay = new Bitpay\Bitpay(array('bitpay' => $this->getBitpayConfig()));
|
327 |
+
|
328 |
+
if (false === isset($this->_bitpay) || true === empty($this->_bitpay)) {
|
329 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getBitpay(): could not create new BitPay object. Cannot continue!');
|
330 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getBitpay(): could not create new BitPay object. Cannot continue!');
|
331 |
+
} else {
|
332 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getBitpay(): successfully created new BitPay object.');
|
333 |
+
}
|
334 |
}
|
335 |
|
336 |
return $this->_bitpay;
|
346 |
return array(
|
347 |
'public_key' => 'payment/bitpay/public_key',
|
348 |
'private_key' => 'payment/bitpay/private_key',
|
349 |
+
'network' => \Mage::getStoreConfig('payment/bitpay/network'),
|
350 |
'key_storage' => '\\Bitpay\\Storage\\MagentoStorage',
|
351 |
);
|
352 |
}
|
356 |
*/
|
357 |
public function getBitpayClient()
|
358 |
{
|
359 |
+
if (false === empty($this->_client)) {
|
360 |
return $this->_client;
|
361 |
}
|
362 |
|
363 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
364 |
+
$this->registerAutoloader();
|
365 |
+
}
|
366 |
|
367 |
$this->_client = new Bitpay\Client\Client();
|
368 |
+
|
369 |
+
if (false === isset($this->_client) || true === empty($this->_client)) {
|
370 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getBitpayClient(): could not create new BitPay Client object. Cannot continue!');
|
371 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getBitpayClient(): could not create new BitPay Client object. Cannot continue!');
|
372 |
+
} else {
|
373 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getBitpayClient(): successfully created new BitPay Client object.');
|
374 |
+
}
|
375 |
+
|
376 |
$this->_client->setPublicKey($this->getPublicKey());
|
377 |
$this->_client->setPrivateKey($this->getPrivateKey());
|
378 |
$this->_client->setNetwork($this->getBitpay()->get('network'));
|
384 |
|
385 |
public function getToken()
|
386 |
{
|
387 |
+
if (true === empty($this->_autoloaderRegistered)) {
|
388 |
+
$this->registerAutoloader();
|
389 |
+
}
|
390 |
+
|
391 |
$token = new Bitpay\Token();
|
392 |
+
|
393 |
+
if (false === isset($token) || true === empty($token)) {
|
394 |
+
$this->debugData('[ERROR] In Bitpay_Core_Helper_Data::getToken(): could not create new BitPay Token object. Cannot continue!');
|
395 |
+
throw new \Exception('In Bitpay_Core_Helper_Data::getToken(): could not create new BitPay Token object. Cannot continue!');
|
396 |
+
} else {
|
397 |
+
$this->debugData('[INFO] In Bitpay_Core_Helper_Data::getToken(): successfully created new BitPay Token object.');
|
398 |
+
}
|
399 |
+
|
400 |
+
$token->setToken(\Mage::getStoreConfig('payment/bitpay/token'));
|
401 |
|
402 |
return $token;
|
403 |
}
|
app/code/community/Bitpay/Core/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2011-2014 BitPay, Inc.
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
-
of this software and associated documentation files (the "Software"), to deal
|
7 |
-
in the Software without restriction, including without limitation the rights
|
8 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
-
copies of the Software, and to permit persons to whom the Software is
|
10 |
-
furnished to do so, subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in
|
13 |
-
all copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
-
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Bitpay/Core/Model/Config/PairingCode.php
CHANGED
@@ -23,25 +23,21 @@ class Bitpay_Core_Model_Config_PairingCode extends Mage_Core_Model_Config_Data
|
|
23 |
*/
|
24 |
$pairingCode = trim($this->getValue());
|
25 |
|
26 |
-
if (empty($pairingCode)) {
|
27 |
return;
|
28 |
}
|
29 |
|
30 |
-
Mage::helper('bitpay')->debugData('
|
31 |
|
32 |
try {
|
33 |
-
Mage::helper('bitpay')->sendPairingRequest($pairingCode);
|
34 |
-
} catch (Exception $e) {
|
35 |
-
Mage::helper('bitpay')->debugData(
|
36 |
-
|
37 |
-
);
|
38 |
-
Mage::getSingleton('core/session')->addError(
|
39 |
-
'There was an error while trying to pair the pairing code. Please try again or enabled debug mode and send the "payment_bitpay.log" file to support.'
|
40 |
-
);
|
41 |
|
42 |
return;
|
43 |
}
|
44 |
|
45 |
-
Mage::getSingleton('core/session')->addSuccess('Pairing
|
46 |
}
|
47 |
}
|
23 |
*/
|
24 |
$pairingCode = trim($this->getValue());
|
25 |
|
26 |
+
if (true === empty($pairingCode)) {
|
27 |
return;
|
28 |
}
|
29 |
|
30 |
+
\Mage::helper('bitpay')->debugData('[INFO] In Bitpay_Core_Model_Config_PairingCode::save(): attempting to pair with BitPay with pairing code ' . $pairingCode);
|
31 |
|
32 |
try {
|
33 |
+
\Mage::helper('bitpay')->sendPairingRequest($pairingCode);
|
34 |
+
} catch (\Exception $e) {
|
35 |
+
\Mage::helper('bitpay')->debugData(sprintf('[ERROR] Exception thrown while calling the sendPairingRequest() function. The specific error message is: "%s"', $e->getMessage()));
|
36 |
+
\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.');
|
|
|
|
|
|
|
|
|
37 |
|
38 |
return;
|
39 |
}
|
40 |
|
41 |
+
\Mage::getSingleton('core/session')->addSuccess('Pairing with BitPay was successful.');
|
42 |
}
|
43 |
}
|
app/code/community/Bitpay/Core/Model/Invoice.php
CHANGED
@@ -24,18 +24,20 @@ class Bitpay_Core_Model_Invoice extends Mage_Core_Model_Abstract
|
|
24 |
*/
|
25 |
public function prepareWithBitpayInvoice($invoice)
|
26 |
{
|
|
|
|
|
|
|
|
|
|
|
27 |
$this->addData(
|
28 |
array(
|
29 |
'id' => $invoice->getId(),
|
30 |
-
//'updated_at' => 'NOW()',
|
31 |
'url' => $invoice->getUrl(),
|
32 |
'pos_data' => $invoice->getPosData(),
|
33 |
'status' => $invoice->getStatus(),
|
34 |
'btc_price' => $invoice->getBtcPrice(),
|
35 |
-
//'btc_due' => $invoice->getBtcDue(),
|
36 |
'price' => $invoice->getPrice(),
|
37 |
'currency' => $invoice->getCurrency()->getCode(),
|
38 |
-
//'ex_rates' => $invoice->getExRates(),
|
39 |
'order_id' => $invoice->getOrderId(),
|
40 |
'invoice_time' => $invoice->getInvoiceTime(),
|
41 |
'expiration_time' => $invoice->getExpirationTime(),
|
@@ -43,7 +45,6 @@ class Bitpay_Core_Model_Invoice extends Mage_Core_Model_Abstract
|
|
43 |
'btc_paid' => $invoice->getBtcPaid(),
|
44 |
'rate' => $invoice->getRate(),
|
45 |
'exception_status' => $invoice->getExceptionStatus(),
|
46 |
-
//'token' => $invoice->getToken(),
|
47 |
)
|
48 |
);
|
49 |
|
@@ -58,6 +59,11 @@ class Bitpay_Core_Model_Invoice extends Mage_Core_Model_Abstract
|
|
58 |
*/
|
59 |
public function prepateWithOrder($order)
|
60 |
{
|
|
|
|
|
|
|
|
|
|
|
61 |
$this->addData(
|
62 |
array(
|
63 |
'quote_id' => $order->getQuoteId(),
|
24 |
*/
|
25 |
public function prepareWithBitpayInvoice($invoice)
|
26 |
{
|
27 |
+
if (false === isset($invoice) || true === empty($invoice)) {
|
28 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Model_Invoice::prepareWithBitpayInvoice(): Missing or empty $invoice parameter.');
|
29 |
+
throw new \Exception('In Bitpay_Core_Model_Invoice::prepareWithBitpayInvoice(): Missing or empty $invoice parameter.');
|
30 |
+
}
|
31 |
+
|
32 |
$this->addData(
|
33 |
array(
|
34 |
'id' => $invoice->getId(),
|
|
|
35 |
'url' => $invoice->getUrl(),
|
36 |
'pos_data' => $invoice->getPosData(),
|
37 |
'status' => $invoice->getStatus(),
|
38 |
'btc_price' => $invoice->getBtcPrice(),
|
|
|
39 |
'price' => $invoice->getPrice(),
|
40 |
'currency' => $invoice->getCurrency()->getCode(),
|
|
|
41 |
'order_id' => $invoice->getOrderId(),
|
42 |
'invoice_time' => $invoice->getInvoiceTime(),
|
43 |
'expiration_time' => $invoice->getExpirationTime(),
|
45 |
'btc_paid' => $invoice->getBtcPaid(),
|
46 |
'rate' => $invoice->getRate(),
|
47 |
'exception_status' => $invoice->getExceptionStatus(),
|
|
|
48 |
)
|
49 |
);
|
50 |
|
59 |
*/
|
60 |
public function prepateWithOrder($order)
|
61 |
{
|
62 |
+
if (false === isset($order) || true === empty($order)) {
|
63 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Model_Invoice::prepateWithOrder(): Missing or empty $order parameter.');
|
64 |
+
throw new \Exception('In Bitpay_Core_Model_Invoice::prepateWithOrder(): Missing or empty $order parameter.');
|
65 |
+
}
|
66 |
+
|
67 |
$this->addData(
|
68 |
array(
|
69 |
'quote_id' => $order->getQuoteId(),
|
app/code/community/Bitpay/Core/Model/Method/Bitcoin.php
CHANGED
@@ -12,6 +12,7 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
12 |
protected $_code = 'bitpay';
|
13 |
protected $_formBlockType = 'bitpay/form_bitpay';
|
14 |
protected $_infoBlockType = 'bitpay/info';
|
|
|
15 |
protected $_isGateway = true;
|
16 |
protected $_canAuthorize = true;
|
17 |
protected $_canCapture = false;
|
@@ -19,12 +20,14 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
19 |
protected $_isInitializeNeeded = false;
|
20 |
protected $_canFetchTransactionInfo = false;
|
21 |
protected $_canManagerRecurringProfiles = false;
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
27 |
protected $_debugReplacePrivateDataKeys = array();
|
|
|
28 |
protected static $_redirectUrl;
|
29 |
|
30 |
/**
|
@@ -34,40 +37,46 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
34 |
*/
|
35 |
public function authorize(Varien_Object $payment, $amount)
|
36 |
{
|
37 |
-
$
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
// Create BitPay Invoice
|
40 |
$invoice = $this->initializeInvoice();
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
$invoice = $this->prepareInvoice($invoice, $payment, $amount);
|
42 |
|
43 |
try {
|
44 |
-
$bitpayInvoice = Mage::helper('bitpay')->getBitpayClient()->createInvoice($invoice);
|
45 |
-
} catch (Exception $e) {
|
46 |
-
$this->debugData($e->getMessage());
|
47 |
-
|
48 |
-
array(
|
49 |
-
Mage::helper('bitpay')->getBitpayClient()->getRequest()->getBody(),
|
50 |
-
Mage::helper('bitpay')->getBitpayClient()->getResponse()->getBody(),
|
51 |
-
)
|
52 |
-
);
|
53 |
-
Mage::throwException('Could not authorize transaction.');
|
54 |
}
|
55 |
|
56 |
self::$_redirectUrl = $bitpayInvoice->getUrl();
|
|
|
57 |
$this->debugData(
|
58 |
array(
|
59 |
-
'BitPay Invoice created',
|
60 |
sprintf('Invoice URL: "%s"', $bitpayInvoice->getUrl()),
|
61 |
)
|
62 |
);
|
63 |
|
64 |
// Save BitPay Invoice in database for reference
|
65 |
-
$mirrorInvoice = Mage::getModel('bitpay/invoice')
|
66 |
->prepareWithBitpayInvoice($bitpayInvoice)
|
67 |
->prepateWithOrder($payment->getOrder())
|
68 |
->save();
|
69 |
|
70 |
-
$this->debugData($bitpayInvoice->getId());
|
71 |
|
72 |
return $this;
|
73 |
}
|
@@ -81,18 +90,20 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
81 |
*/
|
82 |
public function canUseCheckout()
|
83 |
{
|
84 |
-
$token = Mage::getStoreConfig('payment/bitpay/token');
|
85 |
|
86 |
-
if (empty($token)) {
|
87 |
/**
|
88 |
* Merchant must goto their account and create a pairing code to
|
89 |
* enter in.
|
90 |
*/
|
91 |
-
$this->debugData('Magento store does not have a BitPay token.');
|
92 |
|
93 |
return false;
|
94 |
}
|
95 |
|
|
|
|
|
96 |
return true;
|
97 |
}
|
98 |
|
@@ -104,11 +115,33 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
104 |
*/
|
105 |
public function fetchInvoice($id)
|
106 |
{
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
-
$client = Mage::helper('bitpay')->getBitpayClient();
|
110 |
$invoice = $client->getInvoice($id);
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
return $invoice;
|
113 |
}
|
114 |
|
@@ -121,9 +154,12 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
121 |
*/
|
122 |
public function extractAddress($address)
|
123 |
{
|
124 |
-
$
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
127 |
|
128 |
$options = array();
|
129 |
$options['buyerName'] = $address->getName();
|
@@ -145,7 +181,10 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
145 |
|
146 |
// trim to fit API specs
|
147 |
foreach (array('buyerName', 'buyerAddress1', 'buyerAddress2', 'buyerAddress3', 'buyerAddress4', 'buyerCity', 'buyerState', 'buyerZip', 'buyerCountry', 'buyerEmail', 'buyerPhone') as $f) {
|
148 |
-
$options[$f]
|
|
|
|
|
|
|
149 |
}
|
150 |
|
151 |
return $options;
|
@@ -158,9 +197,7 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
158 |
*/
|
159 |
public function getOrderPlaceRedirectUrl()
|
160 |
{
|
161 |
-
$this->debugData(
|
162 |
-
'Customer wants to place the order. Create invoice and redirect user to invoice'
|
163 |
-
);
|
164 |
|
165 |
return self::$_redirectUrl;
|
166 |
}
|
@@ -173,13 +210,21 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
173 |
*/
|
174 |
private function initializeInvoice()
|
175 |
{
|
176 |
-
Mage::helper('bitpay')->registerAutoloader();
|
177 |
|
178 |
$invoice = new Bitpay\Invoice();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
$invoice->setFullNotifications(true);
|
180 |
-
$invoice->setTransactionSpeed(Mage::getStoreConfig('payment/bitpay/speed'));
|
181 |
-
$invoice->setNotificationUrl(Mage::getUrl(Mage::getStoreConfig('payment/bitpay/notification_url')));
|
182 |
-
$invoice->setRedirectUrl(Mage::getUrl(Mage::getStoreConfig('payment/bitpay/redirect_url')));
|
183 |
|
184 |
return $invoice;
|
185 |
}
|
@@ -195,14 +240,15 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
195 |
*/
|
196 |
private function prepareInvoice($invoice, $payment, $amount)
|
197 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
$invoice->setOrderId($payment->getOrder()->getIncrementId());
|
199 |
-
$invoice->setPosData(
|
200 |
-
json_encode(
|
201 |
-
array(
|
202 |
-
'id' => $payment->getOrder()->getIncrementId(),
|
203 |
-
)
|
204 |
-
)
|
205 |
-
);
|
206 |
|
207 |
$invoice = $this->addCurrencyInfo($invoice, $payment->getOrder());
|
208 |
$invoice = $this->addPriceInfo($invoice, $amount);
|
@@ -220,7 +266,20 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
220 |
*/
|
221 |
private function addBuyerInfo($invoice, $order)
|
222 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
$buyer = new Bitpay\Buyer();
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
$buyer->setFirstName($order->getCustomerFirstname());
|
225 |
$buyer->setLastName($order->getCustomerLastname());
|
226 |
$invoice->setBuyer($buyer);
|
@@ -237,7 +296,20 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
237 |
*/
|
238 |
private function addCurrencyInfo($invoice, $order)
|
239 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
$currency = new Bitpay\Currency();
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
$currency->setCode($order->getBaseCurrencyCode());
|
242 |
$invoice->setCurrency($currency);
|
243 |
|
@@ -253,7 +325,20 @@ class Bitpay_Core_Model_Method_Bitcoin extends Mage_Payment_Model_Method_Abstrac
|
|
253 |
*/
|
254 |
private function addPriceInfo($invoice, $amount)
|
255 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
$item = new \Bitpay\Item();
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
$item->setPrice($amount);
|
258 |
$invoice->setItem($item);
|
259 |
|
12 |
protected $_code = 'bitpay';
|
13 |
protected $_formBlockType = 'bitpay/form_bitpay';
|
14 |
protected $_infoBlockType = 'bitpay/info';
|
15 |
+
|
16 |
protected $_isGateway = true;
|
17 |
protected $_canAuthorize = true;
|
18 |
protected $_canCapture = false;
|
20 |
protected $_isInitializeNeeded = false;
|
21 |
protected $_canFetchTransactionInfo = false;
|
22 |
protected $_canManagerRecurringProfiles = false;
|
23 |
+
protected $_canUseCheckout = true;
|
24 |
+
protected $_canUseForMultishipping = true;
|
25 |
+
protected $_canCapturePartial = false;
|
26 |
+
protected $_canRefund = false;
|
27 |
+
protected $_canVoid = false;
|
28 |
+
|
29 |
protected $_debugReplacePrivateDataKeys = array();
|
30 |
+
|
31 |
protected static $_redirectUrl;
|
32 |
|
33 |
/**
|
37 |
*/
|
38 |
public function authorize(Varien_Object $payment, $amount)
|
39 |
{
|
40 |
+
if (false === isset($payment) || false === isset($amount) || true === empty($payment) || true === empty($amount)) {
|
41 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::authorize(): missing payment or amount parameters.');
|
42 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::authorize(): missing payment or amount parameters.');
|
43 |
+
}
|
44 |
+
|
45 |
+
$this->debugData('[INFO] Bitpay_Core_Model_Method_Bitcoin::authorize(): authorizing new order.');
|
46 |
|
47 |
// Create BitPay Invoice
|
48 |
$invoice = $this->initializeInvoice();
|
49 |
+
|
50 |
+
if (false === isset($invoice) || true === empty($invoice)) {
|
51 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::authorize(): could not initialize invoice.');
|
52 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::authorize(): could not initialize invoice.');
|
53 |
+
}
|
54 |
+
|
55 |
$invoice = $this->prepareInvoice($invoice, $payment, $amount);
|
56 |
|
57 |
try {
|
58 |
+
$bitpayInvoice = \Mage::helper('bitpay')->getBitpayClient()->createInvoice($invoice);
|
59 |
+
} catch (\Exception $e) {
|
60 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::authorize(): ' . $e->getMessage());
|
61 |
+
\Mage::throwException('In Bitpay_Core_Model_Method_Bitcoin::authorize(): Could not authorize transaction.');
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
63 |
|
64 |
self::$_redirectUrl = $bitpayInvoice->getUrl();
|
65 |
+
|
66 |
$this->debugData(
|
67 |
array(
|
68 |
+
'[INFO] BitPay Invoice created',
|
69 |
sprintf('Invoice URL: "%s"', $bitpayInvoice->getUrl()),
|
70 |
)
|
71 |
);
|
72 |
|
73 |
// Save BitPay Invoice in database for reference
|
74 |
+
$mirrorInvoice = \Mage::getModel('bitpay/invoice')
|
75 |
->prepareWithBitpayInvoice($bitpayInvoice)
|
76 |
->prepateWithOrder($payment->getOrder())
|
77 |
->save();
|
78 |
|
79 |
+
$this->debugData('[INFO] Leaving Bitpay_Core_Model_Method_Bitcoin::authorize(): invoice id ' . $bitpayInvoice->getId());
|
80 |
|
81 |
return $this;
|
82 |
}
|
90 |
*/
|
91 |
public function canUseCheckout()
|
92 |
{
|
93 |
+
$token = \Mage::getStoreConfig('payment/bitpay/token');
|
94 |
|
95 |
+
if (false === isset($token) || true === empty($token)) {
|
96 |
/**
|
97 |
* Merchant must goto their account and create a pairing code to
|
98 |
* enter in.
|
99 |
*/
|
100 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::canUseCheckout(): There was an error retrieving the token store param from the database or this Magento store does not have a BitPay token.');
|
101 |
|
102 |
return false;
|
103 |
}
|
104 |
|
105 |
+
$this->debugData('[INFO] Leaving Bitpay_Core_Model_Method_Bitcoin::canUseCheckout(): token obtained from storage successfully.');
|
106 |
+
|
107 |
return true;
|
108 |
}
|
109 |
|
115 |
*/
|
116 |
public function fetchInvoice($id)
|
117 |
{
|
118 |
+
if (false === isset($id) || true === empty($id)) {
|
119 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): missing or invalid id parameter.');
|
120 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): missing or invalid id parameter.');
|
121 |
+
} else {
|
122 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): function called with id ' . $id);
|
123 |
+
}
|
124 |
+
|
125 |
+
\Mage::helper('bitpay')->registerAutoloader();
|
126 |
+
|
127 |
+
$client = \Mage::helper('bitpay')->getBitpayClient();
|
128 |
+
|
129 |
+
if (false === isset($client) || true === empty($client)) {
|
130 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): could not obtain BitPay client.');
|
131 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): could not obtain BitPay client.');
|
132 |
+
} else {
|
133 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): obtained BitPay client successfully.');
|
134 |
+
}
|
135 |
|
|
|
136 |
$invoice = $client->getInvoice($id);
|
137 |
|
138 |
+
if (false === isset($invoice) || true === empty($invoice)) {
|
139 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): could not retrieve invoice from BitPay.');
|
140 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): could not retrieve invoice from BitPay.');
|
141 |
+
} else {
|
142 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::fetchInvoice(): successfully retrieved invoice id ' . $id . ' from BitPay.');
|
143 |
+
}
|
144 |
+
|
145 |
return $invoice;
|
146 |
}
|
147 |
|
154 |
*/
|
155 |
public function extractAddress($address)
|
156 |
{
|
157 |
+
if (false === isset($address) || true === empty($address)) {
|
158 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::extractAddress(): missing or invalid address parameter.');
|
159 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::extractAddress(): missing or invalid address parameter.');
|
160 |
+
} else {
|
161 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::extractAddress(): called with good address parameter, extracting now.');
|
162 |
+
}
|
163 |
|
164 |
$options = array();
|
165 |
$options['buyerName'] = $address->getName();
|
181 |
|
182 |
// trim to fit API specs
|
183 |
foreach (array('buyerName', 'buyerAddress1', 'buyerAddress2', 'buyerAddress3', 'buyerAddress4', 'buyerCity', 'buyerState', 'buyerZip', 'buyerCountry', 'buyerEmail', 'buyerPhone') as $f) {
|
184 |
+
if (true === isset($options[$f]) && strlen($options[$f]) > 100) {
|
185 |
+
$this->debugData('[WARNING] In Bitpay_Core_Model_Method_Bitcoin::extractAddress(): the ' . $f . ' parameter was greater than 100 characters, trimming.');
|
186 |
+
$options[$f] = substr($options[$f], 0, 100);
|
187 |
+
}
|
188 |
}
|
189 |
|
190 |
return $options;
|
197 |
*/
|
198 |
public function getOrderPlaceRedirectUrl()
|
199 |
{
|
200 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::getOrderPlaceRedirectUrl(): $_redirectUrl is ' . self::$_redirectUrl);
|
|
|
|
|
201 |
|
202 |
return self::$_redirectUrl;
|
203 |
}
|
210 |
*/
|
211 |
private function initializeInvoice()
|
212 |
{
|
213 |
+
\Mage::helper('bitpay')->registerAutoloader();
|
214 |
|
215 |
$invoice = new Bitpay\Invoice();
|
216 |
+
|
217 |
+
if (false === isset($invoice) || true === empty($invoice)) {
|
218 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::initializeInvoice(): could not construct new BitPay invoice object.');
|
219 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::initializeInvoice(): could not construct new BitPay invoice object.');
|
220 |
+
} else {
|
221 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::initializeInvoice(): constructed new BitPay invoice object successfully.');
|
222 |
+
}
|
223 |
+
|
224 |
$invoice->setFullNotifications(true);
|
225 |
+
$invoice->setTransactionSpeed(\Mage::getStoreConfig('payment/bitpay/speed'));
|
226 |
+
$invoice->setNotificationUrl(\Mage::getUrl(\Mage::getStoreConfig('payment/bitpay/notification_url')));
|
227 |
+
$invoice->setRedirectUrl(\Mage::getUrl(\Mage::getStoreConfig('payment/bitpay/redirect_url')));
|
228 |
|
229 |
return $invoice;
|
230 |
}
|
240 |
*/
|
241 |
private function prepareInvoice($invoice, $payment, $amount)
|
242 |
{
|
243 |
+
if (false === isset($invoice) || true === empty($invoice) || false === isset($payment) || true === empty($payment) || false === isset($amount) || true === empty($amount)) {
|
244 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): missing or invalid invoice, payment or amount parameter.');
|
245 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): missing or invalid invoice, payment or amount parameter.');
|
246 |
+
} else {
|
247 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::prepareInvoice(): entered function with good invoice, payment and amount parameters.');
|
248 |
+
}
|
249 |
+
|
250 |
$invoice->setOrderId($payment->getOrder()->getIncrementId());
|
251 |
+
$invoice->setPosData(json_encode(array('id' => $payment->getOrder()->getIncrementId())));
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
|
253 |
$invoice = $this->addCurrencyInfo($invoice, $payment->getOrder());
|
254 |
$invoice = $this->addPriceInfo($invoice, $amount);
|
266 |
*/
|
267 |
private function addBuyerInfo($invoice, $order)
|
268 |
{
|
269 |
+
if (false === isset($invoice) || true === empty($invoice) || false === isset($order) || true === empty($order)) {
|
270 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addBuyerInfo(): missing or invalid invoice or order parameter.');
|
271 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addBuyerInfo(): missing or invalid invoice or order parameter.');
|
272 |
+
} else {
|
273 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::addBuyerInfo(): function called with good invoice and order parameters.');
|
274 |
+
}
|
275 |
+
|
276 |
$buyer = new Bitpay\Buyer();
|
277 |
+
|
278 |
+
if (false === isset($buyer) || true === empty($buyer)) {
|
279 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addBuyerInfo(): could not construct new BitPay buyer object.');
|
280 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addBuyerInfo(): could not construct new BitPay buyer object.');
|
281 |
+
}
|
282 |
+
|
283 |
$buyer->setFirstName($order->getCustomerFirstname());
|
284 |
$buyer->setLastName($order->getCustomerLastname());
|
285 |
$invoice->setBuyer($buyer);
|
296 |
*/
|
297 |
private function addCurrencyInfo($invoice, $order)
|
298 |
{
|
299 |
+
if (false === isset($invoice) || true === empty($invoice) || false === isset($order) || true === empty($order)) {
|
300 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addCurrencyInfo(): missing or invalid invoice or order parameter.');
|
301 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addCurrencyInfo(): missing or invalid invoice or order parameter.');
|
302 |
+
} else {
|
303 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::addCurrencyInfo(): function called with good invoice and order parameters.');
|
304 |
+
}
|
305 |
+
|
306 |
$currency = new Bitpay\Currency();
|
307 |
+
|
308 |
+
if (false === isset($currency) || true === empty($currency)) {
|
309 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addCurrencyInfo(): could not construct new BitPay currency object.');
|
310 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addCurrencyInfo(): could not construct new BitPay currency object.');
|
311 |
+
}
|
312 |
+
|
313 |
$currency->setCode($order->getBaseCurrencyCode());
|
314 |
$invoice->setCurrency($currency);
|
315 |
|
325 |
*/
|
326 |
private function addPriceInfo($invoice, $amount)
|
327 |
{
|
328 |
+
if (false === isset($invoice) || true === empty($invoice) || false === isset($amount) || true === empty($amount)) {
|
329 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addPriceInfo(): missing or invalid invoice or amount parameter.');
|
330 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addPriceInfo(): missing or invalid invoice or amount parameter.');
|
331 |
+
} else {
|
332 |
+
$this->debugData('[INFO] In Bitpay_Core_Model_Method_Bitcoin::addPriceInfo(): function called with good invoice and amount parameters.');
|
333 |
+
}
|
334 |
+
|
335 |
$item = new \Bitpay\Item();
|
336 |
+
|
337 |
+
if (false === isset($item) || true === empty($item)) {
|
338 |
+
$this->debugData('[ERROR] In Bitpay_Core_Model_Method_Bitcoin::addPriceInfo(): could not construct new BitPay item object.');
|
339 |
+
throw new \Exception('In Bitpay_Core_Model_Method_Bitcoin::addPriceInfo(): could not construct new BitPay item object.');
|
340 |
+
}
|
341 |
+
|
342 |
$item->setPrice($amount);
|
343 |
$invoice->setItem($item);
|
344 |
|
app/code/community/Bitpay/Core/Model/Network.php
CHANGED
@@ -18,8 +18,8 @@ class Bitpay_Core_Model_Network
|
|
18 |
public function toOptionArray()
|
19 |
{
|
20 |
return array(
|
21 |
-
array('value' => self::NETWORK_LIVENET, 'label' => Mage::helper('bitpay')->__(
|
22 |
-
array('value' => self::NETWORK_TESTNET, 'label' => Mage::helper('bitpay')->__(
|
23 |
);
|
24 |
}
|
25 |
}
|
18 |
public function toOptionArray()
|
19 |
{
|
20 |
return array(
|
21 |
+
array('value' => self::NETWORK_LIVENET, 'label' => \Mage::helper('bitpay')->__(ucwords(self::NETWORK_LIVENET))),
|
22 |
+
array('value' => self::NETWORK_TESTNET, 'label' => \Mage::helper('bitpay')->__(ucwords(self::NETWORK_TESTNET))),
|
23 |
);
|
24 |
}
|
25 |
}
|
app/code/community/Bitpay/Core/Model/Observer.php
CHANGED
@@ -6,61 +6,61 @@
|
|
6 |
|
7 |
class Bitpay_Core_Model_Observer
|
8 |
{
|
9 |
-
|
|
|
10 |
*/
|
11 |
public function checkForRequest($observer)
|
12 |
{
|
13 |
}
|
14 |
|
15 |
-
|
16 |
* Queries BitPay to update the order states in magento to make sure that
|
17 |
* open orders are closed/canceled if the BitPay invoice expires or becomes
|
18 |
* invalid.
|
19 |
*/
|
20 |
public function updateOrderStates()
|
21 |
{
|
22 |
-
Mage::
|
23 |
-
'cronjob: started'
|
24 |
-
);
|
25 |
-
|
26 |
-
$apiKey = Mage::getStoreConfig('payment/bitpay/api_key');
|
27 |
|
28 |
-
if (empty($apiKey)) {
|
29 |
-
Mage::helper('bitpay')->debugData(
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
return; // Api Key needs to be set
|
34 |
}
|
35 |
|
36 |
-
|
37 |
* Get all of the orders that are open and have not received an IPN for
|
38 |
* complete, expired, or invalid.
|
39 |
-
*
|
40 |
-
* If anyone knows of a better way to do this, please let me know
|
41 |
*/
|
42 |
-
$orders = Mage::getModel('bitpay/ipn')->getOpenOrders();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
* Get all orders that have been paid using bitpay and
|
46 |
* are not complete/closed/etc
|
47 |
*/
|
48 |
foreach ($orders as $order) {
|
49 |
-
|
50 |
* Query BitPay with the invoice ID to get the status. We must take
|
51 |
* care not to anger the API limiting gods and disable our access
|
52 |
* to the API.
|
53 |
*/
|
54 |
$status = null;
|
55 |
|
|
|
56 |
// Does the order need to be updated?
|
57 |
// Yes? Update Order Status
|
58 |
// No? continue
|
59 |
}
|
60 |
|
61 |
-
Mage::helper('bitpay')->debugData(
|
62 |
-
'cronjob: end'
|
63 |
-
);
|
64 |
}
|
65 |
|
66 |
/**
|
@@ -69,6 +69,7 @@ class Bitpay_Core_Model_Observer
|
|
69 |
*/
|
70 |
public function cleanExpired()
|
71 |
{
|
72 |
-
Mage::helper('bitpay')->cleanExpired();
|
|
|
73 |
}
|
74 |
}
|
6 |
|
7 |
class Bitpay_Core_Model_Observer
|
8 |
{
|
9 |
+
/*
|
10 |
+
* TODO: Why is this here?
|
11 |
*/
|
12 |
public function checkForRequest($observer)
|
13 |
{
|
14 |
}
|
15 |
|
16 |
+
/*
|
17 |
* Queries BitPay to update the order states in magento to make sure that
|
18 |
* open orders are closed/canceled if the BitPay invoice expires or becomes
|
19 |
* invalid.
|
20 |
*/
|
21 |
public function updateOrderStates()
|
22 |
{
|
23 |
+
$apiKey = \Mage::getStoreConfig('payment/bitpay/api_key');
|
|
|
|
|
|
|
|
|
24 |
|
25 |
+
if (false === isset($apiKey) || empty($apiKey)) {
|
26 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::updateOrderStates() could not start job to update the order states because the API key was not set.');
|
27 |
+
return;
|
28 |
+
} else {
|
29 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::updateOrderStates() started job to query BitPay to update the existing order states.');
|
|
|
30 |
}
|
31 |
|
32 |
+
/*
|
33 |
* Get all of the orders that are open and have not received an IPN for
|
34 |
* complete, expired, or invalid.
|
|
|
|
|
35 |
*/
|
36 |
+
$orders = \Mage::getModel('bitpay/ipn')->getOpenOrders();
|
37 |
+
|
38 |
+
if (false === isset($orders) || empty($orders)) {
|
39 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::updateOrderStates() could not retrieve the open orders.');
|
40 |
+
return;
|
41 |
+
} else {
|
42 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::updateOrderStates() successfully retrieved existing open orders.');
|
43 |
+
}
|
44 |
|
45 |
+
/*
|
46 |
* Get all orders that have been paid using bitpay and
|
47 |
* are not complete/closed/etc
|
48 |
*/
|
49 |
foreach ($orders as $order) {
|
50 |
+
/*
|
51 |
* Query BitPay with the invoice ID to get the status. We must take
|
52 |
* care not to anger the API limiting gods and disable our access
|
53 |
* to the API.
|
54 |
*/
|
55 |
$status = null;
|
56 |
|
57 |
+
// TODO:
|
58 |
// Does the order need to be updated?
|
59 |
// Yes? Update Order Status
|
60 |
// No? continue
|
61 |
}
|
62 |
|
63 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::updateOrderStates() order status update job finished.');
|
|
|
|
|
64 |
}
|
65 |
|
66 |
/**
|
69 |
*/
|
70 |
public function cleanExpired()
|
71 |
{
|
72 |
+
\Mage::helper('bitpay')->debugData('[INFO] Bitpay_Core_Model_Observer::cleanExpired() called.');
|
73 |
+
\Mage::helper('bitpay')->cleanExpired();
|
74 |
}
|
75 |
}
|
app/code/community/Bitpay/Core/Model/Status.php
CHANGED
@@ -19,12 +19,12 @@ class Bitpay_Core_Model_Status
|
|
19 |
public function toOptionArray()
|
20 |
{
|
21 |
return array(
|
22 |
-
array('value' => self::STATUS_NEW, 'label' => Mage::helper('bitpay')->__(
|
23 |
-
array('value' => self::STATUS_PAID, 'label' => Mage::helper('bitpay')->__(
|
24 |
-
array('value' => self::STATUS_CONFIRMED, 'label' => Mage::helper('bitpay')->__(
|
25 |
-
array('value' => self::STATUS_COMPLETE, 'label' => Mage::helper('bitpay')->__(
|
26 |
-
array('value' => self::STATUS_EXPIRED, 'label' => Mage::helper('bitpay')->__(
|
27 |
-
array('value' => self::STATUS_INVALID, 'label' => Mage::helper('bitpay')->__(
|
28 |
);
|
29 |
}
|
30 |
}
|
19 |
public function toOptionArray()
|
20 |
{
|
21 |
return array(
|
22 |
+
array('value' => self::STATUS_NEW, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_NEW))),
|
23 |
+
array('value' => self::STATUS_PAID, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_PAID))),
|
24 |
+
array('value' => self::STATUS_CONFIRMED, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_CONFIRMED))),
|
25 |
+
array('value' => self::STATUS_COMPLETE, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_COMPLETE))),
|
26 |
+
array('value' => self::STATUS_EXPIRED, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_EXPIRED))),
|
27 |
+
array('value' => self::STATUS_INVALID, 'label' => \Mage::helper('bitpay')->__(ucwords(self::STATUS_INVALID))),
|
28 |
);
|
29 |
}
|
30 |
}
|
app/code/community/Bitpay/Core/Model/TransactionSpeed.php
CHANGED
@@ -16,9 +16,9 @@ class Bitpay_Core_Model_TransactionSpeed
|
|
16 |
public function toOptionArray()
|
17 |
{
|
18 |
return array(
|
19 |
-
array('value' => self::SPEED_LOW, 'label' => Mage::helper('bitpay')->__(
|
20 |
-
array('value' => self::SPEED_MEDIUM, 'label' => Mage::helper('bitpay')->__(
|
21 |
-
array('value' => self::SPEED_HIGH, 'label' => Mage::helper('bitpay')->__(
|
22 |
);
|
23 |
}
|
24 |
}
|
16 |
public function toOptionArray()
|
17 |
{
|
18 |
return array(
|
19 |
+
array('value' => self::SPEED_LOW, 'label' => \Mage::helper('bitpay')->__(ucwords(self::SPEED_LOW))),
|
20 |
+
array('value' => self::SPEED_MEDIUM, 'label' => \Mage::helper('bitpay')->__(ucwords(self::SPEED_MEDIUM))),
|
21 |
+
array('value' => self::SPEED_HIGH, 'label' => \Mage::helper('bitpay')->__(ucwords(self::SPEED_HIGH))),
|
22 |
);
|
23 |
}
|
24 |
}
|
app/code/community/Bitpay/Core/README.md
DELETED
@@ -1,204 +0,0 @@
|
|
1 |
-
bitpay/magento-plugin
|
2 |
-
=====================
|
3 |
-
|
4 |
-
# Build Status
|
5 |
-
|
6 |
-
[![Build Status](https://travis-ci.org/bitpay/magento-plugin.svg?branch=master)](https://travis-ci.org/bitpay/magento-plugin)
|
7 |
-
|
8 |
-
# Brief Description
|
9 |
-
|
10 |
-
BitPay has the most powerful bitcoin infrastructure on the planet and is trusted by over 40,000 merchants.
|
11 |
-
|
12 |
-
# Detail Description
|
13 |
-
|
14 |
-
Bitcoin is a powerful new peer-to-peer platform for the next generation of
|
15 |
-
financial technology. The decentralized nature of the Bitcoin network allows
|
16 |
-
for a highly resilient value transfer infrastructure, and this allows merchants
|
17 |
-
to gain greater profits.
|
18 |
-
|
19 |
-
This is because there are little to no fees for transferring Bitcoins from one
|
20 |
-
person to another. Unlike other payment methods, Bitcoin payments cannot be
|
21 |
-
reversed, so once you are paid you can ship! No waiting days for a payment to
|
22 |
-
clear.
|
23 |
-
|
24 |
-
# Requirements
|
25 |
-
|
26 |
-
* [Magento](http://magento.com/resources/system-requirements) >= 1.9.0.1 (Older version will work, but we do not test against those)
|
27 |
-
* [GMP](http://us2.php.net/gmp) You may have to install this as most servers do not come with it.
|
28 |
-
* [mcrypt](http://us2.php.net/mcrypt) Magento requires this so you're fine
|
29 |
-
* [OpenSSL](http://us2.php.net/openssl) Must be compiled with PHP
|
30 |
-
* PHP >= 5.4
|
31 |
-
|
32 |
-
# Upgrade From Version 1.x to 2.x
|
33 |
-
|
34 |
-
Merchants who have previous been using the BitPay Magento plugin will need to remove
|
35 |
-
previous plugin. This can be done by using the [scripts/delete](https://github.com/bitpay/magento-plugin/blob/master/scripts/delete)
|
36 |
-
script before installing the new plugin.
|
37 |
-
|
38 |
-
# Installation
|
39 |
-
|
40 |
-
## Magento Connect Manager
|
41 |
-
|
42 |
-
Goto [http://www.magentocommerce.com/magento-connect/bitpay-payment-method.html](http://www.magentocommerce.com/magento-connect/bitpay-payment-method.html)
|
43 |
-
and click the *Install Now* link which will give you the *Extension Key* needed
|
44 |
-
for the next step.
|
45 |
-
|
46 |
-
Once you have the key, log into you Magento Store's Admin Panel and navigate to
|
47 |
-
**System > Magento Connect > Magento Connect Manager**.
|
48 |
-
|
49 |
-
***NOTE*** It may ask you to log in again using the same credentials that you use
|
50 |
-
to log into the Admin Panel.
|
51 |
-
|
52 |
-
All you need to do is paste the extension key and click on the *Install* button.
|
53 |
-
|
54 |
-
***WARNING*** It is good practice to backup your database before installing
|
55 |
-
extensions. Please make sure you Create Backups.
|
56 |
-
|
57 |
-
## Download
|
58 |
-
|
59 |
-
Visit the [Releases](https://github.com/bitpay/magento-plugin/releases) page of
|
60 |
-
this repository and download the latest version. Once this is done, you can just
|
61 |
-
unzip the contents and use any method you want to put them on your server. The
|
62 |
-
contents will mirror the Magento directory structure.
|
63 |
-
|
64 |
-
***NOTE*** These files can also up uploaded using the *Magento Connect Manager*
|
65 |
-
that comes with your Magento Store
|
66 |
-
|
67 |
-
***WARNING*** It is good practice to backup your database before installing
|
68 |
-
extensions. Please make sure you Create Backups.
|
69 |
-
|
70 |
-
## modman
|
71 |
-
|
72 |
-
Using [modman](https://github.com/colinmollenhour/modman) you can
|
73 |
-
install the BitPay Magento Plugin. Once
|
74 |
-
you have modman installed, run `modman init` if you have not already done so. Next
|
75 |
-
just run `modman clone https://github.com/bitpay/magento-plugin.git` in the root
|
76 |
-
of the Magento installation. In this case it is `/var/www/magento`.
|
77 |
-
|
78 |
-
## Development
|
79 |
-
|
80 |
-
For developers wanting to contribute to this project, it is assumed you have a
|
81 |
-
stable Magento environment to work with, and are familiar with developing for
|
82 |
-
Magento. You will need to clone this repository or fork and clone the repository
|
83 |
-
you created.
|
84 |
-
|
85 |
-
Once you have cloned the repository, you will need to run [composer install](https://getcomposer.org/doc/00-intro.md#using-composer).
|
86 |
-
Using and setting up composer is outside the scope, however you will find the
|
87 |
-
documentation on their site comprehensive.
|
88 |
-
|
89 |
-
Once you are done, you can then run the ``scripts/package`` script to create a
|
90 |
-
distribution files which you can find in ``build/dist``. This is the file that
|
91 |
-
you can upload to your server to unzip or do with what you will.
|
92 |
-
|
93 |
-
If you encounter any issues or implement any updates or changes, please open an
|
94 |
-
[issue](https://github.com/bitpay/magento-plugin/issues) or submit a Pull Request.
|
95 |
-
|
96 |
-
***NOTE*** The ``scripts/package`` file contains some configuration settings that
|
97 |
-
will need to change for different releases. If you are using this script to build
|
98 |
-
files that are for distribution, these will need to be updated.
|
99 |
-
|
100 |
-
# Configuration
|
101 |
-
|
102 |
-
Configuration can be done using the Administrator section of your Megento store.
|
103 |
-
Once Logged in, you will find the configuration settings under **System > Configuration > Sales > Payment Methods**.
|
104 |
-
|
105 |
-
![BitPay Magento Settings](https://raw.githubusercontent.com/bitpay/magento-plugin/master/docs/MagentoSettings.png "BitPay Megento Settings")
|
106 |
-
|
107 |
-
Here your will need to create a [pairing code](https://bitpay.com/api-tokens) using
|
108 |
-
your BitPay merchant account. Once you have a Pairing Code, put the code in the
|
109 |
-
Pairing Code field. This will take care of the rest for you.
|
110 |
-
|
111 |
-
***NOTE*** Pairing Codes are only valid for a short period of time. If it expires
|
112 |
-
before you get to use it, you can always create a new one an use the new one.
|
113 |
-
|
114 |
-
***NOTE*** You will only need to do this once since each time you do this, the
|
115 |
-
extension will generate public and private keys that are used to identify you
|
116 |
-
when using the API.
|
117 |
-
|
118 |
-
You are also able to configure how BitPay's IPN (Instant Payment Notifications)
|
119 |
-
changes the order in your Magento store.
|
120 |
-
|
121 |
-
![BitPay Invoice Settings](https://raw.githubusercontent.com/bitpay/magento-plugin/master/docs/MagentoInvoiceSettings.png "BitPay Invoice Settings")
|
122 |
-
|
123 |
-
# Usage
|
124 |
-
|
125 |
-
Once enabled, your customers will be given the option to pay with Bitcoins. Once
|
126 |
-
they checkout they are redirected to a full screen BitPay invoice to pay for
|
127 |
-
the order.
|
128 |
-
|
129 |
-
As a merchant, the orders in your Magento store can be treated as any other
|
130 |
-
order. You may need to adjust the Invoice Settings depending on your order
|
131 |
-
fulfillment.
|
132 |
-
|
133 |
-
# Support
|
134 |
-
|
135 |
-
## BitPay Support
|
136 |
-
|
137 |
-
* [GitHub Issues](https://github.com/bitpay/magento-plugin/issues)
|
138 |
-
* Open an issue if you are having issues with this plugin.
|
139 |
-
* [Support](https://support.bitpay.com)
|
140 |
-
* BitPay merchant support documentation
|
141 |
-
|
142 |
-
## Magento Support
|
143 |
-
|
144 |
-
* [Homepage](http://magento.com)
|
145 |
-
* [Documentation](http://docs.magentocommerce.com)
|
146 |
-
* [Support Forums](https://www.magentocommerce.com/support/ce/)
|
147 |
-
|
148 |
-
# Troubleshooting
|
149 |
-
|
150 |
-
1. Ensure a valid SSL certificate is installed on your server. Also ensure your
|
151 |
-
root CA cert is updated. If your CA cert is not current, you will see curl
|
152 |
-
SSL verification errors.
|
153 |
-
2. Verify that your web server is not blocking POSTs from servers it may not
|
154 |
-
recognize. Double check this on your firewall as well, if one is being used.
|
155 |
-
3. Check the `payment_bitpay.log` file for any errors during BitPay payment attempts.
|
156 |
-
If you contact BitPay support, they will ask to see the log file to help
|
157 |
-
diagnose the problem. The log file will be found inside your Magento's
|
158 |
-
`var/log/` directory. ***NOTE*** You will need to enable the debugging
|
159 |
-
setting for the extension to output information into the log file.
|
160 |
-
4. Check the version of this plugin against the official plugin repository to
|
161 |
-
ensure you are using the latest version. Your issue might have been
|
162 |
-
addressed in a newer version! See the [Releases](https://github.com/bitpay/magento-plugin/releases)
|
163 |
-
page for the latest.
|
164 |
-
5. If all else fails, send an email describing your issue **in detail** to
|
165 |
-
support@bitpay.com
|
166 |
-
|
167 |
-
***TIP***: When contacting support it will help us is you provide:
|
168 |
-
|
169 |
-
* Magento Version (Found at the bottom page in the Administration section)
|
170 |
-
* Other extensions you have installed
|
171 |
-
* Some extensions do not play nice
|
172 |
-
* Configuration settings for the extension (Most merchants take screen grabs)
|
173 |
-
* Any log files that will help
|
174 |
-
* web server error logs
|
175 |
-
* enabled debugging for this extension and send us `var/log/payment_bitpay.log`
|
176 |
-
* Screen grabs of error message if applicable.
|
177 |
-
|
178 |
-
# Contribute
|
179 |
-
|
180 |
-
To contribute to this project, please fork and submit a pull request.
|
181 |
-
|
182 |
-
# License
|
183 |
-
|
184 |
-
The MIT License (MIT)
|
185 |
-
|
186 |
-
Copyright (c) 2011-2014 BitPay, Inc.
|
187 |
-
|
188 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
189 |
-
of this software and associated documentation files (the "Software"), to deal
|
190 |
-
in the Software without restriction, including without limitation the rights
|
191 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
192 |
-
copies of the Software, and to permit persons to whom the Software is
|
193 |
-
furnished to do so, subject to the following conditions:
|
194 |
-
|
195 |
-
The above copyright notice and this permission notice shall be included in
|
196 |
-
all copies or substantial portions of the Software.
|
197 |
-
|
198 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
199 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
200 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
201 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
202 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
203 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
204 |
-
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Bitpay/Core/controllers/IndexController.php
CHANGED
@@ -14,19 +14,21 @@ class Bitpay_Core_IndexController extends Mage_Core_Controller_Front_Action
|
|
14 |
*/
|
15 |
public function indexAction()
|
16 |
{
|
17 |
-
$params = $this->getRequest()->getParams();
|
18 |
$paid = false;
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
);
|
|
|
|
|
24 |
}
|
25 |
|
26 |
$this->loadLayout();
|
|
|
27 |
$this->getResponse()->setHeader('Content-type', 'application/json');
|
28 |
-
|
29 |
-
|
30 |
-
);
|
31 |
}
|
32 |
}
|
14 |
*/
|
15 |
public function indexAction()
|
16 |
{
|
|
|
17 |
$paid = false;
|
18 |
+
$params = $this->getRequest()->getParams();
|
19 |
+
|
20 |
+
if (true === isset($params['paid'])) {
|
21 |
+
\Mage::helper('bitpay')->registerAutoloader();
|
22 |
+
\Mage::helper('bitpay')->debugData($params);
|
23 |
+
} else {
|
24 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IndexController::indexAction(), Could not get parameters from HTTP request.');
|
25 |
}
|
26 |
|
27 |
$this->loadLayout();
|
28 |
+
|
29 |
$this->getResponse()->setHeader('Content-type', 'application/json');
|
30 |
+
|
31 |
+
// ?
|
32 |
+
$this->getResponse()->setBody(json_encode(array('paid' => $paid)));
|
33 |
}
|
34 |
}
|
app/code/community/Bitpay/Core/controllers/IpnController.php
CHANGED
@@ -4,8 +4,6 @@
|
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
|
7 |
-
|
8 |
-
|
9 |
/**
|
10 |
* @route /bitpay/ipn
|
11 |
*/
|
@@ -19,33 +17,41 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
|
|
19 |
*/
|
20 |
public function indexAction()
|
21 |
{
|
22 |
-
if (
|
23 |
ini_set('allow_url_fopen', true);
|
24 |
}
|
25 |
|
26 |
$raw_post_data = file_get_contents('php://input');
|
27 |
|
28 |
-
if (
|
29 |
-
|
|
|
30 |
}
|
31 |
|
32 |
-
Mage::helper('bitpay')->registerAutoloader();
|
33 |
-
|
34 |
-
|
35 |
-
sprintf('Incoming IPN from bitpay'),
|
36 |
-
getallheaders(),
|
37 |
-
$raw_post_data,
|
38 |
-
)
|
39 |
-
);
|
40 |
|
41 |
// Magento doesn't seem to have a way to get the Request body
|
42 |
-
$ipn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
$ipn->posData = is_string($ipn->posData) ? json_decode($ipn->posData) : $ipn->posData;
|
44 |
$ipn->buyerFields = isset($ipn->buyerFields) ? $ipn->buyerFields : new stdClass();
|
45 |
-
|
|
|
46 |
|
47 |
// Log IPN
|
48 |
-
$mageIpn = Mage::getModel('bitpay/ipn')->addData(
|
49 |
array(
|
50 |
'invoice_id' => isset($ipn->id) ? $ipn->id : '',
|
51 |
'url' => isset($ipn->url) ? $ipn->url : '',
|
@@ -63,18 +69,11 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
|
|
63 |
)
|
64 |
)->save();
|
65 |
|
66 |
-
|
67 |
-
Mage::helper('bitpay')->debugData(
|
68 |
-
sprintf('Did not receive order id in IPN. See IPN "%s" in database.', $mageIpn->getId())
|
69 |
-
);
|
70 |
-
throw new Exception('Invalid Bitpay IPN received.');
|
71 |
-
}
|
72 |
|
73 |
-
$order
|
74 |
-
|
75 |
-
|
76 |
-
Mage::helper('bitpay')->debugData('Invalid Bitpay IPN received.');
|
77 |
-
Mage::throwException('Invalid Bitpay IPN received.');
|
78 |
}
|
79 |
|
80 |
/**
|
@@ -82,32 +81,58 @@ class Bitpay_Core_IpnController extends Mage_Core_Controller_Front_Action
|
|
82 |
* match up and no one is using an automated tool to post IPN's to merchants
|
83 |
* store.
|
84 |
*/
|
85 |
-
$invoice = Mage::getModel('bitpay/method_bitcoin')->fetchInvoice($ipn->id);
|
|
|
|
|
|
|
|
|
|
|
86 |
|
87 |
// Does the status match?
|
88 |
-
if ($invoice
|
89 |
-
Mage::getModel('bitpay/method_bitcoin')->debugData('IPN status and status from BitPay are different');
|
90 |
-
Mage::throwException('There was an error processing the
|
91 |
}
|
92 |
|
93 |
// Does the price match?
|
94 |
-
if ($invoice
|
95 |
-
Mage::getModel('bitpay/method_bitcoin')>debugData('
|
96 |
-
Mage::throwException('There was an error processing the
|
97 |
}
|
98 |
|
99 |
// Update the order to notifiy that it has been paid
|
100 |
-
if (in_array($invoice->getStatus(), array('paid', 'confirmed', 'complete'))) {
|
101 |
-
$payment = Mage::getModel('sales/order_payment')->setOrder($order);
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
}
|
105 |
|
106 |
// use state as defined by Merchant
|
107 |
-
$state = Mage::getStoreConfig(sprintf('payment/bitpay/invoice_%s', $invoice->getStatus()));
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
$order->addStatusToHistory(
|
109 |
$state,
|
110 |
-
sprintf('Incoming IPN status "%s" updated order state to "%s"', $invoice->getStatus(), $state)
|
111 |
)->save();
|
112 |
}
|
113 |
}
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
|
|
|
|
|
7 |
/**
|
8 |
* @route /bitpay/ipn
|
9 |
*/
|
17 |
*/
|
18 |
public function indexAction()
|
19 |
{
|
20 |
+
if (false === ini_get('allow_url_fopen')) {
|
21 |
ini_set('allow_url_fopen', true);
|
22 |
}
|
23 |
|
24 |
$raw_post_data = file_get_contents('php://input');
|
25 |
|
26 |
+
if (false === $raw_post_data) {
|
27 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Could not read from the php://input stream or invalid Bitpay IPN received.');
|
28 |
+
throw new \Exception('Could not read from the php://input stream or invalid Bitpay IPN received.');
|
29 |
}
|
30 |
|
31 |
+
\Mage::helper('bitpay')->registerAutoloader();
|
32 |
+
|
33 |
+
\Mage::helper('bitpay')->debugData(array(sprintf('[INFO] In Bitpay_Core_IpnController::indexAction(), Incoming IPN message from BitPay: '),$raw_post_data,));
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
// Magento doesn't seem to have a way to get the Request body
|
36 |
+
$ipn = json_decode($raw_post_data);
|
37 |
+
|
38 |
+
if (true === empty($ipn)) {
|
39 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Could not decode the JSON payload from BitPay.');
|
40 |
+
throw new \Exception('Could not decode the JSON payload from BitPay.');
|
41 |
+
}
|
42 |
+
|
43 |
+
if (true === empty($ipn->id) || false === isset($ipn->posData)) {
|
44 |
+
\Mage::helper('bitpay')->debugData(sprintf('[ERROR] In Bitpay_Core_IpnController::indexAction(), Did not receive order ID in IPN: ', $ipn));
|
45 |
+
throw new \Exception('Invalid Bitpay payment notification message received - did not receive order ID.');
|
46 |
+
}
|
47 |
+
|
48 |
$ipn->posData = is_string($ipn->posData) ? json_decode($ipn->posData) : $ipn->posData;
|
49 |
$ipn->buyerFields = isset($ipn->buyerFields) ? $ipn->buyerFields : new stdClass();
|
50 |
+
|
51 |
+
\Mage::helper('bitpay')->debugData($ipn);
|
52 |
|
53 |
// Log IPN
|
54 |
+
$mageIpn = \Mage::getModel('bitpay/ipn')->addData(
|
55 |
array(
|
56 |
'invoice_id' => isset($ipn->id) ? $ipn->id : '',
|
57 |
'url' => isset($ipn->url) ? $ipn->url : '',
|
69 |
)
|
70 |
)->save();
|
71 |
|
72 |
+
$order = \Mage::getModel('sales/order')->loadByIncrementId($ipn->posData->id);
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
+
if (false === isset($order) || true === empty($order->getId())) {
|
75 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Invalid Bitpay IPN received.');
|
76 |
+
\Mage::throwException('Invalid Bitpay IPN received.');
|
|
|
|
|
77 |
}
|
78 |
|
79 |
/**
|
81 |
* match up and no one is using an automated tool to post IPN's to merchants
|
82 |
* store.
|
83 |
*/
|
84 |
+
$invoice = \Mage::getModel('bitpay/method_bitcoin')->fetchInvoice($ipn->id);
|
85 |
+
|
86 |
+
if (false === isset($invoice) || true === empty($invoice)) {
|
87 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Could not retrieve the invoice details for the ipn ID of ' . $ipn->id);
|
88 |
+
\Mage::throwException('Could not retrieve the invoice details for the ipn ID of ' . $ipn->id);
|
89 |
+
}
|
90 |
|
91 |
// Does the status match?
|
92 |
+
if ($invoice->getStatus() != $ipn->status) {
|
93 |
+
\Mage::getModel('bitpay/method_bitcoin')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), IPN status and status from BitPay are different. Rejecting this IPN!');
|
94 |
+
\Mage::throwException('There was an error processing the IPN - statuses are different. Rejecting this IPN!');
|
95 |
}
|
96 |
|
97 |
// Does the price match?
|
98 |
+
if ($invoice->getPrice() != $ipn->price) {
|
99 |
+
\Mage::getModel('bitpay/method_bitcoin')>debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), IPN price and invoice price are different. Rejecting this IPN!');
|
100 |
+
\Mage::throwException('There was an error processing the IPN - invoice price does not match the IPN price. Rejecting this IPN!');
|
101 |
}
|
102 |
|
103 |
// Update the order to notifiy that it has been paid
|
104 |
+
if (true === in_array($invoice->getStatus(), array('paid', 'confirmed', 'complete'))) {
|
105 |
+
$payment = \Mage::getModel('sales/order_payment')->setOrder($order);
|
106 |
+
|
107 |
+
if (true === isset($payment) && false === empty($payment)) {
|
108 |
+
$payment->registerCaptureNotification($invoice->getPrice());
|
109 |
+
$order->addPayment($payment);
|
110 |
+
|
111 |
+
// If the customer has not already been notified by email
|
112 |
+
// send the notification now that there's a new order.
|
113 |
+
if (!$order->getEmailSent()) {
|
114 |
+
\Mage::helper('bitpay')->debugData('[INFO] In Bitpay_Core_IpnController::indexAction(), Order email not sent so I am calling $order->sendNewOrderEmail() now...');
|
115 |
+
$order->sendNewOrderEmail();
|
116 |
+
}
|
117 |
+
|
118 |
+
$order->save();
|
119 |
+
} else {
|
120 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Could not create a payment object in the Bitpay IPN controller.');
|
121 |
+
\Mage::throwException('Could not create a payment object in the Bitpay IPN controller.');
|
122 |
+
}
|
123 |
}
|
124 |
|
125 |
// use state as defined by Merchant
|
126 |
+
$state = \Mage::getStoreConfig(sprintf('payment/bitpay/invoice_%s', $invoice->getStatus()));
|
127 |
+
|
128 |
+
if (false === isset($state) || true === empty($state)) {
|
129 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_IpnController::indexAction(), Could not retrieve the defined state parameter to update this order to in the Bitpay IPN controller.');
|
130 |
+
\Mage::throwException('Could not retrieve the defined state parameter to update this order to in the Bitpay IPN controller.');
|
131 |
+
}
|
132 |
+
|
133 |
$order->addStatusToHistory(
|
134 |
$state,
|
135 |
+
sprintf('[INFO] In Bitpay_Core_IpnController::indexAction(), Incoming IPN status "%s" updated order state to "%s"', $invoice->getStatus(), $state)
|
136 |
)->save();
|
137 |
}
|
138 |
}
|
app/code/community/Bitpay/Core/etc/system.xml
CHANGED
@@ -28,9 +28,8 @@
|
|
28 |
<pairing_code translate="label">
|
29 |
<label>Pairing Code</label>
|
30 |
<comment>
|
31 |
-
<![CDATA[
|
32 |
-
|
33 |
-
on your store.]]>
|
34 |
</comment>
|
35 |
<frontend_type>text</frontend_type>
|
36 |
<backend_model>bitpay/config_pairingCode</backend_model>
|
@@ -51,8 +50,7 @@
|
|
51 |
<title translate="label">
|
52 |
<label>Title</label>
|
53 |
<comment>
|
54 |
-
|
55 |
-
experience.
|
56 |
</comment>
|
57 |
<frontend_type>text</frontend_type>
|
58 |
<sort_order>20</sort_order>
|
@@ -63,7 +61,7 @@
|
|
63 |
<network translate="label">
|
64 |
<label>Network</label>
|
65 |
<comment>
|
66 |
-
<![CDATA[You can sign up for a test account at <a href="https://test.bitpay.com">test.bitpay.com</a>.]]>
|
67 |
</comment>
|
68 |
<frontend_type>select</frontend_type>
|
69 |
<source_model>bitpay/network</source_model>
|
@@ -74,7 +72,9 @@
|
|
74 |
</network>
|
75 |
<debug translate="label">
|
76 |
<label>Debug</label>
|
77 |
-
<comment>
|
|
|
|
|
78 |
<frontend_type>select</frontend_type>
|
79 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
80 |
<sort_order>40</sort_order>
|
@@ -106,7 +106,9 @@
|
|
106 |
<show_in_default>1</show_in_default>
|
107 |
<show_in_website>1</show_in_website>
|
108 |
<show_in_store>1</show_in_store>
|
109 |
-
<comment
|
|
|
|
|
110 |
</speed>
|
111 |
<mage_settings_heading>
|
112 |
<label>Magento Specific Settings</label>
|
@@ -170,8 +172,7 @@
|
|
170 |
<invoice_paid translate="label">
|
171 |
<label>Paid</label>
|
172 |
<comment>
|
173 |
-
An invoice is considered "paid" when the
|
174 |
-
network sees a transaction.
|
175 |
</comment>
|
176 |
<frontend_type>select</frontend_type>
|
177 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
@@ -183,8 +184,7 @@
|
|
183 |
<invoice_confirmed translate="label">
|
184 |
<label>Confirmed</label>
|
185 |
<comment>
|
186 |
-
A confirmed invoice means that the Bitcoin network
|
187 |
-
has approved the transaction.
|
188 |
</comment>
|
189 |
<frontend_type>select</frontend_type>
|
190 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
@@ -196,8 +196,7 @@
|
|
196 |
<invoice_complete translate="label">
|
197 |
<label>Complete</label>
|
198 |
<comment>
|
199 |
-
|
200 |
-
for the payment in your BitPay merchant account.
|
201 |
</comment>
|
202 |
<frontend_type>select</frontend_type>
|
203 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
@@ -210,7 +209,7 @@
|
|
210 |
<label>Requirements</label>
|
211 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
212 |
<comment>
|
213 |
-
<![CDATA[
|
214 |
</comment>
|
215 |
<sort_order>500</sort_order>
|
216 |
<show_in_default>1</show_in_default>
|
28 |
<pairing_code translate="label">
|
29 |
<label>Pairing Code</label>
|
30 |
<comment>
|
31 |
+
<![CDATA[You must first create a pairing code for your BitPay Merchant account at <a href="https://bitpay.com/api-tokens" target="_blank">https://bitpay.com/api-tokens</a> and copy/paste
|
32 |
+
that code here. Once you have successfully paired this Magento store with your BitPay Merchant account, you can begin accepting Bitcoins as payment.]]>
|
|
|
33 |
</comment>
|
34 |
<frontend_type>text</frontend_type>
|
35 |
<backend_model>bitpay/config_pairingCode</backend_model>
|
50 |
<title translate="label">
|
51 |
<label>Title</label>
|
52 |
<comment>
|
53 |
+
<![CDATA[This is the payment method name your customers will see during checkout.]]>
|
|
|
54 |
</comment>
|
55 |
<frontend_type>text</frontend_type>
|
56 |
<sort_order>20</sort_order>
|
61 |
<network translate="label">
|
62 |
<label>Network</label>
|
63 |
<comment>
|
64 |
+
<![CDATA[You can sign up for a test account at <a href="https://test.bitpay.com" target="_blank">test.bitpay.com</a>.]]>
|
65 |
</comment>
|
66 |
<frontend_type>select</frontend_type>
|
67 |
<source_model>bitpay/network</source_model>
|
72 |
</network>
|
73 |
<debug translate="label">
|
74 |
<label>Debug</label>
|
75 |
+
<comment>
|
76 |
+
<![CDATA[By enabling this, it will output more verbose information in log files.]]>
|
77 |
+
</comment>
|
78 |
<frontend_type>select</frontend_type>
|
79 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
80 |
<sort_order>40</sort_order>
|
106 |
<show_in_default>1</show_in_default>
|
107 |
<show_in_website>1</show_in_website>
|
108 |
<show_in_store>1</show_in_store>
|
109 |
+
<comment>
|
110 |
+
<![CDATA[Determines when a BitPay payment confirmation is sent.<br /><strong>High:</strong> an invoice is confirmed immediately when payment received.<br /><strong>Medium:</strong> an invoice is confirmed after 1 block confirmation by the Bitcoin network (~10 mins).<br /><strong>Low:</strong> an invoice is confirmed after 6 block confirmations by the Bitcoin network (~1 hour).<br />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.]]>
|
111 |
+
</comment>
|
112 |
</speed>
|
113 |
<mage_settings_heading>
|
114 |
<label>Magento Specific Settings</label>
|
172 |
<invoice_paid translate="label">
|
173 |
<label>Paid</label>
|
174 |
<comment>
|
175 |
+
<![CDATA[An invoice is considered "paid" when the Bitcoin network sees a transaction.]]>
|
|
|
176 |
</comment>
|
177 |
<frontend_type>select</frontend_type>
|
178 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
184 |
<invoice_confirmed translate="label">
|
185 |
<label>Confirmed</label>
|
186 |
<comment>
|
187 |
+
<![CDATA[A confirmed invoice means that the Bitcoin network has approved the transaction.]]>
|
|
|
188 |
</comment>
|
189 |
<frontend_type>select</frontend_type>
|
190 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
196 |
<invoice_complete translate="label">
|
197 |
<label>Complete</label>
|
198 |
<comment>
|
199 |
+
<![CDATA[A completed BitPay invoice indicates the payment for the invoice has been fully confirmed by the Bitcoin network and the funds have been deposited into your BitPay Merchant account.]]>
|
|
|
200 |
</comment>
|
201 |
<frontend_type>select</frontend_type>
|
202 |
<source_model>adminhtml/system_config_source_order_status</source_model>
|
209 |
<label>Requirements</label>
|
210 |
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
211 |
<comment>
|
212 |
+
<![CDATA[This extension will not function if you do not meet the system requirements.]]>
|
213 |
</comment>
|
214 |
<sort_order>500</sort_order>
|
215 |
<show_in_default>1</show_in_default>
|
app/design/adminhtml/default/default/template/bitpay/info/default.phtml
CHANGED
@@ -3,16 +3,15 @@
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
-
|
7 |
-
<?php
|
8 |
/**
|
9 |
* @see Bitpay_Core_Block_Info
|
10 |
*/
|
11 |
-
?>
|
12 |
-
<h3>Ordered with BitPay</h3>
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
</p>
|
18 |
-
|
|
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
+
|
|
|
7 |
/**
|
8 |
* @see Bitpay_Core_Block_Info
|
9 |
*/
|
|
|
|
|
10 |
|
11 |
+
echo '<h3>Ordered with BitPay</h3>';
|
12 |
+
|
13 |
+
if ($url = $this->getBitpayInvoiceUrl()) {
|
14 |
+
echo '<p><a href="' . $url . '" target="_blank">View Invoice</a></p>';
|
15 |
+
}
|
16 |
+
|
17 |
+
?>
|
app/design/adminhtml/default/default/template/bitpay/system/config/field/header.phtml
CHANGED
@@ -3,15 +3,16 @@
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
-
|
7 |
-
<?php
|
8 |
/**
|
9 |
* @see Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Header
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
?>
|
12 |
-
<div style="background-color:#002855;padding:5px;color:#ffffff">
|
13 |
-
<img src="https://raw.githubusercontent.com/bitpay/bitpay-brand/master/bitpay-logo-primary.png" alt="BitPay" witdth="113" height="44" />
|
14 |
-
<a style="color:#ffffff;font-family:'Ubuntu',sans-serif;text-decoration:none;margin:15px" href="https://support.bitpay.com/?ref=magento" target="_new">Support</a>
|
15 |
-
<a style="color:#ffffff;font-family:'Ubuntu',sans-serif;text-decoration:none;margin:15px" href="https://bitpay.com/start?ref=magento" target="_new">Sign Up</a>
|
16 |
-
<a style="color:#ffffff;font-family:'Ubuntu',sans-serif;text-decoration:none;margin:15px" href="https://bitpay.com/merchant-login?ref=magento" target="_new">Login</a>
|
17 |
-
</div>
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
+
|
|
|
7 |
/**
|
8 |
* @see Bitpay_Core_Block_Adminhtml_System_Config_Form_Field_Header
|
9 |
*/
|
10 |
+
|
11 |
+
echo '<div style="background-color:#002855;padding:5px;color:#ffffff">' .
|
12 |
+
'<img src="https://raw.githubusercontent.com/bitpay/bitpay-brand/master/bitpay-logo-primary.png" alt="BitPay" witdth="113" height="44" />' .
|
13 |
+
'<a style="color:#ffffff;font-family:\'Ubuntu\',sans-serif;text-decoration:none;margin:15px" href="https://support.bitpay.com/?ref=magento" target="_blank">Support</a>' .
|
14 |
+
'<a style="color:#ffffff;font-family:\'Ubuntu\',sans-serif;text-decoration:none;margin:15px" href="https://bitpay.com/start?ref=magento" target="_blank">Sign Up</a>' .
|
15 |
+
'<a style="color:#ffffff;font-family:\'Ubuntu\',sans-serif;text-decoration:none;margin:15px" href="https://bitpay.com/merchant-login?ref=magento" target="_blank">Login</a>' .
|
16 |
+
'</div>';
|
17 |
+
|
18 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/bitpay/form/bitpay.phtml
CHANGED
@@ -3,17 +3,14 @@
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
-
|
7 |
-
<?php
|
8 |
/**
|
9 |
* @see Bitpay_Core_Block_Form_Bitpay
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
?>
|
12 |
-
<?php $_code = $this->getMethodCode() ?>
|
13 |
-
<ul class="form-list" id="payment_form_<?php echo $_code ?>" style="display:none;">
|
14 |
-
<li>
|
15 |
-
When paying with this payment method, once you click on the `Place Order` button
|
16 |
-
you will be transfered to <a href="https://bitpay.com" target="_new">BitPay</a>
|
17 |
-
to complete your purchase.
|
18 |
-
</li>
|
19 |
-
</ul>
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
+
|
|
|
7 |
/**
|
8 |
* @see Bitpay_Core_Block_Form_Bitpay
|
9 |
*/
|
10 |
+
|
11 |
+
$_code = $this->getMethodCode();
|
12 |
+
|
13 |
+
echo '<ul class="form-list" id="payment_form_' . $_code . '" style="display:none;">' .
|
14 |
+
'<li>You will be transfered to <a href="https://bitpay.com" target="_blank">BitPay</a> to complete your purchase when using this payment method.</li>' .
|
15 |
+
'</ul>';
|
16 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/base/default/template/bitpay/iframe.phtml
CHANGED
@@ -32,7 +32,7 @@ if ($request->getScheme() == 'https') {
|
|
32 |
//<![CDATA[
|
33 |
new PeriodicalExecuter(function() {
|
34 |
new Ajax.Request(
|
35 |
-
"<?php echo $url
|
36 |
{
|
37 |
asynchronous: true,
|
38 |
evalScripts: true,
|
32 |
//<![CDATA[
|
33 |
new PeriodicalExecuter(function() {
|
34 |
new Ajax.Request(
|
35 |
+
"<?php echo $url . '?quote=' . $quoteId; ?>",
|
36 |
{
|
37 |
asynchronous: true,
|
38 |
evalScripts: true,
|
app/design/frontend/base/default/template/bitpay/info/default.phtml
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
6 |
-
?>
|
7 |
-
<p><strong><?php echo $this->escapeHtml($this->getMethod()->getTitle()) ?></strong></p>
|
8 |
|
9 |
-
|
|
|
|
|
|
3 |
* @license Copyright 2011-2014 BitPay Inc., MIT License
|
4 |
* @see https://github.com/bitpay/magento-plugin/blob/master/LICENSE
|
5 |
*/
|
|
|
|
|
6 |
|
7 |
+
echo '<p><strong>' . $this->escapeHtml($this->getMethod()->getTitle()) . '</strong></p>';
|
8 |
+
|
9 |
+
echo $this->getChildHtml();
|
10 |
+
?>
|
app/etc/modules/Bitpay_Core.xml
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
*/
|
7 |
-->
|
8 |
<config>
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
</config>
|
6 |
*/
|
7 |
-->
|
8 |
<config>
|
9 |
+
<modules>
|
10 |
+
<Bitpay_Core>
|
11 |
+
<active>true</active>
|
12 |
+
<codePool>community</codePool>
|
13 |
+
<depends>
|
14 |
+
<Mage_Payment />
|
15 |
+
</depends>
|
16 |
+
</Bitpay_Core>
|
17 |
+
</modules>
|
18 |
</config>
|
lib/Bitpay/Client/Adapter/CurlAdapter.php
CHANGED
@@ -74,7 +74,7 @@ class CurlAdapter implements AdapterInterface
|
|
74 |
if (false === $raw) {
|
75 |
$errorMessage = curl_error($curl);
|
76 |
curl_close($curl);
|
77 |
-
throw new \
|
78 |
}
|
79 |
|
80 |
/** @var ResponseInterface */
|
74 |
if (false === $raw) {
|
75 |
$errorMessage = curl_error($curl);
|
76 |
curl_close($curl);
|
77 |
+
throw new \Bitpay\Client\ConnectionException($errorMessage);
|
78 |
}
|
79 |
|
80 |
/** @var ResponseInterface */
|
lib/Bitpay/Client/ArgumentException.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Bitpay\Client;
|
4 |
+
|
5 |
+
class ArgumentException extends \Exception
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
lib/Bitpay/Client/BitpayException.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Bitpay\Client;
|
4 |
+
|
5 |
+
class BitpayException extends \Exception
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
lib/Bitpay/Client/Client.php
CHANGED
@@ -469,6 +469,12 @@ class Client implements ClientInterface
|
|
469 |
*/
|
470 |
public function createToken(array $payload = array())
|
471 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
$this->request = $this->createNewRequest();
|
473 |
$this->request->setMethod(Request::METHOD_POST);
|
474 |
$this->request->setPath('tokens');
|
@@ -478,7 +484,7 @@ class Client implements ClientInterface
|
|
478 |
$body = json_decode($this->response->getBody(), true);
|
479 |
|
480 |
if (isset($body['error'])) {
|
481 |
-
throw new \
|
482 |
}
|
483 |
|
484 |
$tkn = $body['data'][0];
|
@@ -590,9 +596,11 @@ class Client implements ClientInterface
|
|
590 |
throw new \Exception('Please set your Private Key');
|
591 |
}
|
592 |
|
593 |
-
if (
|
594 |
if ($this->network->isPortRequiredInUrl === true) {
|
595 |
$url = $request->getUriWithPort();
|
|
|
|
|
596 |
}
|
597 |
} else {
|
598 |
$url = $request->getUri();
|
469 |
*/
|
470 |
public function createToken(array $payload = array())
|
471 |
{
|
472 |
+
if ($payload !== array()) {
|
473 |
+
if (1 !== preg_match('/^[a-zA-Z0-9]{7}$/', $payload['pairingCode'])) {
|
474 |
+
throw new ArgumentException("pairing code is not legal");
|
475 |
+
}
|
476 |
+
}
|
477 |
+
|
478 |
$this->request = $this->createNewRequest();
|
479 |
$this->request->setMethod(Request::METHOD_POST);
|
480 |
$this->request->setPath('tokens');
|
484 |
$body = json_decode($this->response->getBody(), true);
|
485 |
|
486 |
if (isset($body['error'])) {
|
487 |
+
throw new \Bitpay\Client\BitpayException($this->response->getStatusCode().": ".$body['error']);
|
488 |
}
|
489 |
|
490 |
$tkn = $body['data'][0];
|
596 |
throw new \Exception('Please set your Private Key');
|
597 |
}
|
598 |
|
599 |
+
if (true == property_exists($this->network, 'isPortRequiredInUrl')) {
|
600 |
if ($this->network->isPortRequiredInUrl === true) {
|
601 |
$url = $request->getUriWithPort();
|
602 |
+
} else {
|
603 |
+
$url = $request->getUri();
|
604 |
}
|
605 |
} else {
|
606 |
$url = $request->getUri();
|
lib/Bitpay/Client/ConnectionException.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Bitpay\Client;
|
4 |
+
|
5 |
+
class ConnectionException extends \Exception
|
6 |
+
{
|
7 |
+
|
8 |
+
}
|
lib/Bitpay/Currency.php
CHANGED
@@ -6,6 +6,8 @@
|
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
|
|
|
|
9 |
/**
|
10 |
* For the most part this should conform to ISO 4217
|
11 |
*
|
@@ -114,7 +116,7 @@ class Currency implements CurrencyInterface
|
|
114 |
public function setCode($code)
|
115 |
{
|
116 |
if (null !== $code && !in_array(strtoupper($code), self::$availableCurrencies)) {
|
117 |
-
throw new \
|
118 |
sprintf('The currency code "%s" is not supported.', $code)
|
119 |
);
|
120 |
}
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
9 |
+
use Bitpay\Client;
|
10 |
+
|
11 |
/**
|
12 |
* For the most part this should conform to ISO 4217
|
13 |
*
|
116 |
public function setCode($code)
|
117 |
{
|
118 |
if (null !== $code && !in_array(strtoupper($code), self::$availableCurrencies)) {
|
119 |
+
throw new \Bitpay\Client\ArgumentException(
|
120 |
sprintf('The currency code "%s" is not supported.', $code)
|
121 |
);
|
122 |
}
|
lib/Bitpay/Item.php
CHANGED
@@ -6,6 +6,8 @@
|
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
|
|
|
|
9 |
/**
|
10 |
*
|
11 |
* @package Bitpay
|
@@ -99,6 +101,9 @@ class Item implements ItemInterface
|
|
99 |
*/
|
100 |
public function setPrice($price)
|
101 |
{
|
|
|
|
|
|
|
102 |
$this->price = $price;
|
103 |
|
104 |
return $this;
|
6 |
|
7 |
namespace Bitpay;
|
8 |
|
9 |
+
use Bitpay\Client;
|
10 |
+
|
11 |
/**
|
12 |
*
|
13 |
* @package Bitpay
|
101 |
*/
|
102 |
public function setPrice($price)
|
103 |
{
|
104 |
+
if (1 !== preg_match('/^[0-9]+(?:\.[0-9]{1,2})?$/', $price)) {
|
105 |
+
throw new \Bitpay\Client\ArgumentException("Price must be formatted as a float");
|
106 |
+
}
|
107 |
$this->price = $price;
|
108 |
|
109 |
return $this;
|
lib/Bitpay/Math/BcEngine.php
CHANGED
@@ -100,6 +100,10 @@ class BcEngine implements EngineInterface
|
|
100 |
$a = $this->input($a);
|
101 |
$b = $this->input($b);
|
102 |
|
|
|
|
|
|
|
|
|
103 |
return bcmod($a, $b);
|
104 |
}
|
105 |
|
@@ -159,7 +163,7 @@ class BcEngine implements EngineInterface
|
|
159 |
} elseif (preg_match('/^-?[0-9]+$/', $x)) {
|
160 |
return $x;
|
161 |
} else {
|
162 |
-
throw new \Exception("The input must be a numeric string in decimal or hexadecimal (with leading 0x) format.\n".var_export($x,
|
163 |
}
|
164 |
|
165 |
}
|
100 |
$a = $this->input($a);
|
101 |
$b = $this->input($b);
|
102 |
|
103 |
+
if (substr($a, 0, 1) === '-') {
|
104 |
+
return bcadd(bcmod($a, $b), $b);
|
105 |
+
}
|
106 |
+
|
107 |
return bcmod($a, $b);
|
108 |
}
|
109 |
|
163 |
} elseif (preg_match('/^-?[0-9]+$/', $x)) {
|
164 |
return $x;
|
165 |
} else {
|
166 |
+
throw new \Exception("The input must be a numeric string in decimal or hexadecimal (with leading 0x) format.\n".var_export($x, true));
|
167 |
}
|
168 |
|
169 |
}
|
lib/Bitpay/Math/GmpEngine.php
CHANGED
@@ -50,11 +50,6 @@ class GmpEngine implements EngineInterface
|
|
50 |
*/
|
51 |
public function mod($a, $b)
|
52 |
{
|
53 |
-
// gmp_mod has weird behavior when the left operand is negative - https://bugs.php.net/bug.php?id=52906
|
54 |
-
if (substr($a, 0, 1) === '-') {
|
55 |
-
return gmp_strval(gmp_sub(gmp_mod($a, $b), $b));
|
56 |
-
}
|
57 |
-
|
58 |
return gmp_strval(gmp_mod($a, $b));
|
59 |
}
|
60 |
|
50 |
*/
|
51 |
public function mod($a, $b)
|
52 |
{
|
|
|
|
|
|
|
|
|
|
|
53 |
return gmp_strval(gmp_mod($a, $b));
|
54 |
}
|
55 |
|
lib/Bitpay/Storage/MagentoStorage.php
CHANGED
@@ -27,7 +27,13 @@ class MagentoStorage implements StorageInterface
|
|
27 |
$data = serialize($key);
|
28 |
$encryptedData = \Mage::helper('core')->encrypt($data);
|
29 |
$config = new \Mage_Core_Model_Config();
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
/**
|
@@ -35,7 +41,7 @@ class MagentoStorage implements StorageInterface
|
|
35 |
*/
|
36 |
public function load($id)
|
37 |
{
|
38 |
-
if (isset($this->_keys[$id])) {
|
39 |
return $this->_keys[$id];
|
40 |
}
|
41 |
|
@@ -44,16 +50,20 @@ class MagentoStorage implements StorageInterface
|
|
44 |
/**
|
45 |
* Not in database
|
46 |
*/
|
47 |
-
if (empty($entity)) {
|
|
|
48 |
return false;
|
49 |
}
|
50 |
|
51 |
$decodedEntity = unserialize(\Mage::helper('core')->decrypt($entity));
|
52 |
|
53 |
-
if (empty($decodedEntity)) {
|
|
|
54 |
return false;
|
55 |
}
|
56 |
|
|
|
|
|
57 |
return $decodedEntity;
|
58 |
}
|
59 |
}
|
27 |
$data = serialize($key);
|
28 |
$encryptedData = \Mage::helper('core')->encrypt($data);
|
29 |
$config = new \Mage_Core_Model_Config();
|
30 |
+
|
31 |
+
if (true === isset($config) && false === empty($config)) {
|
32 |
+
$config->saveConfig($key->getId(), $encryptedData);
|
33 |
+
} else {
|
34 |
+
\Mage::helper('bitpay')->debugData('[ERROR] In file lib/Bitpay/Storage/MagentoStorage.php, class MagentoStorage::persist - Could not instantiate a \Mage_Core_Model_Config object.');
|
35 |
+
throw new \Exception('[ERROR] In file lib/Bitpay/Storage/MagentoStorage.php, class MagentoStorage::persist - Could not instantiate a \Mage_Core_Model_Config object.');
|
36 |
+
}
|
37 |
}
|
38 |
|
39 |
/**
|
41 |
*/
|
42 |
public function load($id)
|
43 |
{
|
44 |
+
if (true === isset($id) && true === isset($this->_keys[$id])) {
|
45 |
return $this->_keys[$id];
|
46 |
}
|
47 |
|
50 |
/**
|
51 |
* Not in database
|
52 |
*/
|
53 |
+
if (false === isset($entity) || true === empty($entity)) {
|
54 |
+
\Mage::helper('bitpay')->debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' did not return the store config parameter because it was not found in the database.');
|
55 |
return false;
|
56 |
}
|
57 |
|
58 |
$decodedEntity = unserialize(\Mage::helper('core')->decrypt($entity));
|
59 |
|
60 |
+
if (false === isset($decodedEntity) || true === empty($decodedEntity)) {
|
61 |
+
\Mage::helper('bitpay')->debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' could not decrypt & unserialize the entity ' . $entity . '.');
|
62 |
return false;
|
63 |
}
|
64 |
|
65 |
+
\Mage::helper('bitpay')->debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' successfully decrypted & unserialized the entity ' . $entity . '.');
|
66 |
+
|
67 |
return $decodedEntity;
|
68 |
}
|
69 |
}
|
lib/Bitpay/Util/Util.php
CHANGED
@@ -145,6 +145,10 @@ class Util
|
|
145 |
throw new \Exception(sprintf('Argument is expected to be a string of decimal numbers. You passed in "%s"', gettype($dec)));
|
146 |
}
|
147 |
|
|
|
|
|
|
|
|
|
148 |
$hex = '';
|
149 |
|
150 |
while (Math::cmp($dec, 0) > 0) {
|
@@ -190,16 +194,15 @@ class Util
|
|
190 |
if (null === $parameters) {
|
191 |
$parameters = new Secp256k1();
|
192 |
}
|
193 |
-
|
194 |
$tmp = self::decToBin($hex);
|
195 |
|
196 |
$n = strlen($tmp) - 1;
|
197 |
-
$old = 11;
|
198 |
$S = new Point(PointInterface::INFINITY, PointInterface::INFINITY);
|
199 |
-
|
200 |
|
201 |
while ($n >= 0) {
|
202 |
$S = self::pointDouble($S);
|
|
|
203 |
if ($tmp[$n] == 1) {
|
204 |
$S = self::pointAdd($S, $point);
|
205 |
}
|
145 |
throw new \Exception(sprintf('Argument is expected to be a string of decimal numbers. You passed in "%s"', gettype($dec)));
|
146 |
}
|
147 |
|
148 |
+
if (substr($dec, 0, 1) === '-') {
|
149 |
+
$dec = substr($dec, 1);
|
150 |
+
}
|
151 |
+
|
152 |
$hex = '';
|
153 |
|
154 |
while (Math::cmp($dec, 0) > 0) {
|
194 |
if (null === $parameters) {
|
195 |
$parameters = new Secp256k1();
|
196 |
}
|
|
|
197 |
$tmp = self::decToBin($hex);
|
198 |
|
199 |
$n = strlen($tmp) - 1;
|
|
|
200 |
$S = new Point(PointInterface::INFINITY, PointInterface::INFINITY);
|
201 |
+
|
202 |
|
203 |
while ($n >= 0) {
|
204 |
$S = self::pointDouble($S);
|
205 |
+
|
206 |
if ($tmp[$n] == 1) {
|
207 |
$S = self::pointAdd($S, $point);
|
208 |
}
|
lib/Symfony/Component/Config/Definition/ArrayNode.php
CHANGED
@@ -302,7 +302,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
|
302 |
|
303 |
// if extra fields are present, throw exception
|
304 |
if (count($value) && !$this->ignoreExtraKeys) {
|
305 |
-
$msg = sprintf('Unrecognized
|
306 |
$ex = new InvalidConfigurationException($msg);
|
307 |
$ex->setPath($this->getPath());
|
308 |
|
302 |
|
303 |
// if extra fields are present, throw exception
|
304 |
if (count($value) && !$this->ignoreExtraKeys) {
|
305 |
+
$msg = sprintf('Unrecognized option%s "%s" under "%s"', 1 === count($value) ? '' : 's', implode(', ', array_keys($value)), $this->getPath());
|
306 |
$ex = new InvalidConfigurationException($msg);
|
307 |
$ex->setPath($this->getPath());
|
308 |
|
lib/Symfony/Component/Config/Definition/BaseNode.php
CHANGED
@@ -14,9 +14,10 @@ namespace Symfony\Component\Config\Definition;
|
|
14 |
use Symfony\Component\Config\Definition\Exception\Exception;
|
15 |
use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
|
16 |
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
|
|
17 |
|
18 |
/**
|
19 |
-
* The base node class
|
20 |
*
|
21 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
22 |
*/
|
@@ -181,7 +182,7 @@ abstract class BaseNode implements NodeInterface
|
|
181 |
}
|
182 |
|
183 |
/**
|
184 |
-
* Returns the name of this node
|
185 |
*
|
186 |
* @return string The Node's name.
|
187 |
*/
|
14 |
use Symfony\Component\Config\Definition\Exception\Exception;
|
15 |
use Symfony\Component\Config\Definition\Exception\ForbiddenOverwriteException;
|
16 |
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
17 |
+
use Symfony\Component\Config\Definition\Exception\InvalidTypeException;
|
18 |
|
19 |
/**
|
20 |
+
* The base node class.
|
21 |
*
|
22 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
23 |
*/
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
+
* Returns the name of this node.
|
186 |
*
|
187 |
* @return string The Node's name.
|
188 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
CHANGED
@@ -329,7 +329,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition
|
|
329 |
}
|
330 |
|
331 |
/**
|
332 |
-
* Returns a node builder to be used to add children and prototype
|
333 |
*
|
334 |
* @return NodeBuilder The node builder
|
335 |
*/
|
329 |
}
|
330 |
|
331 |
/**
|
332 |
+
* Returns a node builder to be used to add children and prototype.
|
333 |
*
|
334 |
* @return NodeBuilder The node builder
|
335 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php
CHANGED
@@ -31,7 +31,7 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
|
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
-
* Instantiate a Node
|
35 |
*
|
36 |
* @return BooleanNode The node
|
37 |
*/
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* Instantiate a Node.
|
35 |
*
|
36 |
* @return BooleanNode The node
|
37 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php
CHANGED
@@ -36,7 +36,7 @@ class EnumNodeDefinition extends ScalarNodeDefinition
|
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
-
* Instantiate a Node
|
40 |
*
|
41 |
* @return EnumNode The node
|
42 |
*
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
+
* Instantiate a Node.
|
40 |
*
|
41 |
* @return EnumNode The node
|
42 |
*
|
lib/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
CHANGED
@@ -26,7 +26,7 @@ class ExprBuilder
|
|
26 |
public $thenPart;
|
27 |
|
28 |
/**
|
29 |
-
* Constructor
|
30 |
*
|
31 |
* @param NodeDefinition $node The related node
|
32 |
*/
|
@@ -196,7 +196,7 @@ class ExprBuilder
|
|
196 |
}
|
197 |
|
198 |
/**
|
199 |
-
* Returns the related node
|
200 |
*
|
201 |
* @return NodeDefinition
|
202 |
*
|
@@ -225,8 +225,10 @@ class ExprBuilder
|
|
225 |
{
|
226 |
foreach ($expressions as $k => $expr) {
|
227 |
if ($expr instanceof ExprBuilder) {
|
228 |
-
$
|
229 |
-
|
|
|
|
|
230 |
};
|
231 |
}
|
232 |
}
|
26 |
public $thenPart;
|
27 |
|
28 |
/**
|
29 |
+
* Constructor.
|
30 |
*
|
31 |
* @param NodeDefinition $node The related node
|
32 |
*/
|
196 |
}
|
197 |
|
198 |
/**
|
199 |
+
* Returns the related node.
|
200 |
*
|
201 |
* @return NodeDefinition
|
202 |
*
|
225 |
{
|
226 |
foreach ($expressions as $k => $expr) {
|
227 |
if ($expr instanceof ExprBuilder) {
|
228 |
+
$if = $expr->ifPart;
|
229 |
+
$then = $expr->thenPart;
|
230 |
+
$expressions[$k] = function ($v) use ($if, $then) {
|
231 |
+
return $if($v) ? $then($v) : $v;
|
232 |
};
|
233 |
}
|
234 |
}
|
lib/Symfony/Component/Config/Definition/Builder/MergeBuilder.php
CHANGED
@@ -23,7 +23,7 @@ class MergeBuilder
|
|
23 |
public $allowOverwrite = true;
|
24 |
|
25 |
/**
|
26 |
-
* Constructor
|
27 |
*
|
28 |
* @param NodeDefinition $node The related node
|
29 |
*/
|
23 |
public $allowOverwrite = true;
|
24 |
|
25 |
/**
|
26 |
+
* Constructor.
|
27 |
*
|
28 |
* @param NodeDefinition $node The related node
|
29 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/NodeBuilder.php
CHANGED
@@ -22,8 +22,7 @@ class NodeBuilder implements NodeParentInterface
|
|
22 |
protected $nodeMapping;
|
23 |
|
24 |
/**
|
25 |
-
* Constructor
|
26 |
-
*
|
27 |
*/
|
28 |
public function __construct()
|
29 |
{
|
22 |
protected $nodeMapping;
|
23 |
|
24 |
/**
|
25 |
+
* Constructor.
|
|
|
26 |
*/
|
27 |
public function __construct()
|
28 |
{
|
lib/Symfony/Component/Config/Definition/Builder/NodeDefinition.php
CHANGED
@@ -40,7 +40,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|
40 |
protected $attributes = array();
|
41 |
|
42 |
/**
|
43 |
-
* Constructor
|
44 |
*
|
45 |
* @param string $name The name of the node
|
46 |
* @param NodeParentInterface|null $parent The parent
|
@@ -333,7 +333,7 @@ abstract class NodeDefinition implements NodeParentInterface
|
|
333 |
}
|
334 |
|
335 |
/**
|
336 |
-
* Instantiate and configure the node according to this definition
|
337 |
*
|
338 |
* @return NodeInterface $node The node instance
|
339 |
*
|
40 |
protected $attributes = array();
|
41 |
|
42 |
/**
|
43 |
+
* Constructor.
|
44 |
*
|
45 |
* @param string $name The name of the node
|
46 |
* @param NodeParentInterface|null $parent The parent
|
333 |
}
|
334 |
|
335 |
/**
|
336 |
+
* Instantiate and configure the node according to this definition.
|
337 |
*
|
338 |
* @return NodeInterface $node The node instance
|
339 |
*
|
lib/Symfony/Component/Config/Definition/Builder/NodeParentInterface.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
namespace Symfony\Component\Config\Definition\Builder;
|
13 |
|
14 |
/**
|
15 |
-
* An interface that must be implemented by all node parents
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
12 |
namespace Symfony\Component\Config\Definition\Builder;
|
13 |
|
14 |
/**
|
15 |
+
* An interface that must be implemented by all node parents.
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php
CHANGED
@@ -23,7 +23,7 @@ class NormalizationBuilder
|
|
23 |
public $remappings = array();
|
24 |
|
25 |
/**
|
26 |
-
* Constructor
|
27 |
*
|
28 |
* @param NodeDefinition $node The related node
|
29 |
*/
|
23 |
public $remappings = array();
|
24 |
|
25 |
/**
|
26 |
+
* Constructor.
|
27 |
*
|
28 |
* @param NodeDefinition $node The related node
|
29 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/ParentNodeDefinitionInterface.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
namespace Symfony\Component\Config\Definition\Builder;
|
13 |
|
14 |
/**
|
15 |
-
* An interface that must be implemented by nodes which can have children
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
12 |
namespace Symfony\Component\Config\Definition\Builder;
|
13 |
|
14 |
/**
|
15 |
+
* An interface that must be implemented by nodes which can have children.
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/ScalarNodeDefinition.php
CHANGED
@@ -21,7 +21,7 @@ use Symfony\Component\Config\Definition\ScalarNode;
|
|
21 |
class ScalarNodeDefinition extends VariableNodeDefinition
|
22 |
{
|
23 |
/**
|
24 |
-
* Instantiate a Node
|
25 |
*
|
26 |
* @return ScalarNode The node
|
27 |
*/
|
21 |
class ScalarNodeDefinition extends VariableNodeDefinition
|
22 |
{
|
23 |
/**
|
24 |
+
* Instantiate a Node.
|
25 |
*
|
26 |
* @return ScalarNode The node
|
27 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php
CHANGED
@@ -22,7 +22,7 @@ class ValidationBuilder
|
|
22 |
public $rules = array();
|
23 |
|
24 |
/**
|
25 |
-
* Constructor
|
26 |
*
|
27 |
* @param NodeDefinition $node The related node
|
28 |
*/
|
22 |
public $rules = array();
|
23 |
|
24 |
/**
|
25 |
+
* Constructor.
|
26 |
*
|
27 |
* @param NodeDefinition $node The related node
|
28 |
*/
|
lib/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php
CHANGED
@@ -21,7 +21,7 @@ use Symfony\Component\Config\Definition\VariableNode;
|
|
21 |
class VariableNodeDefinition extends NodeDefinition
|
22 |
{
|
23 |
/**
|
24 |
-
* Instantiate a Node
|
25 |
*
|
26 |
* @return VariableNode The node
|
27 |
*/
|
21 |
class VariableNodeDefinition extends NodeDefinition
|
22 |
{
|
23 |
/**
|
24 |
+
* Instantiate a Node.
|
25 |
*
|
26 |
* @return VariableNode The node
|
27 |
*/
|
lib/Symfony/Component/Config/Definition/ConfigurationInterface.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
namespace Symfony\Component\Config\Definition;
|
13 |
|
14 |
/**
|
15 |
-
* Configuration interface
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
12 |
namespace Symfony\Component\Config\Definition;
|
13 |
|
14 |
/**
|
15 |
+
* Configuration interface.
|
16 |
*
|
17 |
* @author Victor Berchet <victor@suumit.com>
|
18 |
*/
|
lib/Symfony/Component/Config/Definition/Exception/Exception.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
namespace Symfony\Component\Config\Definition\Exception;
|
13 |
|
14 |
/**
|
15 |
-
* Base exception for all configuration exceptions
|
16 |
*
|
17 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
18 |
*/
|
12 |
namespace Symfony\Component\Config\Definition\Exception;
|
13 |
|
14 |
/**
|
15 |
+
* Base exception for all configuration exceptions.
|
16 |
*
|
17 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
18 |
*/
|
lib/Symfony/Component/Config/Definition/NodeInterface.php
CHANGED
@@ -52,7 +52,8 @@ interface NodeInterface
|
|
52 |
/**
|
53 |
* Returns the default value of the node.
|
54 |
*
|
55 |
-
* @return mixed
|
|
|
56 |
* @throws \RuntimeException if the node has no default value
|
57 |
*/
|
58 |
public function getDefaultValue();
|
52 |
/**
|
53 |
* Returns the default value of the node.
|
54 |
*
|
55 |
+
* @return mixed The default value
|
56 |
+
*
|
57 |
* @throws \RuntimeException if the node has no default value
|
58 |
*/
|
59 |
public function getDefaultValue();
|
lib/Symfony/Component/Config/Definition/NumericNode.php
CHANGED
@@ -14,7 +14,7 @@ namespace Symfony\Component\Config\Definition;
|
|
14 |
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
15 |
|
16 |
/**
|
17 |
-
* This node represents a numeric value in the config tree
|
18 |
*
|
19 |
* @author David Jeanmonod <david.jeanmonod@gmail.com>
|
20 |
*/
|
14 |
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
15 |
|
16 |
/**
|
17 |
+
* This node represents a numeric value in the config tree.
|
18 |
*
|
19 |
* @author David Jeanmonod <david.jeanmonod@gmail.com>
|
20 |
*/
|
lib/Symfony/Component/Config/Definition/PrototypedArrayNode.php
CHANGED
@@ -155,7 +155,7 @@ class PrototypedArrayNode extends ArrayNode
|
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
-
* Retrieves the prototype
|
159 |
*
|
160 |
* @return PrototypeNodeInterface The prototype
|
161 |
*/
|
155 |
}
|
156 |
|
157 |
/**
|
158 |
+
* Retrieves the prototype.
|
159 |
*
|
160 |
* @return PrototypeNodeInterface The prototype
|
161 |
*/
|
lib/Symfony/Component/Config/Definition/VariableNode.php
CHANGED
@@ -49,7 +49,9 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface
|
|
49 |
*/
|
50 |
public function getDefaultValue()
|
51 |
{
|
52 |
-
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
49 |
*/
|
50 |
public function getDefaultValue()
|
51 |
{
|
52 |
+
$v = $this->defaultValue;
|
53 |
+
|
54 |
+
return $v instanceof \Closure ? $v() : $v;
|
55 |
}
|
56 |
|
57 |
/**
|
lib/Symfony/Component/Config/Exception/FileLoaderImportCircularReferenceException.php
CHANGED
@@ -22,6 +22,6 @@ class FileLoaderImportCircularReferenceException extends FileLoaderLoadException
|
|
22 |
{
|
23 |
$message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]);
|
24 |
|
25 |
-
|
26 |
}
|
27 |
}
|
22 |
{
|
23 |
$message = sprintf('Circular reference detected in "%s" ("%s" > "%s").', $this->varToString($resources[0]), implode('" > "', $resources), $resources[0]);
|
24 |
|
25 |
+
\Exception::__construct($message, $code, $previous);
|
26 |
}
|
27 |
}
|
lib/Symfony/Component/Config/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
Copyright (c) 2004-
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
1 |
+
Copyright (c) 2004-2015 Fabien Potencier
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
lib/Symfony/Component/Config/Resource/DirectoryResource.php
CHANGED
@@ -50,7 +50,7 @@ class DirectoryResource implements ResourceInterface, \Serializable
|
|
50 |
}
|
51 |
|
52 |
/**
|
53 |
-
* Returns the pattern to restrict monitored files
|
54 |
*
|
55 |
* @return string|null
|
56 |
*/
|
50 |
}
|
51 |
|
52 |
/**
|
53 |
+
* Returns the pattern to restrict monitored files.
|
54 |
*
|
55 |
* @return string|null
|
56 |
*/
|
lib/Symfony/Component/Config/Util/XmlUtils.php
CHANGED
@@ -22,7 +22,7 @@ namespace Symfony\Component\Config\Util;
|
|
22 |
class XmlUtils
|
23 |
{
|
24 |
/**
|
25 |
-
* This class should not be instantiated
|
26 |
*/
|
27 |
private function __construct()
|
28 |
{
|
22 |
class XmlUtils
|
23 |
{
|
24 |
/**
|
25 |
+
* This class should not be instantiated.
|
26 |
*/
|
27 |
private function __construct()
|
28 |
{
|
lib/Symfony/Component/Config/phpunit.xml.dist
CHANGED
@@ -6,6 +6,10 @@
|
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
|
|
|
|
|
|
|
|
9 |
<testsuites>
|
10 |
<testsuite name="Symfony Config Component Test Suite">
|
11 |
<directory>./Tests/</directory>
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
9 |
+
<php>
|
10 |
+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
11 |
+
<ini name="error_reporting" value="-16385"/>
|
12 |
+
</php>
|
13 |
<testsuites>
|
14 |
<testsuite name="Symfony Config Component Test Suite">
|
15 |
<directory>./Tests/</directory>
|
lib/Symfony/Component/DependencyInjection/Compiler/CheckCircularReferencesPass.php
CHANGED
@@ -15,7 +15,7 @@ use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceExce
|
|
15 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 |
|
17 |
/**
|
18 |
-
* Checks your services for circular references
|
19 |
*
|
20 |
* References from method calls are ignored since we might be able to resolve
|
21 |
* these references depending on the order in which services are called.
|
15 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
16 |
|
17 |
/**
|
18 |
+
* Checks your services for circular references.
|
19 |
*
|
20 |
* References from method calls are ignored since we might be able to resolve
|
21 |
* these references depending on the order in which services are called.
|
lib/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php
CHANGED
@@ -12,7 +12,6 @@
|
|
12 |
namespace Symfony\Component\DependencyInjection\Compiler;
|
13 |
|
14 |
use Symfony\Component\DependencyInjection\Definition;
|
15 |
-
|
16 |
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
17 |
use Symfony\Component\DependencyInjection\ContainerInterface;
|
18 |
use Symfony\Component\DependencyInjection\Reference;
|
12 |
namespace Symfony\Component\DependencyInjection\Compiler;
|
13 |
|
14 |
use Symfony\Component\DependencyInjection\Definition;
|
|
|
15 |
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
|
16 |
use Symfony\Component\DependencyInjection\ContainerInterface;
|
17 |
use Symfony\Component\DependencyInjection\Reference;
|
lib/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php
CHANGED
@@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\Exception\ScopeCrossingInjectionExcept
|
|
20 |
use Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException;
|
21 |
|
22 |
/**
|
23 |
-
* Checks the validity of references
|
24 |
*
|
25 |
* The following checks are performed by this pass:
|
26 |
* - target definitions are not abstract
|
20 |
use Symfony\Component\DependencyInjection\Exception\ScopeWideningInjectionException;
|
21 |
|
22 |
/**
|
23 |
+
* Checks the validity of references.
|
24 |
*
|
25 |
* The following checks are performed by this pass:
|
26 |
* - target definitions are not abstract
|
lib/Symfony/Component/DependencyInjection/Compiler/CompilerPassInterface.php
CHANGED
@@ -14,7 +14,7 @@ namespace Symfony\Component\DependencyInjection\Compiler;
|
|
14 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
15 |
|
16 |
/**
|
17 |
-
* Interface that must be implemented by compilation passes
|
18 |
*
|
19 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
20 |
*
|
14 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
15 |
|
16 |
/**
|
17 |
+
* Interface that must be implemented by compilation passes.
|
18 |
*
|
19 |
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
|
20 |
*
|
lib/Symfony/Component/DependencyInjection/Compiler/DecoratorServicePass.php
CHANGED
@@ -30,7 +30,7 @@ class DecoratorServicePass implements CompilerPassInterface
|
|
30 |
}
|
31 |
$definition->setDecoratedService(null);
|
32 |
|
33 |
-
list
|
34 |
if (!$renamedId) {
|
35 |
$renamedId = $id.'.inner';
|
36 |
}
|
30 |
}
|
31 |
$definition->setDecoratedService(null);
|
32 |
|
33 |
+
list($inner, $renamedId) = $decorated;
|
34 |
if (!$renamedId) {
|
35 |
$renamedId = $id.'.inner';
|
36 |
}
|
lib/Symfony/Component/DependencyInjection/Compiler/MergeExtensionConfigurationPass.php
CHANGED
@@ -15,7 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
15 |
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
16 |
|
17 |
/**
|
18 |
-
* Merges extension configs into the container builder
|
19 |
*
|
20 |
* @author Fabien Potencier <fabien@symfony.com>
|
21 |
*/
|
15 |
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
16 |
|
17 |
/**
|
18 |
+
* Merges extension configs into the container builder.
|
19 |
*
|
20 |
* @author Fabien Potencier <fabien@symfony.com>
|
21 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/PassConfig.php
CHANGED
@@ -14,7 +14,7 @@ namespace Symfony\Component\DependencyInjection\Compiler;
|
|
14 |
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
15 |
|
16 |
/**
|
17 |
-
* Compiler Pass Configuration
|
18 |
*
|
19 |
* This class has a default configuration embedded.
|
20 |
*
|
14 |
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
15 |
|
16 |
/**
|
17 |
+
* Compiler Pass Configuration.
|
18 |
*
|
19 |
* This class has a default configuration embedded.
|
20 |
*
|
lib/Symfony/Component/DependencyInjection/Compiler/RemoveAbstractDefinitionsPass.php
CHANGED
@@ -14,13 +14,12 @@ namespace Symfony\Component\DependencyInjection\Compiler;
|
|
14 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
15 |
|
16 |
/**
|
17 |
-
* Removes abstract Definitions
|
18 |
-
*
|
19 |
*/
|
20 |
class RemoveAbstractDefinitionsPass implements CompilerPassInterface
|
21 |
{
|
22 |
/**
|
23 |
-
* Removes abstract definitions from the ContainerBuilder
|
24 |
*
|
25 |
* @param ContainerBuilder $container
|
26 |
*/
|
14 |
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
15 |
|
16 |
/**
|
17 |
+
* Removes abstract Definitions.
|
|
|
18 |
*/
|
19 |
class RemoveAbstractDefinitionsPass implements CompilerPassInterface
|
20 |
{
|
21 |
/**
|
22 |
+
* Removes abstract definitions from the ContainerBuilder.
|
23 |
*
|
24 |
* @param ContainerBuilder $container
|
25 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/RemovePrivateAliasesPass.php
CHANGED
@@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
23 |
class RemovePrivateAliasesPass implements CompilerPassInterface
|
24 |
{
|
25 |
/**
|
26 |
-
* Removes private aliases from the ContainerBuilder
|
27 |
*
|
28 |
* @param ContainerBuilder $container
|
29 |
*/
|
23 |
class RemovePrivateAliasesPass implements CompilerPassInterface
|
24 |
{
|
25 |
/**
|
26 |
+
* Removes private aliases from the ContainerBuilder.
|
27 |
*
|
28 |
* @param ContainerBuilder $container
|
29 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/RepeatedPass.php
CHANGED
@@ -69,7 +69,7 @@ class RepeatedPass implements CompilerPassInterface
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
* Sets if the pass should repeat
|
73 |
*/
|
74 |
public function setRepeat()
|
75 |
{
|
@@ -77,7 +77,7 @@ class RepeatedPass implements CompilerPassInterface
|
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
-
* Returns the passes
|
81 |
*
|
82 |
* @return RepeatablePassInterface[] An array of RepeatablePassInterface objects
|
83 |
*/
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
+
* Sets if the pass should repeat.
|
73 |
*/
|
74 |
public function setRepeat()
|
75 |
{
|
77 |
}
|
78 |
|
79 |
/**
|
80 |
+
* Returns the passes.
|
81 |
*
|
82 |
* @return RepeatablePassInterface[] An array of RepeatablePassInterface objects
|
83 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php
CHANGED
@@ -52,7 +52,7 @@ class ResolveDefinitionTemplatesPass implements CompilerPassInterface
|
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
-
* Resolves the definition
|
56 |
*
|
57 |
* @param string $id The definition identifier
|
58 |
* @param DefinitionDecorator $definition
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
+
* Resolves the definition.
|
56 |
*
|
57 |
* @param string $id The definition identifier
|
58 |
* @param DefinitionDecorator $definition
|
lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php
CHANGED
@@ -39,7 +39,7 @@ class ServiceReferenceGraphEdge
|
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
-
* Returns the value of the edge
|
43 |
*
|
44 |
* @return ServiceReferenceGraphNode
|
45 |
*/
|
@@ -49,7 +49,7 @@ class ServiceReferenceGraphEdge
|
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
-
* Returns the source node
|
53 |
*
|
54 |
* @return ServiceReferenceGraphNode
|
55 |
*/
|
@@ -59,7 +59,7 @@ class ServiceReferenceGraphEdge
|
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
-
* Returns the destination node
|
63 |
*
|
64 |
* @return ServiceReferenceGraphNode
|
65 |
*/
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
+
* Returns the value of the edge.
|
43 |
*
|
44 |
* @return ServiceReferenceGraphNode
|
45 |
*/
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
+
* Returns the source node.
|
53 |
*
|
54 |
* @return ServiceReferenceGraphNode
|
55 |
*/
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
+
* Returns the destination node.
|
63 |
*
|
64 |
* @return ServiceReferenceGraphNode
|
65 |
*/
|
lib/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphNode.php
CHANGED
@@ -111,7 +111,7 @@ class ServiceReferenceGraphNode
|
|
111 |
}
|
112 |
|
113 |
/**
|
114 |
-
* Returns the value of this Node
|
115 |
*
|
116 |
* @return mixed The value
|
117 |
*/
|
111 |
}
|
112 |
|
113 |
/**
|
114 |
+
* Returns the value of this Node.
|
115 |
*
|
116 |
* @return mixed The value
|
117 |
*/
|
lib/Symfony/Component/DependencyInjection/Container.php
CHANGED
@@ -344,7 +344,7 @@ class Container implements IntrospectableContainerInterface
|
|
344 |
}
|
345 |
|
346 |
/**
|
347 |
-
* Returns true if the given service has actually been initialized
|
348 |
*
|
349 |
* @param string $id The service identifier
|
350 |
*
|
@@ -387,7 +387,7 @@ class Container implements IntrospectableContainerInterface
|
|
387 |
}
|
388 |
|
389 |
/**
|
390 |
-
* This is called when you enter a scope
|
391 |
*
|
392 |
* @param string $name
|
393 |
*
|
@@ -512,7 +512,7 @@ class Container implements IntrospectableContainerInterface
|
|
512 |
}
|
513 |
|
514 |
/**
|
515 |
-
* Returns whether this container has a certain scope
|
516 |
*
|
517 |
* @param string $name The name of the scope
|
518 |
*
|
@@ -526,7 +526,7 @@ class Container implements IntrospectableContainerInterface
|
|
526 |
}
|
527 |
|
528 |
/**
|
529 |
-
* Returns whether this scope is currently active
|
530 |
*
|
531 |
* This does not actually check if the passed scope actually exists.
|
532 |
*
|
344 |
}
|
345 |
|
346 |
/**
|
347 |
+
* Returns true if the given service has actually been initialized.
|
348 |
*
|
349 |
* @param string $id The service identifier
|
350 |
*
|
387 |
}
|
388 |
|
389 |
/**
|
390 |
+
* This is called when you enter a scope.
|
391 |
*
|
392 |
* @param string $name
|
393 |
*
|
512 |
}
|
513 |
|
514 |
/**
|
515 |
+
* Returns whether this container has a certain scope.
|
516 |
*
|
517 |
* @param string $name The name of the scope
|
518 |
*
|
526 |
}
|
527 |
|
528 |
/**
|
529 |
+
* Returns whether this scope is currently active.
|
530 |
*
|
531 |
* This does not actually check if the passed scope actually exists.
|
532 |
*
|
lib/Symfony/Component/DependencyInjection/ContainerBuilder.php
CHANGED
@@ -279,10 +279,10 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
279 |
* @param string $extension The extension alias or namespace
|
280 |
* @param array $values An array of values that customizes the extension
|
281 |
*
|
282 |
-
* @return ContainerBuilder
|
283 |
-
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
284 |
*
|
285 |
-
* @throws
|
|
|
286 |
*
|
287 |
* @api
|
288 |
*/
|
@@ -521,7 +521,6 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
521 |
*
|
522 |
* @param ContainerBuilder $container The ContainerBuilder instance to merge.
|
523 |
*
|
524 |
-
*
|
525 |
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
526 |
*
|
527 |
* @api
|
@@ -1132,7 +1131,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
|
1132 |
}
|
1133 |
|
1134 |
/**
|
1135 |
-
* Shares a given service in the container
|
1136 |
*
|
1137 |
* @param Definition $definition
|
1138 |
* @param mixed $service
|
279 |
* @param string $extension The extension alias or namespace
|
280 |
* @param array $values An array of values that customizes the extension
|
281 |
*
|
282 |
+
* @return ContainerBuilder The current instance
|
|
|
283 |
*
|
284 |
+
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
285 |
+
* @throws \LogicException if the container is frozen
|
286 |
*
|
287 |
* @api
|
288 |
*/
|
521 |
*
|
522 |
* @param ContainerBuilder $container The ContainerBuilder instance to merge.
|
523 |
*
|
|
|
524 |
* @throws BadMethodCallException When this ContainerBuilder is frozen
|
525 |
*
|
526 |
* @api
|
1131 |
}
|
1132 |
|
1133 |
/**
|
1134 |
+
* Shares a given service in the container.
|
1135 |
*
|
1136 |
* @param Definition $definition
|
1137 |
* @param mixed $service
|
lib/Symfony/Component/DependencyInjection/ContainerInterface.php
CHANGED
@@ -106,7 +106,7 @@ interface ContainerInterface
|
|
106 |
public function setParameter($name, $value);
|
107 |
|
108 |
/**
|
109 |
-
* Enters the given scope
|
110 |
*
|
111 |
* @param string $name
|
112 |
*
|
@@ -115,7 +115,7 @@ interface ContainerInterface
|
|
115 |
public function enterScope($name);
|
116 |
|
117 |
/**
|
118 |
-
* Leaves the current scope, and re-enters the parent scope
|
119 |
*
|
120 |
* @param string $name
|
121 |
*
|
@@ -124,7 +124,7 @@ interface ContainerInterface
|
|
124 |
public function leaveScope($name);
|
125 |
|
126 |
/**
|
127 |
-
* Adds a scope to the container
|
128 |
*
|
129 |
* @param ScopeInterface $scope
|
130 |
*
|
@@ -133,7 +133,7 @@ interface ContainerInterface
|
|
133 |
public function addScope(ScopeInterface $scope);
|
134 |
|
135 |
/**
|
136 |
-
* Whether this container has the given scope
|
137 |
*
|
138 |
* @param string $name
|
139 |
*
|
106 |
public function setParameter($name, $value);
|
107 |
|
108 |
/**
|
109 |
+
* Enters the given scope.
|
110 |
*
|
111 |
* @param string $name
|
112 |
*
|
115 |
public function enterScope($name);
|
116 |
|
117 |
/**
|
118 |
+
* Leaves the current scope, and re-enters the parent scope.
|
119 |
*
|
120 |
* @param string $name
|
121 |
*
|
124 |
public function leaveScope($name);
|
125 |
|
126 |
/**
|
127 |
+
* Adds a scope to the container.
|
128 |
*
|
129 |
* @param ScopeInterface $scope
|
130 |
*
|
133 |
public function addScope(ScopeInterface $scope);
|
134 |
|
135 |
/**
|
136 |
+
* Whether this container has the given scope.
|
137 |
*
|
138 |
* @param string $name
|
139 |
*
|
lib/Symfony/Component/DependencyInjection/Definition.php
CHANGED
@@ -265,7 +265,7 @@ class Definition
|
|
265 |
}
|
266 |
|
267 |
/**
|
268 |
-
* Sets a specific argument
|
269 |
*
|
270 |
* @param int $index
|
271 |
* @param mixed $argument
|
@@ -414,7 +414,7 @@ class Definition
|
|
414 |
}
|
415 |
|
416 |
/**
|
417 |
-
* Sets tags for this definition
|
418 |
*
|
419 |
* @param array $tags
|
420 |
*
|
@@ -473,7 +473,7 @@ class Definition
|
|
473 |
}
|
474 |
|
475 |
/**
|
476 |
-
* Whether this definition has a tag with the given name
|
477 |
*
|
478 |
* @param string $name
|
479 |
*
|
@@ -545,7 +545,7 @@ class Definition
|
|
545 |
}
|
546 |
|
547 |
/**
|
548 |
-
* Sets the scope of the service
|
549 |
*
|
550 |
* @param string $scope Whether the service must be shared or not
|
551 |
*
|
@@ -561,7 +561,7 @@ class Definition
|
|
561 |
}
|
562 |
|
563 |
/**
|
564 |
-
* Returns the scope of the service
|
565 |
*
|
566 |
* @return string
|
567 |
*
|
@@ -589,7 +589,7 @@ class Definition
|
|
589 |
}
|
590 |
|
591 |
/**
|
592 |
-
* Whether this service is public facing
|
593 |
*
|
594 |
* @return bool
|
595 |
*
|
265 |
}
|
266 |
|
267 |
/**
|
268 |
+
* Sets a specific argument.
|
269 |
*
|
270 |
* @param int $index
|
271 |
* @param mixed $argument
|
414 |
}
|
415 |
|
416 |
/**
|
417 |
+
* Sets tags for this definition.
|
418 |
*
|
419 |
* @param array $tags
|
420 |
*
|
473 |
}
|
474 |
|
475 |
/**
|
476 |
+
* Whether this definition has a tag with the given name.
|
477 |
*
|
478 |
* @param string $name
|
479 |
*
|
545 |
}
|
546 |
|
547 |
/**
|
548 |
+
* Sets the scope of the service.
|
549 |
*
|
550 |
* @param string $scope Whether the service must be shared or not
|
551 |
*
|
561 |
}
|
562 |
|
563 |
/**
|
564 |
+
* Returns the scope of the service.
|
565 |
*
|
566 |
* @return string
|
567 |
*
|
589 |
}
|
590 |
|
591 |
/**
|
592 |
+
* Whether this service is public facing.
|
593 |
*
|
594 |
* @return bool
|
595 |
*
|
lib/Symfony/Component/DependencyInjection/DefinitionDecorator.php
CHANGED
@@ -200,7 +200,8 @@ class DefinitionDecorator extends Definition
|
|
200 |
* @param int $index
|
201 |
* @param mixed $value
|
202 |
*
|
203 |
-
* @return DefinitionDecorator
|
|
|
204 |
* @throws InvalidArgumentException when $index isn't an integer
|
205 |
*
|
206 |
* @api
|
200 |
* @param int $index
|
201 |
* @param mixed $value
|
202 |
*
|
203 |
+
* @return DefinitionDecorator the current instance
|
204 |
+
*
|
205 |
* @throws InvalidArgumentException when $index isn't an integer
|
206 |
*
|
207 |
* @api
|
lib/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
CHANGED
@@ -236,7 +236,7 @@ class GraphvizDumper extends Dumper
|
|
236 |
}
|
237 |
|
238 |
/**
|
239 |
-
* Adds attributes
|
240 |
*
|
241 |
* @param array $attributes An array of attributes
|
242 |
*
|
@@ -253,7 +253,7 @@ class GraphvizDumper extends Dumper
|
|
253 |
}
|
254 |
|
255 |
/**
|
256 |
-
* Adds options
|
257 |
*
|
258 |
* @param array $options An array of options
|
259 |
*
|
236 |
}
|
237 |
|
238 |
/**
|
239 |
+
* Adds attributes.
|
240 |
*
|
241 |
* @param array $attributes An array of attributes
|
242 |
*
|
253 |
}
|
254 |
|
255 |
/**
|
256 |
+
* Adds options.
|
257 |
*
|
258 |
* @param array $options An array of options
|
259 |
*
|
lib/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
CHANGED
@@ -37,13 +37,15 @@ use Symfony\Component\ExpressionLanguage\Expression;
|
|
37 |
class PhpDumper extends Dumper
|
38 |
{
|
39 |
/**
|
40 |
-
* Characters that might appear in the generated variable name as first character
|
|
|
41 |
* @var string
|
42 |
*/
|
43 |
const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz';
|
44 |
|
45 |
/**
|
46 |
-
* Characters that might appear in the generated variable name as any but the first character
|
|
|
47 |
* @var string
|
48 |
*/
|
49 |
const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_';
|
@@ -109,17 +111,19 @@ class PhpDumper extends Dumper
|
|
109 |
), $options);
|
110 |
|
111 |
if (!empty($options['file']) && is_dir($dir = dirname($options['file']))) {
|
112 |
-
// Build a regexp where the first
|
113 |
// but every other sub-dir is optional up to the full path in $dir
|
|
|
114 |
|
115 |
$dir = explode(DIRECTORY_SEPARATOR, realpath($dir));
|
116 |
$i = count($dir);
|
117 |
|
118 |
if (3 <= $i) {
|
119 |
$regex = '';
|
120 |
-
$
|
|
|
121 |
|
122 |
-
while (
|
123 |
$regex = sprintf('(%s%s)?', preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex);
|
124 |
}
|
125 |
|
@@ -215,7 +219,7 @@ class PhpDumper extends Dumper
|
|
215 |
}
|
216 |
|
217 |
/**
|
218 |
-
* Generates code for the proxies to be attached after the container class
|
219 |
*
|
220 |
* @return string
|
221 |
*/
|
@@ -497,7 +501,7 @@ class PhpDumper extends Dumper
|
|
497 |
}
|
498 |
|
499 |
/**
|
500 |
-
* Adds configurator definition
|
501 |
*
|
502 |
* @param string $id
|
503 |
* @param Definition $definition
|
@@ -530,7 +534,7 @@ class PhpDumper extends Dumper
|
|
530 |
}
|
531 |
|
532 |
/**
|
533 |
-
* Adds a service
|
534 |
*
|
535 |
* @param string $id
|
536 |
* @param Definition $definition
|
@@ -643,7 +647,7 @@ EOF;
|
|
643 |
}
|
644 |
|
645 |
/**
|
646 |
-
* Adds multiple services
|
647 |
*
|
648 |
* @return string
|
649 |
*/
|
@@ -786,6 +790,9 @@ $bagClass
|
|
786 |
*/
|
787 |
class $class extends $baseClass
|
788 |
{
|
|
|
|
|
|
|
789 |
EOF;
|
790 |
}
|
791 |
|
@@ -796,6 +803,7 @@ EOF;
|
|
796 |
*/
|
797 |
private function addConstructor()
|
798 |
{
|
|
|
799 |
$arguments = $this->container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null;
|
800 |
|
801 |
$code = <<<EOF
|
@@ -804,7 +812,7 @@ EOF;
|
|
804 |
* Constructor.
|
805 |
*/
|
806 |
public function __construct()
|
807 |
-
{
|
808 |
parent::__construct($arguments);
|
809 |
|
810 |
EOF;
|
@@ -833,15 +841,15 @@ EOF;
|
|
833 |
*/
|
834 |
private function addFrozenConstructor()
|
835 |
{
|
836 |
-
$
|
837 |
|
838 |
-
|
839 |
|
840 |
/**
|
841 |
* Constructor.
|
842 |
*/
|
843 |
public function __construct()
|
844 |
-
{
|
845 |
EOF;
|
846 |
|
847 |
if ($this->container->getParameterBag()->all()) {
|
@@ -879,7 +887,7 @@ EOF;
|
|
879 |
}
|
880 |
|
881 |
/**
|
882 |
-
* Adds the methodMap property definition
|
883 |
*
|
884 |
* @return string
|
885 |
*/
|
@@ -899,7 +907,7 @@ EOF;
|
|
899 |
}
|
900 |
|
901 |
/**
|
902 |
-
* Adds the aliases property definition
|
903 |
*
|
904 |
* @return string
|
905 |
*/
|
@@ -1295,7 +1303,7 @@ EOF;
|
|
1295 |
}
|
1296 |
|
1297 |
/**
|
1298 |
-
* Dumps a parameter
|
1299 |
*
|
1300 |
* @param string $name
|
1301 |
*
|
@@ -1311,7 +1319,7 @@ EOF;
|
|
1311 |
}
|
1312 |
|
1313 |
/**
|
1314 |
-
* Gets a service call
|
1315 |
*
|
1316 |
* @param string $id
|
1317 |
* @param Reference $reference
|
@@ -1356,7 +1364,7 @@ EOF;
|
|
1356 |
}
|
1357 |
|
1358 |
/**
|
1359 |
-
* Returns the next name to use
|
1360 |
*
|
1361 |
* @return string
|
1362 |
*/
|
@@ -1405,6 +1413,17 @@ EOF;
|
|
1405 |
return $this->expressionLanguage;
|
1406 |
}
|
1407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1408 |
private function export($value)
|
1409 |
{
|
1410 |
if (null !== $this->targetDirRegex && is_string($value) && preg_match($this->targetDirRegex, $value, $matches, PREG_OFFSET_CAPTURE)) {
|
@@ -1413,8 +1432,8 @@ EOF;
|
|
1413 |
$suffix = isset($value[$suffix]) ? '.'.var_export(substr($value, $suffix), true) : '';
|
1414 |
$dirname = '__DIR__';
|
1415 |
|
1416 |
-
|
1417 |
-
$dirname = sprintf('
|
1418 |
}
|
1419 |
|
1420 |
if ($prefix || $suffix) {
|
37 |
class PhpDumper extends Dumper
|
38 |
{
|
39 |
/**
|
40 |
+
* Characters that might appear in the generated variable name as first character.
|
41 |
+
*
|
42 |
* @var string
|
43 |
*/
|
44 |
const FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz';
|
45 |
|
46 |
/**
|
47 |
+
* Characters that might appear in the generated variable name as any but the first character.
|
48 |
+
*
|
49 |
* @var string
|
50 |
*/
|
51 |
const NON_FIRST_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789_';
|
111 |
), $options);
|
112 |
|
113 |
if (!empty($options['file']) && is_dir($dir = dirname($options['file']))) {
|
114 |
+
// Build a regexp where the first root dirs are mandatory,
|
115 |
// but every other sub-dir is optional up to the full path in $dir
|
116 |
+
// Mandate at least 2 root dirs and not more that 5 optional dirs.
|
117 |
|
118 |
$dir = explode(DIRECTORY_SEPARATOR, realpath($dir));
|
119 |
$i = count($dir);
|
120 |
|
121 |
if (3 <= $i) {
|
122 |
$regex = '';
|
123 |
+
$lastOptionalDir = $i > 8 ? $i - 5 : 3;
|
124 |
+
$this->targetDirMaxMatches = $i - $lastOptionalDir;
|
125 |
|
126 |
+
while (--$i >= $lastOptionalDir) {
|
127 |
$regex = sprintf('(%s%s)?', preg_quote(DIRECTORY_SEPARATOR.$dir[$i], '#'), $regex);
|
128 |
}
|
129 |
|
219 |
}
|
220 |
|
221 |
/**
|
222 |
+
* Generates code for the proxies to be attached after the container class.
|
223 |
*
|
224 |
* @return string
|
225 |
*/
|
501 |
}
|
502 |
|
503 |
/**
|
504 |
+
* Adds configurator definition.
|
505 |
*
|
506 |
* @param string $id
|
507 |
* @param Definition $definition
|
534 |
}
|
535 |
|
536 |
/**
|
537 |
+
* Adds a service.
|
538 |
*
|
539 |
* @param string $id
|
540 |
* @param Definition $definition
|
647 |
}
|
648 |
|
649 |
/**
|
650 |
+
* Adds multiple services.
|
651 |
*
|
652 |
* @return string
|
653 |
*/
|
790 |
*/
|
791 |
class $class extends $baseClass
|
792 |
{
|
793 |
+
private \$parameters;
|
794 |
+
private \$targetDirs = array();
|
795 |
+
|
796 |
EOF;
|
797 |
}
|
798 |
|
803 |
*/
|
804 |
private function addConstructor()
|
805 |
{
|
806 |
+
$targetDirs = $this->exportTargetDirs();
|
807 |
$arguments = $this->container->getParameterBag()->all() ? 'new ParameterBag($this->getDefaultParameters())' : null;
|
808 |
|
809 |
$code = <<<EOF
|
812 |
* Constructor.
|
813 |
*/
|
814 |
public function __construct()
|
815 |
+
{{$targetDirs}
|
816 |
parent::__construct($arguments);
|
817 |
|
818 |
EOF;
|
841 |
*/
|
842 |
private function addFrozenConstructor()
|
843 |
{
|
844 |
+
$targetDirs = $this->exportTargetDirs();
|
845 |
|
846 |
+
$code = <<<EOF
|
847 |
|
848 |
/**
|
849 |
* Constructor.
|
850 |
*/
|
851 |
public function __construct()
|
852 |
+
{{$targetDirs}
|
853 |
EOF;
|
854 |
|
855 |
if ($this->container->getParameterBag()->all()) {
|
887 |
}
|
888 |
|
889 |
/**
|
890 |
+
* Adds the methodMap property definition.
|
891 |
*
|
892 |
* @return string
|
893 |
*/
|
907 |
}
|
908 |
|
909 |
/**
|
910 |
+
* Adds the aliases property definition.
|
911 |
*
|
912 |
* @return string
|
913 |
*/
|
1303 |
}
|
1304 |
|
1305 |
/**
|
1306 |
+
* Dumps a parameter.
|
1307 |
*
|
1308 |
* @param string $name
|
1309 |
*
|
1319 |
}
|
1320 |
|
1321 |
/**
|
1322 |
+
* Gets a service call.
|
1323 |
*
|
1324 |
* @param string $id
|
1325 |
* @param Reference $reference
|
1364 |
}
|
1365 |
|
1366 |
/**
|
1367 |
+
* Returns the next name to use.
|
1368 |
*
|
1369 |
* @return string
|
1370 |
*/
|
1413 |
return $this->expressionLanguage;
|
1414 |
}
|
1415 |
|
1416 |
+
private function exportTargetDirs()
|
1417 |
+
{
|
1418 |
+
return null === $this->targetDirRegex ? '' : <<<EOF
|
1419 |
+
|
1420 |
+
\$dir = __DIR__;
|
1421 |
+
for (\$i = 1; \$i <= {$this->targetDirMaxMatches}; ++\$i) {
|
1422 |
+
\$this->targetDirs[\$i] = \$dir = dirname(\$dir);
|
1423 |
+
}
|
1424 |
+
EOF;
|
1425 |
+
}
|
1426 |
+
|
1427 |
private function export($value)
|
1428 |
{
|
1429 |
if (null !== $this->targetDirRegex && is_string($value) && preg_match($this->targetDirRegex, $value, $matches, PREG_OFFSET_CAPTURE)) {
|
1432 |
$suffix = isset($value[$suffix]) ? '.'.var_export(substr($value, $suffix), true) : '';
|
1433 |
$dirname = '__DIR__';
|
1434 |
|
1435 |
+
if (0 < $offset = 1 + $this->targetDirMaxMatches - count($matches)) {
|
1436 |
+
$dirname = sprintf('$this->targetDirs[%d]', $offset);
|
1437 |
}
|
1438 |
|
1439 |
if ($prefix || $suffix) {
|
lib/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php
CHANGED
@@ -142,7 +142,7 @@ class XmlDumper extends Dumper
|
|
142 |
$service->setAttribute('lazy', 'true');
|
143 |
}
|
144 |
if (null !== $decorated = $definition->getDecoratedService()) {
|
145 |
-
list
|
146 |
$service->setAttribute('decorates', $decorated);
|
147 |
if (null !== $renamedId) {
|
148 |
$service->setAttribute('decoration-inner-name', $renamedId);
|
@@ -286,7 +286,7 @@ class XmlDumper extends Dumper
|
|
286 |
}
|
287 |
|
288 |
/**
|
289 |
-
* Escapes arguments
|
290 |
*
|
291 |
* @param array $arguments
|
292 |
*
|
142 |
$service->setAttribute('lazy', 'true');
|
143 |
}
|
144 |
if (null !== $decorated = $definition->getDecoratedService()) {
|
145 |
+
list($decorated, $renamedId) = $decorated;
|
146 |
$service->setAttribute('decorates', $decorated);
|
147 |
if (null !== $renamedId) {
|
148 |
$service->setAttribute('decoration-inner-name', $renamedId);
|
286 |
}
|
287 |
|
288 |
/**
|
289 |
+
* Escapes arguments.
|
290 |
*
|
291 |
* @param array $arguments
|
292 |
*
|
lib/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
CHANGED
@@ -61,7 +61,7 @@ class YamlDumper extends Dumper
|
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
-
* Adds a service
|
65 |
*
|
66 |
* @param string $id
|
67 |
* @param Definition $definition
|
@@ -140,7 +140,7 @@ class YamlDumper extends Dumper
|
|
140 |
}
|
141 |
|
142 |
if (null !== $decorated = $definition->getDecoratedService()) {
|
143 |
-
list
|
144 |
$code .= sprintf(" decorates: %s\n", $decorated);
|
145 |
if (null !== $renamedId) {
|
146 |
$code .= sprintf(" decoration_inner_name: %s\n", $renamedId);
|
@@ -163,7 +163,7 @@ class YamlDumper extends Dumper
|
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
-
* Adds a service alias
|
167 |
*
|
168 |
* @param string $alias
|
169 |
* @param Alias $id
|
@@ -180,7 +180,7 @@ class YamlDumper extends Dumper
|
|
180 |
}
|
181 |
|
182 |
/**
|
183 |
-
* Adds services
|
184 |
*
|
185 |
* @return string
|
186 |
*/
|
@@ -207,7 +207,7 @@ class YamlDumper extends Dumper
|
|
207 |
}
|
208 |
|
209 |
/**
|
210 |
-
* Adds parameters
|
211 |
*
|
212 |
* @return string
|
213 |
*/
|
@@ -223,7 +223,7 @@ class YamlDumper extends Dumper
|
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
-
* Dumps the value to YAML format
|
227 |
*
|
228 |
* @param mixed $value
|
229 |
*
|
@@ -312,7 +312,7 @@ class YamlDumper extends Dumper
|
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
-
* Escapes arguments
|
316 |
*
|
317 |
* @param array $arguments
|
318 |
*
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
+
* Adds a service.
|
65 |
*
|
66 |
* @param string $id
|
67 |
* @param Definition $definition
|
140 |
}
|
141 |
|
142 |
if (null !== $decorated = $definition->getDecoratedService()) {
|
143 |
+
list($decorated, $renamedId) = $decorated;
|
144 |
$code .= sprintf(" decorates: %s\n", $decorated);
|
145 |
if (null !== $renamedId) {
|
146 |
$code .= sprintf(" decoration_inner_name: %s\n", $renamedId);
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
+
* Adds a service alias.
|
167 |
*
|
168 |
* @param string $alias
|
169 |
* @param Alias $id
|
180 |
}
|
181 |
|
182 |
/**
|
183 |
+
* Adds services.
|
184 |
*
|
185 |
* @return string
|
186 |
*/
|
207 |
}
|
208 |
|
209 |
/**
|
210 |
+
* Adds parameters.
|
211 |
*
|
212 |
* @return string
|
213 |
*/
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
+
* Dumps the value to YAML format.
|
227 |
*
|
228 |
* @param mixed $value
|
229 |
*
|
312 |
}
|
313 |
|
314 |
/**
|
315 |
+
* Escapes arguments.
|
316 |
*
|
317 |
* @param array $arguments
|
318 |
*
|
lib/Symfony/Component/DependencyInjection/Extension/ConfigurationExtensionInterface.php
CHANGED
@@ -22,7 +22,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|
22 |
interface ConfigurationExtensionInterface
|
23 |
{
|
24 |
/**
|
25 |
-
* Returns extension configuration
|
26 |
*
|
27 |
* @param array $config An array of configuration values
|
28 |
* @param ContainerBuilder $container A ContainerBuilder instance
|
22 |
interface ConfigurationExtensionInterface
|
23 |
{
|
24 |
/**
|
25 |
+
* Returns extension configuration.
|
26 |
*
|
27 |
* @param array $config An array of configuration values
|
28 |
* @param ContainerBuilder $container A ContainerBuilder instance
|
lib/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php
CHANGED
@@ -16,7 +16,6 @@ namespace Symfony\Component\DependencyInjection;
|
|
16 |
* for containers, allowing logic to be implemented based on a Container's state.
|
17 |
*
|
18 |
* @author Evan Villemez <evillemez@gmail.com>
|
19 |
-
*
|
20 |
*/
|
21 |
interface IntrospectableContainerInterface extends ContainerInterface
|
22 |
{
|
@@ -26,7 +25,6 @@ interface IntrospectableContainerInterface extends ContainerInterface
|
|
26 |
* @param string $id
|
27 |
*
|
28 |
* @return bool true if the service has been initialized, false otherwise
|
29 |
-
*
|
30 |
*/
|
31 |
public function initialized($id);
|
32 |
}
|
16 |
* for containers, allowing logic to be implemented based on a Container's state.
|
17 |
*
|
18 |
* @author Evan Villemez <evillemez@gmail.com>
|
|
|
19 |
*/
|
20 |
interface IntrospectableContainerInterface extends ContainerInterface
|
21 |
{
|
25 |
* @param string $id
|
26 |
*
|
27 |
* @return bool true if the service has been initialized, false otherwise
|
|
|
28 |
*/
|
29 |
public function initialized($id);
|
30 |
}
|
lib/Symfony/Component/DependencyInjection/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
Copyright (c) 2004-
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
1 |
+
Copyright (c) 2004-2015 Fabien Potencier
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
lib/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
CHANGED
@@ -67,7 +67,7 @@ class XmlFileLoader extends FileLoader
|
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
-
* Parses parameters
|
71 |
*
|
72 |
* @param \DOMDocument $xml
|
73 |
* @param string $file
|
@@ -80,7 +80,7 @@ class XmlFileLoader extends FileLoader
|
|
80 |
}
|
81 |
|
82 |
/**
|
83 |
-
* Parses imports
|
84 |
*
|
85 |
* @param \DOMDocument $xml
|
86 |
* @param string $file
|
@@ -101,7 +101,7 @@ class XmlFileLoader extends FileLoader
|
|
101 |
}
|
102 |
|
103 |
/**
|
104 |
-
* Parses multiple definitions
|
105 |
*
|
106 |
* @param \DOMDocument $xml
|
107 |
* @param string $file
|
@@ -121,7 +121,7 @@ class XmlFileLoader extends FileLoader
|
|
121 |
}
|
122 |
|
123 |
/**
|
124 |
-
* Parses an individual Definition
|
125 |
*
|
126 |
* @param string $id
|
127 |
* @param \DOMElement $service
|
@@ -226,7 +226,7 @@ class XmlFileLoader extends FileLoader
|
|
226 |
}
|
227 |
|
228 |
/**
|
229 |
-
* Processes anonymous services
|
230 |
*
|
231 |
* @param \DOMDocument $xml
|
232 |
* @param string $file
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
+
* Parses parameters.
|
71 |
*
|
72 |
* @param \DOMDocument $xml
|
73 |
* @param string $file
|
80 |
}
|
81 |
|
82 |
/**
|
83 |
+
* Parses imports.
|
84 |
*
|
85 |
* @param \DOMDocument $xml
|
86 |
* @param string $file
|
101 |
}
|
102 |
|
103 |
/**
|
104 |
+
* Parses multiple definitions.
|
105 |
*
|
106 |
* @param \DOMDocument $xml
|
107 |
* @param string $file
|
121 |
}
|
122 |
|
123 |
/**
|
124 |
+
* Parses an individual Definition.
|
125 |
*
|
126 |
* @param string $id
|
127 |
* @param \DOMElement $service
|
226 |
}
|
227 |
|
228 |
/**
|
229 |
+
* Processes anonymous services.
|
230 |
*
|
231 |
* @param \DOMDocument $xml
|
232 |
* @param string $file
|
lib/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
CHANGED
@@ -78,7 +78,7 @@ class YamlFileLoader extends FileLoader
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
-
* Parses all imports
|
82 |
*
|
83 |
* @param array $content
|
84 |
* @param string $file
|
@@ -104,7 +104,7 @@ class YamlFileLoader extends FileLoader
|
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
-
* Parses definitions
|
108 |
*
|
109 |
* @param array $content
|
110 |
* @param string $file
|
@@ -371,7 +371,7 @@ class YamlFileLoader extends FileLoader
|
|
371 |
}
|
372 |
|
373 |
/**
|
374 |
-
* Loads from Extensions
|
375 |
*
|
376 |
* @param array $content
|
377 |
*/
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
+
* Parses all imports.
|
82 |
*
|
83 |
* @param array $content
|
84 |
* @param string $file
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
+
* Parses definitions.
|
108 |
*
|
109 |
* @param array $content
|
110 |
* @param string $file
|
371 |
}
|
372 |
|
373 |
/**
|
374 |
+
* Loads from Extensions.
|
375 |
*
|
376 |
* @param array $content
|
377 |
*/
|
lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
CHANGED
@@ -204,7 +204,7 @@ class ParameterBag implements ParameterBagInterface
|
|
204 |
}
|
205 |
|
206 |
/**
|
207 |
-
* Resolves parameters inside a string
|
208 |
*
|
209 |
* @param string $value The string to resolve
|
210 |
* @param array $resolving An array of keys that are being resolved (used internally to detect circular references)
|
204 |
}
|
205 |
|
206 |
/**
|
207 |
+
* Resolves parameters inside a string.
|
208 |
*
|
209 |
* @param string $value The string to resolve
|
210 |
* @param array $resolving An array of keys that are being resolved (used internally to detect circular references)
|
lib/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php
CHANGED
@@ -96,7 +96,7 @@ interface ParameterBagInterface
|
|
96 |
public function resolveValue($value);
|
97 |
|
98 |
/**
|
99 |
-
* Escape parameter placeholders
|
100 |
*
|
101 |
* @param mixed $value
|
102 |
*
|
@@ -105,7 +105,7 @@ interface ParameterBagInterface
|
|
105 |
public function escapeValue($value);
|
106 |
|
107 |
/**
|
108 |
-
* Unescape parameter placeholders
|
109 |
*
|
110 |
* @param mixed $value
|
111 |
*
|
96 |
public function resolveValue($value);
|
97 |
|
98 |
/**
|
99 |
+
* Escape parameter placeholders %.
|
100 |
*
|
101 |
* @param mixed $value
|
102 |
*
|
105 |
public function escapeValue($value);
|
106 |
|
107 |
/**
|
108 |
+
* Unescape parameter placeholders %.
|
109 |
*
|
110 |
* @param mixed $value
|
111 |
*
|
lib/Symfony/Component/DependencyInjection/Reference.php
CHANGED
@@ -61,7 +61,7 @@ class Reference
|
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
-
* Returns true when this Reference is strict
|
65 |
*
|
66 |
* @return bool
|
67 |
*/
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
+
* Returns true when this Reference is strict.
|
65 |
*
|
66 |
* @return bool
|
67 |
*/
|
lib/Symfony/Component/DependencyInjection/Variable.php
CHANGED
@@ -29,7 +29,7 @@ class Variable
|
|
29 |
private $name;
|
30 |
|
31 |
/**
|
32 |
-
* Constructor
|
33 |
*
|
34 |
* @param string $name
|
35 |
*/
|
@@ -39,7 +39,7 @@ class Variable
|
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
-
* Converts the object to a string
|
43 |
*
|
44 |
* @return string
|
45 |
*/
|
29 |
private $name;
|
30 |
|
31 |
/**
|
32 |
+
* Constructor.
|
33 |
*
|
34 |
* @param string $name
|
35 |
*/
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
+
* Converts the object to a string.
|
43 |
*
|
44 |
* @return string
|
45 |
*/
|
lib/Symfony/Component/DependencyInjection/composer.json
CHANGED
@@ -19,9 +19,9 @@
|
|
19 |
"php": ">=5.3.3"
|
20 |
},
|
21 |
"require-dev": {
|
22 |
-
"symfony/yaml": "~2.
|
23 |
"symfony/config": "~2.2",
|
24 |
-
"symfony/expression-language": "~2.4"
|
25 |
},
|
26 |
"suggest": {
|
27 |
"symfony/yaml": "",
|
19 |
"php": ">=5.3.3"
|
20 |
},
|
21 |
"require-dev": {
|
22 |
+
"symfony/yaml": "~2.1",
|
23 |
"symfony/config": "~2.2",
|
24 |
+
"symfony/expression-language": "~2.4,>=2.4.10"
|
25 |
},
|
26 |
"suggest": {
|
27 |
"symfony/yaml": "",
|
lib/Symfony/Component/DependencyInjection/phpunit.xml.dist
CHANGED
@@ -6,6 +6,10 @@
|
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
|
|
|
|
|
|
|
|
9 |
<testsuites>
|
10 |
<testsuite name="Symfony DependencyInjection Component Test Suite">
|
11 |
<directory>./Tests/</directory>
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
9 |
+
<php>
|
10 |
+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
11 |
+
<ini name="error_reporting" value="-16385"/>
|
12 |
+
</php>
|
13 |
<testsuites>
|
14 |
<testsuite name="Symfony DependencyInjection Component Test Suite">
|
15 |
<directory>./Tests/</directory>
|
lib/Symfony/Component/Filesystem/Exception/IOException.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
namespace Symfony\Component\Filesystem\Exception;
|
13 |
|
14 |
/**
|
15 |
-
* Exception class thrown when a filesystem operation failure happens
|
16 |
*
|
17 |
* @author Romain Neutron <imprec@gmail.com>
|
18 |
* @author Christian Gärtner <christiangaertner.film@googlemail.com>
|
12 |
namespace Symfony\Component\Filesystem\Exception;
|
13 |
|
14 |
/**
|
15 |
+
* Exception class thrown when a filesystem operation failure happens.
|
16 |
*
|
17 |
* @author Romain Neutron <imprec@gmail.com>
|
18 |
* @author Christian Gärtner <christiangaertner.film@googlemail.com>
|
lib/Symfony/Component/Filesystem/Filesystem.php
CHANGED
@@ -32,8 +32,8 @@ class Filesystem
|
|
32 |
* @param string $targetFile The target filename
|
33 |
* @param bool $override Whether to override an existing file or not
|
34 |
*
|
35 |
-
* @throws FileNotFoundException
|
36 |
-
* @throws IOException
|
37 |
*/
|
38 |
public function copy($originFile, $targetFile, $override = false)
|
39 |
{
|
@@ -154,7 +154,7 @@ class Filesystem
|
|
154 |
}
|
155 |
} else {
|
156 |
// https://bugs.php.net/bug.php?id=52176
|
157 |
-
if (
|
158 |
if (true !== @rmdir($file)) {
|
159 |
throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
|
160 |
}
|
@@ -190,7 +190,7 @@ class Filesystem
|
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
-
* Change the owner of an array of files or directories
|
194 |
*
|
195 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner
|
196 |
* @param string $user The new owner user name
|
@@ -217,7 +217,7 @@ class Filesystem
|
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
-
* Change the group of an array of files or directories
|
221 |
*
|
222 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group
|
223 |
* @param string $group The group name
|
@@ -297,7 +297,7 @@ class Filesystem
|
|
297 |
if (true !== @symlink($originDir, $targetDir)) {
|
298 |
$report = error_get_last();
|
299 |
if (is_array($report)) {
|
300 |
-
if (
|
301 |
throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
|
302 |
}
|
303 |
}
|
@@ -308,7 +308,7 @@ class Filesystem
|
|
308 |
}
|
309 |
|
310 |
/**
|
311 |
-
* Given an existing path, convert it to a path relative to a given starting path
|
312 |
*
|
313 |
* @param string $endPath Absolute path of target
|
314 |
* @param string $startPath Absolute path where traversal begins
|
@@ -318,7 +318,7 @@ class Filesystem
|
|
318 |
public function makePathRelative($endPath, $startPath)
|
319 |
{
|
320 |
// Normalize separators on Windows
|
321 |
-
if (
|
322 |
$endPath = strtr($endPath, '\\', '/');
|
323 |
$startPath = strtr($startPath, '\\', '/');
|
324 |
}
|
@@ -408,7 +408,7 @@ class Filesystem
|
|
408 |
}
|
409 |
} else {
|
410 |
if (is_link($file)) {
|
411 |
-
$this->symlink($file->
|
412 |
} elseif (is_dir($file)) {
|
413 |
$this->mkdir($target);
|
414 |
} elseif (is_file($file)) {
|
32 |
* @param string $targetFile The target filename
|
33 |
* @param bool $override Whether to override an existing file or not
|
34 |
*
|
35 |
+
* @throws FileNotFoundException When originFile doesn't exist
|
36 |
+
* @throws IOException When copy fails
|
37 |
*/
|
38 |
public function copy($originFile, $targetFile, $override = false)
|
39 |
{
|
154 |
}
|
155 |
} else {
|
156 |
// https://bugs.php.net/bug.php?id=52176
|
157 |
+
if ('\\' === DIRECTORY_SEPARATOR && is_dir($file)) {
|
158 |
if (true !== @rmdir($file)) {
|
159 |
throw new IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
|
160 |
}
|
190 |
}
|
191 |
|
192 |
/**
|
193 |
+
* Change the owner of an array of files or directories.
|
194 |
*
|
195 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change owner
|
196 |
* @param string $user The new owner user name
|
217 |
}
|
218 |
|
219 |
/**
|
220 |
+
* Change the group of an array of files or directories.
|
221 |
*
|
222 |
* @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to change group
|
223 |
* @param string $group The group name
|
297 |
if (true !== @symlink($originDir, $targetDir)) {
|
298 |
$report = error_get_last();
|
299 |
if (is_array($report)) {
|
300 |
+
if ('\\' === DIRECTORY_SEPARATOR && false !== strpos($report['message'], 'error code(1314)')) {
|
301 |
throw new IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
|
302 |
}
|
303 |
}
|
308 |
}
|
309 |
|
310 |
/**
|
311 |
+
* Given an existing path, convert it to a path relative to a given starting path.
|
312 |
*
|
313 |
* @param string $endPath Absolute path of target
|
314 |
* @param string $startPath Absolute path where traversal begins
|
318 |
public function makePathRelative($endPath, $startPath)
|
319 |
{
|
320 |
// Normalize separators on Windows
|
321 |
+
if ('\\' === DIRECTORY_SEPARATOR) {
|
322 |
$endPath = strtr($endPath, '\\', '/');
|
323 |
$startPath = strtr($startPath, '\\', '/');
|
324 |
}
|
408 |
}
|
409 |
} else {
|
410 |
if (is_link($file)) {
|
411 |
+
$this->symlink($file->getRealPath(), $target);
|
412 |
} elseif (is_dir($file)) {
|
413 |
$this->mkdir($target);
|
414 |
} elseif (is_file($file)) {
|
lib/Symfony/Component/Filesystem/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
Copyright (c) 2004-
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
1 |
+
Copyright (c) 2004-2015 Fabien Potencier
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
of this software and associated documentation files (the "Software"), to deal
|
lib/Symfony/Component/Filesystem/phpunit.xml.dist
CHANGED
@@ -6,6 +6,10 @@
|
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
|
|
|
|
|
|
|
|
9 |
<testsuites>
|
10 |
<testsuite name="Symfony Filesystem Component Test Suite">
|
11 |
<directory>./Tests/</directory>
|
6 |
colors="true"
|
7 |
bootstrap="vendor/autoload.php"
|
8 |
>
|
9 |
+
<php>
|
10 |
+
<!-- Silence E_USER_DEPRECATED (-16385 == -1 & ~E_USER_DEPRECATED) -->
|
11 |
+
<ini name="error_reporting" value="-16385"/>
|
12 |
+
</php>
|
13 |
<testsuites>
|
14 |
<testsuite name="Symfony Filesystem Component Test Suite">
|
15 |
<directory>./Tests/</directory>
|
package.xml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<package><name>Bitpay_Core</name><version>2.1.1</version><stability>stable</stability><license uri="https://github.com/bitpay/magento-plugin/blob/master/LICENSE">MIT</license><channel>community</channel><extends/><summary/><description/><notes/><authors><author><name>Integrations Team</name><user>BitPayInc</user><email>support@bitpay.com</email></author></authors><date>2014-12-11</date><time>17:52:24</time><compatible/><dependencies/><required php_min="5.4.0" php_max="6.0.0">php</required><extensions><name>openssl<min/><max/></name><name>mcrypt<min/><max/></name></extensions><contents><target name="mage"><dir name="app"><dir name="design"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="form"><file name="bitpay.phtml" hash="e672ef8c02b000293cb04febfdbb3f26"/></dir><file name="iframe.phtml" hash="fcff11f0d6090b5dacb839257c40802a"/><dir name="info"><file name="default.phtml" hash="8ccc37fb65b7ffd9bb93bfffaed4460c"/></dir><file name="json.phtml" hash="cc43e25d0445d5ba15b448ba946dabfd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="info"><file name="default.phtml" hash="647029fe9f25cd398346b98a39526a5e"/></dir><dir name="system"><dir name="config"><dir name="field"><file name="header.phtml" hash="8f82364aa99736ef33499aa1162c0176"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Bitpay_Core.xml" hash="d59f55b764493144419eccae1b52eb1d"/></dir></dir><dir name="locale"><dir name="en_US"><file name="Bitpay_Core.csv" hash="1f6198bdeee3f77f87c36b4e09b45be2"/></dir></dir><dir name="code"><dir name="community"><dir name="Bitpay"><dir name="Core"><dir name="controllers"><file name="IpnController.php" hash="f53cb748646056ac13fa0542dcbda450"/><file name="IndexController.php" hash="e91b49bf2141492d1b9b12e03723ed04"/></dir><dir name="Block"><dir name="Form"><file name="Bitpay.php" hash="a720aec5391c0c9cfa9a84239b4d0165"/></dir><file name="Iframe.php" hash="1adec7fac67f9e5448536bf019fc0d51"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Header.php" hash="115fbc1b966ecc9ad52a2afaf0170947"/><file name="Extension.php" hash="80b5a2837b0077cc1d349a7a1a532ef8"/></dir></dir></dir></dir></dir><file name="Info.php" hash="e08b38ba2bc75441fc485f98ebea76b9"/></dir><file name="README.md" hash="e33d856153a0d0b501e5e17a926cc59c"/><dir name="etc"><file name="adminhtml.xml" hash="a3d6e1c3fb81e271a85260aba4f9f797"/><file name="config.xml" hash="5d131d785a389615421b279796ac2aa3"/><file name="system.xml" hash="177a038d50021efd72ca536968989a9f"/></dir><file name="LICENSE" hash="c443b0598a4770735bb68838f7d563a3"/><dir name="sql"><dir name="bitpay_setup"><file name="mysql4-install-2.0.0.php" hash="dbc4ded8c37cf1fdc798fe24f259ae1e"/></dir></dir><dir name="Model"><file name="TransactionSpeed.php" hash="14f2bec5848c3be13f1d01420dbf1108"/><file name="Network.php" hash="f5b26b26c9e37e8c0afa017c61aa02a2"/><file name="Status.php" hash="36c5b681659bd5a44bd2a7f8fdf86eef"/><dir name="Mysql4"><dir name="Ipn"><file name="Collection.php" hash="5731cf9f07a7542a5fb7c357713b1415"/></dir><file name="Invoice.php" hash="09eef9e9eb8fd73a0e0991f0b06ed8f7"/><dir name="Invoice"><file name="Collection.php" hash="9f133b3a850ed81ee2b10afddaa8f192"/></dir><file name="Ipn.php" hash="c4d06de91130340c90e2b823d3221e98"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b7bb6c723c948626da6a2af91ca6ce1b"/></dir></dir><file name="Observer.php" hash="06e346a10c702ccbac7e6c694f3680c2"/><file name="Invoice.php" hash="54a93e232a7ffbb75cc294d06b15b31e"/><dir name="Method"><file name="Bitcoin.php" hash="b84637450f3f3f7947efba732218cb35"/></dir><file name="Ipn.php" hash="10cdfe78efea3eb9e6776b35f48acc9d"/><dir name="Config"><file name="PairingCode.php" hash="4134601160d1351d3ef37175094e5e44"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e954c8dd36a10f6adb098dab3c0fa70c"/></dir></dir></dir></dir></dir></dir><dir name="lib"><dir name="Bitpay"><file name="Token.php" hash="8440fcdcbf7d20d8bda3e7ee7e6ad73f"/><dir name="Client"><file name="Request.php" hash="fbdd615774ab606df4062b3874c03496"/><dir name="Adapter"><file name="ca-bundle.crt" hash="9025ca14554240fc05c4e919ae3f8923"/><file name="AdapterInterface.php" hash="b85307a1bd110c08141a7eb29b305973"/><file name="CurlAdapter.php" hash="bbaa12cd6f55dc11f8592be6afca2e1b"/></dir><file name="Response.php" hash="195796fb21d235e1348caca2a990910d"/><file name="ResponseInterface.php" hash="1d53f3b84efc12e370c72ac7be0e8211"/><file name="RequestInterface.php" hash="1a77530dddf63f24a78ce488c401f499"/><file name="ClientInterface.php" hash="365b7a595eb15705bd4bd88273d10293"/><file name="Client.php" hash="958f19ff3a204c8b7f0731249c6c7fbe"/></dir><dir name="Storage"><file name="EncryptedFilesystemStorage.php" hash="e42a3c81bd19393ae78c10fed77dfb75"/><file name="MagentoStorage.php" hash="3066b70d4ecad0da42efba88ede524aa"/><file name="StorageInterface.php" hash="bb136e52d599fdb59739f32d027a1602"/><file name="FilesystemStorage.php" hash="673528691f5b999fc5481ff112140dfe"/><file name="MockStorage.php" hash="2570dbf74083bb8a7117595a6c4aefb4"/></dir><file name="AccessTokenInterface.php" hash="57b7b403c1644dba10474d67b3b781ca"/><file name="Currency.php" hash="bcb762551a0dcbcb5aa8ce013e83eedc"/><file name="KeyInterface.php" hash="30253c1e42ee7b452bbb0a7451c88685"/><file name="ItemInterface.php" hash="94e9fc64fafde84425cb30f73b96dc48"/><file name="PointInterface.php" hash="2a8fce4bbc8e84e221563c27ce7b57ce"/><file name="Point.php" hash="605d50d4b9890f2e1a3120fb5b0c50d2"/><dir name="Util"><file name="CurveParameterInterface.php" hash="72ca86056b4abfebbcfec87037478db7"/><file name="Base58.php" hash="544526f4f89848bfb61f7bfcae348af6"/><file name="Fingerprint.php" hash="0dde9668583a04391a2faf99d4b72914"/><file name="SecureRandom.php" hash="9e699a6e383cb439a604f6e6e1837833"/><file name="Util.php" hash="50d3eaeb02b2ad1652ebb15db1e68563"/><file name="Error.php" hash="d4e4ba021b73f94467793043db14cc93"/><file name="Secp256k1.php" hash="84d9a363e0f185200664c712832b8759"/></dir><file name="PayoutInstruction.php" hash="ef96db181023671aecac43950b709001"/><file name="Bitpay.php" hash="50120aeed758c3acb3bebfc4b202f168"/><file name="ApplicationInterface.php" hash="8721d3fe85f80dbf71ead7df93eb3f82"/><file name="InvoiceInterface.php" hash="1e280dbf85d96ad462b47c087fbe6d9f"/><file name="Payout.php" hash="ca73c1f0a81a642ed0a6fed6fd1002c1"/><file name="SinKey.php" hash="f126c1344247e87aa5c108d57f0ca354"/><file name="UserInterface.php" hash="7714dd84ab21eac77736a80d9e19f7c0"/><file name="Bill.php" hash="d41fc149de27e026546cda7db6c060cb"/><file name="Application.php" hash="832324bd621f53ac57d5d4d04ecf4e1c"/><dir name="Math"><file name="EngineInterface.php" hash="a0de5260325608e0911d4128fe3e52c2"/><file name="BcEngine.php" hash="cf0ccc0f167fe563d06fa9bd5d94cc7d"/><file name="Math.php" hash="98fb61ecc9379c625c9b970df7e0ac54"/><file name="GmpEngine.php" hash="8d7dc45a36229dc49dbf4cc9c2362286"/></dir><file name="BillInterface.php" hash="4d4f7c1e6b8ea9421a5e6651c7bd0654"/><file name="User.php" hash="061f9f4dcff8d3090cb358ae1b87e259"/><file name="Buyer.php" hash="aa43ea51f57b00568e3827d1e7ba2025"/><file name="PrivateKey.php" hash="d3e6ec3b5c91eb9627509365b26fb744"/><file name="Autoloader.php" hash="109400039e04ef345ac879a944fe45ba"/><file name="PublicKey.php" hash="dca40e9a5e8679f21d143d205cd2c389"/><dir name="Crypto"><file name="McryptExtension.php" hash="160e7e94e6ec50b255742bb5366dea29"/><file name="HashExtension.php" hash="62f5d49ddafbc7e7ca19aaaea76830ba"/><file name="CryptoInterface.php" hash="13ac34aa5f26fe5640c037511c7789f4"/><file name="OpenSSLExtension.php" hash="e8393638871fc2605dbd6ec58e7a7564"/></dir><file name="TokenInterface.php" hash="a0da969c86e363b201cc48c0a228ebed"/><file name="BuyerInterface.php" hash="749f9fc623ff65e5bce296a5b4dfdbbc"/><file name="PayoutTransaction.php" hash="80ed69aae8134c32caddbfd8e17a85e3"/><file name="Invoice.php" hash="f93959d593e54c30f01ccae85f521168"/><dir name="Network"><file name="Customnet.php" hash="d2af606a4a63babf0a08d0e8abac72f5"/><file name="Livenet.php" hash="7107f34a87978e78588482e5b1f868d4"/><file name="NetworkAwareInterface.php" hash="1d1f87d25469a8ce2d0f1f2eaaf03ef1"/><file name="NetworkInterface.php" hash="998b026f803b4d99daec03b876d2d132"/><file name="NetworkAware.php" hash="d92aad1b38105078cd5055b295014a11"/><file name="Testnet.php" hash="98b315759b32549c558e143e50a365ad"/></dir><file name="PayoutTransactionInterface.php" hash="43a42bf47814d44b431328b5e70731a4"/><file name="Key.php" hash="0c6bdce34e7b3a650914393c9da5c99d"/><file name="CurrencyInterface.php" hash="561ff6c529ab29813e751999e70fb166"/><file name="KeyManager.php" hash="ad48cd3f5ddba0c47606659a32e85e7b"/><dir name="DependencyInjection"><dir name="Loader"><file name="ArrayLoader.php" hash="5176febbc2ff9bf1646f623dccd54cd7"/></dir><file name="BitpayExtension.php" hash="fc361f93a85be0b066dd1a60bb5d4a15"/><file name="services.xml" hash="cda4e79bf0e6f6821e5b4c2e16c240cb"/></dir><file name="PayoutInterface.php" hash="5fe5e08a395d2179e64baa3364ff512c"/><file name="PayoutInstructionInterface.php" hash="5d6c51b0b6a980d84bfad21ecaecf92c"/><file name="Item.php" hash="2f320697b5e4b93697d43e9b1ef0dfd7"/><file name="AccessToken.php" hash="dd33ed2e4802be42097c3c09e0d12b63"/><dir name="Config"><file name="Configuration.php" hash="7cb0441f0dce52bab9f30f0cc3dee2fa"/></dir></dir><dir name="Symfony"><dir name="Component"><dir name="Filesystem"><file name="Filesystem.php" hash="edb49d36e815cf4ce917d94ec97b4f0c"/><file name="composer.json" hash="d685adc2374ea7ec68ebb150e6e69d7c"/><file name="CHANGELOG.md" hash="1537577578897cb0d5702f346fae3c82"/><file name="phpunit.xml.dist" hash="e4529d07bfbb4b93cf7115435a20de00"/><dir name="Exception"><file name="IOException.php" hash="79569770a034723c06472d45b57d74da"/><file name="IOExceptionInterface.php" hash="9ce81ced7d137497a4aa3639b2c445fe"/><file name="FileNotFoundException.php" hash="8a8b119b88f20a5a3078e051a308f741"/><file name="ExceptionInterface.php" hash="11a7d451ae71b6aeba9e1236a53865f0"/></dir><file name="README.md" hash="e499eea57ed2f13503b64641c0890418"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/></dir><dir name="DependencyInjection"><file name="Variable.php" hash="ed13f0022bf056748456b80c702dbe21"/><file name="composer.json" hash="7ba3739efbddb446a81690fd1d9519ec"/><dir name="Extension"><file name="PrependExtensionInterface.php" hash="0eea6361b5960d4ff58646b75864898f"/><file name="Extension.php" hash="ae958d857ad986bfa7ac7280f93309f4"/><file name="ConfigurationExtensionInterface.php" hash="91e7049535b88272b10235d421b515ae"/><file name="ExtensionInterface.php" hash="d9f5df364b37addf087305ce17842de9"/></dir><file name="Container.php" hash="55e374251b9a6b77f006be11afedd186"/><file name="ContainerInterface.php" hash="a0757378d7d6af1a83b39353fb6e0433"/><file name="TaggedContainerInterface.php" hash="3c47bde46b89617dcd69f4ebf5056865"/><dir name="Dumper"><file name="PhpDumper.php" hash="631503f37f14db170e56f74c86d4e136"/><file name="YamlDumper.php" hash="afce5af8be425e1a636faca889705489"/><file name="XmlDumper.php" hash="e20198ac9362bb0b401dee15644761ef"/><file name="GraphvizDumper.php" hash="1a322cf7994e091ee5f4fbc5dee172ac"/><file name="Dumper.php" hash="3b295c276bb774433a45f1ee0339a299"/><file name="DumperInterface.php" hash="b9dd1589f9ffac4366fd4148d9e78ade"/></dir><file name="CHANGELOG.md" hash="0316942313ddf17e8db0729defedc187"/><file name="ExpressionLanguage.php" hash="3eebc81d79682bdbfe5ce43980d2ab92"/><file name="DefinitionDecorator.php" hash="350c7c88d50274205f06db8c6363d944"/><file name="ContainerBuilder.php" hash="3b1cb5b5b565b32f68fcade60d973f26"/><dir name="Loader"><file name="FileLoader.php" hash="4327841db6a3761ad17e54553178cf28"/><file name="ClosureLoader.php" hash="e435524e4fe5c3bb374a9d89dcc4abcc"/><dir name="schema"><dir name="dic"><dir name="services"><file name="services-1.0.xsd" hash="8fdc942dfd53dfae77fef5e6fe565dd8"/></dir></dir></dir><file name="IniFileLoader.php" hash="7ea10963772ecf6f0c18fb04faead289"/><file name="XmlFileLoader.php" hash="02d6d28b68190ea6436e5700339f9dd2"/><file name="YamlFileLoader.php" hash="b20857baf643ec4ddf789dc7ff7ddfe3"/><file name="PhpFileLoader.php" hash="2cd10bb9323270c20e818347691d13d0"/></dir><file name="Parameter.php" hash="7b2faf5e73ce778720b67e94cf6d2bba"/><file name="phpunit.xml.dist" hash="feee5228ed5181328e2df056380ae84c"/><dir name="ParameterBag"><file name="ParameterBagInterface.php" hash="ef0511892d36e002bad1b86affec9b0a"/><file name="ParameterBag.php" hash="870224c3721e05e6617703e0b3ac200d"/><file name="FrozenParameterBag.php" hash="7a5a470e2d4ae055483c4370995ed030"/></dir><file name="Alias.php" hash="08d0c245ef3762be097338102e96debf"/><dir name="Exception"><file name="ParameterCircularReferenceException.php" hash="7b059f59730003361cceadd8965ad7c5"/><file name="OutOfBoundsException.php" hash="792b235a45e9f4c0c7a7280580b1a2a3"/><file name="InvalidArgumentException.php" hash="f1b09121e6850f5271d8bd3a6837efd3"/><file name="LogicException.php" hash="5b78b4f59982df23deaf0242aec3d4a9"/><file name="ScopeWideningInjectionException.php" hash="719ca3a89890fcb941cca1b16a0fafef"/><file name="InactiveScopeException.php" hash="9022cb0f19ecaf1198318f0c178c5264"/><file name="ServiceCircularReferenceException.php" hash="8ac40af4863b3c6cd9311cc1a29cf802"/><file name="ParameterNotFoundException.php" hash="6d83c2934f82a5ef7992b7081eaeffd7"/><file name="RuntimeException.php" hash="4e4d9c135fec917ae3fa78f25fbd7f85"/><file name="BadMethodCallException.php" hash="7881aa76d06f7b9e4bd45dc85ae0d52e"/><file name="ScopeCrossingInjectionException.php" hash="0d73336fcf6534c59887f8b5687d1bd6"/><file name="ServiceNotFoundException.php" hash="9785d054cb75a079dcecc97fc77a8ebb"/><file name="ExceptionInterface.php" hash="d79633abb224cffc0597be170aca74ea"/></dir><file name="ContainerAwareTrait.php" hash="304f3c4322c235b332992d829d68e50b"/><file name="README.md" hash="4a37dd76abb0d970c3c58030be21a993"/><file name="IntrospectableContainerInterface.php" hash="7577ca734861035a9f992c5d1a6be2b4"/><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><dir name="LazyProxy"><dir name="PhpDumper"><file name="NullDumper.php" hash="55c3aaf28d4107dd40fb2905ce91c692"/><file name="DumperInterface.php" hash="0ff96280df12f153aee121649615763f"/></dir><dir name="Instantiator"><file name="InstantiatorInterface.php" hash="2195bb770e5851fa1ebd680906ae112b"/><file name="RealServiceInstantiator.php" hash="f89b9132dd5853375551eb8347e8e51f"/></dir></dir><file name="ContainerAwareInterface.php" hash="b4bbd2a21e9afe2cd25d26c37c54bfa9"/><dir name="Compiler"><file name="RepeatedPass.php" hash="c61bdf647720f5b93874c9d123cd42aa"/><file name="CheckDefinitionValidityPass.php" hash="2b373903ccf9d566a6927aed6c3c6650"/><file name="PassConfig.php" hash="9173d4b56e1e0383fc40a5fc86077db1"/><file name="RemoveAbstractDefinitionsPass.php" hash="270937e454d381dae233d817e52069ec"/><file name="ResolveDefinitionTemplatesPass.php" hash="28318b7955b5e5dce88315b7c008a1b1"/><file name="Compiler.php" hash="14bcd46172f5ac3e022e1d8f4fe1b08c"/><file name="RepeatablePassInterface.php" hash="bee7b2336c610435c89fdc854101b604"/><file name="DecoratorServicePass.php" hash="058412adc061c83531b229a0e588295f"/><file name="CompilerPassInterface.php" hash="1292a88c9fadf67d117a659fb0bfd499"/><file name="ServiceReferenceGraph.php" hash="ee56e0a4fcdc016088e61c2d9afbfa80"/><file name="LoggingFormatter.php" hash="d18aa0d044d4725eaacd006c55b8e366"/><file name="ServiceReferenceGraphNode.php" hash="bed96bf3e9ad54306a37bbc45e884f2d"/><file name="CheckExceptionOnInvalidReferenceBehaviorPass.php" hash="69b6713e0ee778e9b2cad497a9082151"/><file name="RemoveUnusedDefinitionsPass.php" hash="e8e05577d6086ebe2b4251e665919489"/><file name="ServiceReferenceGraphEdge.php" hash="0e3f4ba1f08962ec73803a78f7a8c3f2"/><file name="ResolveParameterPlaceHoldersPass.php" hash="f33dfb27625ccb59d575de3fd0e3862f"/><file name="AnalyzeServiceReferencesPass.php" hash="77d48a44db3ac5428d50ec8ebf228cb3"/><file name="CheckCircularReferencesPass.php" hash="2b6f29700b6e8a7c12f4b1455f3f1627"/><file name="ResolveReferencesToAliasesPass.php" hash="29d8ba719ae7c1b2286083201664b4c5"/><file name="ResolveInvalidReferencesPass.php" hash="499e4e7357d1e565d334b146f3e05863"/><file name="MergeExtensionConfigurationPass.php" hash="8e74f04cb687ee9d86f90d0f1ddc2425"/><file name="CheckReferenceValidityPass.php" hash="f676fc1ca0c1761af99fe7d2d9395078"/><file name="ReplaceAliasByActualDefinitionPass.php" hash="0ece3d877daaabc8be38509d97752e2c"/><file name="InlineServiceDefinitionsPass.php" hash="eab7d43cb04a3252d731a5e8527eefc5"/><file name="RemovePrivateAliasesPass.php" hash="77d93353f41f2505251e003a33993f31"/></dir><file name="Scope.php" hash="d464293058a891542cef77f9e14e18b4"/><file name="ContainerAware.php" hash="4318c2ce4d160e6d183edce4928db696"/><file name="ScopeInterface.php" hash="b990c20640f9a64135bcf0369f4e22a6"/><file name="Reference.php" hash="7367f27d64a597705da4de9f3e91d2d4"/><file name="SimpleXMLElement.php" hash="41fe9a267150ceee2ac80c11156b863b"/><file name="Definition.php" hash="74311dc33c39183396e981fadebe41d8"/></dir><dir name="Config"><file name="FileLocatorInterface.php" hash="19f6ce347d97710e6e204f6072080d7f"/><file name="composer.json" hash="f811d1f0df9a5b256c16a7029dae9513"/><dir name="Util"><file name="XmlUtils.php" hash="58db59d5ad3b6664d4c664c1556f2755"/></dir><file name="CHANGELOG.md" hash="2e855ecea3b2fd176fcde9dcbee078b4"/><dir name="Loader"><file name="LoaderResolver.php" hash="fa0e5cf636fcb699349bc383ac1c58e4"/><file name="Loader.php" hash="ee72e1f5134967e385909103288f1f28"/><file name="LoaderInterface.php" hash="186d2f94152a27ccec52ef09dee3ff5b"/><file name="FileLoader.php" hash="5cf3b0ea85d4ec9c88347f2836e6829a"/><file name="LoaderResolverInterface.php" hash="b5b88cd457cd2722513763f34d91181f"/><file name="DelegatingLoader.php" hash="55f0bb12cab11e866f3b8dc990acfe44"/></dir><file name="FileLocator.php" hash="026635098bb87b0f3d9aa9db277372ea"/><file name="phpunit.xml.dist" hash="605cf1675c2d220c39f6c275855da588"/><dir name="Exception"><file name="FileLoaderImportCircularReferenceException.php" hash="b00d7fdeddee90ff6e91ffa0c0475e91"/><file name="FileLoaderLoadException.php" hash="c72ffdb8bb37fc40fb9c45d5bb7fea6c"/></dir><file name="README.md" hash="80fb119edb21de39ff671d640fc7f381"/><dir name="Definition"><file name="ConfigurationInterface.php" hash="3c993b6405debf926234927327e1540e"/><file name="BooleanNode.php" hash="35e38c75b51cdff67f3098103a791e44"/><file name="IntegerNode.php" hash="9ccc83daaba13a6119645846977462c1"/><file name="PrototypedArrayNode.php" hash="3d0baac9726afc546668ede050877690"/><dir name="Dumper"><file name="YamlReferenceDumper.php" hash="b3872d7001d6e2720a867a2bf09af371"/><file name="XmlReferenceDumper.php" hash="ff8ec25bb68fe90df74a0ad5ce81acf6"/></dir><file name="VariableNode.php" hash="3e4b560662b4c12afc027e67a7ccf286"/><file name="BaseNode.php" hash="63e11f9397fbab26d89c667d174f60c9"/><file name="ReferenceDumper.php" hash="52e870bf26dfc67c5cc508f35728877d"/><file name="NumericNode.php" hash="e1f6089157b5651cbcab6b672f3d40d5"/><dir name="Exception"><file name="DuplicateKeyException.php" hash="ede2ab4177afff995069bc54c4517f9e"/><file name="Exception.php" hash="a7eb222da39a7eefc7b0c04a1583cc44"/><file name="InvalidTypeException.php" hash="4dc25832f90b656b88da8ac50789784a"/><file name="InvalidConfigurationException.php" hash="df898eea27890a50cb912e1dbb88f1b2"/><file name="ForbiddenOverwriteException.php" hash="e2a12d6760feb9f7c96d61e502f68b2c"/><file name="UnsetKeyException.php" hash="55c97aa4e81643f04c3abd943cc29a24"/><file name="InvalidDefinitionException.php" hash="aeb2ca3c7e035486a4ccebeac363125c"/></dir><file name="PrototypeNodeInterface.php" hash="ef44def01e8a4abfa4eaabdab44a3e1e"/><file name="ScalarNode.php" hash="f132a3acf024a2e7fdbcf311900ac6cf"/><file name="ArrayNode.php" hash="684defea39e4aa1cd112eb9b81bc11cb"/><file name="EnumNode.php" hash="4718c796e11ef0403e41dce26b7224ea"/><file name="NodeInterface.php" hash="d4d5849e645f20a1da8585fc117c865b"/><dir name="Builder"><file name="ExprBuilder.php" hash="4612723b84cd2729dd94020f1412539a"/><file name="FloatNodeDefinition.php" hash="ea6a82bed9a7bfe2f7c7e4bded4ba25e"/><file name="ParentNodeDefinitionInterface.php" hash="ac0a6d2f8ae048f365844d761db049db"/><file name="EnumNodeDefinition.php" hash="2935ae381b785ced6f6ec1eded9a9ce0"/><file name="TreeBuilder.php" hash="48f136a2fe26ef3b84f2f4e785dafdca"/><file name="MergeBuilder.php" hash="5057c1e1846430d716f3bcb082a1f36a"/><file name="NodeBuilder.php" hash="11c167f7db0435c311dfab6b90960194"/><file name="NodeParentInterface.php" hash="511a0150b959a7eab00cbf0fed174c0a"/><file name="NumericNodeDefinition.php" hash="5432ea41087e28803130a9cbe74e4356"/><file name="IntegerNodeDefinition.php" hash="0de24b6c3b0846189e0e7140340e4c20"/><file name="NodeDefinition.php" hash="9b97f7f23dc5c957e7ab16bcc6defd6c"/><file name="NormalizationBuilder.php" hash="f03726ad2acc69648e3f4c92c3436b63"/><file name="ValidationBuilder.php" hash="8c0ab61f8ce4e8a0b95fae338d07289d"/><file name="ScalarNodeDefinition.php" hash="d9fa4186f4448c3cad8152bb9b08a10d"/><file name="BooleanNodeDefinition.php" hash="3241b942a983dc282827a75fe4bbe666"/><file name="VariableNodeDefinition.php" hash="b2d76649ce3c123cbd3488fd7b449b71"/><file name="ArrayNodeDefinition.php" hash="21e3f5e637dd4a2bc46cda050c6e2245"/></dir><file name="Processor.php" hash="4d853174c3a8b201b3684fd8cdc5b768"/><file name="FloatNode.php" hash="7dfded8c4692130fc554b4078fb50f60"/></dir><dir name="Resource"><file name="ResourceInterface.php" hash="8f062b489e002da9b8c9fedde7686f53"/><file name="FileResource.php" hash="67e90b9f2144af1021feef854ed138f4"/><file name="DirectoryResource.php" hash="6920b0a4fcff8b6499ea3a12d2c6ac6c"/></dir><file name="LICENSE" hash="09ce405e925cdeb923da1789121864c7"/><file name="ConfigCache.php" hash="42fe66cd64cd32ea55cefd056c7a1b67"/></dir></dir></dir></dir></target></contents></package>
|
1 |
<?xml version="1.0"?>
|
2 |
+
<package><name>Bitpay_Core</name><version>2.1.2</version><stability>stable</stability><license uri="https://github.com/bitpay/magento-plugin/blob/master/LICENSE">MIT</license><channel>community</channel><extends/><summary/><description/><notes/><authors><author><name>Integrations Team</name><user>BitPayInc</user><email>support@bitpay.com</email></author></authors><date>2015-01-14</date><time>14:39:06</time><compatible/><dependencies/><required php_min="5.4.0" php_max="6.0.0">php</required><extensions><name>openssl<min/><max/></name><name>mcrypt<min/><max/></name></extensions><contents><target name="mage"><dir name="app"><dir name="locale"><dir name="en_US"><file name="Bitpay_Core.csv" hash="1f6198bdeee3f77f87c36b4e09b45be2"/></dir></dir><dir name="code"><dir name="community"><dir name="Bitpay"><dir name="Core"><dir name="controllers"><file name="IndexController.php" hash="cccb8e613c6ddbc102c3f194d10bc17b"/><file name="IpnController.php" hash="1b24021e7cefc71fa3bd4211155ac1b2"/></dir><dir name="Helper"><file name="Data.php" hash="a3ec244ea664da05b7c4ad84f29c1be8"/></dir><dir name="Block"><file name="Iframe.php" hash="4e30275678e7f53ee474ec4beeaa23c9"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Extension.php" hash="ce9dd3c24d090a4f3ecd10f0488eb635"/><file name="Header.php" hash="a1a0f427bfacfda6375acd345696262a"/></dir></dir></dir></dir></dir><file name="Info.php" hash="3c8ca079710e5b8e5d176a0c15383400"/><dir name="Form"><file name="Bitpay.php" hash="c071d4a4f56b2c5cebaad25d21ad0645"/></dir></dir><dir name="Model"><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="b7bb6c723c948626da6a2af91ca6ce1b"/></dir></dir><file name="Observer.php" hash="7aff74761b0df271cb42c38be29316b5"/><file name="Network.php" hash="b9e46a0a056d758d37d50b6e078b7f8a"/><dir name="Method"><file name="Bitcoin.php" hash="090244442578d5eee1949de4e1a28d8e"/></dir><file name="TransactionSpeed.php" hash="7c3f5dd65fdc4838224c14bf050b4d0d"/><dir name="Config"><file name="PairingCode.php" hash="10c5ed0378e7ca8f0a46dd0529898830"/></dir><file name="Invoice.php" hash="39336ff3cb1e4478c13bdf8a4f50b895"/><dir name="Mysql4"><dir name="Ipn"><file name="Collection.php" hash="5731cf9f07a7542a5fb7c357713b1415"/></dir><file name="Invoice.php" hash="09eef9e9eb8fd73a0e0991f0b06ed8f7"/><dir name="Invoice"><file name="Collection.php" hash="9f133b3a850ed81ee2b10afddaa8f192"/></dir><file name="Ipn.php" hash="c4d06de91130340c90e2b823d3221e98"/></dir><file name="Status.php" hash="f54b852c353206667262d11a1ca419a8"/><file name="Ipn.php" hash="10cdfe78efea3eb9e6776b35f48acc9d"/></dir><dir name="etc"><file name="config.xml" hash="5d131d785a389615421b279796ac2aa3"/><file name="system.xml" hash="292e163d31c53b3586f9f319f236ff47"/><file name="adminhtml.xml" hash="a3d6e1c3fb81e271a85260aba4f9f797"/></dir><dir name="sql"><dir name="bitpay_setup"><file name="mysql4-install-2.0.0.php" hash="dbc4ded8c37cf1fdc798fe24f259ae1e"/></dir></dir></dir></dir></dir></dir><dir name="design"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="info"><file name="default.phtml" hash="7e31f22f964ccbbbdcd71504c60e0393"/></dir><dir name="system"><dir name="config"><dir name="field"><file name="header.phtml" hash="971ec034699d110f7842a2c8befb4c55"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="bitpay.xml" hash="c7e3886904c20f44b58409968c4209f0"/></dir><dir name="template"><dir name="bitpay"><dir name="form"><file name="bitpay.phtml" hash="c12ef983014d5a73906502d2031108e2"/></dir><dir name="info"><file name="default.phtml" hash="a3bd6e183052b9d9181aaf96accfa42e"/></dir><file name="iframe.phtml" hash="84892655b0e807e905251b8763850bae"/><file name="json.phtml" hash="cc43e25d0445d5ba15b448ba946dabfd"/></dir></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Bitpay_Core.xml" hash="122aa83102518a01122aaddcafa8ea7f"/></dir></dir></dir><dir name="lib"><dir name="Symfony"><dir name="Component"><dir name="DependencyInjection"><file name="ContainerBuilder.php" hash="81ff255a4f4c85f2ccd1733e6597e0a9"/><file name="SimpleXMLElement.php" hash="41fe9a267150ceee2ac80c11156b863b"/><dir name="Extension"><file name="ExtensionInterface.php" hash="d9f5df364b37addf087305ce17842de9"/><file name="Extension.php" hash="ae958d857ad986bfa7ac7280f93309f4"/><file name="PrependExtensionInterface.php" hash="0eea6361b5960d4ff58646b75864898f"/><file name="ConfigurationExtensionInterface.php" hash="a1cbab69d6a97cd38a1e4e705779f905"/></dir><file name="Alias.php" hash="08d0c245ef3762be097338102e96debf"/><file name="TaggedContainerInterface.php" hash="3c47bde46b89617dcd69f4ebf5056865"/><file name="ScopeInterface.php" hash="b990c20640f9a64135bcf0369f4e22a6"/><file name="phpunit.xml.dist" hash="65fadd262f9e2cc93a3aad45d1f341e1"/><dir name="LazyProxy"><dir name="Instantiator"><file name="InstantiatorInterface.php" hash="2195bb770e5851fa1ebd680906ae112b"/><file name="RealServiceInstantiator.php" hash="f89b9132dd5853375551eb8347e8e51f"/></dir><dir name="PhpDumper"><file name="DumperInterface.php" hash="0ff96280df12f153aee121649615763f"/><file name="NullDumper.php" hash="55c3aaf28d4107dd40fb2905ce91c692"/></dir></dir><file name="ExpressionLanguage.php" hash="3eebc81d79682bdbfe5ce43980d2ab92"/><file name="ContainerInterface.php" hash="8028901dbade81edc95d8e9a1f922478"/><file name="Scope.php" hash="d464293058a891542cef77f9e14e18b4"/><file name="IntrospectableContainerInterface.php" hash="3b4b46eeef76d72b9d356385d6576830"/><file name="Container.php" hash="7f09cfb0a513941003e3de7b16e70c09"/><file name="Parameter.php" hash="7b2faf5e73ce778720b67e94cf6d2bba"/><file name="ContainerAwareTrait.php" hash="304f3c4322c235b332992d829d68e50b"/><file name="Reference.php" hash="e16a543b515f15d9c0b1ef505c50b95c"/><dir name="Exception"><file name="ScopeWideningInjectionException.php" hash="719ca3a89890fcb941cca1b16a0fafef"/><file name="InactiveScopeException.php" hash="9022cb0f19ecaf1198318f0c178c5264"/><file name="BadMethodCallException.php" hash="7881aa76d06f7b9e4bd45dc85ae0d52e"/><file name="ServiceNotFoundException.php" hash="9785d054cb75a079dcecc97fc77a8ebb"/><file name="RuntimeException.php" hash="4e4d9c135fec917ae3fa78f25fbd7f85"/><file name="LogicException.php" hash="5b78b4f59982df23deaf0242aec3d4a9"/><file name="OutOfBoundsException.php" hash="792b235a45e9f4c0c7a7280580b1a2a3"/><file name="ExceptionInterface.php" hash="d79633abb224cffc0597be170aca74ea"/><file name="ServiceCircularReferenceException.php" hash="8ac40af4863b3c6cd9311cc1a29cf802"/><file name="ParameterNotFoundException.php" hash="6d83c2934f82a5ef7992b7081eaeffd7"/><file name="InvalidArgumentException.php" hash="f1b09121e6850f5271d8bd3a6837efd3"/><file name="ParameterCircularReferenceException.php" hash="7b059f59730003361cceadd8965ad7c5"/><file name="ScopeCrossingInjectionException.php" hash="0d73336fcf6534c59887f8b5687d1bd6"/></dir><file name="CHANGELOG.md" hash="0316942313ddf17e8db0729defedc187"/><file name="LICENSE" hash="56dedd4bd25ecd034ac4e1c17ebba0cc"/><file name="Definition.php" hash="b21fa974c7447f00b8444316abe9204f"/><file name="Variable.php" hash="0709a98930af173c2089f972b050ee1b"/><dir name="Compiler"><file name="Compiler.php" hash="14bcd46172f5ac3e022e1d8f4fe1b08c"/><file name="ResolveParameterPlaceHoldersPass.php" hash="f33dfb27625ccb59d575de3fd0e3862f"/><file name="RepeatedPass.php" hash="466e5e4ae231a2231d122823e5d16915"/><file name="ReplaceAliasByActualDefinitionPass.php" hash="0ece3d877daaabc8be38509d97752e2c"/><file name="ServiceReferenceGraphEdge.php" hash="4656ff2d6ccca2540a440d4bdecc2347"/><file name="DecoratorServicePass.php" hash="c42f097de100864a185ef1c021a510f6"/><file name="CheckExceptionOnInvalidReferenceBehaviorPass.php" hash="0a061122dcf50fc4b8da961e04400b9d"/><file name="PassConfig.php" hash="b9d66fce6ec1e4357d0d4e945aa3f93c"/><file name="AnalyzeServiceReferencesPass.php" hash="77d48a44db3ac5428d50ec8ebf228cb3"/><file name="RepeatablePassInterface.php" hash="bee7b2336c610435c89fdc854101b604"/><file name="ResolveInvalidReferencesPass.php" hash="499e4e7357d1e565d334b146f3e05863"/><file name="ServiceReferenceGraph.php" hash="ee56e0a4fcdc016088e61c2d9afbfa80"/><file name="CheckDefinitionValidityPass.php" hash="2b373903ccf9d566a6927aed6c3c6650"/><file name="CompilerPassInterface.php" hash="853eace86233ce23e4d0f8b89736d173"/><file name="CheckReferenceValidityPass.php" hash="2ec0cc8f8f771e30708d83b66405290b"/><file name="RemoveUnusedDefinitionsPass.php" hash="e8e05577d6086ebe2b4251e665919489"/><file name="ServiceReferenceGraphNode.php" hash="730f73ae4d86383fafa160264a474dfe"/><file name="LoggingFormatter.php" hash="d18aa0d044d4725eaacd006c55b8e366"/><file name="RemoveAbstractDefinitionsPass.php" hash="50373c5ff2ab6b3b540bd76036b8a3aa"/><file name="MergeExtensionConfigurationPass.php" hash="4252a3ea826e1423e66377c81dd12ae9"/><file name="InlineServiceDefinitionsPass.php" hash="eab7d43cb04a3252d731a5e8527eefc5"/><file name="ResolveDefinitionTemplatesPass.php" hash="30cabb0ccd2b9569d3ded2b4ebeb93a8"/><file name="CheckCircularReferencesPass.php" hash="529a03d3c6ac37bf5f37d2f05984353a"/><file name="ResolveReferencesToAliasesPass.php" hash="29d8ba719ae7c1b2286083201664b4c5"/><file name="RemovePrivateAliasesPass.php" hash="3ab8d8e151db2b5fd88819fa57f2308a"/></dir><file name="ContainerAwareInterface.php" hash="b4bbd2a21e9afe2cd25d26c37c54bfa9"/><dir name="Loader"><file name="PhpFileLoader.php" hash="2cd10bb9323270c20e818347691d13d0"/><file name="IniFileLoader.php" hash="7ea10963772ecf6f0c18fb04faead289"/><file name="YamlFileLoader.php" hash="fa1b8024ce6d9867fbf7f5135a0dbce6"/><file name="FileLoader.php" hash="4327841db6a3761ad17e54553178cf28"/><file name="XmlFileLoader.php" hash="e921b5607467cb4719e8e2bcb0349c66"/><file name="ClosureLoader.php" hash="e435524e4fe5c3bb374a9d89dcc4abcc"/><dir name="schema"><dir name="dic"><dir name="services"><file name="services-1.0.xsd" hash="8fdc942dfd53dfae77fef5e6fe565dd8"/></dir></dir></dir></dir><file name="DefinitionDecorator.php" hash="088ef975cd93b71b1118f29a4894bc3a"/><file name="ContainerAware.php" hash="4318c2ce4d160e6d183edce4928db696"/><dir name="ParameterBag"><file name="ParameterBag.php" hash="fb6f40da7f38cc4a3d636dc09ff7fd07"/><file name="ParameterBagInterface.php" hash="9c29ec4f6769f64eacd57633b62605ff"/><file name="FrozenParameterBag.php" hash="7a5a470e2d4ae055483c4370995ed030"/></dir><dir name="Dumper"><file name="DumperInterface.php" hash="b9dd1589f9ffac4366fd4148d9e78ade"/><file name="Dumper.php" hash="3b295c276bb774433a45f1ee0339a299"/><file name="GraphvizDumper.php" hash="95e156fafea46747f4a4a38b85faf943"/><file name="XmlDumper.php" hash="0834804e82bbba5658b4f3cb0294c5af"/><file name="YamlDumper.php" hash="5940848c7422f7ff0ece71f91bf9ec1a"/><file name="PhpDumper.php" hash="7b1e05faeeb6c013b4a2647439a4679a"/></dir><file name="composer.json" hash="134f706fbc63147624e46136a8fa0213"/><file name="README.md" hash="4a37dd76abb0d970c3c58030be21a993"/></dir><dir name="Config"><dir name="Resource"><file name="ResourceInterface.php" hash="8f062b489e002da9b8c9fedde7686f53"/><file name="DirectoryResource.php" hash="0dd51e1fce277a9dac05d77eb98553dc"/><file name="FileResource.php" hash="67e90b9f2144af1021feef854ed138f4"/></dir><file name="phpunit.xml.dist" hash="c794a91aae05def17fb44431cb4fca84"/><dir name="Exception"><file name="FileLoaderLoadException.php" hash="c72ffdb8bb37fc40fb9c45d5bb7fea6c"/><file name="FileLoaderImportCircularReferenceException.php" hash="59c5c886c2d0230703a6a8ebc47541af"/></dir><file name="ConfigCache.php" hash="42fe66cd64cd32ea55cefd056c7a1b67"/><file name="CHANGELOG.md" hash="2e855ecea3b2fd176fcde9dcbee078b4"/><file name="LICENSE" hash="56dedd4bd25ecd034ac4e1c17ebba0cc"/><dir name="Definition"><file name="PrototypedArrayNode.php" hash="4ea0d7cac936058397a02b4d1b24abd6"/><file name="BooleanNode.php" hash="35e38c75b51cdff67f3098103a791e44"/><file name="VariableNode.php" hash="f11fea9a1fe9fe3ebf5aaaad541faca8"/><file name="BaseNode.php" hash="4e1c72481d5d85f9347494885976831a"/><file name="Processor.php" hash="4d853174c3a8b201b3684fd8cdc5b768"/><file name="ScalarNode.php" hash="f132a3acf024a2e7fdbcf311900ac6cf"/><file name="ConfigurationInterface.php" hash="2715dbdacacd877e377fbdbd4ad1ec90"/><file name="EnumNode.php" hash="4718c796e11ef0403e41dce26b7224ea"/><dir name="Exception"><file name="InvalidConfigurationException.php" hash="df898eea27890a50cb912e1dbb88f1b2"/><file name="UnsetKeyException.php" hash="55c97aa4e81643f04c3abd943cc29a24"/><file name="InvalidDefinitionException.php" hash="aeb2ca3c7e035486a4ccebeac363125c"/><file name="Exception.php" hash="663baaeb8e61e07fa5a9ad4274686d53"/><file name="ForbiddenOverwriteException.php" hash="e2a12d6760feb9f7c96d61e502f68b2c"/><file name="InvalidTypeException.php" hash="4dc25832f90b656b88da8ac50789784a"/><file name="DuplicateKeyException.php" hash="ede2ab4177afff995069bc54c4517f9e"/></dir><file name="NodeInterface.php" hash="6f9786dc687247c82fe66f20030d3045"/><file name="IntegerNode.php" hash="9ccc83daaba13a6119645846977462c1"/><file name="PrototypeNodeInterface.php" hash="ef44def01e8a4abfa4eaabdab44a3e1e"/><file name="FloatNode.php" hash="7dfded8c4692130fc554b4078fb50f60"/><file name="ReferenceDumper.php" hash="52e870bf26dfc67c5cc508f35728877d"/><file name="NumericNode.php" hash="75d9c7fc5aa9188383c41a3b9db09ba9"/><file name="ArrayNode.php" hash="410683e3bc07db7398694b96d919c878"/><dir name="Dumper"><file name="XmlReferenceDumper.php" hash="ff8ec25bb68fe90df74a0ad5ce81acf6"/><file name="YamlReferenceDumper.php" hash="b3872d7001d6e2720a867a2bf09af371"/></dir><dir name="Builder"><file name="NumericNodeDefinition.php" hash="5432ea41087e28803130a9cbe74e4356"/><file name="ExprBuilder.php" hash="00801f867f745d41e276e503fcc91422"/><file name="NodeBuilder.php" hash="7693aa48110f594cf10b5cff5961fe1c"/><file name="FloatNodeDefinition.php" hash="ea6a82bed9a7bfe2f7c7e4bded4ba25e"/><file name="NormalizationBuilder.php" hash="46bebb98028e9769c8cf3831ba00eac1"/><file name="NodeParentInterface.php" hash="8857cb48e2ba81f9ac87d906cdff6828"/><file name="BooleanNodeDefinition.php" hash="f695e1837c512ef8114328e660bf548b"/><file name="EnumNodeDefinition.php" hash="d24500c7829d10fe297bc51941d9f687"/><file name="ValidationBuilder.php" hash="f3f979aa257bebf13b5eff13cec65f89"/><file name="TreeBuilder.php" hash="48f136a2fe26ef3b84f2f4e785dafdca"/><file name="IntegerNodeDefinition.php" hash="0de24b6c3b0846189e0e7140340e4c20"/><file name="ArrayNodeDefinition.php" hash="22a935981e46b1e93f47671d4eba7a0b"/><file name="NodeDefinition.php" hash="cb35eeaefb91af375748b08cea511624"/><file name="MergeBuilder.php" hash="b11f7c9b66d7b499362eec9cb4bbb1f4"/><file name="ScalarNodeDefinition.php" hash="60cdafbd23a7cfe8082e9a05131ed580"/><file name="VariableNodeDefinition.php" hash="72ec2bf4a8686d8ae753fe91f026b1a6"/><file name="ParentNodeDefinitionInterface.php" hash="2116ee0288a4d682af361f2d472ec242"/></dir></dir><file name="FileLocator.php" hash="026635098bb87b0f3d9aa9db277372ea"/><dir name="Util"><file name="XmlUtils.php" hash="74d9ff921ec1235a84f44b4ff48dccad"/></dir><dir name="Loader"><file name="DelegatingLoader.php" hash="55f0bb12cab11e866f3b8dc990acfe44"/><file name="LoaderResolver.php" hash="fa0e5cf636fcb699349bc383ac1c58e4"/><file name="Loader.php" hash="ee72e1f5134967e385909103288f1f28"/><file name="FileLoader.php" hash="5cf3b0ea85d4ec9c88347f2836e6829a"/><file name="LoaderInterface.php" hash="186d2f94152a27ccec52ef09dee3ff5b"/><file name="LoaderResolverInterface.php" hash="b5b88cd457cd2722513763f34d91181f"/></dir><file name="FileLocatorInterface.php" hash="19f6ce347d97710e6e204f6072080d7f"/><file name="composer.json" hash="f811d1f0df9a5b256c16a7029dae9513"/><file name="README.md" hash="80fb119edb21de39ff671d640fc7f381"/></dir><dir name="Filesystem"><file name="Filesystem.php" hash="42a77b14e5ad6730973a550ef3d1befd"/><file name="phpunit.xml.dist" hash="0b56a69620e3c1e5425a4006506948db"/><dir name="Exception"><file name="ExceptionInterface.php" hash="11a7d451ae71b6aeba9e1236a53865f0"/><file name="IOException.php" hash="86997298817e01fd6a9fad7e9bf9ab7c"/><file name="IOExceptionInterface.php" hash="9ce81ced7d137497a4aa3639b2c445fe"/><file name="FileNotFoundException.php" hash="8a8b119b88f20a5a3078e051a308f741"/></dir><file name="CHANGELOG.md" hash="1537577578897cb0d5702f346fae3c82"/><file name="LICENSE" hash="56dedd4bd25ecd034ac4e1c17ebba0cc"/><file name="composer.json" hash="d685adc2374ea7ec68ebb150e6e69d7c"/><file name="README.md" hash="e499eea57ed2f13503b64641c0890418"/></dir></dir></dir><dir name="Bitpay"><file name="TokenInterface.php" hash="a0da969c86e363b201cc48c0a228ebed"/><file name="AccessToken.php" hash="dd33ed2e4802be42097c3c09e0d12b63"/><file name="Bitpay.php" hash="50120aeed758c3acb3bebfc4b202f168"/><dir name="Storage"><file name="MagentoStorage.php" hash="a2b276b80d0b568b67bd6b1dd1c4af04"/><file name="StorageInterface.php" hash="bb136e52d599fdb59739f32d027a1602"/><file name="MockStorage.php" hash="2570dbf74083bb8a7117595a6c4aefb4"/><file name="EncryptedFilesystemStorage.php" hash="e42a3c81bd19393ae78c10fed77dfb75"/><file name="FilesystemStorage.php" hash="673528691f5b999fc5481ff112140dfe"/></dir><file name="PayoutInstruction.php" hash="ef96db181023671aecac43950b709001"/><file name="Application.php" hash="832324bd621f53ac57d5d4d04ecf4e1c"/><file name="BuyerInterface.php" hash="749f9fc623ff65e5bce296a5b4dfdbbc"/><file name="PointInterface.php" hash="2a8fce4bbc8e84e221563c27ce7b57ce"/><file name="KeyManager.php" hash="ad48cd3f5ddba0c47606659a32e85e7b"/><dir name="Network"><file name="Livenet.php" hash="7107f34a87978e78588482e5b1f868d4"/><file name="NetworkInterface.php" hash="998b026f803b4d99daec03b876d2d132"/><file name="Testnet.php" hash="98b315759b32549c558e143e50a365ad"/><file name="NetworkAware.php" hash="d92aad1b38105078cd5055b295014a11"/><file name="Customnet.php" hash="d2af606a4a63babf0a08d0e8abac72f5"/><file name="NetworkAwareInterface.php" hash="1d1f87d25469a8ce2d0f1f2eaaf03ef1"/></dir><file name="ApplicationInterface.php" hash="8721d3fe85f80dbf71ead7df93eb3f82"/><file name="CurrencyInterface.php" hash="561ff6c529ab29813e751999e70fb166"/><file name="KeyInterface.php" hash="30253c1e42ee7b452bbb0a7451c88685"/><file name="PayoutInstructionInterface.php" hash="5d6c51b0b6a980d84bfad21ecaecf92c"/><dir name="Math"><file name="EngineInterface.php" hash="a0de5260325608e0911d4128fe3e52c2"/><file name="GmpEngine.php" hash="3136a8196599b00f097c15c0aa3a4c49"/><file name="Math.php" hash="98fb61ecc9379c625c9b970df7e0ac54"/><file name="BcEngine.php" hash="2db2b0d7aed63b5641d646f56f196942"/></dir><file name="User.php" hash="061f9f4dcff8d3090cb358ae1b87e259"/><file name="AccessTokenInterface.php" hash="57b7b403c1644dba10474d67b3b781ca"/><file name="ItemInterface.php" hash="94e9fc64fafde84425cb30f73b96dc48"/><file name="SinKey.php" hash="f126c1344247e87aa5c108d57f0ca354"/><dir name="DependencyInjection"><file name="services.xml" hash="cda4e79bf0e6f6821e5b4c2e16c240cb"/><dir name="Loader"><file name="ArrayLoader.php" hash="5176febbc2ff9bf1646f623dccd54cd7"/></dir><file name="BitpayExtension.php" hash="fc361f93a85be0b066dd1a60bb5d4a15"/></dir><dir name="Config"><file name="Configuration.php" hash="7cb0441f0dce52bab9f30f0cc3dee2fa"/></dir><file name="Invoice.php" hash="f93959d593e54c30f01ccae85f521168"/><file name="Buyer.php" hash="aa43ea51f57b00568e3827d1e7ba2025"/><file name="PrivateKey.php" hash="d3e6ec3b5c91eb9627509365b26fb744"/><file name="Bill.php" hash="d41fc149de27e026546cda7db6c060cb"/><file name="Point.php" hash="605d50d4b9890f2e1a3120fb5b0c50d2"/><file name="InvoiceInterface.php" hash="1e280dbf85d96ad462b47c087fbe6d9f"/><file name="Item.php" hash="a4fc84d7309cf44de812612ca2fa6c90"/><file name="PayoutTransaction.php" hash="80ed69aae8134c32caddbfd8e17a85e3"/><file name="Key.php" hash="0c6bdce34e7b3a650914393c9da5c99d"/><dir name="Crypto"><file name="CryptoInterface.php" hash="13ac34aa5f26fe5640c037511c7789f4"/><file name="HashExtension.php" hash="62f5d49ddafbc7e7ca19aaaea76830ba"/><file name="OpenSSLExtension.php" hash="e8393638871fc2605dbd6ec58e7a7564"/><file name="McryptExtension.php" hash="160e7e94e6ec50b255742bb5366dea29"/></dir><file name="PayoutInterface.php" hash="5fe5e08a395d2179e64baa3364ff512c"/><file name="BillInterface.php" hash="4d4f7c1e6b8ea9421a5e6651c7bd0654"/><dir name="Util"><file name="Error.php" hash="d4e4ba021b73f94467793043db14cc93"/><file name="Base58.php" hash="544526f4f89848bfb61f7bfcae348af6"/><file name="Secp256k1.php" hash="84d9a363e0f185200664c712832b8759"/><file name="SecureRandom.php" hash="9e699a6e383cb439a604f6e6e1837833"/><file name="Fingerprint.php" hash="0dde9668583a04391a2faf99d4b72914"/><file name="Util.php" hash="00a6664bc2a77483a01c614054a20e58"/><file name="CurveParameterInterface.php" hash="72ca86056b4abfebbcfec87037478db7"/></dir><file name="Payout.php" hash="ca73c1f0a81a642ed0a6fed6fd1002c1"/><file name="Token.php" hash="8440fcdcbf7d20d8bda3e7ee7e6ad73f"/><file name="PublicKey.php" hash="dca40e9a5e8679f21d143d205cd2c389"/><file name="PayoutTransactionInterface.php" hash="43a42bf47814d44b431328b5e70731a4"/><file name="Autoloader.php" hash="109400039e04ef345ac879a944fe45ba"/><file name="Currency.php" hash="85fad91aae2c896aee7f463c9952d320"/><dir name="Client"><file name="Request.php" hash="fbdd615774ab606df4062b3874c03496"/><file name="RequestInterface.php" hash="1a77530dddf63f24a78ce488c401f499"/><file name="Response.php" hash="195796fb21d235e1348caca2a990910d"/><file name="ConnectionException.php" hash="f5cd06c10cca143d3e7a4f6c24e2727b"/><file name="ClientInterface.php" hash="365b7a595eb15705bd4bd88273d10293"/><file name="BitpayException.php" hash="f8de7190213f0fab975e44f29ffa17f1"/><dir name="Adapter"><file name="CurlAdapter.php" hash="267beddc7821db66f81a113c4d806a20"/><file name="AdapterInterface.php" hash="b85307a1bd110c08141a7eb29b305973"/><file name="ca-bundle.crt" hash="9025ca14554240fc05c4e919ae3f8923"/></dir><file name="ResponseInterface.php" hash="1d53f3b84efc12e370c72ac7be0e8211"/><file name="ArgumentException.php" hash="3dc6e11dfc71116cad8e843255a09d2b"/><file name="Client.php" hash="0338ed97a40491c33d059c66dab39166"/></dir><file name="UserInterface.php" hash="7714dd84ab21eac77736a80d9e19f7c0"/></dir></dir></target></contents></package>
|