|
|
|
|
@ -717,8 +717,11 @@ class Index extends CI_Controller {
|
|
|
|
|
$pn_receiver_account = $GAI_API->payee->email_address;
|
|
|
|
|
$pn_receiver_account_name = $GAI_API->payee->merchant;
|
|
|
|
|
// $pn_receiver_account_name = $this->fundsource_map($pn_receiver_account)->merchant;
|
|
|
|
|
$save_to_pn = $GAI_API->payee->email_address == 'pay@trippest.com' ? true : false;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 'PAYMENT.SALE.REFUNDED':
|
|
|
|
|
$save_to_pn = false;
|
|
|
|
|
case 'PAYMENT.SALE.REVERSED':
|
|
|
|
|
$pn_invoice = $post_data->resource->invoice_number;
|
|
|
|
|
$pn_mc_currency = $post_data->resource->amount->currency;
|
|
|
|
|
@ -741,10 +744,13 @@ class Index extends CI_Controller {
|
|
|
|
|
$post_data->GAI_API = $GAI_API;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'PAYMENT.CAPTURE.COMPLETED':
|
|
|
|
|
case 'PAYMENT.CAPTURE.DECLINED': // todo: CHECKOUT.PAYMENT-APPROVAL.REVERSED
|
|
|
|
|
$save_to_pn = true;
|
|
|
|
|
case 'PAYMENT.CAPTURE.PENDING':
|
|
|
|
|
$save_to_pn = $post_data->event_type !== 'PAYMENT.CAPTURE.PENDING'; // false;
|
|
|
|
|
$save_to_pn = false;
|
|
|
|
|
// $save_to_pn = $post_data->event_type !== 'PAYMENT.CAPTURE.PENDING'; // false;
|
|
|
|
|
case 'PAYMENT.CAPTURE.COMPLETED':
|
|
|
|
|
// $save_to_pn = false;
|
|
|
|
|
$fund_type = 'pay';
|
|
|
|
|
$pn_invoice = $post_data->resource->invoice_id;
|
|
|
|
|
$pn_custom = isset($post_data->resource->custom_id) ? $post_data->resource->custom_id : '';
|
|
|
|
|
@ -760,8 +766,11 @@ class Index extends CI_Controller {
|
|
|
|
|
$post_data->GAI_API = $GAI_API;
|
|
|
|
|
$pn_receiver_account = $GAI_API->payee->email_address;
|
|
|
|
|
$pn_receiver_account_name = $this->fundsource_map($pn_receiver_account)->merchant;
|
|
|
|
|
|
|
|
|
|
$save_to_pn = $post_data->event_type === 'PAYMENT.CAPTURE.COMPLETED' ? ($GAI_API->payee->email_address == 'pay@trippest.com' ? true : false) : $save_to_pn;
|
|
|
|
|
break;
|
|
|
|
|
case 'PAYMENT.CAPTURE.REFUNDED':
|
|
|
|
|
$save_to_pn = false;
|
|
|
|
|
case 'PAYMENT.CAPTURE.REVERSED':
|
|
|
|
|
$fund_type = 'refund';
|
|
|
|
|
$pn_invoice = $post_data->resource->invoice_id;
|
|
|
|
|
|