|
|
|
|
@ -785,13 +785,13 @@ class Index extends CI_Controller {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
//找到没有发送的记录
|
|
|
|
|
public function send_note($pn_txn_id = false, $old_ssje=NULL) {
|
|
|
|
|
public function send_note($pn_txn_id = false, $old_ssje=NULL, $pn_sn=NULL) {
|
|
|
|
|
$data = array();
|
|
|
|
|
$handpick = empty($pn_txn_id) ? false : TRUE;
|
|
|
|
|
|
|
|
|
|
//优先处理指定的交易号,用于修正交易号直接发送通知
|
|
|
|
|
if (!empty($pn_txn_id)) {
|
|
|
|
|
$data['unsend_list'] = array($this->Note_model->note($pn_txn_id));
|
|
|
|
|
$data['unsend_list'] = array($this->Note_model->note($pn_txn_id, $pn_sn));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//找到处理过的的记录
|
|
|
|
|
@ -816,6 +816,18 @@ class Index extends CI_Controller {
|
|
|
|
|
if (empty($pn_txn_id)) {
|
|
|
|
|
echo ++$show_index . ' ' . $item->pn_txn_id . '<br/>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// webhook的跳过
|
|
|
|
|
$webhook_memo = json_decode($item->pn_memo);
|
|
|
|
|
$is_webhook = false;
|
|
|
|
|
if (isset($webhook_memo->id) && substr($webhook_memo->id, 0, 2)==="WH") {
|
|
|
|
|
$is_webhook = true;
|
|
|
|
|
}
|
|
|
|
|
if (true === $is_webhook) {
|
|
|
|
|
$this->Note_model->update_send($item->pn_txn_id, 'sendfail');
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理
|
|
|
|
|
if (strtolower($item->pn_payment_status) == 'refunded') {
|
|
|
|
|
$this->send_refund($item, $handpick, $old_ssje);
|
|
|
|
|
@ -960,13 +972,7 @@ class Index extends CI_Controller {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加邮件发送记录
|
|
|
|
|
$webhook_memo = json_decode($item->pn_memo);
|
|
|
|
|
$is_webhook = false;
|
|
|
|
|
if (isset($webhook_memo->id) && substr($webhook_memo->id, 0, 2)==="WH") {
|
|
|
|
|
$is_webhook = true;
|
|
|
|
|
}
|
|
|
|
|
if ($item->pn_send !== 'send' && false===$is_webhook) {
|
|
|
|
|
//给外联发送通知邮件
|
|
|
|
|
$fromName = !empty($item->pn_payer) ? $item->pn_payer : '';
|
|
|
|
|
|