コード例 #1
0
 /**
  * @expectedException Braintree_Exception_Configuration
  * @expectedExceptionMessage "invalid" is not a valid environment.
  */
 function testSetInvalidEnvironment()
 {
     Braintree_Configuration::environment('invalid');
     Braintree_Configuration::reset();
 }
コード例 #2
0
ファイル: Configuration.php プロジェクト: nstungxd/F2CA5
     * @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);
    }
}
Braintree_Configuration::reset();
コード例 #3
0
 function setup()
 {
     Braintree_Configuration::reset();
 }
コード例 #4
0
 function testBaseUrl()
 {
     Braintree_Configuration::environment('sandbox');
     $bu = Braintree_Configuration::baseUrl();
     $this->assertEquals('https://sandbox.braintreegateway.com:443', $bu);
     Braintree_Configuration::reset();
 }
コード例 #5
0
 /**
  * @expectedException Braintree_Exception_Configuration
  * @expectedExceptionMessage Braintree_Configuration::merchantId needs to be set (or accessToken needs to be passed to Braintree_Gateway).
  */
 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']);
 }