|
|
|
|
@ -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();
|
|
|
|
|
|