提交 e7e311cd 编写于 作者: T Terry

订单支付部分小问题处理

上级 252206d6
......@@ -168,6 +168,11 @@ class Item extends Service
*/
protected function actionSaveOrderItems($items, $order_id, $store)
{
/**
* 由于是通过session查订单的方式,而不是新建,paypal报错可能多次下单(更新方式),
* 因此在添加订单产品的时候先进行一次删除产品操作。
*/
MyOrderItem::deleteAll(['order_id' => $order_id]);
if (is_array($items) && !empty($items) && $order_id && $store) {
foreach ($items as $item) {
$myOrderItem = new MyOrderItem();
......
......@@ -578,7 +578,7 @@ class Paypal extends Service
$subtotal = Yii::$service->helper->format->number_format($orderInfo['subtotal']);
$shipping_total = Yii::$service->helper->format->number_format($orderInfo['shipping_total']);
$discount_amount= $orderInfo['subtotal_with_discount'] ? $orderInfo['subtotal_with_discount'] : 0;
//$subtotal = $subtotal - $discount_amount;
$subtotal = $subtotal - $discount_amount;
$nvp_array['PAYMENTREQUEST_0_CURRENCYCODE'] = $currency;
$nvp_array['PAYMENTREQUEST_0_AMT'] = $grand_total;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册