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


PHP Braintree_Http::post方法代碼示例

本文整理匯總了PHP中Braintree_Http::post方法的典型用法代碼示例。如果您正苦於以下問題:PHP Braintree_Http::post方法的具體用法?PHP Braintree_Http::post怎麽用?PHP Braintree_Http::post使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Braintree_Http的用法示例。


在下文中一共展示了Braintree_Http::post方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: generate

 /**
  * 
  * @param string $settlement_date
  * @param string $groupByCustomField
  * @return Braintree_SettlementBatchSummary|Braintree_Result_Error
  */
 public function generate($settlement_date, $groupByCustomField = NULL)
 {
     $criteria = array('settlement_date' => $settlement_date);
     if (isset($groupByCustomField)) {
         $criteria['group_by_custom_field'] = $groupByCustomField;
     }
     $params = array('settlement_batch_summary' => $criteria);
     $path = $this->_config->merchantPath() . '/settlement_batch_summary';
     $response = $this->_http->post($path, $params);
     if (isset($groupByCustomField)) {
         $response['settlementBatchSummary']['records'] = $this->_underscoreCustomField($groupByCustomField, $response['settlementBatchSummary']['records']);
     }
     return $this->_verifyGatewayResponse($response);
 }
開發者ID:buga1234,項目名稱:buga_segforours,代碼行數:20,代碼來源:SettlementBatchSummaryGateway.php

示例2: testAll_returnsAllPlans

 function testAll_returnsAllPlans()
 {
     $newId = strval(rand());
     $params = array("id" => $newId, "billingDayOfMonth" => "1", "billingFrequency" => "1", "currencyIsoCode" => "USD", "description" => "some description", "name" => "php test plan", "numberOfBillingCycles" => "1", "price" => "1.00", "trialDuration" => "3", "trialDurationUnit" => "day", "trialPeriod" => "true");
     Braintree_Http::post("/plans/create_plan_for_tests", array("plan" => $params));
     $addOnParams = array("kind" => "add_on", "plan_id" => $newId, "amount" => "1.00", "name" => "add_on_name");
     Braintree_Http::post("/modifications/create_modification_for_tests", array("modification" => $addOnParams));
     $discountParams = array("kind" => "discount", "plan_id" => $newId, "amount" => "1.00", "name" => "discount_name");
     Braintree_Http::post("/modifications/create_modification_for_tests", array("modification" => $discountParams));
     $plans = Braintree_Plan::all();
     foreach ($plans as $plan) {
         if ($plan->id == $newId) {
             $actualPlan = $plan;
         }
     }
     $this->assertNotNull($actualPlan);
     $this->assertEquals($params["billingDayOfMonth"], $actualPlan->billingDayOfMonth);
     $this->assertEquals($params["billingFrequency"], $actualPlan->billingFrequency);
     $this->assertEquals($params["currencyIsoCode"], $actualPlan->currencyIsoCode);
     $this->assertEquals($params["description"], $actualPlan->description);
     $this->assertEquals($params["name"], $actualPlan->name);
     $this->assertEquals($params["numberOfBillingCycles"], $actualPlan->numberOfBillingCycles);
     $this->assertEquals($params["price"], $actualPlan->price);
     $this->assertEquals($params["trialDuration"], $actualPlan->trialDuration);
     $this->assertEquals($params["trialDurationUnit"], $actualPlan->trialDurationUnit);
     $this->assertEquals($params["trialPeriod"], $actualPlan->trialPeriod);
     $addOn = $actualPlan->addOns[0];
     $this->assertEquals($addOnParams["name"], $addOn->name);
     $discount = $actualPlan->discounts[0];
     $this->assertEquals($discountParams["name"], $discount->name);
 }
開發者ID:rayku,項目名稱:rayku,代碼行數:31,代碼來源:PlanTest.php

示例3: createGrant

 public static function createGrant($gateway, $params)
 {
     $http = new Braintree_Http($gateway->config);
     $http->useClientCredentials();
     $response = $http->post('/oauth_testing/grants', array('grant' => $params));
     return $response['grant']['code'];
 }
開發者ID:buga1234,項目名稱:buga_segforours,代碼行數:7,代碼來源:OAuthTestHelper.php

示例4: retryCharge

 public static function retryCharge($subscriptionId, $amount = null)
 {
     $transaction_params = array('type' => Braintree_Transaction::SALE, 'subscriptionId' => $subscriptionId);
     if (isset($amount)) {
         $transaction_params['amount'] = $amount;
     }
     $response = Braintree_Http::post('/transactions', array('transaction' => $transaction_params));
     return self::_verifyGatewayResponse($response);
 }
開發者ID:agency2016,項目名稱:rothy_cloudynote,代碼行數:9,代碼來源:Subscription.php

示例5: search

 public static function search($query)
 {
     $criteria = array();
     foreach ($query as $term) {
         $criteria[$term->name] = $term->toparam();
     }
     $response = Braintree_Http::post('/verifications/advanced_search_ids', array('search' => $criteria));
     $pager = array('className' => __CLASS__, 'classMethod' => 'fetch', 'methodArgs' => array($query));
     return new Braintree_ResourceCollection($response, $pager);
 }
開發者ID:othreed,項目名稱:osCommerce-234-bootstrap-wADDONS,代碼行數:10,代碼來源:CreditCardVerification.php

示例6: generate

 public static function generate($settlement_date, $groupByCustomField = NULL)
 {
     $criteria = array('settlement_date' => $settlement_date);
     if (isset($groupByCustomField)) {
         $criteria['group_by_custom_field'] = $groupByCustomField;
     }
     $params = array('settlement_batch_summary' => $criteria);
     $response = Braintree_Http::post('/settlement_batch_summary', $params);
     if (isset($groupByCustomField)) {
         $response['settlementBatchSummary']['records'] = self::_underscoreCustomField($groupByCustomField, $response['settlementBatchSummary']['records']);
     }
     return self::_verifyGatewayResponse($response);
 }
開發者ID:bobstermyang,項目名稱:communityfoodshare,代碼行數:13,代碼來源:SettlementBatchSummary.php

示例7: strval

 function testGatewayAll_returnsAllAddOns()
 {
     $newId = strval(rand());
     $addOnParams = array("amount" => "100.00", "description" => "some description", "id" => $newId, "kind" => "add_on", "name" => "php_add_on", "neverExpires" => "false", "numberOfBillingCycles" => "1");
     $http = new Braintree_Http(Braintree_Configuration::$global);
     $path = Braintree_Configuration::$global->merchantPath() . "/modifications/create_modification_for_tests";
     $http->post($path, array("modification" => $addOnParams));
     $gateway = new Braintree_Gateway(array('environment' => 'development', 'merchantId' => 'integration_merchant_id', 'publicKey' => 'integration_public_key', 'privateKey' => 'integration_private_key'));
     $addOns = $gateway->addOn()->all();
     foreach ($addOns as $addOn) {
         if ($addOn->id == $newId) {
             $actualAddOn = $addOn;
         }
     }
     $this->assertNotNull($actualAddOn);
     $this->assertEquals($addOnParams["amount"], $actualAddOn->amount);
     $this->assertEquals($addOnParams["description"], $actualAddOn->description);
     $this->assertEquals($addOnParams["id"], $actualAddOn->id);
 }
開發者ID:beevo,項目名稱:disruptivestrong,代碼行數:19,代碼來源:AddOnsTest.php

示例8: testAll_returnsAllDiscounts

 function testAll_returnsAllDiscounts()
 {
     $newId = strval(rand());
     $discountParams = array("amount" => "100.00", "description" => "some description", "id" => $newId, "kind" => "discount", "name" => "php_discount", "neverExpires" => "false", "numberOfBillingCycles" => "1");
     Braintree_Http::post("/modifications/create_modification_for_tests", array("modification" => $discountParams));
     $discounts = Braintree_Discount::all();
     foreach ($discounts as $discount) {
         if ($discount->id == $newId) {
             $actualDiscount = $discount;
         }
     }
     $this->assertNotNull($actualDiscount);
     $this->assertEquals($discountParams["amount"], $actualDiscount->amount);
     $this->assertEquals($discountParams["description"], $actualDiscount->description);
     $this->assertEquals($discountParams["id"], $actualDiscount->id);
     $this->assertEquals($discountParams["kind"], $actualDiscount->kind);
     $this->assertEquals($discountParams["name"], $actualDiscount->name);
     $this->assertFalse($actualDiscount->neverExpires);
     $this->assertEquals($discountParams["numberOfBillingCycles"], $actualDiscount->numberOfBillingCycles);
 }
開發者ID:anmolview,項目名稱:yiidemos,代碼行數:20,代碼來源:DiscountTest.php

示例9: strval

 function testGatewayAll_returnsAllPlans()
 {
     $newId = strval(rand());
     $params = array("id" => $newId, "billingDayOfMonth" => "1", "billingFrequency" => "1", "currencyIsoCode" => "USD", "description" => "some description", "name" => "php test plan", "numberOfBillingCycles" => "1", "price" => "1.00", "trialPeriod" => "false");
     $http = new Braintree_Http(Braintree_Configuration::$global);
     $path = Braintree_Configuration::$global->merchantPath() . "/plans/create_plan_for_tests";
     $http->post($path, array("plan" => $params));
     $gateway = new Braintree_Gateway(array('environment' => 'development', 'merchantId' => 'integration_merchant_id', 'publicKey' => 'integration_public_key', 'privateKey' => 'integration_private_key'));
     $plans = $gateway->plan()->all();
     foreach ($plans as $plan) {
         if ($plan->id == $newId) {
             $actualPlan = $plan;
         }
     }
     $this->assertNotNull($actualPlan);
     $this->assertEquals($params["billingDayOfMonth"], $actualPlan->billingDayOfMonth);
     $this->assertEquals($params["billingFrequency"], $actualPlan->billingFrequency);
     $this->assertEquals($params["currencyIsoCode"], $actualPlan->currencyIsoCode);
     $this->assertEquals($params["description"], $actualPlan->description);
     $this->assertEquals($params["name"], $actualPlan->name);
     $this->assertEquals($params["numberOfBillingCycles"], $actualPlan->numberOfBillingCycles);
     $this->assertEquals($params["price"], $actualPlan->price);
 }
開發者ID:beevo,項目名稱:disruptivestrong,代碼行數:23,代碼來源:PlanTest.php

示例10: _doCreate

 /**
  * sends the create request to the gateway
  *
  * @ignore
  * @param var $url
  * @param array $params
  * @return mixed
  */
 public static function _doCreate($url, $params)
 {
     $response = Braintree_Http::post($url, $params);
     return self::_verifyGatewayResponse($response);
 }
開發者ID:anmolview,項目名稱:yiidemos,代碼行數:13,代碼來源:Transaction.php

示例11: create3DSVerification

 public static function create3DSVerification($merchantAccountId, $params)
 {
     $http = new Braintree_Http(Braintree_Configuration::$global);
     $path = Braintree_Configuration::$global->merchantPath() . '/three_d_secure/create_verification/' . $merchantAccountId;
     $response = $http->post($path, array('threeDSecureVerification' => $params));
     return $response['threeDSecureVerification']['threeDSecureToken'];
 }
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:7,代碼來源:TestHelper.php

示例12: create3DSVerification

 public static function create3DSVerification($merchantAccountId, $params)
 {
     $response = Braintree_Http::post('/three_d_secure/create_verification/' . $merchantAccountId, array('threeDSecureVerification' => $params));
     return $response['threeDSecureVerification']['threeDSecureToken'];
 }
開發者ID:kingsj,項目名稱:shopping-cart-lite,代碼行數:5,代碼來源:TestHelper.php

示例13: _doGenerate

 /**
  * sends the generate request to the gateway
  *
  * @ignore
  * @param var $url
  * @param array $params
  * @return mixed
  */
 public function _doGenerate($subPath, $params)
 {
     $fullPath = $this->_config->merchantPath() . $subPath;
     $response = $this->_http->post($fullPath, $params);
     return $this->_verifyGatewayResponse($response);
 }
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:14,代碼來源:ClientTokenGateway.php


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