How to get customers data so i can pass it to a gateway payment.
Here is my model:
public function getStandardCheckoutFormFields() {
$orderIncrementId = $this->getCheckout()->getLastRealOrderId();
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
//$order = $this->get_sale_order($orderIncrementId);
echo Mage::getModel('customer/customer')->load($orderIncrementId);
$productArray = array();
foreach ($order->getAllItems() as $item) {
$productArray[] = array(
"product_name" => $item->getName(),
"product_qty" => $item->getQtyOrdered(),
"product_price" => $item->getPrice(),
);
}
return $productArray;
}
here is my controller:
public function redirectAction(){
$session = Mage::getSingleton('checkout/session');
$session->setAsurepayCustompayQuoteId($session->getQuoteId());
$this->getResponse()->setBody($this->getLayout()->createBlock('custompay/redirect')->toHtml());
$session->unsQuoteId();
$session->unsRedirectUrl();
}
This are running perfectly running, the problem is i can’t get customer details such as customer name, address and etc.
I already tried this code
Mage::getSingleton(customer/customer)->getData();
There was a result but not printing.
In the checkout page success (onepage). When customer redirected here, There is no email will be send to the customer and the order was not update as completed.
You’re trying to load a customer with an id that belongs to the order. This obviously doesn’t work! You need to extract the
customer_idfrom the order and load the customer model based on that.You’re also using
Mage::getSingletonwhich is the wrong call. You want a new instance tailored to a specific customer, not the single permissible instance of the class.