0

I have some trouble by an update from 1.7 to 1.9.

One Payment Extension Smasoft_Oneclickorder shows the ajax response message

The requested Payment Method is not available.

After click on the onepage checkout button in the card.

The Extension is build for 1.7 and have no updates yet, but it works till this point.

in the Class: Smasoft_Oneclickorder_IndexController i found a method:

_saveMagentoOrder

With this content:

protected function _saveMagentoOrder()
{
    /** @var $onepage Mage_Checkout_Model_Type_Onepage */
    $onepage = $this->getOnepage();

    try {
        $onepage->savePayment(array(
            'method' => 'smasoft_oneclickorder',
        ));
        $onepage->getQuote()->collectTotals()->save();
        Mage::register('oneclickorder_ignore_quote_validation', true, true);
        $onepage->saveOrder();
        Mage::unregister('oneclickorder_ignore_quote_validation');
        return true;
    } catch (Exception $e) {
        $this->_errors[] = $message = $e->getMessage();
    }
    return false;
}

... it seems normal ... but later in the

class: Mage_Sales_Model_Quote::public function getPaymentsCollection()
the $this->_payments

is null ... so he tries to load the payment method.

Do you have an idea what i have to change, that the method will be found in 1.9?

Thanks!

3 Answers 3

4

There are two places, where this exception is thrown:

/app/code/core/Mage/Payment/Model/Info.php:83

and

/app/code/core/Mage/Sales/Model/Quote/Payment.php:151

Try to debug here :

Mage_Payment_Model_Method_Abstract::isAvailable()
0

app\design\frontend\base\default\template\checkout\onepage\payment.phtml

file you can place this code

<fieldset id='checkout-payment-method-load'>

instead of

<fieldset>
0

I solve the problem by my own. For this i modify the payment helper to this:

<?php
/**
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 *
 * @category    Smasoft
 * @package     Smasoft_Oneclikorder
 * @copyright   Copyright (c) 2013 Slabko Michail. <[email protected]>
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * Dummy oneclick order payment method model
 */
class Smasoft_Oneclickorder_Model_Payment_Method_Oneclick extends Mage_Payment_Model_Method_Abstract
{
    protected $_canUseCheckout = false;
    /**
     * Payment method code
     *
     * @var string
     */
    protected $_code = 'smasoft_oneclickorder';
    /**
     * @inheritdoc
     */
    public function canUseForCountry($country)
    {
        return true;
    }
    /**
     * @inheritdoc
     */
    public function isAvailable($quote = null)
    {
        return true;
    }
    /**
     * @inheritdoc
     */
    public function isApplicableToQuote($quote, $checksBitMask)
    {
        return true;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.