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 magento.stackexchange.com, 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 community@magento.com.

Magento Forum

Добвление payment method на страницу checkout
 
karat12
Jr. Member
 
Total Posts:  3
Joined:  2010-10-04
 

Не получается добавить payment method на страницу checkout. Подскажите, как это сделать?

config.xml

<?xml version="1.0"?>
<config>
    <
modules>
        <
DigitalRiver_DRWPIntegration>
            <
version>0.1.0</version>
        </
DigitalRiver_DRWPIntegration>
    </
modules>

    <
frontend>
        <
routers>
            <
drwp>
                <use>
standard</use>
                <
args>
                    <
module>DigitalRiver_DRWPIntegration</module>
                    <
frontName>drwp</frontName>
                </
args>
            </
drwp>
        </
routers>
    </
frontend>

    <global>
        <
blocks>
            <
drwp>
                <class>
CDigitalRiver_DRWPIntegration_Block</class>
            </
drwp>
        </
blocks>

        <
models>
            <
drwp>
                <class>
DigitalRiver_DRWPIntegration_Model</class>
            </
drwp>
        </
models>

        <
resources>
            <
drwpintegration_setup>
                <
setup>
                    <
module>DigitalRiver_DRWPIntegration</module>
                </
setup>
                <
connection>
                    <use>
core_setup</use>
                </
connection>
            </
drwpintegration_setup>
            <
drwpintegration_write>
                <
connection>
                    <use>
core_write</use>
                </
connection>
            </
drwpintegration_write>
            <
drwpintegration_read>
                <
connection>
                    <use>
core_read</use>
                </
connection>
            </
drwpintegration_read>
        </
resources>
    </global>

    <default>
        <
payment>
            <
drwpintegration>
                <
model>drwpintegration/card</model>
                <
title>Digital River</title>
                <
order_status backend_model="adminhtml/system_config_backend_encrypted"/>
            </
drwpintegration>
        </
payment>
    </default>
</
config>

Model/CreditCard.php

<?php

class DigitalRiver_DRWPIntegration_Model_CreditCard extends Mage_Payment_Model_Method_Cc
{
    
protected $_code                    'drwpintegration_creditcard';

    protected 
$_canUseForMultishipping  false;
    protected 
$_canUseInternal          false;
    protected 
$_isInitializeNeeded      true;

    
/**
     * Instantiate state and set it to state object
     *
     * @param string $paymentAction
     * @param Varien_Object $stateObject
     */
    
public function initialize($paymentAction$stateObject)
    
{
        $stateObject
->setState(Mage_Sales_Model_Order::STATE_PENDING_PAYMENT);
        
$stateObject->setStatus('pending_payment');
        
$stateObject->setIsNotified(false);
        
$stateObject->save();
    
}
}
?>

Model/PaymentMethod.php

<?php

class DigitalRiver_DRWPIntegration_Model_PaymentMethod extends Mage_Payment_Model_Method_Cc
{
    
protected $_code 'drwpintegration';

    protected 
$_isGateway               true;
    protected 
$_canAuthorize            true;
    protected 
$_canCapture              true;
    protected 
$_canCapturePartial       false;
    protected 
$_canRefund               false;
    protected 
$_canVoid                 true;
    protected 
$_canUseInternal          true;
    protected 
$_canUseCheckout          true;
    protected 
$_canUseForMultishipping  true;
    protected 
$_canSaveCc false;
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
karat12
Jr. Member
 
Total Posts:  3
Joined:  2010-10-04
 

Забыл добавить system.xml

<?xml version="1.0"?>
<config>
   <
sections>
        <
payment>
            <
groups>
                <
drwpintegration translate="label" module="paygate">
                    <
label>Digital River</label>
                    <
sort_order>670</sort_order>
                    <
show_in_default>1</show_in_default>
                    <
show_in_website>1</show_in_website>
                    <
show_in_store>0</show_in_store>
                    <
fields>
                        <
active translate="label">
                            <
label>Enabled</label>
                            <
frontend_type>select</frontend_type>
                            <
source_model>adminhtml/system_config_source_yesno</source_model>
                            <
sort_order>1</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>0</show_in_store>
                        </
active>
                        <
order_status translate="label">
                            <
label>New order status</label>
                            <
frontend_type>select</frontend_type>
                            <
source_model>adminhtml/system_config_source_order_status_processing</source_model>
                            <
sort_order>4</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>0</show_in_store>
                        </
order_status>
                        <
title translate="label">
                            <
label>Title</label>
                            <
frontend_type>text</frontend_type>
                            <
sort_order>2</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>0</show_in_store>
                        </
title>
                    </
fields>
                </
drwpintegration>
                <
drwpintegration_card translate="label" module="paygate">
                    <
label>Credit Card Digital River</label>
                    <
sort_order>671</sort_order>
                    <
show_in_default>1</show_in_default>
                    <
show_in_website>1</show_in_website>
                    <
show_in_store>0</show_in_store>
                    <
fields>
                        <
active translate="label">
                            <
label>Enabled</label>
                            <
frontend_type>select</frontend_type>
                            <
source_model>adminhtml/system_config_source_yesno</source_model>
                            <
sort_order>1</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>0</show_in_store>
                        </
active>
                        <
order_status translate="label">
                            <
label>New order status</label>
                            <
frontend_type>select</frontend_type>
                            <
source_model>adminhtml/system_config_source_order_status_processing</source_model>
                            <
sort_order>2</sort_order>
                            <
show_in_default>1</show_in_default>
                            <
show_in_website>1</show_in_website>
                            <
show_in_store>0</show_in_store>
                        </
order_status>
                    </
fields>
                </
drwpintegration_card>
            </
groups>
        </
payment>
    </
sections>
</
config>

В админке выбрал Enabled = yes. Но на странице checkout мой метод так и не появился :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alaivatech
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2012-10-26
india
 



Please use Alaiva Technologie’s

One Step Checkout

to avoid those issues..

Alaiva Technologies creates high quality Magento extensions for your online business needs.

Visit us at http://alaiva.com/ for creative and useful extensions!

Some of our extensions: One Step Checkout | Out of Stock Notification

Hire Us!

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