本文整理匯總了PHP中Braintree_Http::put方法的典型用法代碼示例。如果您正苦於以下問題:PHP Braintree_Http::put方法的具體用法?PHP Braintree_Http::put怎麽用?PHP Braintree_Http::put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Braintree_Http
的用法示例。
在下文中一共展示了Braintree_Http::put方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
/**
* updates the address record
*
* if calling this method in context,
* customerOrId is the 2nd attribute, addressId 3rd.
* customerOrId & addressId are not sent in object context.
*
*
* @access public
* @param array $attributes
* @param mixed $customerOrId (only used in call)
* @param string $addressId (only used in call)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public function update($customerOrId, $addressId, $attributes)
{
$this->_validateId($addressId);
$customerId = $this->_determineCustomerId($customerOrId);
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$path = $this->_config->merchantPath() . '/customers/' . $customerId . '/addresses/' . $addressId;
$response = $this->_http->put($path, array('address' => $attributes));
return $this->_verifyGatewayResponse($response);
}
示例2: testSearch_daysPastDue
function testSearch_daysPastDue()
{
$creditCard = Braintree_SubscriptionTestHelper::createCreditCard();
$triallessPlan = Braintree_SubscriptionTestHelper::triallessPlan();
$subscription = Braintree_Subscription::create(array('paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id']))->subscription;
Braintree_Http::put('/subscriptions/' . $subscription->id . '/make_past_due', array('daysPastDue' => 5));
$found = false;
$collection = Braintree_Subscription::search(array(Braintree_SubscriptionSearch::daysPastDue()->between(2, 10)));
foreach ($collection as $item) {
$found = true;
$this->assertTrue($item->daysPastDue <= 10);
$this->assertTrue($item->daysPastDue >= 2);
}
$this->assertTrue($found);
}
示例3: cancelRelease
public static function cancelRelease($transactionId)
{
self::_validateId($transactionId);
$response = Braintree_Http::put('/transactions/' . $transactionId . '/cancel_release', array());
return self::_verifyGatewayResponse($response);
}
示例4: escrow
public static function escrow($transactionId)
{
$http = new Braintree_Http(Braintree_Configuration::$global);
$path = Braintree_Configuration::$global->merchantPath() . '/transactions/' . $transactionId . '/escrow';
$http->put($path);
}
示例5: escrow
public static function escrow($transactionId)
{
Braintree_Http::put('/transactions/' . $transactionId . '/escrow');
}
示例6: test_rangeNode_settledAt
function test_rangeNode_settledAt()
{
$transaction = Braintree_Transaction::saleNoValidate(array('amount' => '1000.00', 'creditCard' => array('number' => '4111111111111111', 'expirationDate' => '05/12'), 'options' => array('submitForSettlement' => true)));
Braintree_Http::put('/transactions/' . $transaction->id . '/settle');
$transaction = Braintree_Transaction::find($transaction->id);
$twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC"));
$ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC"));
$ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC"));
$collection = Braintree_Transaction::search(array(Braintree_TransactionSearch::id()->is($transaction->id), Braintree_TransactionSearch::settledAt()->between($twenty_min_ago, $ten_min_ago)));
$this->assertEquals(0, $collection->maximumCount());
$collection = Braintree_Transaction::search(array(Braintree_TransactionSearch::id()->is($transaction->id), Braintree_TransactionSearch::settledAt()->between($ten_min_ago, $ten_min_from_now)));
$this->assertEquals(1, $collection->maximumCount());
$this->assertEquals($transaction->id, $collection->firstItem()->id);
}
示例7: testRetryCharge_WithAmount
function testRetryCharge_WithAmount()
{
$subscription = Braintree_SubscriptionTestHelper::createSubscription();
Braintree_Http::put('/subscriptions/' . $subscription->id . '/make_past_due');
$result = Braintree_Subscription::retryCharge($subscription->id, 1000);
$this->assertTrue($result->success);
$transaction = $result->transaction;
$this->assertEquals(1000, $transaction->amount);
$this->assertNotNull($transaction->processorAuthorizationCode);
$this->assertEquals(Braintree_Transaction::SALE, $transaction->type);
$this->assertEquals(Braintree_Transaction::AUTHORIZED, $transaction->status);
}
示例8: _doUpdate
private static function _doUpdate($url, $params)
{
$response = Braintree_Http::put($url, $params);
return self::_verifyGatewayResponse($response);
}
示例9: update
/**
* updates the address record
*
* if calling this method in static context,
* customerOrId is the 2nd attribute, addressId 3rd.
* customerOrId & addressId are not sent in object context.
*
*
* @access public
* @param array $attributes
* @param mixed $customerOrId (only used in static call)
* @param string $addressId (only used in static call)
* @return object Braintree_Result_Successful or Braintree_Result_Error
*/
public static function update($customerOrId, $addressId, $attributes)
{
self::_validateId($addressId);
$customerId = self::_determineCustomerId($customerOrId);
Braintree_Util::verifyKeys(self::updateSignature(), $attributes);
$response = Braintree_Http::put('/customers/' . $customerId . '/addresses/' . $addressId, array('address' => $attributes));
return self::_verifyGatewayResponse($response);
}
示例10: settle
public static function settle($transactionId)
{
Braintree_Http::put('/transactions/' . $transactionId . '/settle');
}
示例11: cancel
public static function cancel($subscriptionId)
{
$response = Braintree_Http::put('/subscriptions/' . $subscriptionId . '/cancel');
return self::_verifyGatewayResponse($response);
}
示例12: submitForSettlement
public static function submitForSettlement($transactionId, $amount = null)
{
self::_validateId($transactionId);
$response = Braintree_Http::put('/transactions/' . $transactionId . '/submit_for_settlement', array('transaction' => array('amount' => $amount)));
return self::_verifyGatewayResponse($response);
}
示例13:
function testRetryCharge_WithAmount()
{
$subscription = Braintree_SubscriptionTestHelper::createSubscription();
$http = new Braintree_Http(Braintree_Configuration::$global);
$path = Braintree_Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due';
$http->put($path);
$result = Braintree_Subscription::retryCharge($subscription->id, 1000);
$this->assertTrue($result->success);
$transaction = $result->transaction;
$this->assertEquals(1000, $transaction->amount);
$this->assertNotNull($transaction->processorAuthorizationCode);
$this->assertEquals(Braintree_Transaction::SALE, $transaction->type);
$this->assertEquals(Braintree_Transaction::AUTHORIZED, $transaction->status);
}