• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Braintree_Configuration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Braintree_Configuration的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Configuration类的具体用法?PHP Braintree_Configuration怎么用?PHP Braintree_Configuration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Braintree_Configuration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: testAuthorizationWithConfig

 function testAuthorizationWithConfig()
 {
     $config = new Braintree_Configuration(array('environment' => 'development', 'merchant_id' => 'integration_merchant_id', 'publicKey' => 'badPublicKey', 'privateKey' => 'badPrivateKey'));
     $http = new Braintree_Http($config);
     $result = $http->_doUrlRequest('GET', $config->baseUrl() . '/merchants/integration_merchant_id/customers');
     $this->assertEquals(401, $result['status']);
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:7,代码来源:HttpTest.php


示例3: __construct

 public function __construct($config)
 {
     if (is_array($config)) {
         $config = new Braintree_Configuration($config);
     }
     $config->assertValid();
     $this->config = $config;
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:8,代码来源:Gateway.php


示例4: __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


示例5: 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


示例6: 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


示例7: _doUrlRequest

 public static function _doUrlRequest($httpVerb, $url, $requestBody = null)
 {
     $curl = curl_init();
     curl_setopt($curl, CURLOPT_TIMEOUT, 60);
     curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $httpVerb);
     curl_setopt($curl, CURLOPT_URL, $url);
     curl_setopt($curl, CURLOPT_ENCODING, 'gzip');
     curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/xml', 'Content-Type: application/xml', 'User-Agent: Braintree PHP Library ' . Braintree_Version::get(), 'X-ApiVersion: ' . Braintree_Configuration::API_VERSION));
     curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
     curl_setopt($curl, CURLOPT_USERPWD, Braintree_Configuration::publicKey() . ':' . Braintree_Configuration::privateKey());
     // curl_setopt($curl, CURLOPT_VERBOSE, true);
     if (Braintree_Configuration::sslOn()) {
         curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
         curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
         curl_setopt($curl, CURLOPT_CAINFO, Braintree_Configuration::caFile());
     }
     if (!empty($requestBody)) {
         curl_setopt($curl, CURLOPT_POSTFIELDS, $requestBody);
     }
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     $response = curl_exec($curl);
     $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
     curl_close($curl);
     if (Braintree_Configuration::sslOn()) {
         if ($httpStatus == 0) {
             throw new Braintree_Exception_SSLCertificate();
         }
     }
     return array('status' => $httpStatus, 'body' => $response);
 }
开发者ID:grlf,项目名称:eyedock,代码行数:30,代码来源:Http.php


示例8: testHmacSha1_again

 function testHmacSha1_again()
 {
     Braintree_Configuration::privateKey(str_repeat(chr(0xaa), 80));
     $message = 'Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data';
     $d = Braintree_Digest::_hmacSha1($message, Braintree_Configuration::privateKey());
     $this->assertEquals('e8e99d0f45237d786d6bbaa7965c7808bbff1a91', $d);
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:7,代码来源:DigestTest.php


示例9: 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


示例10: _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


示例11: 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


示例12: __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


示例13: 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


示例14: __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


示例15: __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


示例16: _matchingSignature

 private static function _matchingSignature($signaturePairs)
 {
     foreach ($signaturePairs as $pair) {
         $components = preg_split("/\\|/", $pair);
         if ($components[0] == Braintree_Configuration::publicKey()) {
             return $components[1];
         }
     }
     return null;
 }
开发者ID:bobstermyang,项目名称:communityfoodshare,代码行数:10,代码来源:WebhookNotification.php


示例17: __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


示例18: 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


示例19: 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


示例20: setUp

 function setUp()
 {
     echo __METHOD__ . '()' . PHP_EOL;
     $config = (include getenv("CONFIG_path") . "payment.php");
     $braintreeConfig = $config['provider_config']['braintree'];
     \Braintree_Configuration::environment('sandbox');
     \Braintree_Configuration::merchantId($braintreeConfig['merchant_id']);
     \Braintree_Configuration::publicKey($braintreeConfig['public_key']);
     \Braintree_Configuration::privateKey($braintreeConfig['private_key']);
     $this->provider = new BraintreePaymentProvider($braintreeConfig, true, $this);
 }
开发者ID:npmweb,项目名称:payment,代码行数:11,代码来源:BraintreeTestCase.php



注:本文中的Braintree_Configuration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Braintree_CreditCard类代码示例发布时间:2022-05-23
下一篇:
PHP Box_Di类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap