當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Braintree_Http::put方法代碼示例

本文整理匯總了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);
 }
開發者ID:buga1234,項目名稱:buga_segforours,代碼行數:23,代碼來源:AddressGateway.php

示例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);
 }
開發者ID:kingsolmn,項目名稱:CakePHP-Braintree-Plugin,代碼行數:15,代碼來源:SubscriptionSearchTest.php

示例3: cancelRelease

 public static function cancelRelease($transactionId)
 {
     self::_validateId($transactionId);
     $response = Braintree_Http::put('/transactions/' . $transactionId . '/cancel_release', array());
     return self::_verifyGatewayResponse($response);
 }
開發者ID:anmolview,項目名稱:yiidemos,代碼行數:6,代碼來源:Transaction.php

示例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);
 }
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:6,代碼來源:TestHelper.php

示例5: escrow

 public static function escrow($transactionId)
 {
     Braintree_Http::put('/transactions/' . $transactionId . '/escrow');
 }
開發者ID:kingsj,項目名稱:shopping-cart-lite,代碼行數:4,代碼來源:TestHelper.php

示例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);
 }
開發者ID:kingsolmn,項目名稱:CakePHP-Braintree-Plugin,代碼行數:14,代碼來源:TransactionAdvancedSearchTest.php

示例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);
 }
開發者ID:robelkin,項目名稱:braintree_php,代碼行數:12,代碼來源:SubscriptionTest.php

示例8: _doUpdate

 private static function _doUpdate($url, $params)
 {
     $response = Braintree_Http::put($url, $params);
     return self::_verifyGatewayResponse($response);
 }
開發者ID:bobstermyang,項目名稱:communityfoodshare,代碼行數:5,代碼來源:MerchantAccount.php

示例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);
 }
開發者ID:agency2016,項目名稱:rothy_cloudynote,代碼行數:22,代碼來源:Address.php

示例10: settle

 public static function settle($transactionId)
 {
     Braintree_Http::put('/transactions/' . $transactionId . '/settle');
 }
開發者ID:robelkin,項目名稱:braintree_php,代碼行數:4,代碼來源:TestHelper.php

示例11: cancel

 public static function cancel($subscriptionId)
 {
     $response = Braintree_Http::put('/subscriptions/' . $subscriptionId . '/cancel');
     return self::_verifyGatewayResponse($response);
 }
開發者ID:agency2016,項目名稱:rothy_cloudynote,代碼行數:5,代碼來源:Subscription.php

示例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);
 }
開發者ID:technomagegithub,項目名稱:inmed-magento,代碼行數:6,代碼來源:Transaction.php

示例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);
 }
開發者ID:buga1234,項目名稱:buga_segforours,代碼行數:14,代碼來源:SubscriptionTest.php


注:本文中的Braintree_Http::put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。