Small update for merchants that are using custom extensions that may not have had a shipping address set

This commit is contained in:
Joshua Estes 2014-08-06 11:59:12 -04:00
parent 4735d290c4
commit 6a4d367be0
1 changed files with 11 additions and 1 deletions

View File

@ -457,7 +457,17 @@ class Bitpay_Bitcoins_Model_PaymentMethod extends Mage_Payment_Model_Method_Abst
'apiKey' => $apiKey,
);
$options += $this->ExtractAddress($order->getShippingAddress());
/**
* Some merchants are using custom extensions where the shipping
* address may not be set, this will only extract the shipping
* address if there is one already set.
*/
if ($order->getShippingAddress()) {
$options = array_merge(
$options,
$this->ExtractAddress($order->getShippingAddress())
);
}
$invoice = bpCreateInvoice($orderId, $amount, array('orderId' => $orderId), $options);
$payment->setIsTransactionPending(true); // status will be PAYMENT_REVIEW instead of PROCESSING