Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Retrive selected payment type on checkou
Jr. Member
Total Posts:  27
Joined:  2007-09-29

Hi Guys (and girls!?) smile

I’m working on a COD (Cash on delivery) payment module at the moment. The biggest problem is, that the module has to add additional cost to the shipping total.

For example:
Shipping: Airmail, Payment: Credit Card -> Shipping Cost: € 20,00
Shipping: Airmail, Payment: COD -> Shipping Cost: € 25,00

I already built the module and created a overloaded method for the “getTotals” of Mage_Sales_Model_Quote. The problem is, that now i need to know wich Payment type the customer has chosen during checkout. Cause only if he has chosen “COD”, i can change the total by the getTotals->setData() method. Otherwise the COD Cost will alway be added, whatever payment type is chosen by the costumer.

So my question is:
Can anybod tell me, over wich object / method I’m able to get the selected Payment ID / Title / information during the checkout process? I already tried some sales->quote and checkout methods, but couldn’t find the right one.

Thanks a lot in advance,

Magento Community Magento Community
Magento Community
Magento Community
Jr. Member
Total Posts:  12
Joined:  2008-06-01
Reutlingen, Germany


i use the following code in my overriden Mage_Checkout_Model_Type_Onepage saveOrder() method:


complete example code:

class Mage_Sparkasse_Model_Type_Onepage extends Mage_Checkout_Model_Type_Onepage
public function saveOrder()
$redirectUrl $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();
$paymentMethod $this->getQuote()->getPayment()->getMethod();
$redirectUrl && ($paymentMethod == Mage_Sparkasse_Model_FormCreditcard::CODE || $paymentMethod == Mage_Sparkasse_Model_FormDirectdebit::CODE)){

return $this;

i hope that would help you a little bit

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