本文整理汇总了PHP中Braintree_Configuration::publicKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_Configuration::publicKey方法的具体用法?PHP Braintree_Configuration::publicKey怎么用?PHP Braintree_Configuration::publicKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_Configuration
的用法示例。
在下文中一共展示了Braintree_Configuration::publicKey方法的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;
}
示例2: _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'));
}
示例3: 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);
}
示例4: 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));
}
示例5: _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);
}
示例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');
}
示例7: __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);
}
示例8: 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);
}
示例9: 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);
}
示例10: __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']);
}
示例11: __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");
}
示例12: __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']);
}
示例13: __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());
}
示例14: __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']);
}
示例15: _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;
}