当前位置: 首页>>代码示例>>PHP>>正文


PHP Errors::fromArray方法代码示例

本文整理汇总了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;
 }
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:23,代码来源:BatchResponseInformation.php

示例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;
 }
开发者ID:payhub,项目名称:payhubws-sdk,代码行数:17,代码来源:RefundInformation.php

示例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;
 }
开发者ID:payhub,项目名称:payhubws-sdk,代码行数:16,代码来源:VerifyResponseInformation.php

示例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;
 }
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:14,代码来源:TransactionReportInformation.php

示例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;
     }
 }
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:20,代码来源:TransactionManager.php

示例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;
 }
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:16,代码来源:SaleResponseInformation.php

示例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;
     }
 }
开发者ID:payhub,项目名称:payhubws-sdk,代码行数:18,代码来源:TransactionReportInformation.php

示例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;
     }
 }
开发者ID:payhub,项目名称:payhubws-sdk,代码行数:53,代码来源:TransactionManager.php

示例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;
 }
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:16,代码来源:AuthorizationResponseInformation.php


注:本文中的Errors::fromArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。