|
|
|
@ -206,17 +206,22 @@ class Note_model extends CI_Model {
|
|
|
|
|
"pay@trippest.com" => "Trippest", // business":"pay@trippest.com"
|
|
|
|
|
"pays@chinahighlights.com" => "", // "CHT",
|
|
|
|
|
"paypal@chinahighlights.com" => "2", // "CHT",
|
|
|
|
|
"ycc@hainatravel.com" => "dev",
|
|
|
|
|
"0" => "unknown",
|
|
|
|
|
);
|
|
|
|
|
public function set_fundsource(&$ele)
|
|
|
|
|
{
|
|
|
|
|
$ele->fundsource = "";
|
|
|
|
|
$raw = json_decode($ele->pn_memo);
|
|
|
|
|
$business = isset($raw->business) ? $raw->business : (isset($raw->receiver_email) ? $raw->receiver_email : '0');
|
|
|
|
|
$business = isset($raw->business) ? $raw->business : (isset($raw->receiver_email) ? $raw->receiver_email : '');
|
|
|
|
|
$business = (isset($raw->GAI_API->payee) && isset($raw->GAI_API->payee->email_address)) ? $raw->GAI_API->payee->email_address : $business;
|
|
|
|
|
|
|
|
|
|
$business = $business ? $business : '0';
|
|
|
|
|
if ($this->code_fundsource[$business]) {
|
|
|
|
|
$ele->fundsource = $this->code_fundsource[$business];
|
|
|
|
|
}
|
|
|
|
|
if ( ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0)) {
|
|
|
|
|
$is_webhook = ! isset($raw->ipn_track_id) && (isset($raw->id) && strpos($raw->id, "WH-") === 0);
|
|
|
|
|
if ($is_webhook && $business === '0') {
|
|
|
|
|
$ele->fundsource = '';
|
|
|
|
|
}
|
|
|
|
|
$ele->parent_txn_id = isset($raw->parent_txn_id) ? $raw->parent_txn_id : '';
|
|
|
|
|