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


PHP Braintree_Http::get方法代码示例

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


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

示例1: all

 /**
  * 
  * @return Braintree_AddOn[]
  */
 public function all()
 {
     $path = $this->_config->merchantPath() . '/add_ons';
     $response = $this->_http->get($path);
     $addOns = array("addOn" => $response['addOns']);
     return Braintree_Util::extractAttributeAsArray($addOns, 'addOn');
 }
开发者ID:buga1234,项目名称:buga_segforours,代码行数:11,代码来源:AddOnGateway.php

示例2: find

 public static function find($merchant_account_id)
 {
     try {
         $response = Braintree_Http::get('/merchant_accounts/' . $merchant_account_id);
         return self::factory($response['merchantAccount']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('merchant account with id ' . $merchant_account_id . ' not found');
     }
 }
开发者ID:bobstermyang,项目名称:communityfoodshare,代码行数:9,代码来源:MerchantAccount.php

示例3: find

 public static function find($id)
 {
     try {
         $response = Braintree_Http::get('/subscriptions/' . $id);
         return self::factory($response['subscription']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('subscription with id ' . $id . ' not found');
     }
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:9,代码来源:Subscription.php

示例4: find

 /**
  * find a paypalAccount by token
  *
  * @access public
  * @param string $token paypal accountunique id
  * @return object Braintree_PayPalAccount
  * @throws Braintree_Exception_NotFound
  */
 public static function find($token)
 {
     self::_validateId($token);
     try {
         $response = Braintree_Http::get('/payment_methods/paypal_account/' . $token);
         return self::factory($response['paypalAccount']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('paypal account with token ' . $token . ' not found');
     }
 }
开发者ID:kingsj,项目名称:shopping-cart-lite,代码行数:18,代码来源:PayPalAccount.php

示例5: all

 public static function all()
 {
     $response = Braintree_Http::get('/plans');
     if (key_exists('plans', $response)) {
         $plans = array("plan" => $response['plans']);
     } else {
         $plans = array("plan" => array());
     }
     return Braintree_Util::extractAttributeAsArray($plans, 'plan');
 }
开发者ID:bobstermyang,项目名称:communityfoodshare,代码行数:10,代码来源:Plan.php

示例6: testSandboxSSL

 function testSandboxSSL()
 {
     try {
         Braintree_Configuration::environment('sandbox');
         $this->setExpectedException('Braintree_Exception_Authentication');
         Braintree_Http::get('/');
     } catch (Exception $e) {
         Braintree_Configuration::environment('development');
         throw $e;
     }
     Braintree_Configuration::environment('development');
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:12,代码来源:HttpTest.php

示例7: find

 /**
  * find an address by id
  *
  * Finds the address with the given <b>addressId</b> that is associated
  * to the given <b>customerOrId</b>.
  * If the address cannot be found, a NotFound exception will be thrown.
  *
  *
  * @access public
  * @param mixed $customerOrId
  * @param string $addressId
  * @return object Braintree_Address
  * @throws Braintree_Exception_NotFound
  */
 public function find($customerOrId, $addressId)
 {
     $customerId = $this->_determineCustomerId($customerOrId);
     $this->_validateId($addressId);
     try {
         $path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId;
         $response = $this->_http->get($path);
         return Braintree_Address::factory($response['address']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('address for customer ' . $customerId . ' with id ' . $addressId . ' not found.');
     }
 }
开发者ID:buga1234,项目名称:buga_segforours,代码行数:26,代码来源:AddressGateway.php

示例8: find

 /**
  * find a PaymentMethod by token
  *
  * @access public
  * @param string $token payment method unique id
  * @return object Braintree_CreditCard or Braintree_PayPalAccount
  * @throws Braintree_Exception_NotFound
  */
 public static function find($token)
 {
     self::_validateId($token);
     try {
         $response = Braintree_Http::get('/payment_methods/any/' . $token);
         if (isset($response['creditCard'])) {
             return Braintree_CreditCard::factory($response['creditCard']);
         } else {
             if (isset($response['paypalAccount'])) {
                 return Braintree_PayPalAccount::factory($response['paypalAccount']);
             } else {
                 if (is_array($response)) {
                     return Braintree_UnknownPaymentMethod::factory($response);
                 }
             }
         }
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('payment method with token ' . $token . ' not found');
     }
 }
开发者ID:bala223344,项目名称:wordpress-bear,代码行数:28,代码来源:PaymentMethod.php

示例9: find

 /**
  * @access public
  *
  */
 public static function find($id)
 {
     self::_validateId($id);
     try {
         $response = Braintree_Http::get('/transactions/' . $id);
         return self::factory($response['transaction']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('transaction with id ' . $id . ' not found');
     }
 }
开发者ID:anmolview,项目名称:yiidemos,代码行数:14,代码来源:Transaction.php

示例10: fromNonce

 /**
  * Convert a payment method nonce to a credit card
  *
  * @access public
  * @param string $nonce payment method nonce
  * @return object Braintree_CreditCard
  * @throws Braintree_Exception_NotFound
  */
 public static function fromNonce($nonce)
 {
     self::_validateId($nonce, "nonce");
     try {
         $response = Braintree_Http::get('/payment_methods/from_nonce/' . $nonce);
         return self::factory($response['creditCard']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('credit card with nonce ' . $nonce . ' locked, consumed or not found');
     }
 }
开发者ID:netGALAXYStudios,项目名称:ourmovingapp,代码行数:18,代码来源:CreditCard.php

示例11: all

 public static function all()
 {
     $response = Braintree_Http::get('/add_ons');
     $addOns = array("addOn" => $response['addOns']);
     return Braintree_Util::extractAttributeAsArray($addOns, 'addOn');
 }
开发者ID:othreed,项目名称:osCommerce-234-bootstrap-wADDONS,代码行数:6,代码来源:AddOn.php

示例12: find

 /**
  * find an address by id
  *
  * Finds the address with the given <b>addressId</b> that is associated
  * to the given <b>customerOrId</b>.
  * If the address cannot be found, a NotFound exception will be thrown.
  *
  *
  * @access public
  * @param mixed $customerOrId
  * @param string $addressId
  * @return object Braintree_Address
  * @throws Braintree_Exception_NotFound
  */
 public static function find($customerOrId, $addressId)
 {
     $customerId = self::_determineCustomerId($customerOrId);
     self::_validateId($addressId);
     try {
         $response = Braintree_Http::get('/customers/' . $customerId . '/addresses/' . $addressId);
         return self::factory($response['address']);
     } catch (Braintree_Exception_NotFound $e) {
         throw new Braintree_Exception_NotFound('address for customer ' . $customerId . ' with id ' . $addressId . ' not found.');
     }
 }
开发者ID:agency2016,项目名称:rothy_cloudynote,代码行数:25,代码来源:Address.php

示例13: all

 public static function all()
 {
     $response = Braintree_Http::get('/discounts');
     $discounts = array("discount" => $response['discounts']);
     return Braintree_Util::extractAttributeAsArray($discounts, 'discount');
 }
开发者ID:irovast,项目名称:eyedock,代码行数:6,代码来源:Discount.php

示例14: all

 public static function all()
 {
     $response = Braintree_Http::get('/plans');
     $plans = array("plan" => $response['plans']);
     return Braintree_Util::extractAttributeAsArray($plans, 'plan');
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:6,代码来源:Plan.php


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