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; } }
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; } }
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; } }