merchantId() public static method

public static merchantId ( $value = null )
Ejemplo n.º 1
0
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     \Braintree\Configuration::environment('sandbox');
     \Braintree\Configuration::merchantId(env('BRAINTREE_MERCHANT_ID'));
     \Braintree\Configuration::publicKey(env('BRAINTREE_PUBLIC_KEY'));
     \Braintree\Configuration::privateKey(env('BRAINTREE_PRIVATE_KEY'));
 }
Ejemplo n.º 2
0
 public function teardown()
 {
     Braintree\Configuration::environment('development');
     Braintree\Configuration::merchantId('integration_merchant_id');
     Braintree\Configuration::publicKey('integration_public_key');
     Braintree\Configuration::privateKey('integration_private_key');
 }
Ejemplo n.º 3
0
 /**
  * Bootstrap method to be called during application bootstrap stage.
  *
  * @param Application $app the application currently running
  */
 public function bootstrap($app)
 {
     Configuration::environment($this->environment);
     Configuration::merchantId($this->merchantId);
     Configuration::publicKey($this->publicKey);
     Configuration::privateKey($this->privateKey);
 }
 /**
  * Boot the service provider.
  */
 public function boot()
 {
     Configuration::environment($this->app['config']->get('services.braintree.environment'));
     Configuration::merchantId($this->app['config']->get('services.braintree.merchant_id'));
     Configuration::publicKey($this->app['config']->get('services.braintree.public_key'));
     Configuration::privateKey($this->app['config']->get('services.braintree.private_key'));
 }
Ejemplo n.º 5
0
 public function initHandler()
 {
     Configuration::environment($this->environment->config('braintree.environment'));
     Configuration::merchantId($this->environment->config('braintree.merchant'));
     Configuration::publicKey($this->environment->config('braintree.public'));
     Configuration::privateKey($this->environment->config('braintree.private'));
     return $this;
 }
Ejemplo n.º 6
0
 public static function testMerchantConfig()
 {
     Braintree\Configuration::reset();
     Braintree\Configuration::environment('development');
     Braintree\Configuration::merchantId('test_merchant_id');
     Braintree\Configuration::publicKey('test_public_key');
     Braintree\Configuration::privateKey('test_private_key');
 }
Ejemplo n.º 7
0
 public static function integrationMerchantConfig()
 {
     Configuration::reset();
     Configuration::environment('development');
     Configuration::merchantId('integration_merchant_id');
     Configuration::publicKey('integration_public_key');
     Configuration::privateKey('integration_private_key');
 }
 public function __construct()
 {
     Braintree_Configuration::environment(Config::get('billing_braintree.environment'));
     Braintree_Configuration::merchantId(Config::get('billing_braintree.merchantId'));
     Braintree_Configuration::publicKey(Config::get('billing_braintree.publicKey'));
     Braintree_Configuration::privateKey(Config::get('billing_braintree.privateKey'));
     $this->allowAccessForPastDue = Config::get('billing_braintree.allowAccessForPastDue', true);
     $this->allowGracePeriod = Config::get('billing_braintree.allowGracePeriod', true);
 }
 public 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']);
 }
 public function initialize(array $parameters = array())
 {
     $parentInitialize = Parent::initialize($parameters);
     Braintree\Configuration::reset();
     Braintree\Configuration::environment($this->getTestMode());
     Braintree\Configuration::merchantId($this->getMerchantId());
     Braintree\Configuration::publicKey($this->getPublicKey());
     Braintree\Configuration::privateKey($this->getPrivateKey());
     return $parentInitialize;
 }
Ejemplo n.º 11
0
 public function testGatewayRejectionIsNullOnProcessorDecline()
 {
     $old_merchant_id = Braintree\Configuration::merchantId();
     $old_public_key = Braintree\Configuration::publicKey();
     $old_private_key = Braintree\Configuration::privateKey();
     Braintree\Configuration::merchantId('processing_rules_merchant_id');
     Braintree\Configuration::publicKey('processing_rules_public_key');
     Braintree\Configuration::privateKey('processing_rules_private_key');
     $customer = Braintree\Customer::createNoValidate();
     $result = Braintree\CreditCard::create(array('customerId' => $customer->id, 'number' => '5105105105105100', 'expirationDate' => '05/2011', 'cvv' => '200', 'options' => array('verifyCard' => true)));
     Braintree\Configuration::merchantId($old_merchant_id);
     Braintree\Configuration::publicKey($old_public_key);
     Braintree\Configuration::privateKey($old_private_key);
     $this->assertFalse($result->success);
     $this->assertNull($result->creditCardVerification->gatewayRejectionReason);
 }
