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


PHP Braintree_Configuration::environment方法代碼示例

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


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

示例1: generateToken

 public function generateToken()
 {
     require "lib/braintree-php-3.5.0/lib/Braintree.php";
     Braintree_Configuration::environment('sandbox');
     Braintree_Configuration::merchantId('w7gz99fhtbrhj6y6');
     Braintree_Configuration::publicKey('p5hhp9ctz3znhsq3');
     Braintree_Configuration::privateKey('2baa5dd4adcb171001ce768fc2edf041');
     $clientToken = Braintree_ClientToken::generate();
     return $clientToken;
 }
開發者ID:LukeXF,項目名稱:vision,代碼行數:10,代碼來源:Store.php

示例2: setupConfig

 /**
  *v setup a config
  */
 public function setupConfig()
 {
     \Braintree_Configuration::environment($this->environment);
     \Braintree_Configuration::merchantId($this->merchantId);
     \Braintree_Configuration::publicKey($this->publicKey);
     \Braintree_Configuration::privateKey($this->privateKey);
 }
開發者ID:darrencoutts118,項目名稱:yii2-braintree,代碼行數:10,代碼來源:Braintree.php

示例3: send

 public function send()
 {
     $this->load->model('checkout/order');
     $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
     $amount = $this->currency->format($order_info['total'], $order_info['currency_code'], 1.0, false);
     //Load Braintree Library
     require_once './vendor/braintree/braintree_php/lib/Braintree.php';
     Braintree_Configuration::environment($this->config->get('simple_braintree_payments_mode'));
     Braintree_Configuration::merchantId($this->config->get('simple_braintree_payments_merchant'));
     Braintree_Configuration::publicKey($this->config->get('simple_braintree_payments_public_key'));
     Braintree_Configuration::privateKey($this->config->get('simple_braintree_payments_private_key'));
     // Payment nonce received from the client js side
     $nonce = $_POST["payment_method_nonce"];
     //create object to use as json
     $json = array();
     $result = null;
     try {
         // Perform the transaction
         $result = Braintree_Transaction::sale(array('amount' => $amount, 'paymentMethodNonce' => $nonce, 'orderId' => $this->session->data['order_id']));
     } catch (Exception $e) {
         $json['phperror'] = $e->getMessage();
     }
     $json['details'] = $result;
     if ($result->success) {
         $this->model_checkout_order->confirm($this->session->data['order_id'], $this->config->get('simple_braintree_payments_order_status_id'));
         $json['success'] = $this->url->link('checkout/success', '', 'SSL');
     } else {
         $json['error'] = $result->_attributes['message'];
     }
     $this->response->setOutput(json_encode($json));
 }
開發者ID:andyvr,項目名稱:braintree-payments,代碼行數:31,代碼來源:simple_braintree_payments.php

示例4: _braintreeConfigure

 private function _braintreeConfigure()
 {
     Braintree_Configuration::environment(Config::get('app.braintree_environment'));
     Braintree_Configuration::merchantId(Config::get('app.braintree_merchant_id'));
     Braintree_Configuration::publicKey(Config::get('app.braintree_public_key'));
     Braintree_Configuration::privateKey(Config::get('app.braintree_private_key'));
 }
開發者ID:felipemarques8,項目名稱:goentregas,代碼行數:7,代碼來源:WebController.php

示例5: __construct

 public function __construct()
 {
     \Braintree_Configuration::environment(Config::BRAINTREE_MODE);
     \Braintree_Configuration::merchantId(Config::BRAINTREE_MERCHANT_ID);
     \Braintree_Configuration::publicKey(Config::BRAINTREE_PUBLIC_KEY);
     \Braintree_Configuration::privateKey(Config::BRAINTREE_PRIVATE_KEY);
 }
開發者ID:prideloki,項目名稱:HQ-Single-Payment,代碼行數:7,代碼來源:BrainTree.php

示例6: testMerchantConfig

function testMerchantConfig()
{
    Braintree_Configuration::environment('development');
    Braintree_Configuration::merchantId('test_merchant_id');
    Braintree_Configuration::publicKey('test_public_key');
    Braintree_Configuration::privateKey('test_private_key');
}
開發者ID:oscarsmartwave,項目名稱:l45fbl45t,代碼行數:7,代碼來源:TestHelper.php

示例7: __construct

 function __construct()
 {
     $braintree = (include 'config/braintree.php');
     Braintree_Configuration::environment($braintree['environment']);
     Braintree_Configuration::merchantId($braintree['merchantId']);
     Braintree_Configuration::publicKey($braintree['publicKey']);
     Braintree_Configuration::privateKey($braintree['privateKey']);
 }
開發者ID:Slimshavy,項目名稱:tiferesrachamim-temp,代碼行數:8,代碼來源:BraintreeHelper.php

