當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。