Added namespace backslash

This commit is contained in:
Rich Morgan 2015-01-05 15:55:06 -05:00
parent cea830617b
commit f796e0a4f7
1 changed files with 12 additions and 12 deletions

View File

@ -23,7 +23,7 @@ class Bitpay_Core_Block_Iframe extends Mage_Checkout_Block_Onepage_Payment
*/ */
public function getIframeUrl() 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 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(); $method = $this->getQuote()->getPayment()->getMethodInstance();
if (false === isset($method) || true === empty($method)) { 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.'); 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( array(
'currency' => $this->getQuote()->getQuoteCurrencyCode(), 'currency' => $this->getQuote()->getQuoteCurrencyCode(),
'fullNotifications' => 'true', 'fullNotifications' => 'true',
'notificationURL' => Mage::getUrl('bitpay/ipn'), 'notificationURL' => \Mage::getUrl('bitpay/ipn'),
'redirectURL' => Mage::getUrl('checkout/onepage/success'), 'redirectURL' => \Mage::getUrl('checkout/onepage/success'),
'transactionSpeed' => Mage::getStoreConfig('payment/bitpay/speed'), 'transactionSpeed' => \Mage::getStoreConfig('payment/bitpay/speed'),
), ),
$method->extractAddress($this->getQuote()->getShippingAddress()) $method->extractAddress($this->getQuote()->getShippingAddress())
); );
if (false === isset($options) || true === empty($options)) { 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.'); throw new Exception('In Bitpay_Core_Block_Iframe::getIframeUrl(): Could not merge the options array.');
} else { } 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 // 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); $price = round($this->getQuote()->getGrandTotal(), 4);
if (false === isset($price) || true === empty($price)) { 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.'); 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()); $hash = $method->getQuoteHash($this->getQuote()->getId());
if (false === isset($hash) || true === empty($hash)) { 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.'); 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 = bpCreateInvoice($quoteId, $price, array('quoteId' => $quoteId, 'quoteHash' => $hash), $options);
$invoice = array('url' => 'https://test.bitpay.com/invoice?id=5NxFkXcJbCSivtQRJa4kHP'); $invoice = array('url' => 'https://test.bitpay.com/invoice?id=5NxFkXcJbCSivtQRJa4kHP');
if (array_key_exists('error', $invoice)) { if (array_key_exists('error', $invoice)) {
Mage::helper('bitpay')->debugData(array('Error creating bitpay invoice', $invoice['error'],)); \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::throwException("Error creating BitPay invoice. Please try again or use another payment option.");
return false; return false;
} }