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


PHP Braintree_Customer::factory方法代码示例

本文整理汇总了PHP中Braintree_Customer::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Customer::factory方法的具体用法?PHP Braintree_Customer::factory怎么用?PHP Braintree_Customer::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Braintree_Customer的用法示例。


在下文中一共展示了Braintree_Customer::factory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGet_givesErrorIfInvalidProperty

 function testGet_givesErrorIfInvalidProperty()
 {
     $this->setExpectedException('PHPUnit_Framework_Error', 'Undefined property on Braintree_Customer: foo');
     $c = Braintree_Customer::factory(array());
     $c->foo;
 }
开发者ID:robelkin,项目名称:braintree_php,代码行数:6,代码来源:CustomerTest.php

示例2: _verifyGatewayResponse

 /**
  * generic method for validating incoming gateway responses
  *
  * creates a new Braintree_Customer object and encapsulates
  * it inside a Braintree_Result_Successful object, or
  * encapsulates a Braintree_Errors object inside a Result_Error
  * alternatively, throws an Unexpected exception if the response is invalid.
  *
  * @ignore
  * @param array $response gateway response values
  * @return object Result_Successful or Result_Error
  * @throws Braintree_Exception_Unexpected
  */
 private function _verifyGatewayResponse($response)
 {
     if (isset($response['customer'])) {
         // return a populated instance of Braintree_Customer
         return new Braintree_Result_Successful(Braintree_Customer::factory($response['customer']));
     } else {
         if (isset($response['apiErrorResponse'])) {
             return new Braintree_Result_Error($response['apiErrorResponse']);
         } else {
             throw new Braintree_Exception_Unexpected("Expected customer or apiErrorResponse");
         }
     }
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:26,代码来源:CustomerGateway.php


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