예제 #1
0
 static function buildFromJSON($vo_json)
 {
     $o_bat = new BankAccountTransaction();
     if (array_key_exists("bank_account_transaction_id", $vo_json)) {
         $o_bat->setBankAccountTransactionId($vo_json["bank_account_transaction_id"]);
     }
     if (array_key_exists('bank_account_transaction_type', $vo_json)) {
         if (gettype($vo_json['bank_account_transaction_type']) === "array") {
             $o_type = (array) $vo_json['bank_account_transaction_type'];
             if (array_key_exists('bank_account_transaction_type_name', $o_type)) {
                 $o_bat->setType($o_type['bank_account_transaction_type_name']);
             }
         } else {
             $o_bat->setType($vo_json['bank_account_transaction_type']);
         }
     }
     if (array_key_exists('bank_account_transaction_method', $vo_json)) {
         if (gettype($vo_json['bank_account_transaction_method']) === "array") {
             $o_method = (array) $vo_json['bank_account_transaction_method'];
             if (array_key_exists('bank_account_transaction_method_name', $o_method)) {
                 $o_bat->setMethod($o_method['bank_account_transaction_method_name']);
             }
         } else {
             $o_bat->setMethod($vo_json['bank_account_transaction_method']);
         }
     }
     if (array_key_exists('bank_account_transaction_recurring_indicator', $vo_json)) {
         $o_bat->setRecurringIndicator($vo_json["bank_account_transaction_recurring_indicator"]);
     }
     if (array_key_exists('bank_account_transaction_routing_number', $vo_json)) {
         $o_bat->setRoutingNumber($vo_json["bank_account_transaction_routing_number"]);
     }
     if (array_key_exists('bank_account_transaction_account_number', $vo_json)) {
         $o_bat->setAccountNumber($vo_json["bank_account_transaction_account_number"]);
     }
     if (array_key_exists('bank_account_transaction_effective_date', $vo_json)) {
         $o_bat->setEffectiveDate(date("m/d/Y H:i:s", strtotime($vo_json["bank_account_transaction_effective_date"])));
     }
     if (array_key_exists('bank_account_transaction_settlement_date', $vo_json)) {
         $o_bat->setSettlementDate(date("m/d/Y H:i:s", strtotime($vo_json["bank_account_transaction_settlement_date"])));
     }
     if (array_key_exists('bank_account_transaction_return_date', $vo_json)) {
         $o_bat->setReturnDate(date("m/d/Y H:i:s", strtotime($vo_json["bank_account_transaction_return_date"])));
     }
     if (array_key_exists('bank_account_transaction_account_name', $vo_json)) {
         $o_bat->setAccountName($vo_json["bank_account_transaction_account_name"]);
     }
     if (array_key_exists('bank_account_transaction_status', $vo_json)) {
         if (gettype($vo_json['bank_account_transaction_status']) === "array") {
             $o_status = (array) $vo_json['bank_account_transaction_status'];
             if (array_key_exists('bank_account_transaction_status_name', $o_status)) {
                 $o_bat->setStatus($o_status['bank_account_transaction_status_name']);
             }
         } else {
             $o_bat->setStatus($vo_json['bank_account_transaction_status']);
         }
     }
     if (array_key_exists('bank_account_transaction_return_code', $vo_json)) {
         $o_bat->setReturnCode($vo_json["bank_account_transaction_return_code"]);
     }
     if (array_key_exists('bank_account_transaction_merchant_transaction_id', $vo_json)) {
         $o_bat->setMerchantTransactionID($vo_json["bank_account_transaction_merchant_transaction_id"]);
     }
     if (array_key_exists('bank_account_transaction_trace', $vo_json)) {
         $o_bat->setTrace($vo_json["bank_account_transaction_trace"]);
     }
     if (array_key_exists('bank_account_transaction_account_type', $vo_json)) {
         if (gettype($vo_json['bank_account_transaction_account_type']) === "array") {
             $o_account_type = (array) $vo_json['bank_account_transaction_account_type'];
             if (array_key_exists('bank_account_transaction_account_type_name', $o_account_type)) {
                 $o_bat->setAccountType($o_account_type['bank_account_transaction_account_type_name']);
             }
         } else {
             $o_bat->setAccountType($vo_json['bank_account_transaction_account_type']);
         }
     }
     // Added to allow intercommunication between CLIENT objects during unit testing//
     if (array_key_exists('messages', $vo_json) && !is_null($vo_json['messages'])) {
         foreach ($vo_json['messages'] as $s_key => $s_msg) {
             $o_bat->addMessage($s_msg);
         }
     }
     if (array_key_exists('bank_account_transaction_amount', $vo_json)) {
         $o_bat->setAmount($vo_json["bank_account_transaction_amount"]);
     }
     if (array_key_exists("bank_account_token", $vo_json)) {
         $o_bat->setToken($vo_json["bank_account_token"]);
     }
     if (array_key_exists("bank_account_transaction_micr_data", $vo_json)) {
         $o_bat->setMICRData($vo_json["bank_account_transaction_micr_data"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field1", $vo_json)) {
         $o_bat->setCustomField1($vo_json["bank_account_transaction_custom_field1"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field2", $vo_json)) {
         $o_bat->setCustomField2($vo_json["bank_account_transaction_custom_field2"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field3", $vo_json)) {
         $o_bat->setCustomField3($vo_json["bank_account_transaction_custom_field3"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field4", $vo_json)) {
         $o_bat->setCustomField4($vo_json["bank_account_transaction_custom_field4"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field5", $vo_json)) {
         $o_bat->setCustomField5($vo_json["bank_account_transaction_custom_field5"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field6", $vo_json)) {
         $o_bat->setCustomField6($vo_json["bank_account_transaction_custom_field6"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field7", $vo_json)) {
         $o_bat->setCustomField7($vo_json["bank_account_transaction_custom_field7"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field8", $vo_json)) {
         $o_bat->setCustomField8($vo_json["bank_account_transaction_custom_field8"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field9", $vo_json)) {
         $o_bat->setCustomField9($vo_json["bank_account_transaction_custom_field9"]);
     }
     if (array_key_exists("bank_account_transaction_custom_field10", $vo_json)) {
         $o_bat->setCustomField10($vo_json["bank_account_transaction_custom_field10"]);
     }
     if (array_key_exists("bank_account_transaction_check_number", $vo_json)) {
         $o_bat->setCheckNumber($vo_json["bank_account_transaction_check_number"]);
     }
     if (array_key_exists("bank_account_transaction_individual_identification_number", $vo_json)) {
         $o_bat->setIndividualIdentificationNumber($vo_json["bank_account_transaction_individual_identification_number"]);
     }
     if (array_key_exists('bank_account_transaction_billing_address', $vo_json)) {
         $o_bat->setBillingAddress(Address::buildFromJSON($vo_json['bank_account_transaction_billing_address']));
     }
     if (array_key_exists("bank_account_transaction_cipher_pay_uuid", $vo_json)) {
         $o_bat->setCipherPayUUID($vo_json["bank_account_transaction_cipher_pay_uuid"]);
     }
     return $o_bat;
 }