コード例 #1
4
 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'));
 }
コード例 #2
3
ファイル: Store.php プロジェクト: LukeXF/vision
 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;
 }
コード例 #3
0
 function teardown()
 {
     Braintree_Configuration::environment('development');
     Braintree_Configuration::merchantId('integration_merchant_id');
     Braintree_Configuration::publicKey('integration_public_key');
     Braintree_Configuration::privateKey('integration_private_key');
 }
コード例 #4
0
 /**
  *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);
 }
コード例 #5
0
 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));
 }
コード例 #6
0
 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);
 }
コード例 #7
0
function testMerchantConfig()
{
    Braintree_Configuration::environment('development');
    Braintree_Configuration::merchantId('test_merchant_id');
    Braintree_Configuration::publicKey('test_public_key');
    Braintree_Configuration::privateKey('test_private_key');
}
コード例 #8
0
 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']);
 }
コード例 #9
0
ファイル: YiiBraintree.php プロジェクト: tejrajs/yiibraintree
 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);
 }
コード例 #10
0
 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");
 }
コード例 #11
0
 /**
  * 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());
 }
コード例 #12
0
 /**
  * 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']);
 }
コード例 #13
0
 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']);
 }
コード例 #14
0
ファイル: PaymentManager.php プロジェクト: npmweb/payment
 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);
 }
コード例 #15
0
 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']);
 }
コード例 #16
0
 function __construct()
 {
     include 'addons/braintree/Braintree.php';
     $this->CI =& get_instance();
     $this->CI->load->model('transaction');
     // Braintree settings
     Braintree_Configuration::environment('sandbox');
     Braintree_Configuration::merchantId('YOUR_MERCHANT_ID');
     Braintree_Configuration::publicKey('YOUR_PUBLIC_KEY');
     Braintree_Configuration::privateKey('YOUR_PRIVATE_KEY');
 }
コード例 #17
0
ファイル: BraintreeTestCase.php プロジェクト: npmweb/payment
 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);
 }
コード例 #18
0
 /**
  * @param $config
  * @param $isTest
  *
  * @return mixed|void
  */
 public function setConfig($config, $isTest)
 {
     if ($isTest == true) {
         \Braintree_Configuration::environment('sandbox');
     } else {
         \Braintree_Configuration::environment('production');
     }
     \Braintree_Configuration::merchantId($config['merchantId']);
     \Braintree_Configuration::publicKey($config['publicKey']);
     \Braintree_Configuration::privateKey($config['privateKey']);
 }
コード例 #19
0
ファイル: Braintree.php プロジェクト: sudhabisht/braintree
 /**
  * Constructor
  *
  * @param string $mode the mode of operation: live or test
  *
  * @return void
  */
 function __construct($mode, &$paymentProcessor)
 {
     $this->_mode = $mode;
     $this->_paymentProcessor = $paymentProcessor;
     $this->_processorName = ts('Braintree');
     $environment = $mode == "test" ? 'sandbox' : 'sandbox';
     Braintree_Configuration::environment($environment);
     Braintree_Configuration::merchantId($paymentProcessor["user_name"]);
     Braintree_Configuration::publicKey($paymentProcessor["password"]);
     Braintree_Configuration::privateKey($paymentProcessor["signature"]);
 }
コード例 #20
0
 private function _braintree()
 {
     include_once YM_MODULES_DIR . 'lib/braintree/Braintree.php';
     if ($this->status == 'test') {
         Braintree_Configuration::environment('sandbox');
     } else {
         Braintree_Configuration::environment('production');
     }
     Braintree_Configuration::merchantId($this->merchantid);
     Braintree_Configuration::publicKey($this->publickey);
     Braintree_Configuration::privateKey($this->privatekey);
 }
コード例 #21
0
ファイル: Braintree_lib.php プロジェクト: sahartak/storage
 function __construct()
 {
     include 'lib/Braintree.php';
     $this->CI =& get_instance();
     $this->transaction_cost = 10.0;
     //$this->CI->load->model('transaction');
     // Braintree settings
     Braintree_Configuration::environment('sandbox');
     Braintree_Configuration::merchantId('y7drg3qfz5csnm6p');
     Braintree_Configuration::publicKey('f5ng46jp79rt95mg');
     Braintree_Configuration::privateKey('a0bc06bf7aa3dd851764b95c218ef929');
 }
コード例 #22
0
 /**
  * connect.
  * --------------------------------------------------
  * Connecting the user with our stored credentials.
  * @throws BraintreeNotConnected
  * --------------------------------------------------
  */
 public function connect()
 {
     /* Check valid connection */
     if (!$this->user->isBraintreeConnected()) {
         throw new BraintreeNotConnected();
     }
     $credentials = json_decode($this->user->connections()->where('service', 'braintree')->first()->access_token);
     Braintree_Configuration::environment($credentials['environment']);
     Braintree_Configuration::merchantId($credentials['merchantID']);
     Braintree_Configuration::publicKey($credentials['publicKey']);
     Braintree_Configuration::privateKey($credentials['privateKey']);
 }
