本文整理汇总了PHP中Errors::fromArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Errors::fromArray方法的具体用法?PHP Errors::fromArray怎么用?PHP Errors::fromArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Errors
的用法示例。
在下文中一共展示了Errors::fromArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromArray
public static function fromArray($data)
{
$batch = new BatchResponseInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($batch), $key)) {
if ($key == "transactions_detail") {
$myArray = array();
foreach ($value as $keys => $val) {
$_tmp = TransactionReportInformation::fromArray($val);
$myArray[] = $_tmp;
}
$batch->{$key} = $myArray;
} elseif ($key == "errors") {
$batch->{$key} = Errors::fromArray($value);
} elseif ($key == "batch_info") {
$batch->{$key} = BatchInfo::fromArray($value);
} else {
$batch->{$key} = $value;
}
}
}
return $batch;
}
示例2: fromArray
public static function fromArray($data)
{
$refund = new RefundInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($refund), $key)) {
if ($key == "errors") {
$refund->{$key} = Errors::fromArray($value);
}
if ($key == "lastRecurringBillResponse") {
$refund->{$key} = RefundResponse::fromArray($value);
} else {
$refund->{$key} = $value;
}
}
}
return $refund;
}
示例3: fromArray
public static function fromArray($data)
{
$verif = new VerifyResponseInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($verif), $key)) {
if ($key == "verifyResponse") {
$verif->{$key} = VerifyResponse::fromArray($value);
} elseif ($key == "errors") {
$verif->{$key} = Errors::fromArray($value);
} else {
$verif->{$key} = $value;
}
}
}
return $verif;
}
示例4: fromArray
public static function fromArray($data)
{
$trn = new TransactionReportInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($trn), $key)) {
if ($key == "errors") {
$trn->{$key} = Errors::fromArray($value);
} else {
$trn->{$key} = $value;
}
}
}
return $trn;
}
示例5: closeBatch
public function closeBatch($id)
{
if (is_null($id) || $id == "") {
return null;
}
$url = $this->getUrl() . Batch::$BATCH_LINK . $id;
$request = $this->setHeadersPatch($url, $this->_oauthToken);
$result = $this->doPatchForBatch($request);
if (array_key_exists('errors', $result)) {
$errors_tmp = new Errors();
foreach ($result as $errorData) {
$errors_tmp = Errors::fromArray($errorData);
}
$errors[] = $errors_tmp;
return $errors;
} else {
$response = Batch::fromArray($result);
return $response;
}
}
示例6: fromArray
public static function fromArray($data)
{
$sale = new SaleResponseInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($sale), $key)) {
if ($key == "saleResponse") {
$sale->{$key} = SaleResponse::fromArray($value);
} elseif ($key == "errors") {
$sale->{$key} = Errors::fromArray($value);
} else {
$sale->{$key} = $value;
}
}
}
return $sale;
}
示例7: fromArray
public static function fromArray($data)
{
if (!is_null($data)) {
$err = null;
$tri = new TransactionReportInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($tri), $key)) {
$tri->{$key} = $value;
} else {
$err[] = $value;
}
}
if (!is_null($err)) {
$tri->errors = Errors::fromArray($err);
}
return $tri;
}
}
示例8: addMetadata
/**
* @param $datos
* @param $type
* @param $operationId
*/
public function addMetadata($metadata, $type, $operationId)
{
$metadataUrl = null;
if (TransactionType::Sale == $type) {
$metadataUrl = $this->_url . "metadata/forSale/" . $operationId;
}
if (TransactionType::AuthOnly == $type) {
$metadataUrl = $this->_url . "metadata/forAuthOnly/" . $operationId;
}
if (TransactionType::Capture == $type) {
$metadataUrl = $this->_url . "metadata/forCapture/" . $operationId;
}
if (TransactionType::Bill == $type) {
$metadataUrl = $this->_url . "metadata/forBill/" . $operationId;
}
if (TransactionType::CardData == $type) {
$metadataUrl = $this->_url . "metadata/forCardData/" . $operationId;
}
if (TransactionType::Customer == $type) {
$metadataUrl = $this->_url . "metadata/forCustomer/" . $operationId;
}
if (TransactionType::Merchant == $type) {
$metadataUrl = $this->_url . "metadata/forMerchant/" . $operationId;
}
if (TransactionType::RecurringBill == $type) {
$metadataUrl = $this->_url . "metadata/forRecurringBill/" . $operationId;
}
if (TransactionType::Schedule == $type) {
$metadataUrl = $this->_url . "metadata/forSchedule/" . $operationId;
}
if (TransactionType::Refund == $type) {
$metadataUrl = $this->_url . "metadata/forRefund/" . $operationId;
}
if (TransactionType::VoidTransaction == $type) {
$metadataUrl = $this->_url . "metadata/forVoid/" . $operationId;
}
$request = $this->setHeadersPut($metadataUrl, $this->_oauthToken);
$result = $this->doPut($request, $metadata);
if (is_array($result)) {
foreach ($result as $errorData) {
$errors_tmp = Errors::fromArray($errorData);
}
$errors[] = $errors_tmp;
return $errors;
} else {
return true;
}
}
示例9: fromArray
public static function fromArray($data)
{
$auth = new AuthorizationResponseInformation();
foreach ($data as $key => $value) {
if (property_exists(get_class($auth), $key)) {
if ($key == "authOnlyResponse") {
$auth->{$key} = AuthOnlyResponse::fromArray($value);
} elseif ($key == "errors") {
$auth->{$key} = Errors::fromArray($value);
} else {
$auth->{$key} = $value;
}
}
}
return $auth;
}