Example #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_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;
 }
Example #2
0
 /**
  * builds a Chargeback object from the passed in JSON object
  * @param type $o_data JSON representation of a Chargeback
  * @return Chargeback object
  * @author Rob Kurst <*****@*****.**>
  */
 static function buildFromJSON($o_data)
 {
     $o_instance = new Chargeback();
     if (array_key_exists('chargeback_mid', $o_data)) {
         $o_instance->setMid($o_data['chargeback_mid']);
     }
     if (array_key_exists('chargeback_card_number', $o_data)) {
         $o_instance->setCardNumber($o_data['chargeback_card_number']);
     }
     if (array_key_exists('chargeback_transaction_amount', $o_data)) {
         $o_instance->setTransactionAmount($o_data['chargeback_transaction_amount']);
     }
     if (array_key_exists('chargeback_authorization_code', $o_data)) {
         $o_instance->setAuthorizationCode($o_data['chargeback_authorization_code']);
     }
     if (array_key_exists('chargeback_transaction_acquirer_reference_number', $o_data)) {
         $o_instance->setTransactionAcquirerReferenceNumber($o_data['chargeback_transaction_acquirer_reference_number']);
     }
     if (array_key_exists('chargeback_reason_code', $o_data)) {
         $o_instance->setReasonCode($o_data['chargeback_reason_code']);
     }
     if (array_key_exists('chargeback_status', $o_data)) {
         $o_instance->setStatus($o_data['chargeback_status']);
     }
     if (array_key_exists('chargeback_received_date', $o_data)) {
         $o_instance->setReceivedDate($o_data['chargeback_received_date']);
     }
     if (array_key_exists('chargeback_transaction_authorization_date', $o_data)) {
         $o_instance->setTransactionAuthorizationDate($o_data['chargeback_transaction_authorization_date']);
     }
     if (array_key_exists('chargeback_transaction_settlement_date', $o_data)) {
         $o_instance->setTransactionSettlementDate($o_data['chargeback_transaction_settlement_date']);
     }
     return $o_instance;
 }
<?php

require_once 'Vindicia/Soap/Vindicia.php';
require_once 'Vindicia/Soap/Const.php';
$pg = 0;
$pageSize = 100;
$startTimestamp = '2015-02-01T00:00:00';
$endTimestamp = '2015-02-08T00:00:00';
$cb = new Chargeback();
$ret = $cb->fetchDeltaSince($startTimestamp, $endTimestamp, $pg, $pageSize);
// optional to return the complete set of objects returned
//print_r ($ret);
$fetched_CBs = $ret['data']->chargebacks;
if ($fetched_CBs != null) {
    foreach ($fetched_CBs as $cb) {
        print "Found Chargeback VID: " . $cb->VID . "\n";
        print "merchantTransactionId: " . $cb->merchantTransactionId . "\n";
        print "amount is : " . $cb->amount . "\n";
        print "\n";
    }
}
$return_code = $ret['returnCode'];
print "Return Code is: {$return_code} \n";
//print_r ($ret);