本文整理汇总了C#中Braintree.BraintreeService.BaseMerchantURL方法的典型用法代码示例。如果您正苦于以下问题:C# BraintreeService.BaseMerchantURL方法的具体用法?C# BraintreeService.BaseMerchantURL怎么用?C# BraintreeService.BaseMerchantURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree.BraintreeService
的用法示例。
在下文中一共展示了BraintreeService.BaseMerchantURL方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BaseMerchantURL_ReturnsProductionURL
public void BaseMerchantURL_ReturnsProductionURL()
{
BraintreeService service = new BraintreeService(new Configuration(
Environment.PRODUCTION,
"integration_merchant_id",
"integration_public_key",
"integration_private_key"
));
Assert.AreEqual("https://www.braintreegateway.com:443/merchants/integration_merchant_id", service.BaseMerchantURL());
}
示例2: BaseMerchantURL_ReturnsSandboxURL
public void BaseMerchantURL_ReturnsSandboxURL()
{
BraintreeService service = new BraintreeService(new Configuration(
Environment.SANDBOX,
"integration_merchant_id",
"integration_public_key",
"integration_private_key"
));
Assert.AreEqual("https://sandbox.braintreegateway.com:443/merchants/integration_merchant_id", service.BaseMerchantURL());
}
示例3: BaseMerchantURL_ReturnsDevelopmentURL
public void BaseMerchantURL_ReturnsDevelopmentURL()
{
BraintreeService service = new BraintreeService(new Configuration(
Environment.DEVELOPMENT,
"integration_merchant_id",
"integration_public_key",
"integration_private_key"
));
var host = System.Environment.GetEnvironmentVariable("GATEWAY_HOST") ?? "localhost";
var port = System.Environment.GetEnvironmentVariable("GATEWAY_PORT") ?? "3000";
var expected = String.Format("http://{0}:{1}/merchants/integration_merchant_id", host, port);
Assert.AreEqual(expected, service.BaseMerchantURL());
}
示例4: Constructor_RaisesDownForMaintenanceExceptionIfDownForMaintenance
public void Constructor_RaisesDownForMaintenanceExceptionIfDownForMaintenance()
{
BraintreeGateway gateway = new BraintreeGateway()
{
Environment = Environment.DEVELOPMENT,
MerchantId = "integration_merchant_id",
PublicKey = "integration_public_key",
PrivateKey = "integration_private_key"
};
BraintreeService service = new BraintreeService(gateway.Configuration);
try {
CustomerRequest trParams = new CustomerRequest();
CustomerRequest request = new CustomerRequest
{
FirstName = "John",
LastName = "Doe"
};
String queryString = TestHelper.QueryStringForTR(trParams, request, service.BaseMerchantURL() + "/test/maintenance", service);
gateway.Customer.ConfirmTransparentRedirect(queryString);
Assert.Fail("Expected DownForMaintenanceException");
} catch (Braintree.Exceptions.DownForMaintenanceException) {
// expected
}
}
示例5: ConfigurationWithStringEnvironment_Initializes
public void ConfigurationWithStringEnvironment_Initializes()
{
Configuration config = new Configuration(
"development",
"integration_merchant_id",
"integration_public_key",
"integration_private_key"
);
BraintreeService service = new BraintreeService(config);
var host = System.Environment.GetEnvironmentVariable("GATEWAY_HOST") ?? "localhost";
var port = System.Environment.GetEnvironmentVariable("GATEWAY_PORT") ?? "3000";
var expected = string.Format("http://{0}:{1}/merchants/integration_merchant_id", host, port);
Assert.AreEqual(expected, service.BaseMerchantURL());
}