perf: PayPal webhook处理

webht/payment
Lei OT 12 months ago
parent a5ea8d1519
commit ac7a6fc57c

@ -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);

@ -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; //限制最大数量,防止查询单词过短

Loading…
Cancel
Save