Пример #1
0
 /**
  * Builds a PushNotification object from the given JSON object
  * @param type $vo_json the JSON representation of the PushNotification
  * @return PushNotification a push notification object
  * @author Rob Kurst <*****@*****.**>
  */
 public static function buildFromJSON($vo_json)
 {
     $o_return = new PushNotification();
     if (array_key_exists("push_notification_type", $vo_json) && $vo_json["push_notification_type"] == "PING") {
         $o_return->setPING();
     }
     if (array_key_exists("push_notification_settlement_batch", $vo_json)) {
         $o_return->setSettlementBatch(SettlementBatch::buildFromJSON($vo_json["push_notification_settlement_batch"]));
     }
     if (array_key_exists("push_notification_bank_account_transaction", $vo_json)) {
         $o_return->setBankAccountTransaction(BankAccountTransaction::buildFromJSON($vo_json["push_notification_bank_account_transaction"]));
     }
     return $o_return;
 }
Пример #2
0
 /**
  * Builds a PushNotification object from the given JSON object
  * @param type $vo_json the JSON representation of the PushNotification
  * @return PushNotification a push notification object
  * @author Rob Kurst <*****@*****.**>
  */
 public static function buildFromJSON($vo_json)
 {
     $o_return = new PushNotification();
     if (array_key_exists("push_notification_type", $vo_json) && $vo_json["push_notification_type"] == "PING") {
         $o_return->setPING();
     }
     if (array_key_exists("push_notification_type", $vo_json) && $vo_json["push_notification_type"] == "INCOMING CHARGEBACK") {
         if (array_key_exists("push_notification_chargeback", $vo_json)) {
             $o_return->setIncomingChargeback(Chargeback::buildFromJSON($vo_json["push_notification_chargeback"]));
         }
     }
     if (array_key_exists("push_notification_settlement_batch", $vo_json)) {
         $o_return->setSettlementBatch(SettlementBatch::buildFromJSON($vo_json["push_notification_settlement_batch"]));
     }
     if (array_key_exists("push_notification_bank_account_transaction", $vo_json)) {
         $o_return->setBankAccountTransaction(BankAccountTransaction::buildFromJSON($vo_json["push_notification_bank_account_transaction"]));
     }
     if (array_key_exists("push_notification_id", $vo_json)) {
         $o_return->setID($vo_json["push_notification_id"]);
     }
     return $o_return;
 }