【发布时间】:2011-05-11 07:17:45
【问题描述】:
我是 magento 的新手。 使用付款方式 ccsave 以编程方式创建订单时(用于信用卡付款) 我得到以下异常:
异常“Mage_Core_Exception”,带有消息“信用卡到期日期不正确”
可能是我的信用卡信息有误或设置了有关信用卡的数据。
$quote->addProduct($product, new Varien_Object(10));
$addressData = array(
'firstname' => $data[2],
'lastname' => $data[3],
'street' => $data[4],
'city' => $data[6],
'postcode' =>$data[8],
'telephone' => $data[9],
'country_id' => 'US',
'region_id' => $data[7]
);
$billingAddress = $quote->getBillingAddress()->addData($addressData);
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
$payment= array(
'cc_owner' => 'ffffffffff',
'cc_type' => 'VI',
'cc_number' => 1234567890123456,
'cc_exp_month' => 11,
'cc_exp_year' => 2015,
'cc_cid' => 123
);
$quote->getPayment()->addData($payment);
$quote->setPaymentData($payment);
$shippingAddress->setBaseShippingAmount(100);
$shippingAddress->setShippingMethod('customshippingrate');
$shippingAddress->setShippingDescription('abcd');
$quote->getPayment()->importData(array('method' => 'ccsave'));
$quote->collectTotals()->save();
Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_ENABLED, "0");
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
【问题讨论】: