Exemplo n.º 1
0
 public static function fromArray($data)
 {
     if (!is_null($data)) {
         $capture = new CaptureResponse();
         foreach ($data as $key => $value) {
             if ($key == "billingReferences") {
                 $capture->{$key} = BillingReferences::fromArray($value);
             } elseif ($key == "customerReference") {
                 $capture->{$key} = CustomerReference::fromArray($value);
             } else {
                 $capture->{$key} = $value;
             }
         }
         return $capture;
     }
 }
Exemplo n.º 2
0
 public static function fromArray($data)
 {
     if (!is_null($data)) {
         $recurringBill = new RecurringBillResponse();
         foreach ($data as $key => $value) {
             if (property_exists(get_class($recurringBill), $key)) {
                 if ($key == "billingReferences") {
                     $recurringBill->{$key} = BillingReferences::fromArray($value);
                 } elseif ($key == "customerReference") {
                     $recurringBill->{$key} = CustomerReference::fromArray($value);
                 } else {
                     $recurringBill->{$key} = $value;
                 }
             }
         }
         return $recurringBill;
     }
 }
Exemplo n.º 3
0
 public static function fromArray($data)
 {
     if (!is_null($data)) {
         $capture = new Bill();
         foreach ($data as $key => $value) {
             if (property_exists(get_class($capture), $key)) {
                 if ($key == "billingReferences") {
                     $capture->{$key} = BillingReferences::fromArray($value);
                 } elseif ($key == "tax_amount" || $key == "base_amount" || $key == "totalAmount" || $key == "shipping_amount") {
                     $capture->{$key} = TransactionAmount::fromArray($value);
                 } else {
                     $capture->{$key} = $value;
                 }
             }
         }
         return $capture;
     }
 }