From 0e86157c8044734d217c03e1f4ed143ea5651826 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 2 Jan 2020 13:01:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20PayPal=20APP=E7=BB=84=E7=9A=84IPN?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/paypal/controllers/index.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 91466d8d..87b1f0a2 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -886,10 +886,9 @@ class Index extends CI_Controller { // APP 组的China Train Booking-开头的订单号 // 发送邮件提醒外联核对收款金额, 不写入收款记录 $if_empty_gai = $this->process_notify_APP($item, $orderid_info); - if($if_empty_gai !== true) { - $this->Note_model->update_send($item->pn_txn_id, 'send', $item->pn_sn); - continue; - } // 收款记录为空, 需要补录 + $send = $if_empty_gai !== true ? 'send-app' : 'sendfail'; + $this->Note_model->update_send($item->pn_txn_id, $send, $item->pn_sn); + continue; } //检测是否是APP订单,默认不处理 @@ -1609,8 +1608,13 @@ class Index extends CI_Controller { { $content = json_decode($item->pn_memo, true); $post_body = http_build_query($content); - $this->async_curl("http://wx.chinatrainbooking.com/paypalend/", $post_body, 5); - return false; + $post_body .= '&appkey=jdfk*$jfjdk1688'; + $app_return = $this->async_curl("http://wx.chinatrainbooking.com/paypalend/", $post_body, 5); + if (intval($app_return)===200) { + return false; // 下一步更新为send + } + return true; // 下一步: sendfail + $advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype); //查不到订单信息 if (empty($advisor_info)) { @@ -1680,8 +1684,9 @@ class Index extends CI_Controller { if (!in_array(curl_getinfo($ch, CURLINFO_HTTP_CODE),array(0,200)) ) { log_message('error', "Webht Async Curl Call Request html Status Code: ".curl_getinfo($ch, CURLINFO_HTTP_CODE)."; curl url: ".$url); } + $http_ret_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); - return $data; + return $http_ret_code; } }