diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 04193088..f1f94921 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -629,6 +629,7 @@ class Index extends CI_Controller { { $raw_post = file_get_contents('php://input'); if (empty($raw_post)) { + echo 'no'; return; } $post_data = json_decode($raw_post); @@ -793,7 +794,17 @@ class Index extends CI_Controller { $API_str = json_encode($API, JSON_UNESCAPED_SLASHES); $pn_txn_id = $item->pn_txn_id; - $orderid_info = $this->analysis_orderid($item->pn_invoice); + $pn_invoice = $item->pn_invoice; + $orderid_info = $this->analysis_orderid($pn_invoice); + if (empty($orderid_info)) { + $notes = $this->Note_model->search_note($pn_txn_id); + if (empty($notes)) { + return; + } + $IPN_note = $notes[0]; + $pn_invoice = $IPN_note->pn_invoice; + $orderid_info = $this->analysis_orderid($pn_invoice); + } $this->Note_model->update_send($item->pn_txn_id, 'sendfail', $item->pn_sn); diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index c15a5ce1..4105daeb 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -114,6 +114,14 @@ class Note_model extends CI_Model { return $this->get_list(); } + public function search_note($pn_txn_id){ + $this->init(); + $this->topnum=10; + $this->pn_txn_id=" AND pn.pn_txn_id=".$this->HT->escape($pn_txn_id); + $this->orderby=" ORDER BY pn_payer desc "; + return $this->get_list(); + } + public function search_key($search_key) { $this->init(); $this->topnum = 300; //限制最大数量,防止查询单词过短