paypal成功支付后,后台状态未有更改问题
2016-07-07 15:11 来源:www.chinab4c.com 作者:ecshop专家
我用的是官方v2.7.3 RELEASE 20120411版 本,客户可以成功支付,但是后台没有更改状态,我在支付paypal.php的第222行加了一个if($phpsir_debug){echo __LINE__;die();} 结果显示 错误,请教高手,这个地方是哪里错,如何解决,小弟在这里跪谢。 /** * 响应操作 */ function respond() { $phpsir_debug = 1; $payment= get_payment('paypal'); $merchant_id = $payment['paypal_account'];///获取商户编号 // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) ."\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $order_sn = $_POST['invoice']; $memo = !empty($_POST['memo']) ? $_POST['memo'] : ''; $action_note = $txn_id . '(' . $GLOBALS['_LANG']['paypal_txn_id'] . ')' . $memo; if (!$fp) { fclose($fp); if($phpsir_debug){echo __LINE__;die();} return false; } else { fputs($fp, $header . $req); while (!feof($fp)) { $res = fgets($fp, 1024); if (strcmp($res, 'VERIFIED') == 0) { // check the payment_status is Completed if ($payment_status != 'Completed' && $payment_status != 'Pending') { fclose($fp); if($phpsir_debug){echo __LINE__;die();} return false; } // check that txn_id has not been previously processed /*$sql = "SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('order_action') . " WHERE action_note LIKE '" . mysql_like_quote($txn_id) . "%'"; if ($GLOBALS['db']->getOne($sql) > 0) { fclose($fp); return false; }*/ // check that receiver_email is your Primary PayPal email if ($receiver_email != $merchant_id) { fclose($fp); if($phpsir_debug){echo __LINE__;die();} return false; } // check that payment_amount/payment_currency are correct $sql = "SELECT order_amount FROM " . $GLOBALS['ecs']->table('pay_log') . " WHERE log_id = '$order_sn'"; if ($GLOBALS['db']->getOne($sql) != $payment_amount) { fclose($fp); if($phpsir_debug){echo __LINE__;die();} return false; } if ($payment['paypal_currency'] != $payment_currency) { fclose($fp); if($phpsir_debug){echo __LINE__;die();} return false; } // process payment order_paid($order_sn, PS_PAYED, $action_note); fclose($fp); if($phpsir_debug){echo __LINE__;die();} return true; } elseif (strcmp($res, 'INVALID') == 0) { // log for manual investigation fclose($fp); if($phpsir_debug){echo __LINE__;die();} //这个地方显示错误,我都没有改过paypal.php这个文件 return false; } } } } } |
回答:
找q:1156881931 搞定此问题 www.oovvo.com ecshop开发专家 |
最近更新
常用插件
- ecshop二次开发商品购买备
ecshop销售统计 插件介绍:ecshop二次开发订单销售统计和商品购买备注服...
- ecshop二次商品订购人信息
ecshop二次商品订购人信息填写插件,有时候给朋友送花,或者是送礼品的...
- ecshop2.7.2退换货申请插件
ecshop2.7.2退换货申请插件,主要是在 ecshop 现在的基础上,对ecshop的订单处...
- ecshop注册推荐送现金插件
ecshop中的促销售功能还不是很完善,随着电子商务系统的发展和进步,...
- ecshop会员中心订单excel倒出
ecshop会员中心订单excel倒出...
ecshop热门问答
ecshop热门资料
ecshop淘宝补丁
ecshop图文
ecshop不能
ecshop汽车
ecshop模仿
ecshop图片地址
ecshop动态库
手机优惠活动
ecshop仿制
ecshop来电
ecshop笔记本电脑
ecshop长沙做网站
dedecms文章统计
ecshop手机APP
ecshop222
ecshop配送区域修改
ecshop英国
伪静态
ecshop鞋帽
ecshop套餐
ecshop支付方式乱码
ecshopplease
ecshopemail
ecshop帐户
ecshop上傳
ecshop英雄
ecshopupload
ecshop补丁
ecshop盾牌
ecshop分析问题