コード例 #23
0
 public function __construct()
 {
     parent::__construct();
     if ($this->getConfigData('active') == 1) {
         Braintree_Configuration::environment($this->getConfigData('environment'));
         Braintree_Configuration::merchantId($this->getConfigData('merchant_id'));
         Braintree_Configuration::publicKey($this->getConfigData('public_key'));
         Braintree_Configuration::privateKey($this->getConfigData('private_key'));
         $this->_merchantAccountId = $this->getConfigData('merchant_account_id');
         $this->_useVault = $this->getConfigData('use_vault');
     }
 }
コード例 #24
0
 /**
  * _initializeModule
  * Initializes the Braintree module
  *
  * @param None
  *      */
 private function _initializeModule()
 {
     Braintree_Configuration::merchantId($this->merchantId);
     Braintree_Configuration::publicKey($this->publicKey);
     Braintree_Configuration::privateKey($this->privateKey);
     if ($this->production) {
         Braintree_Configuration::environment('production');
     } else {
         Braintree_Configuration::environment('sandbox');
     }
     $this->ready = true;
 }
コード例 #25
0
 public function getTransaction($transaction_id)
 {
     Braintree_Configuration::environment($this->session->userdata('environment'));
     Braintree_Configuration::merchantId($this->session->userdata('merchantId'));
     Braintree_Configuration::publicKey($this->session->userdata('publicKey'));
     Braintree_Configuration::privateKey($this->session->userdata('privateKey'));
     $transaction = Braintree_Transaction::submitForSettlement($transaction_id);
     if ($transaction) {
         return $transaction;
     } else {
         return false;
     }
 }
 public function createTransaction($data)
 {
     Braintree_Configuration::environment($this->config->item('braintree_environment'));
     Braintree_Configuration::merchantId($this->config->item('braintree_merchant_id'));
     Braintree_Configuration::publicKey($this->config->item('braintree_public_key'));
     Braintree_Configuration::privateKey($this->config->item('braintree_private_key'));
     $transaction = Braintree_Transaction::sale($data);
     if ($transaction) {
         return $transaction;
     } else {
         return false;
     }
 }
コード例 #27
0
ファイル: BraintreeApi.php プロジェクト: anmolview/yiidemos
 /**
  * Pulls Braintree ID's and Keys from parameter array in config file
  * Includes Braintree's API files and sets up Braintree configuration
  */
 public function __construct()
 {
     $this->environment = Yii::app()->params['braintreeapi']['environment'];
     $this->merchant_id = Yii::app()->params['braintreeapi']['merchant_id'];
     $this->public_key = Yii::app()->params['braintreeapi']['public_key'];
     $this->private_key = Yii::app()->params['braintreeapi']['private_key'];
     $this->clientside_key = Yii::app()->params['braintreeapi']['clientside_key'];
     require 'lib/Braintree.php';
     Braintree_Configuration::environment($this->environment);
     Braintree_Configuration::merchantId($this->merchant_id);
     Braintree_Configuration::publicKey($this->public_key);
     Braintree_Configuration::privateKey($this->private_key);
 }
コード例 #28
0
ファイル: Braintree.php プロジェクト: coder-d/payment_library
 private function _getClientToken()
 {
     $environment = Configure::read('Braintree.environment');
     $merchantId = Configure::read('Braintree.MerchantId');
     $publicKey = Configure::read('Braintree.PublicKey');
     $privateKey = Configure::read('Braintree.PrivateKey');
     Braintree_Configuration::environment($environment);
     Braintree_Configuration::merchantId($merchantId);
     Braintree_Configuration::publicKey($publicKey);
     Braintree_Configuration::privateKey($privateKey);
     //Get the Client Token
     $clientToken = Braintree_ClientToken::generate();
     return $clientToken;
 }
コード例 #29
0
ファイル: braintree.php プロジェクト: alexanderTsig/arabic
 public function init()
 {
     parent::init();
     if ($this->isConfigured()) {
         require_once 'lib/Braintree.php';
         Braintree_Configuration::merchantId($this->getConfig('merchant_id'));
         Braintree_Configuration::privateKey($this->getConfig('private_key'));
         Braintree_Configuration::publicKey($this->getConfig('public_key'));
         Braintree_Configuration::environment($this->getConfig('sandbox') ? 'sandbox' : 'production');
         if ($this->getConfig('multicurrency')) {
             $this->getDi()->billingPlanTable->customFields()->add(new Am_CustomFieldText('braintree_merchant_account_id', "BrainTree Merchant Account ID", "please set this up if you sell products in different currencies"));
         }
     }
 }
コード例 #30
0
 function PMProGateway_braintree($gateway = NULL)
 {
     $this->gateway = $gateway;
     $this->gateway_environment = pmpro_getOption("gateway_environment");
     //convert to braintree nomenclature
     $environment = $this->gateway_environment;
     if ($environment == "live") {
         $environment = "production";
     }
     Braintree_Configuration::environment($environment);
     Braintree_Configuration::merchantId(pmpro_getOption("braintree_merchantid"));
     Braintree_Configuration::publicKey(pmpro_getOption("braintree_publickey"));
     Braintree_Configuration::privateKey(pmpro_getOption("braintree_privatekey"));
     return $this->gateway;
 }