php - exception while creating order programmetically with payment method ccsave -


i new magento... while creating order programmatically payment method ccsave(for credit card payment) got folloing exception

exception 'mage_core_exception' message 'incorrect credit card expiration date

may worng credit card information or set data credit card..

please me out...

thanks

$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(); 

i changed code , have solved problem of exception 'mage_core_exception' message 'incorrect credit card expiration date'

$billingaddress = $quote->getbillingaddress()->adddata($addressdata);  $shippingaddress = $quote->getshippingaddress()->adddata($addressdata);  $quote->getpayment()->importdata(array('method' => 'ccsave',                  'cc_owner' => 'ffffffffff',                 'cc_type' => 'vi',                 'cc_number' => "1234567890123456",                 'cc_exp_month' => 11,                 'cc_exp_year' => 2015,                 'cc_cid' => 123)); $quote->collecttotals()->save();  mage::app()->getstore()->setconfig(mage_sales_model_order::xml_path_email_enabled, "0");   $service = mage::getmodel('sales/service_quote', $quote); 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -