PayPal webhook 时间; style: payment_list

webht/payment
Lei OT 6 months ago
parent e7a83740ec
commit cce47f2111

@ -230,7 +230,9 @@ class Online_payment_note_model extends CI_Model {
$search_sql.=" AND ( OPN_transactionId = '$keyword'
OR OPN_relatedId like '%$keyword%'
OR OPN_orderId like '%$keyword%'
OR OPN_rawOrderId like '%$keyword%' )";
OR OPN_rawOrderId like '%$keyword%'
OR OPN_payerEmail like '%$keyword%'
)";
}
$this->search = $search_sql;
return $this->query_note();
@ -240,7 +242,10 @@ class Online_payment_note_model extends CI_Model {
{
$this->init_query();
$this->search = $method===null ? "" : " AND OPN_accountMethod IN ($method) ";
$this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' ";
$this->search .= " AND (OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59'
OR OPN_noticeSendTime BETWEEN '$date 00:00:00' AND '$date 23:59:59'
)
";
$this->send = " AND isnull(OPN_noticeSendStatus,'') NOT IN ('', 'sendfail', 'unsend', 'closed' )";
return $this->query_note();
}

@ -41,6 +41,8 @@
.highlights-color {background-color: #eb5e26;}
.trippest-color {background-color: #E83201;}
.opacity-4 {opacity: 0.4;}
.app-color {background-color: #EC3A4F;}
.hly-color {background-color: #009fe9;}
.unknown-color{ background-color: #999999;}
@ -49,12 +51,12 @@
.table td { word-break: break-word; }
/* .text-completed {color: #00CC00;} */
/* .text-pending {color: #ff9900;} */
.text-pending {color: #00A2E8;}
.text-declined {color: #a94442;}
.text-under_review {color: #ff9900;}
.text-resolved {color: #ff9900;}
.text-customer_dispute_updated {color: #ff9900;}
.text-approved {color: #777;}
.text-pending, .text-pending a:not(.btn) {color: #00A2E8;}
.text-declined, .text-declined a:not(.btn) {color: #c0192a;}
.text-under_review, .text-under_review a:not(.btn) {color: #ff9900;}
.text-resolved, .text-resolved a:not(.btn) {color: #ff9900;}
.text-customer_dispute_updated, .text-customer_dispute_updated a:not(.btn) {color: #ff9900;}
.text-approved, .text-approved a:not(.btn) {color: #777;}
.flex {display: flex;}
.items-center {align-items: center;}
@ -278,8 +280,12 @@
?>
<tr class="<?php echo $item->OPN_transactionResult !== 'completed' ? "text-{$item->OPN_transactionResult}" : ''; ?> text-<?= str_ireplace('.', '_', strtolower($item->OPN_resultMsg)) ?>">
<td><?php echo $key+1; ?></td>
<td><span class="brand_text <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->brand_name; ?></span>
<span class="brand_text <?php echo strtolower(str_replace('cht', '',str_replace(" ","",$item->OPN_fundSource)))."-color"; ?>"><?php echo str_replace('cht', '', $item->OPN_fundSource); ?></span><div></div>
<td>
<span class="brand_text <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->brand_name; ?></span>
<?php if ($item->OPN_paymentSource != '' && stripos($item->OPN_paymentSource, $item->brand_name) === false) { ?>
<span class="brand_text opacity-4 <?php echo strtolower(str_replace(" ","",$item->brand_name))."-color"; ?>"><?php echo $item->OPN_paymentSource; ?></span>
<?php } ?>
<span class="brand_text <?php echo strtolower(str_replace('cht', '',str_replace(" ","",$item->OPN_fundSource)))."-color"; ?>"><?php echo str_replace('cht', '', $item->OPN_fundSource); ?></span><div></div>
<a href="<?php $p_invoice = explode('_', $item->OPN_invoiceId);
echo set_url_param(
@ -293,7 +299,9 @@
<span><?php // echo $item->OPN_orderId . ' / ' ?>&nbsp;/&nbsp;<b><?php echo $item->OPN_orderAmount; ?></b><?php echo $item->OPN_currency; ?></span>
<?php // echo $item->OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?>
</td>
<td><?= $item->OPN_payerName .'<br>'. $item->OPN_payerEmail ?></td>
<td><?= $item->OPN_payerName .'<br>' ?>
<a href="<?php echo set_url_param(array('keywords'=>$item->OPN_payerEmail,'method' => '','date'=>'')); ?>"><?php echo $item->OPN_payerEmail; ?></a>
</td>
<td class="hidden-xs">
<?php if ($item->app_name) { ?>
<span class="brand_text <?php echo strtolower(str_replace(" ","",$item->app_name))."-color"; ?>"><?php echo $item->app_name; ?></span>
@ -307,10 +315,10 @@
<?php // echo $item->OPN_remark ? "<div>{$item->OPN_remark}</div>" : ''; ?>
</td>
<td class="hidden-xs"><?php // echo $item->OPN_transactionId; ?>
<a href="<?php echo set_url_param(array('keywords'=>$item->OPN_transactionId,'method' => '',)); ?>"><?php echo $item->OPN_transactionId; ?></a>
<a href="<?php echo set_url_param(array('keywords'=>$item->OPN_transactionId,'method' => '','date'=>'')); ?>"><?php echo $item->OPN_transactionId; ?></a>
<div>
<?php if ($item->OPN_relatedId) { ?>
<a href="<?php echo set_url_param(array('keywords'=>$item->OPN_relatedId,'method' => '',)); ?>"><?php echo $item->OPN_relatedId; ?></a>
<a href="<?php echo set_url_param(array('keywords'=>$item->OPN_relatedId,'method' => '','date'=>'')); ?>"><?php echo $item->OPN_relatedId; ?></a>
<?php } ?>
</div>
</td>
@ -340,15 +348,21 @@
if ($item->OPN_transactionResult !== 'completed') {
$cls = "text-{$item->OPN_transactionResult}";
$text = strtoupper($item->OPN_transactionResult);
$send_text = $item->OPN_noticeType !== 'pay' ? strtoupper($item->OPN_noticeType) : $item->OPN_resultCode;
echo "<span class={$cls} >{$text}</span><br>";
} elseif ($item->OPN_noticeType !== 'pay') {
$send_text = $item->OPN_noticeType == 'refund' ? strtoupper($item->OPN_transactionResult) : $item->OPN_resultCode;
echo '<span class=text-danger >' . strtoupper($item->OPN_noticeType) . '</span><br>';
} else {
$send_text = ($item->OPN_noticeSendStatus ? $item->OPN_noticeSendStatus : '⏳');
echo '<span class="text-success" >' . strtoupper($item->OPN_transactionResult) . '</span><br>';
} ?>
<div class="flex items-center">
<!-- <button type="button" class="btn btn-sm btn-default <?php // echo $send_class; ?>" onclick="show_gai_modal('<?php // echo $item->OPN_SN; ?>')">
<?php // echo $send_text; ?>
</button> -->
<a href="javascript:void(0);" class="btn btn-sm <?php echo $send_class; ?>" onclick="show_gai_modal('<?php echo $item->OPN_SN; ?>')">
<?php echo $item->OPN_noticeSendStatus ? $item->OPN_noticeSendStatus : '⏳' ; ?>
<?php echo $send_text ; ?>
</a>
<span class="ml-auto"><?php echo ($recored_text); ?></span>
</div>
@ -471,7 +485,7 @@ jQuery.browser = {};
$('#modal_set_gai').modal('show');
},
error: function(msg) {
alert('\u53d1\u751f\u9519\u8bef\uff0c\u8bf7\u8054\u7cfbYoyo...');
alert('\u53d1\u751f\u9519\u8bef\uff0c\u8bf7\u8054\u7cfbYoyo....');
}
});
}

@ -741,6 +741,7 @@ class Index extends CI_Controller {
case 'PAYMENT.CAPTURE.COMPLETED':
case 'PAYMENT.CAPTURE.DECLINED': // todo: CHECKOUT.PAYMENT-APPROVAL.REVERSED
case 'PAYMENT.CAPTURE.PENDING':
$save_to_pn = $post_data->event_type !== 'PAYMENT.CAPTURE.PENDING'; // false;
$fund_type = 'pay';
$pn_invoice = $post_data->resource->invoice_id;
$pn_custom = isset($post_data->resource->custom_id) ? $post_data->resource->custom_id : '';
@ -863,6 +864,7 @@ class Index extends CI_Controller {
// $pn_mc_gross = '-' . $post_data->resource->amount->total;
// $post_data->parent_txn_id = $post_data->resource->sale_id;
// }
$create_time = isset($post_data->resource->create_time) ? $post_data->resource->create_time : $post_data->resource->update_time;
$pn_payment_date = isset($post_data->resource->update_time) ? $post_data->resource->update_time : $post_data->resource->create_time;
// $pn_payer = $post_data->resource->amount->currency;
// $pn_payer_email = $post_data->resource->amount->currency;
@ -870,6 +872,7 @@ class Index extends CI_Controller {
$pn_memo = json_encode($post_data); // $raw_post;
if (!empty($pn_txn_id)) {
//把PDT时间转成GMT时间
$create_time = gmdate('Y-m-d H:i:s', strtotime($create_time));
$pn_payment_date = gmdate('Y-m-d H:i:s', strtotime($pn_payment_date));
if ($save_to_pn) {
$this->Note_model->save_paypal_note(
@ -902,6 +905,7 @@ class Index extends CI_Controller {
'net_amount' => $net_amount,
'pay_fee' => isset($post_data->mc_fee) ? $post_data->mc_fee : 0,
'transaction_status' => $transaction_status, // $pn_payment_status, OPN_transactionResult
'payment_create' => $create_time,
'payment_date' => $pn_payment_date,
'fund_source' => $pn_receiver_account_name,
'fund_type' => $fund_type,

@ -573,6 +573,7 @@ class Online_payment_note_model extends CI_Model {
$this->load->model('paypal_model', 'account_model');
$ssje = $this->account_model->get_ssje_exclude_fee($result_data['net_amount'],'', str_replace("CNY", "RMB", strtoupper($result_data['pay_currency'])));
$localSqlDateTime0 = date('Y-m-d H:i:s', strtotime($result_data['payment_create']) + 3600 * 8);
$localSqlDateTime = date('Y-m-d H:i:s', strtotime($result_data['payment_date']) + 3600 * 8);
$save_column = array();
@ -586,7 +587,7 @@ class Online_payment_note_model extends CI_Model {
$save_column['OPN_entryAmountCNY'] = floatval($ssje);
$save_column['OPN_noticeType'] = $result_data['fund_type'];
$save_column['OPN_relatedId'] = $result_data['referer_id'];
$save_column['OPN_acquiringTime'] = $localSqlDateTime;
$save_column['OPN_acquiringTime'] = $localSqlDateTime0;
$save_column['OPN_completeTime'] = $localSqlDateTime;
$save_column['OPN_accountMethod'] = 15002; // $this->config->item('method_code', 'paypal');

Loading…
Cancel
Save