我想知道Magento在paypal_express中成功付款后返回时如何保存订单
这里有一个条件,在我的最新项目中,我必须创建订单后,通过贝宝快捷成功付款完成编程我想知道Magento在paypal_express中成功付款后返回时如何保存订单,magento,paypal,Magento,Paypal,这里有一个条件,在我的最新项目中,我必须创建订单后,通过贝宝快捷成功付款完成编程 当我通过Magento normal flow进行操作时,它工作得非常好,但我想自己编程 我尝试了这个,但它给出了错误的付款方式是不可用的 $quote->collectTotals(); $service = Mage::getModel("sales/service_quote", $quote); $service->submitAll(); $order = $service->getOr
当我通过Magento normal flow进行操作时,它工作得非常好,但我想自己编程 我尝试了这个,但它给出了错误的付款方式是不可用的
$quote->collectTotals();
$service = Mage::getModel("sales/service_quote", $quote);
$service->submitAll();
$order = $service->getOrder();
if($order) {
Mage::dispatchEvent("checkout_type_onepage_save_order_after", array("order" => $order, "quote" => $quote));
try {
$order->sendNewOrderEmail();
}
catch(Exception $e) {
Mage::logException($e);
}
}
我也试过了,但没有效果
$quote = Mage::getModel("sales/quote")->setStore(Mage::getSingleton("core/store")->load(1))->load($shoppingCartId);
$checkout = Mage::getSingleton('paypal/express_checkout', array(
'config' => Mage::getModel('paypal/config', array(Mage_Paypal_Model_Config::METHOD_WPP_EXPRESS)),
'quote' => $quote,
));
$detailsBlock = new Mage_Paypal_Block_Express_Review_Details();
$detailsBlock->setQuote($quote);
$checkout->updateShippingMethod("ups_GND");
$session->setLastQuoteId($shoppingCartId)->setLastSuccessQuoteId($shoppingCartId);
$order = $checkout->getOrder();
if ($order){
$session->setLastOrderId($order->getId())->setLastRealOrderId($order->getIncrementId());
echo "<br>".$order->getData();
}
$quote=Mage::getModel(“sales/quote”)->setStore(Mage::getSingleton(“core/store”)->load(1))->load($shoppingCartId);
$checkout=Mage::getSingleton('paypal/express\u checkout',数组(
'config'=>Mage::getModel('paypal/config',数组(Mage\u paypal\u Model\u config::METHOD\u WPP\u EXPRESS)),
“quote”=>quote美元,
));
$detailsBlock=new Mage\u Paypal\u Block\u Express\u Review\u Details();
$detailsBlock->setQuote($quote);
$checkout->updateShippingMethod(“ups_GND”);
$session->setLastQuoteId($shoppingCartId)->setLastSuccessQuoteId($shoppingCartId);
$order=$checkout->getOrder();
如果($订单){
$session->setLastOrderId($order->getId())->setLastRealOrderId($order->getIncrementId());
echo“
”$order->getData();
}
非常感谢您的帮助。:) 我想自己编程@timgeb请检查我的编辑,我已经试过了,但没有效果。足够公平,关闭投票撤销我想自己编程@timgeb请检查我的编辑,我已经尝试过,但没有效果。足够公平,关闭投票撤销