Added namespace backslash
This commit is contained in:
parent
cea830617b
commit
f796e0a4f7
|
@ -23,7 +23,7 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|||
*/
|
||||
public function getIframeUrl()
|
||||
{
|
||||
if (Mage::getModel('bitpay/ipn')->getQuotePaid($this->getQuote()->getId())) {
|
||||
if (\Mage::getModel('bitpay/ipn')->getQuotePaid($this->getQuote()->getId())) {
|
||||
return 'paid'; // quote's already paid, so don't show the iframe
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|||
$method = $this->getQuote()->getPayment()->getMethodInstance();
|
||||
|
||||
if (false === isset($method) || true === empty($method)) {
|
||||
Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');
|
||||
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');
|
||||
throw new Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not obtain an instance of the payment method.');
|
||||
}
|
||||
|
||||
|
@ -39,18 +39,18 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|||
array(
|
||||
'currency' => $this->getQuote()->getQuoteCurrencyCode(),
|
||||
'fullNotifications' => 'true',
|
||||
'notificationURL' => Mage::getUrl('bitpay/ipn'),
|
||||
'redirectURL' => Mage::getUrl('checkout/onepage/success'),
|
||||
'transactionSpeed' => Mage::getStoreConfig('payment/bitpay/speed'),
|
||||
'notificationURL' => \Mage::getUrl('bitpay/ipn'),
|
||||
'redirectURL' => \Mage::getUrl('checkout/onepage/success'),
|
||||
'transactionSpeed' => \Mage::getStoreConfig('payment/bitpay/speed'),
|
||||
),
|
||||
$method->extractAddress($this->getQuote()->getShippingAddress())
|
||||
);
|
||||
|
||||
if (false === isset($options) || true === empty($options)) {
|
||||
Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
|
||||
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
|
||||
throw new Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
|
||||
} else {
|
||||
Mage::helper('bitpay')->debugData($options);
|
||||
\Mage::helper('bitpay')->debugData($options);
|
||||
}
|
||||
|
||||
// Mage doesn't round the total until saving and it can have more precision
|
||||
|
@ -59,7 +59,7 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|||
$price = round($this->getQuote()->getGrandTotal(), 4);
|
||||
|
||||
if (false === isset($price) || true === empty($price)) {
|
||||
Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the new rounded price.');
|
||||
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the new rounded price.');
|
||||
throw new Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the new rounded price.');
|
||||
}
|
||||
|
||||
|
@ -67,18 +67,18 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
|
|||
$hash = $method->getQuoteHash($this->getQuote()->getId());
|
||||
|
||||
if (false === isset($hash) || true === empty($hash)) {
|
||||
Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the quote hash.');
|
||||
\Mage::helper('bitpay')->debugData('[ERROR] In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not get the quote hash.');
|
||||
throw new Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the quote hash.');
|
||||
}
|
||||
|
||||
Mage::helper('bitpay')->registerAutoloader();
|
||||
\Mage::helper('bitpay')->registerAutoloader();
|
||||
|
||||
//$invoice = bpCreateInvoice($quoteId, $price, array('quoteId' => $quoteId, 'quoteHash' => $hash), $options);
|
||||
$invoice = array('url' => 'https://test.bitpay.com/invoice?id=5NxFkXcJbCSivtQRJa4kHP');
|
||||
|
||||
if (array_key_exists('error', $invoice)) {
|
||||
Mage::helper('bitpay')->debugData(array('Error creating bitpay invoice', $invoice['error'],));
|
||||
Mage::throwException("Error creating BitPay invoice. Please try again or use another payment option.");
|
||||
\Mage::helper('bitpay')->debugData(array('Error creating bitpay invoice', $invoice['error'],));
|
||||
\Mage::throwException("Error creating BitPay invoice. Please try again or use another payment option.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue