paypal 退款处理,通知客人

feature/pay
lyt 6 years ago
parent 434dccc50c
commit cc7fc45dba

@ -549,6 +549,7 @@ class AlipayTradeService extends CI_Controller
$this->AlipayTradeQueryContentBuilder->setOutTradeNo($orderId);
}
$response = $this->Query($this->AlipayTradeQueryContentBuilder);
// return $this->output->set_content_type('application/json')->set_output(json_encode($response));
return $response;
}

@ -1 +1 @@
<html> <head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head> <body style="font-size: 12px;font-family: arial,helvetica,sans-serif;margin-top:0;margin-bottom:0;"> <div class=ppmail> <table align=center border=0 cellpadding=0 cellspacing=0 width=100%> <tbody> <tr valign=top> <td width=100%> <table align=center border=0 cellpadding=0 cellspacing=0 style="color:#333333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;" width=100%> <tbody> <tr valign=top> <td> <img src=https://data.chinahighlights.com/pic/alipay_logo.png border=0 alt="PayPal logo"> </td> <td valign=middle align=right> <?php echo $ALI_completeTime;?> <br>Transaction ID:<a target=new href=#> <?php echo $ALI_dealId;?> </a> </td> </tr> </tbody> </table> <div style="margin-top: 10px;color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;"> <span style="color:#333333 !important;font-weight:bold;font-family: arial,helvetica,sans-serif;">Hello Guilin China International Travel Service Co.,Ltd,</span> <br> <span style=font-size:14px;color:#C88039;font-weight:bold;text-decoration:none;>You received a payment of <?php echo $ALI_orderAmount;?> <?php echo $ALI_currencyCode;?> </span> <br> <table cellpadding=5 style="color:#333333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;"> <tbody> <tr> <td valign=top>Thanks for using iPayLinks.You can now ship any items.To see all the transaction details,log in to your iPayLinks account.<br>It may take a few moments for this transaction to appear in your account.<br> <span style=font-weight:bold;color:#333333;>Seller Protection-</span> <span style="color: #4c8f3a;"> </span> </td> <td> </td> </tr> </tbody> </table> <div style="margin-top:0px;border-bottom:1px solid #aaaaaa;"> </div> <table border=0 cellpadding=0 cellspacing=0 style="color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px; margin-bottom:5px;" width=98% align=left> <tbody> <tr> <td style=padding-top:5px; valign=top width=50% align=left> <span style=color:#333333;font-weight:bold;>Buyer</span> <br> <?php echo $ALI_payerName;?> <br> <?php echo $ALI_payerEmail;?> <br> </td> <td style=padding-top:5px; valign=top> </td> </tr> </tbody> </table> <table align=center border=0 cellpadding=0 cellspacing=0 style="clear:both;color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;margin-top:5px;" width=100%> <tbody> <tr> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=330 align=left>Description</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=75 align=right>&nbsp;</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=75 align=right>&nbsp;</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=80 align=right>Amount</td> </tr> <tr> <td style=padding:10px; width=330 align=left> <?php echo $ALI_orderId;?> <br> </td> <td style=padding:10px; width=75 align=right> </td> <td style=padding:10px; width=75 align=right> </td> <td style=padding:10px; width=80 align=right> <?php echo $ALI_orderAmount;?> <?php echo $ALI_currencyCode;?> </td> </tr> </tbody> </table> </tr> </tbody> </table> </div> </body> </html>
<html> <head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head> <body style="font-size: 12px;font-family: arial,helvetica,sans-serif;margin-top:0;margin-bottom:0;"> <div class=ppmail> <table align=center border=0 cellpadding=0 cellspacing=0 width=100%> <tbody> <tr valign=top> <td width=100%> <table align=center border=0 cellpadding=0 cellspacing=0 style="color:#333333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;" width=100%> <tbody> <tr valign=top> <td> <img src=https://data.chinahighlights.com/pic/alipay_logo.png border=0 alt="PayPal logo"> </td> <td valign=middle align=right> <?php echo $ALI_completeTime;?> <br>Transaction ID:<a target=new href=#> <?php echo $ALI_dealId;?> </a> </td> </tr> </tbody> </table> <div style="margin-top: 10px;color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;"> <span style="color:#333333 !important;font-weight:bold;font-family: arial,helvetica,sans-serif;">Hello Guilin China International Travel Service Co.,Ltd,</span> <br> <span style=font-size:14px;color:#C88039;font-weight:bold;text-decoration:none;>You received a payment of <?php echo $ALI_orderAmount;?> <?php echo $ALI_currencyCode;?> </span> <br> <table cellpadding=5 style="color:#333333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;"> <tbody> <tr> <td valign=top>Thanks for using Alipay.You can now ship any items.To see all the transaction details,log in to your Alipay account.<br>It may take a few moments for this transaction to appear in your account.<br> <span style=font-weight:bold;color:#333333;>Seller Protection-</span> <span style="color: #4c8f3a;"> </span> </td> <td> </td> </tr> </tbody> </table> <div style="margin-top:0px;border-bottom:1px solid #aaaaaa;"> </div> <table border=0 cellpadding=0 cellspacing=0 style="color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px; margin-bottom:5px;" width=98% align=left> <tbody> <tr> <td style=padding-top:5px; valign=top width=50% align=left> <span style=color:#333333;font-weight:bold;>Buyer</span> <br> <?php echo $ALI_payerName;?> <br> <?php echo $ALI_payerEmail;?> <br> </td> <td style=padding-top:5px; valign=top> </td> </tr> </tbody> </table> <table align=center border=0 cellpadding=0 cellspacing=0 style="clear:both;color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;margin-top:5px;" width=100%> <tbody> <tr> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=330 align=left>Description</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=75 align=right>&nbsp;</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=75 align=right>&nbsp;</td> <td style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width=80 align=right>Amount</td> </tr> <tr> <td style=padding:10px; width=330 align=left> <?php echo $ALI_orderId;?> <br> </td> <td style=padding:10px; width=75 align=right> </td> <td style=padding:10px; width=75 align=right> </td> <td style=padding:10px; width=80 align=right> <?php echo $ALI_orderAmount;?> <?php echo $ALI_currencyCode;?> </td> </tr> </tbody> </table> </tr> </tbody> </table> </div> </body> </html>

