当前位置: 动力学知识库 > 问答 > 编程问答 >

magento - Save payment with non-default method

问题描述:

I use code to create a checkout and I would like to set a payment method for this checkout. I would like to use ccsave, but it gives me an error the expiration date is missing for the request.

My code:

$checkout = Mage::getSingleton('checkout/type_onepage');

$checkout->initCheckout();

$checkout->saveCheckoutMethod('register');

$checkout->saveShippingMethod('flatrate_flatrate');

$checkout->savePayment(array('method' => 'ccsave'));

try {

$checkout->saveOrder();

} catch (Exception $ex) {

echo $ex->getMessage();

}

How to set the expiration date and other required parameters for the payment method?

网友答案:
$checkout->savePayment(array(
    'method' => 'ccsave', 
    'cc_owner' => 'ffffffffff', 
    'cc_type' => 'VI', 
    'cc_number' => '4111111111111111', 
    'cc_exp_year' => 2015, 
    'cc_exp_month' => 11,
    'cc_cid' => 123
));
分享给朋友:
您可能感兴趣的文章:
随机阅读: