|
|
|
@ -100,9 +100,10 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
// 填入提取到的订单号
|
|
|
|
|
$this->note_model->set_invoice($item->OPN_SN, $orderid_info->orderid . '_' . $orderid_info->ordertype);
|
|
|
|
|
|
|
|
|
|
$send_email = true;
|
|
|
|
|
// APP自动出票的收款 跳过
|
|
|
|
|
// todo: 检测APP收款是否存在
|
|
|
|
|
if ($orderid_info->ordertype === 'A' && $item->OPN_noticeType === 'pay') {
|
|
|
|
|
$send_email = false;
|
|
|
|
|
// $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'closed');
|
|
|
|
|
// continue;
|
|
|
|
|
}
|
|
|
|
@ -125,7 +126,7 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
if ($advisor_info->order_type == 0) {
|
|
|
|
|
/* 商务订单 */
|
|
|
|
|
// todo: 检测收/退款是否存在
|
|
|
|
|
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') {
|
|
|
|
|
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') {
|
|
|
|
|
/* APP */
|
|
|
|
|
$this->account_model->add_account_info_forAPP(
|
|
|
|
|
$COLI_SN,
|
|
|
|
@ -226,7 +227,7 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
//添加邮件发送记录
|
|
|
|
|
//给外联发送通知邮件
|
|
|
|
|
if ($handpick===false && $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') {
|
|
|
|
|
if ($send_email===true && $handpick===false && $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') {
|
|
|
|
|
$fromName = !empty($item->OPN_payerName) ? $item->OPN_payerName : '';
|
|
|
|
|
$fromEmail = !empty($item->OPN_payerEmail) ? $item->OPN_payerEmail : '';
|
|
|
|
|
$toName = !empty($opi_firstname) ? $opi_firstname : '';
|
|
|
|
@ -236,7 +237,7 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
$M_RelatedInfo = $item->OPN_SN;
|
|
|
|
|
$M_AddTime = $item->OPN_completeTime;
|
|
|
|
|
$M_State = 0;
|
|
|
|
|
// $this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note');
|
|
|
|
|
$this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note');
|
|
|
|
|
//添加邮件发送记录 end
|
|
|
|
|
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send');
|
|
|
|
|
}
|
|
|
|
@ -244,7 +245,7 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
// todo:iPaylinks需要发收款, 退款发所有
|
|
|
|
|
// 3. 更新是否发送财务
|
|
|
|
|
if($is_refund === true ) {
|
|
|
|
|
$this->send_refund($item, $orderid_info, $advisor_info);
|
|
|
|
|
$this->send_refund($send_email, $item, $orderid_info, $advisor_info);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//显示处理记录
|
|
|
|
@ -257,10 +258,12 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
// return $this->output->set_content_type('application/json')->set_output(json_encode($data));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function send_refund($item, $orderid_info, $advisor_info)
|
|
|
|
|
public function send_refund($send_email, $item, $orderid_info, $advisor_info)
|
|
|
|
|
{
|
|
|
|
|
// 发送客人
|
|
|
|
|
if ( $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-' ) {
|
|
|
|
|
if ($send_email===true
|
|
|
|
|
&& $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-'
|
|
|
|
|
) {
|
|
|
|
|
// 客人邮件中的外联落款
|
|
|
|
|
// $web_code = 'cht'; // 默认cht
|
|
|
|
|
$web_lgc = 1;
|
|
|
|
@ -292,18 +295,18 @@ class PaymentService extends CI_Controller {
|
|
|
|
|
$c_M_RelatedInfo = $item->OPN_SN;
|
|
|
|
|
$c_M_AddTime = $item->OPN_completeTime;
|
|
|
|
|
$c_M_State = 0;
|
|
|
|
|
// $this->account_model->save_automail(
|
|
|
|
|
// $c_fromName,
|
|
|
|
|
// $c_fromEmail,
|
|
|
|
|
// $c_toName,
|
|
|
|
|
// $c_toEmail,
|
|
|
|
|
// $c_subject,
|
|
|
|
|
// $c_body,
|
|
|
|
|
// $c_M_RelatedInfo,
|
|
|
|
|
// $c_M_State,
|
|
|
|
|
// $c_M_AddTime,
|
|
|
|
|
// 'ChinaHighlights refund receipt',
|
|
|
|
|
// 'payment note');
|
|
|
|
|
$this->account_model->save_automail(
|
|
|
|
|
$c_fromName,
|
|
|
|
|
$c_fromEmail,
|
|
|
|
|
$c_toName,
|
|
|
|
|
$c_toEmail,
|
|
|
|
|
$c_subject,
|
|
|
|
|
$c_body,
|
|
|
|
|
$c_M_RelatedInfo,
|
|
|
|
|
$c_M_State,
|
|
|
|
|
$c_M_AddTime,
|
|
|
|
|
'ChinaHighlights refund receipt',
|
|
|
|
|
'payment note');
|
|
|
|
|
$this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send-customer');
|
|
|
|
|
}
|
|
|
|
|
// 更新是否需要发送财务
|
|
|
|
|