@ -897,6 +897,7 @@ class Index extends CI_Controller {
$parent_txn_id = json_decode($item->pn_memo)->parent_txn_id;
$parent_note = $this->Note_model->note($parent_txn_id);
if (empty($parent_note)) {
$this->Note_model->update_send($item->pn_txn_id, 'sendfail');
return false;
}
//订单号
@ -947,7 +948,7 @@ class Index extends CI_Controller {
$this->Paypal_model->add_account_info($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, $item->pn_payer_email, $item->pn_txn_id, $ht_memo);
}
}
//更新还没有填的客邮和交易号de收款记录(传统订单)
//更新还没有填的客邮和交易号收款记录(传统订单)
elseif (isset($advisor_info->order_type) && $advisor_info->order_type == 1) {
$ht_memo = '(自动)退款号:' . $item->pn_txn_id . "\n. ";
$ht_memo .= '原交易号:' . $parent_txn_id;
@ -958,7 +959,6 @@ class Index extends CI_Controller {
}
}
$opi_email = !empty($advisor_info->OPI_Email) ? $advisor_info->OPI_Email : ''; //lussie@chinahighlights.net
$opi_firstname = !empty($advisor_info->OPI_FirstName) ? $advisor_info->OPI_FirstName : !empty($advisor_info->OPI_Name) ? $advisor_info->OPI_Name : ''; //lussie
@ -967,9 +967,13 @@ class Index extends CI_Controller {
$this->Note_model->update_send($item->pn_txn_id, 'sendfail');
return false;
}
// TODO site_code
$web_code = $advisor_info->COLI_WebCode;
$site_info = $this->config->item('site');
$site_info = $site_info['cht'];
if ( ! isset($site_info[$web_code])) {
$web_code = 'cht';
}
$site_info = $site_info[$web_code];
$advisor_detail = $this->Paypal_model->get_advisor_detail($advisor_info->OPI_SN, $site_info['site_lgc']);
$item->advisor_detail = $advisor_detail;
$item->site = $site_info['site_url'];
@ -980,19 +984,38 @@ class Index extends CI_Controller {
$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;
$body = $this->load->view('mail_templete', $item, true);
$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');
// TODO 通知客人
$this->load->view('refund_buyer', $item);
// 通知客人, 客人邮箱
$customer_detail = $this->Paypal_model->get_customer_detail($advisor_info->COLI_SN, $orderid_info->ordertype);
$c_fromName = $advisor_detail->OPI2_Name;
$c_fromEmail = $advisor_detail->OPI_Email;
$c_toName = $customer_detail->fullname;
$c_toEmail = $customer_detail->email;
$c_subject = $item->pn_mc_currency . " " . str_replace('-', '', $item->pn_mc_gross) . " Refunded to your account, booking number " . $item->pn_invoice;
$c_body = $this->load->view('refund_buyer', $item, true);
$c_M_RelatedInfo = $item->pn_sn;
$c_M_AddTime = $item->pn_payment_date;
$c_M_State = 0;
$this->Paypal_model->save_automail(
$c_fromName,
$c_fromEmail,
$c_toName,
$c_toEmail,
$c_subject,
$c_body,
$c_M_RelatedInfo,
$c_M_State,
$c_M_AddTime,
'paypal refund receipt');
$this->Note_model->update_send($item->pn_txn_id, 'send-customer');
// TODO 通知财务, 如果已做账
//添加邮件发送记录 end
return $this->Note_model->update_send($item->pn_txn_id, 'send');
return ;
}
public function trippest_note($orderid_info, $paypal_msg)

@ -619,4 +619,21 @@ class Paypal_model extends CI_Model {
where OPI_SN=? and LGC_LGC=? ";
return $this->HT->query($sql, array($OPI_SN, $lgc))->row();
}
public function get_customer_detail($COLI_SN, $ordertype)
{
if ($ordertype === 'T') {
$sql = "SELECT mei.MEI_FirstName+' '+isnull(mei.MEI_MiddleName,'')+' '+isnull(mei.MEI_LastName,'') fullname,
mei.MEI_MailList email
FROM MEmberInfo mei
INNER JOIN CUstomerList cul on mei.MEI_SN=cul.CUL_CUI_SN and cul.CUL_IsLinkMan=1
WHERE CUL_COLI_SN=? ";
return $this->HT->query($sql, $COLI_SN)->row();
} else {
$sql = "SELECT GUT_FirstName+' '+GUT_LastName fullname,GUT_Email email from BIZ_GUEST g
INNER JOIN BIZ_ConfirmLineInfo coli on coli.COLI_GUT_SN=g.GUT_SN
WHERE COLI_SN=? ";
return $this->HT->query($sql, $COLI_SN)->row();
}
}
}

@ -209,7 +209,7 @@ echo "<option value=\"$vf->TEL_SN@" . strstr($vf->TEL_transactionDate, " ", true
$show_send = '';
$class_css = '';
$show_record = '查看录入状态';
if ($item->pn_send == 'send') {
if ($item->pn_send == 'send' || substr($item->pn_send, 0, 5) == "send-") {
$show_send = $item->pn_send;
} elseif ($item->pn_send == 'closeRecord') {
$show_send = $show_record = '已忽略';

Loading…
Cancel
Save