Ejemplo n.º 12
0
 public function initIntegration()
 {
     BraintreeConfiguration::environment($this->braintreeEnvironment);
     BraintreeConfiguration::merchantId($this->braintreeMerchantId);
     BraintreeConfiguration::publicKey($this->braintreePublicKey);
     BraintreeConfiguration::privateKey($this->braintreePrivateKey);
 }
 /**
  * @expectedException Braintree\Exception\Configuration
  * @expectedExceptionMessage privateKey needs to be set
  */
 public function testPrivateKey()
 {
     Braintree\Configuration::environment('development');
     Braintree\Configuration::merchantId('integration_merchant_id');
     Braintree\Configuration::publicKey('integration_public_key');
     //Braintree\Configuration::privateKey('integration_private_key');
     Braintree\Configuration::$global->assertHasAccessTokenOrKeys();
 }
 public function test_rangeNode_gatewayRejectedAt()
 {
     $old_merchant_id = Braintree\Configuration::merchantId();
     $old_public_key = Braintree\Configuration::publicKey();
     $old_private_key = Braintree\Configuration::privateKey();
     Braintree\Configuration::merchantId('processing_rules_merchant_id');
     Braintree\Configuration::publicKey('processing_rules_public_key');
     Braintree\Configuration::privateKey('processing_rules_private_key');
     $transaction = Braintree\Transaction::sale(['amount' => '1000.00', 'creditCard' => ['number' => '4111111111111111', 'expirationDate' => '05/12', 'cvv' => '200']])->transaction;
     $twenty_min_ago = date_create("now -20 minutes", new DateTimeZone("UTC"));
     $ten_min_ago = date_create("now -10 minutes", new DateTimeZone("UTC"));
     $ten_min_from_now = date_create("now +10 minutes", new DateTimeZone("UTC"));
     $collection = Braintree\Transaction::search([Braintree\TransactionSearch::id()->is($transaction->id), Braintree\TransactionSearch::gatewayRejectedAt()->between($twenty_min_ago, $ten_min_ago)]);
     $firstCount = $collection->maximumCount();
     $collection = Braintree\Transaction::search([Braintree\TransactionSearch::id()->is($transaction->id), Braintree\TransactionSearch::gatewayRejectedAt()->between($ten_min_ago, $ten_min_from_now)]);
     $secondCount = $collection->maximumCount();
     $firstId = $collection->firstItem()->id;
     Braintree\Configuration::merchantId($old_merchant_id);
     Braintree\Configuration::publicKey($old_public_key);
     Braintree\Configuration::privateKey($old_private_key);
     $this->assertEquals(0, $firstCount);
     $this->assertEquals(1, $secondCount);
     $this->assertEquals($transaction->id, $firstId);
 }
Ejemplo n.º 15
0
 /**
  * @param string|null $value
  * @return mixed
  */
 public function merchantId($value = null)
 {
     return Configuration::merchantId($value);
 }
Ejemplo n.º 16
0
 public function testGatewayRejectionOnCvv()
 {
     $old_merchant_id = Braintree\Configuration::merchantId();
     $old_public_key = Braintree\Configuration::publicKey();
     $old_private_key = Braintree\Configuration::privateKey();
     Braintree\Configuration::merchantId('processing_rules_merchant_id');
     Braintree\Configuration::publicKey('processing_rules_public_key');
     Braintree\Configuration::privateKey('processing_rules_private_key');
     $result = Braintree\Transaction::sale(['amount' => '100.00', 'creditCard' => ['number' => '5105105105105100', 'expirationDate' => '05/12', 'cvv' => '200']]);
     Braintree\Configuration::merchantId($old_merchant_id);
     Braintree\Configuration::publicKey($old_public_key);
     Braintree\Configuration::privateKey($old_private_key);
     $this->assertFalse($result->success);
     $transaction = $result->transaction;
     $this->assertEquals(Braintree\Transaction::CVV, $transaction->gatewayRejectionReason);
 }