PayPal 付款账号的认证状态, 先从approved事件获取

webht/payment
Lei OT 6 months ago
parent f0074e88ba
commit 36192408b1

@ -55,8 +55,13 @@ class PaymentService extends CI_Controller {
$search_date = $this->note_model->search_date($data['date'], $method);
$unsend = $this->note_model->unsend_note(false, $method);
$sendfail = $this->note_model->sendfail_note(false, $method);
$pengding = [];
// $this->note_model->get_note_where([
// 'OPN_transactionResult' => ['=', 'pending'],
// 'OPN_noticeSendStatus' => ['!=', 'closed'],
// ], 200);
$closed = $this->note_model->closed_note($data['date'], 300, $method);
$data['notelist'] = array_merge(array_merge($unsend, $sendfail), array_merge($search_date, $closed));
$data['notelist'] = array_merge(array_merge($unsend, $sendfail, $pengding), array_merge($search_date, $closed));
}
array_walk($data["notelist"], 'PaymentService::set_brandname');
@ -449,7 +454,11 @@ class PaymentService extends CI_Controller {
// log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($paypal_order, 1));
// log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($paypal_account, 1));
// log_message('error','test: ' . __METHOD__ . ': ' . __LINE__ . ' ' . PHP_EOL . var_export($item->OPN_noticeType, 1));
if (!empty($paypal_order) && !empty($paypal_account) && $item->OPN_noticeType == 'pay') {
if (!empty($paypal_order) && !empty($paypal_account)
&& $item->OPN_noticeType == 'pay'
// && substr($item->OPN_noticeSendStatus, 0, 4) !== 'send'
&& $item->OPN_noticeSendStatus == ''
) {
$payment_ret = $this->get_paypal_order($paypal_order, $paypal_account);
if (!empty($payment_ret)) {
$where_str = " OPN_SN=" . $item->OPN_SN;
@ -459,8 +468,9 @@ class PaymentService extends CI_Controller {
'OPN_payerLogId' => isset($payment_ret->payer->payer_id) ? $payment_ret->payer->payer_id : '',
'OPN_payerName' => isset($payment_ret->payer->fullname) ? $payment_ret->payer->fullname : '',
'OPN_payerEmail' => isset($payment_ret->payer->email_address) ? $payment_ret->payer->email_address : '',
'OPN_payerStatus' => isset($payment_ret->payer->account_status) ? $payment_ret->payer->account_status : '',
'OPN_subject' => isset($payment_ret->item_number) && empty($item->subject) ? $payment_ret->item_number : $item->subject,
'OPN_noticeSendStatus' => 'closed', // 先忽略
'OPN_noticeSendStatus' => $item->OPN_transactionResult!=='pending' ? 'closed' : 'sendfail', // 先忽略
);
$this->note_model->update_note($where_str, $update_note_column);
return false;
@ -517,6 +527,7 @@ class PaymentService extends CI_Controller {
$payer->fullname = $paypal_order_rows[0]->OPN_payerName;
$payer->payer_id = $paypal_order_rows[0]->OPN_payerLogId;
$payer->email_address = $paypal_order_rows[0]->OPN_payerEmail;
$payer->account_status = $paypal_order_rows[0]->OPN_payerStatus;
}
$ret = new stdClass();

@ -177,7 +177,7 @@ class Online_payment_note_model extends CI_Model {
$this->transactionId ? $sql.=$this->transactionId : false;
$this->orderby ? $sql.=$this->orderby : false;
// log_message('error', PHP_EOL . $sql);
log_message('error', PHP_EOL . $sql);
$query = $this->info->query($sql);
$result = $query->result();
@ -196,13 +196,14 @@ class Online_payment_note_model extends CI_Model {
/**
* @param mixed $where ['OPN_SN' => ['=', {val}] ]
*/
public function get_note_where($where) {
public function get_note_where($where, $num=1) {
$this->init_query();
$this->topnum=1;
$this->topnum=$num;
$this->search = '';
foreach ($where as $key => $value) {
$where_val = '';
switch (strtolower($value[0])) {
$sysbol = strtolower($value[0]);
switch ($sysbol) {
case '=':
$where_val = " = {$this->info->escape($value[1])}";
break;
@ -211,7 +212,7 @@ class Online_payment_note_model extends CI_Model {
break;
default:
$where_val = " = {$this->info->escape($value[1])}";
$where_val = " {$sysbol} {$this->info->escape($value[1])}";
break;
}
$this->search .= " AND {$key} {$where_val} ";

@ -32,6 +32,8 @@
.wechat-color {background-color: #62B900;}
.paypal-color {background-color: #002D89;}
.alipay-color {background-color: #00AAEE;}
.dev-color {background-color: #00A2E8;}
.test-color {background-color: #00A2E8;}
.ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #AD1818;}
.creditcard-lianlian-color {background-color: #1985ff;}
.modal {background-color: rgba(0,0,0,0.075);}

Loading…
Cancel
Save