reset() public static method

resets configuration to default
public static reset ( )
Ejemplo n.º 1
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.º 2
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 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.º 4
0
 public function setup()
 {
     Braintree\Configuration::reset();
 }
 /**
  * @expectedException Braintree\Exception\Configuration
  * @expectedExceptionMessage Braintree\Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree\Gateway)
  */
 public function testParsingWithNoKeysRaisesError()
 {
     Braintree\Configuration::reset();
     $sampleNotification = Braintree\WebhookTesting::sampleNotification(Braintree\WebhookNotification::SUBSCRIPTION_WENT_PAST_DUE, 'my_id');
     $webhookNotification = Braintree\WebhookNotification::parse($sampleNotification['bt_signature'], $sampleNotification['bt_payload']);
 }
Ejemplo n.º 6
0
     * @return boolean
     */
    public function sslOn()
    {
        switch ($this->_environment) {
            case 'integration':
            case 'development':
                $ssl = false;
                break;
            case 'production':
            case 'qa':
            case 'sandbox':
            default:
                $ssl = true;
                break;
        }
        return $ssl;
    }
    /**
     * log message to default logger
     *
     * @param string $message
     *
     */
    public function logMessage($message)
    {
        error_log('[Braintree] ' . $message);
    }
}
Configuration::reset();
class_alias('Braintree\\Configuration', 'Braintree_Configuration');
 /**
  * @expectedException Braintree\Exception\Configuration
  * @expectedExceptionMessage "invalid" is not a valid environment.
  */
 public function testSetInvalidEnvironment()
 {
     Braintree\Configuration::environment('invalid');
     Braintree\Configuration::reset();
 }