示例8: init

 public function init()
 {
     require_once 'braintree-php-2.26.0/lib/Braintree.php';
     Braintree_Configuration::environment($this->ENV);
     Braintree_Configuration::merchantId($this->MERCHANT_ID);
     Braintree_Configuration::publicKey($this->PUBLIC_KEY);
     Braintree_Configuration::privateKey($this->PRIVATE_KEY);
 }
開發者ID:tejrajs,項目名稱:yiibraintree,代碼行數:8,代碼來源:YiiBraintree.php

示例9: testConfigGetsAssertedValid

 /**
  * @expectedException Braintree_Exception_Configuration
  * @expectedExceptionMessage merchantId needs to be set.
  */
 function testConfigGetsAssertedValid()
 {
     Braintree_Configuration::environment('development');
     //Braintree_Configuration::merchantId('integration_merchant_id');
     Braintree_Configuration::publicKey('integration_public_key');
     Braintree_Configuration::privateKey('integration_private_key');
     new Braintree_Gateway(Braintree_Configuration::$global);
 }
開發者ID:beevo,項目名稱:disruptivestrong,代碼行數:12,代碼來源:GatewayTest.php

示例10: __construct

 /**
  * Create a new Stripe gateway instance.
  *
  * @param  \Laravel\Cashier\Contracts\Billable   $billable
  * @param  string|null  $plan
  * @return void
  */
 public function __construct(BillableContract $billable, $plan = null)
 {
     $this->plan = $plan;
     $this->billable = $billable;
     Braintree::environment($this->getBraintreeEnvironment());
     Braintree::merchantId($this->getBraintreeMerchantId());
     Braintree::publicKey($this->getBraintreePublicKey());
     Braintree::privateKey($this->getBraintreePrivateKey());
 }
開發者ID:infinity-next,項目名稱:braintree,代碼行數:16,代碼來源:BraintreeGateway.php

示例11: __construct

 /**
  * Constructor method to call the main braintree php api
  * & set the configuration there
  *
  * included since v1.0
  *
  * @param $config
  */
 public function __construct($config)
 {
     //Including main braintree library for connection
     //braintree configuration
     Braintree_Configuration::environment($config['environment']);
     Braintree_Configuration::merchantId($config['merchantId']);
     Braintree_Configuration::publicKey($config['publicKey']);
     Braintree_Configuration::privateKey($config['privateKey']);
 }
開發者ID:agency2016,項目名稱:rothy_cloudynote,代碼行數:17,代碼來源:braintreelibrary.php

示例12: __construct

 public function __construct()
 {
     $this->ci =& get_instance();
     $this->input = $this->ci->input;
     Braintree_Configuration::environment("sandbox");
     Braintree_Configuration::merchantId("yv7v3d5f833vjkp2");
     Braintree_Configuration::publicKey("chg92p6xsjrx4nhj");
     Braintree_Configuration::privateKey("da8986a0ea0ffa58ef149c5f101faee5");
 }
開發者ID:agency2016,項目名稱:rothy_cloudynote,代碼行數:9,代碼來源:braintree_ci.php

示例13: __construct

 public function __construct()
 {
     $this->ci =& get_instance();
     $this->config = $this->ci->config->item('payment');
     $btCfg = $this->ci->config->item('braintree');
     Braintree_Configuration::environment($btCfg['enviroment']);
     Braintree_Configuration::merchantId($btCfg['merchantID']);
     Braintree_Configuration::publicKey($btCfg['publicKey']);
     Braintree_Configuration::privateKey($btCfg['privateKey']);
 }
開發者ID:jr-hqinterview,項目名稱:5cf0f9d5a94d7255e168b6bed94df600,代碼行數:10,代碼來源:Braintree.php

示例14: createBraintreeDriver

 public function createBraintreeDriver()
 {
     $config = $this->_cfg('provider_config')['braintree'];
     $test = $this->_cfg('test');
     \Braintree_Configuration::environment($test ? 'sandbox' : 'production');
     \Braintree_Configuration::merchantId($config['merchant_id']);
     \Braintree_Configuration::publicKey($config['public_key']);
     \Braintree_Configuration::privateKey($config['private_key']);
     return new BraintreePaymentProvider($config, $test, $this->app['log']->getMonolog(), $this->auditLogger);
 }
開發者ID:npmweb,項目名稱:payment,代碼行數:10,代碼來源:PaymentManager.php

示例15: testParsingWebhookWithWrongKeysRaisesError

 function testParsingWebhookWithWrongKeysRaisesError()
 {
     $sampleNotification = Braintree_WebhookTesting::sampleNotification(Braintree_WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, 'my_id');
     Braintree_Configuration::environment('development');
     Braintree_Configuration::merchantId('integration_merchant_id');
     Braintree_Configuration::publicKey('wrong_public_key');
     Braintree_Configuration::privateKey('wrong_private_key');
     $this->setExpectedException('Braintree_Exception_InvalidSignature', 'no matching public key');
     $webhookNotification = Braintree_WebhookNotification::parse($sampleNotification['bt_signature'], "bad" . $sampleNotification['bt_payload']);
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:10,代碼來源:WebhookNotificationTest.php


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