paypal 收款通知:邮件不重复发; 商旅新增的CHTAPP-biz需与APP组的订单区分

feature/pay
lyt 6 years ago
parent 1ce0e268df
commit 11f9e9967f

@ -828,7 +828,7 @@ class Index extends CI_Controller {
$ht_memo = '交易号(自动录入):' . $item->pn_txn_id;
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
//CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') {//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') {//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单
$this->Paypal_model->add_account_info_forAPP($GAI_COLI_SN, $advisor_info->COLI_ID, $item->pn_mc_gross, $item->pn_payment_date, mb_strtoupper($item->pn_mc_currency), $ssje, $item->pn_payment_date, $item->pn_payment_date, $item->pn_payment_date, '', $item->pn_payer_email, $item->pn_txn_id, $ht_memo);
if ($advisor_info->COLI_WebCode == 'CHTAPP' && $advisor_info->COLI_State == 11) { //只修改APP组的订单状态并且订单进度是我的订单
$this->Paypal_model->update_biz_coli_state($GAI_COLI_SN, 8); //把订单状态改为已付款
@ -869,20 +869,21 @@ class Index extends CI_Controller {
//添加邮件发送记录
//给外联发送通知邮件
$fromName = !empty($item->pn_payer) ? $item->pn_payer : '';
$fromEmail = !empty($item->pn_payer_email) ? $item->pn_payer_email : '';
$toName = !empty($opi_firstname) ? $opi_firstname : '';
$toEmail = !empty($opi_email) ? $opi_email : '';
$subject = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->pn_mc_gross . $item->pn_mc_currency . ' / ' . $fromName;
$body = $this->load->view('mail_templete', $item, true); //$item->pn_memo;
$M_RelatedInfo = $item->pn_sn;
$M_AddTime = $item->pn_payment_date;
$M_State = 0;
$this->Paypal_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'paypal note');
//添加邮件发送记录 end
$this->Note_model->update_send($item->pn_txn_id, 'send');
if ($item->pn_send !== 'send') {
//给外联发送通知邮件
$fromName = !empty($item->pn_payer) ? $item->pn_payer : '';
$fromEmail = !empty($item->pn_payer_email) ? $item->pn_payer_email : '';
$toName = !empty($opi_firstname) ? $opi_firstname : '';
$toEmail = !empty($opi_email) ? $opi_email : '';
$subject = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->pn_mc_gross . $item->pn_mc_currency . ' / ' . $fromName;
$body = $this->load->view('mail_templete', $item, true); //$item->pn_memo;
$M_RelatedInfo = $item->pn_sn;
$M_AddTime = $item->pn_payment_date;
$M_State = 0;
$this->Paypal_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'paypal note');
//添加邮件发送记录 end
$this->Note_model->update_send($item->pn_txn_id, 'send');
}
}
//echo 'done!';
}

Loading…
Cancel
Save