0

I am trying to get the customer's name, email, and order number to pass to a payment gateway once the customer hits the place order button. So far I have managed to get the total using

$total = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();

I tried using

Mage::getSingleton('customer/session')->getCustomer();

$email = $customer->getEmail();  

$firstname = $customer->getFirstname(); 

$lastname= $customer->getLastname(); 

but they don't seem to return a value. I know this because I echo the variables after, and none of them work but the $total. Help would be greatly appreciated.

Toto
  • 89,455
  • 62
  • 89
  • 125
Eric Semwenda
  • 436
  • 6
  • 16
  • i think you should use some query to fetch the last order by current user after the order button hit , because i think the order number is generated after gets the entry in database or you can use the query on success page where you can get the order number also – Rohit Goel Jan 30 '13 at 06:05
  • thanks for the response but I need it the details before I get to the success page, to post it to the payment gateway – Eric Semwenda Jan 30 '13 at 06:08
  • than i think you can place the query on that same page right after the button hits , right now which value is submitting to gateway at the time of hit ? – Rohit Goel Jan 30 '13 at 06:13
  • dont worry I found a better solution look at this link: http://www.junaidbhura.com/how-to-make-a-custom-magento-payment-extension-for-an-external-gateway/#comment-1429 – Eric Semwenda Jan 31 '13 at 06:25

1 Answers1

0

The best way to do this is to create a Custom Payment Gateway module.

See

http://www.excellencemagentoblog.com/magento-create-custom-payment-method

Magento Custom Payment Gateway

http://roysimkes.net/blog/2009/11/creating-your-own-payment-gateway-for-magento-part-1/

http://roysimkes.net/blog/2009/11/creating-your-own-payment-gateway-for-magento-%E2%80%93-part-2/

Community
  • 1
  • 1
MagePal Extensions
  • 17,646
  • 2
  • 47
  • 62
  • Thanks for your response that exactly what I did using this tutorial and files: http://www.junaidbhura.com/how-to-make-a-custom-magento-payment-extension-for-an-external-gateway/#comment-1429 – Eric Semwenda Jan 31 '13 at 06:26