perf: PayPal退款处理: 只有wh记录

webht/payment
Lei OT 10 months ago
parent cfa8070b3b
commit 160d6e6621

@ -1250,10 +1250,14 @@ class Index extends CI_Controller {
$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;
$orderid_info = $this->analysis_orderid($item->pn_invoice);
if ( ! $handpick) {
return false;
}
} else {
//订单号
$orderid_info = $this->analysis_orderid($parent_note->pn_invoice);
}
//订单号
$orderid_info = $this->analysis_orderid($parent_note->pn_invoice);
//找不到订单号,设置为发送失败标示
if (empty($orderid_info)) {
@ -1303,7 +1307,7 @@ class Index extends CI_Controller {
$refund_amount = 0;
if (isset($payment_memo->id) && substr($payment_memo->id, 0, 2)==="WH") {
$is_webhook = true;
$refund_amount = $payment_memo->refund_from_received_amount;
$refund_amount = isset($payment_memo->refund_from_received_amount) ? $payment_memo->refund_from_received_amount : '-'.$payment_memo->resource->amount->value;
// $payment_fee = $payment_memo->resource->refund_from_transaction_fee->value;
$payment_fee = property_exists($payment_memo, 'mc_fee') ? $payment_memo->mc_fee : $payment_memo->resource->refund_from_transaction_fee->value;
} else {
@ -1370,6 +1374,8 @@ class Index extends CI_Controller {
$advisor_detail = $this->Paypal_model->get_advisor_detail($advisor_info->COLI_SN, $advisor_info->OPI_SN, $web_lgc);
$item->advisor_detail = $advisor_detail;
$item->payment_date = isset($item->payment_date) ? $item->payment_date : $item->pn_payment_date;
//给外联发送通知邮件
$fromName = !empty($item->pn_payer) ? $item->pn_payer : '';
$fromEmail = !empty($item->pn_payer_email) ? $item->pn_payer_email : '';

@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=http://www.w3.org/1999/xhtml> <head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><title>Your Submission Was Successful! - China Highlights</title><style type=text/css>* { margin:0; font-family: Verdana, Arial, Helvetica, sans-serif; }body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#545454; right: auto; }img, ul, ul li { padding:0; margin:0; border:0; }#warp { border-top:8px solid #a31022!important; }#logo { border: none!important}#logo, #surveyContent { width:210mm; margin:5px auto; padding:5px; }h1 { margin:15px 0 10px 0; font-size:24px; border-bottom:1px solid #d9d9d9; color:#545454; }h2 { margin:15px 0 10px 0; font-size:20px; color:#545454; }.tableSurvey table td { padding:5px; }.tableSurvey table td strong { margin-top:8px; }.tableSurvey1 { border:1px solid #e1e1e1; }.tableSurvey1 th { border:1px solid #fff; height:30px; padding-right:10px; text-align:right; background:#f1f1f1; }.tableSurvey1 td { border:1px solid #f9f9f9; padding:5px; text-align:center; width:80px; }.tableSurvey2 { border:1px solid #e1e1e1; }.tableSurvey2 th { border:1px solid #fff; padding:5px 10px; text-align:right; background:#f1f1f1; font-weight:normal; }.tableSurvey2 td { border:1px solid #f9f9f9; padding:5px; text-align:center; width:80px; }.blue{ color:#0070C0}.text-bold {font-weight: bold;}.text-right{text-align: right;}.title-bold{font-weight: bold;background-color: #ddd;padding: 3px 0;}</style></head> <body> <div id=warp> <div id=surveyContent> <?php $raw = json_decode($pn_memo); $c_gross = str_replace("-", "", $pn_mc_gross); ?> <p>Dear <?php echo $pn_payer ?>,</p> <br> <p>China Highlights has refunded to your account today - <?php echo $c_gross ?><?php echo $pn_mc_currency ?>. The transaction to appear on your account may take up to 2-weeks.</p> <br> <p>Please find below details of your refund transaction:</p> <br> <p class=title-bold>Transaction details</p> <p><?php echo $raw->payment_date ?></p> <p>Payment status: <?php echo $pn_payment_status ?></p> <br> <p class=title-bold>Payment details</p> <p>Gross amount</p> <p class=text-right><?php echo $pn_mc_gross ?> <?php echo $pn_mc_currency ?></p> <br> <p class=title-bold>Invoice ID</p> <p><?php echo $pn_invoice ?></p> <br> <p class=title-bold>Contact information</p> <p><?php echo $pn_payer ?></p> <p><?php echo $pn_payer_email ?></p> <br> <br> <pre style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:13px;">
<html xmlns=http://www.w3.org/1999/xhtml> <head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><title>Your Submission Was Successful! - China Highlights</title><style type=text/css>* { margin:0; font-family: Verdana, Arial, Helvetica, sans-serif; }body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:13px; color:#545454; right: auto; }img, ul, ul li { padding:0; margin:0; border:0; }#warp { border-top:8px solid #a31022!important; }#logo { border: none!important}#logo, #surveyContent { width:210mm; margin:5px auto; padding:5px; }h1 { margin:15px 0 10px 0; font-size:24px; border-bottom:1px solid #d9d9d9; color:#545454; }h2 { margin:15px 0 10px 0; font-size:20px; color:#545454; }.tableSurvey table td { padding:5px; }.tableSurvey table td strong { margin-top:8px; }.tableSurvey1 { border:1px solid #e1e1e1; }.tableSurvey1 th { border:1px solid #fff; height:30px; padding-right:10px; text-align:right; background:#f1f1f1; }.tableSurvey1 td { border:1px solid #f9f9f9; padding:5px; text-align:center; width:80px; }.tableSurvey2 { border:1px solid #e1e1e1; }.tableSurvey2 th { border:1px solid #fff; padding:5px 10px; text-align:right; background:#f1f1f1; font-weight:normal; }.tableSurvey2 td { border:1px solid #f9f9f9; padding:5px; text-align:center; width:80px; }.blue{ color:#0070C0}.text-bold {font-weight: bold;}.text-right{text-align: right;}.title-bold{font-weight: bold;background-color: #ddd;padding: 3px 0;}</style></head> <body> <div id=warp> <div id=surveyContent> <?php $raw = json_decode($pn_memo); $c_gross = str_replace("-", "", $pn_mc_gross); ?> <p>Dear <?php echo $pn_payer ?>,</p> <br> <p>China Highlights has refunded to your account today - <?php echo $c_gross ?><?php echo $pn_mc_currency ?>. The transaction to appear on your account may take up to 2-weeks.</p> <br> <p>Please find below details of your refund transaction:</p> <br> <p class=title-bold>Transaction details</p> <p><?php echo isset($raw->payment_date) ? $raw->payment_date : $pn_payment_date ?></p> <p>Payment status: <?php echo $pn_payment_status ?></p> <br> <p class=title-bold>Payment details</p> <p>Gross amount</p> <p class=text-right><?php echo $pn_mc_gross ?> <?php echo $pn_mc_currency ?></p> <br> <p class=title-bold>Invoice ID</p> <p><?php echo $pn_invoice ?></p> <br> <p class=title-bold>Contact information</p> <p><?php echo $pn_payer ?></p> <p><?php echo $pn_payer_email ?></p> <br> <br> <pre style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:13px;">
Best Regards!
<?php echo $advisor_detail->fullname ?>, Travel Advisor<br>

Loading…
Cancel
Save