Magento Forum

Payment Module question - How do I obtain the payment object ? 
 
Core
Member
 
Total Posts:  68
Joined:  2008-03-09
 

Hi,

I’m writing a payment module that extends “Mage_Payment_Model_Method_Abstract”

Within the function getOrderPlaceRedirectUrl() I need to get some data from the payment object such as customerId, billingAddress, currencyCode etc.  These are used by an XML request that I have to build and then send to the payment gateway to obtain the URL for me to redirect to.  I just can’t see where the payment data is obtained from when it’s not passed in.

Any help/hints will be appreciated.  Matt

 
Magento Community Magento Community
Magento Community
Magento Community
 
Core
Member
 
Total Posts:  68
Joined:  2008-03-09
 

Found the answer.

For the model that extends Mage_Payment_Model_Method_Abstract

Amount: $this->getAmount()
Currency: $paymentInfo->getQuote()->getBaseCurrencyCode()
StoreId: $paymentInfo->getQuote()->getStoreId()
QuoteId: $paymentInfo->getQuote()->getId()

BillingInfo:  $paymentInfo->getQuote()->getBillingAddress();

Hope that helps others that need the same sort of info.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top