本文整理汇总了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');
}
示例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');
}
}
示例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');
}
}
示例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');
}
}
示例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');
}
示例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');
}
示例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.');
}
}
示例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');
}
}
示例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');
}
}
示例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');
}
}
示例11: all
public static function all()
{
$response = Braintree_Http::get('/add_ons');
$addOns = array("addOn" => $response['addOns']);
return Braintree_Util::extractAttributeAsArray($addOns, 'addOn');
}
示例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.');
}
}
示例13: all
public static function all()
{
$response = Braintree_Http::get('/discounts');
$discounts = array("discount" => $response['discounts']);
return Braintree_Util::extractAttributeAsArray($discounts, 'discount');
}
示例14: all
public static function all()
{
$response = Braintree_Http::get('/plans');
$plans = array("plan" => $response['plans']);
return Braintree_Util::extractAttributeAsArray($plans, 'plan');
}