Braintree.Tests.Integration.MerchantIntegrationTest.Create_AllowsCreationOfNonUSMerchantIfOnboardingApplicationIsInternal C# (CSharp) Метод

Create_AllowsCreationOfNonUSMerchantIfOnboardingApplicationIsInternal() приватный Метод

        public void Create_AllowsCreationOfNonUSMerchantIfOnboardingApplicationIsInternal()
        {
            gateway = new BraintreeGateway(
                "client_id$development$signup_client_id",
                "client_secret$development$signup_client_secret"
            );

            ResultImpl<Merchant> result = gateway.Merchant.Create(new MerchantRequest {
                Email = "[email protected]",
                CountryCodeAlpha3 = "JPN",
                PaymentMethods = new string[] {"paypal"},
                PayPalAccount = new PayPalOnlyAccountRequest {
                    ClientId = "paypal_client_id",
                    ClientSecret = "paypal_client_secret"
                }
            });

            Assert.IsTrue(result.IsSuccess());
            Assert.IsFalse(string.IsNullOrEmpty(result.Target.Id));
            Assert.AreEqual("[email protected]", result.Target.Email);
            Assert.AreEqual("[email protected]", result.Target.CompanyName);
            Assert.AreEqual("JPN", result.Target.CountryCodeAlpha3);
            Assert.AreEqual("JP", result.Target.CountryCodeAlpha2);
            Assert.AreEqual("392", result.Target.CountryCodeNumeric);
            Assert.AreEqual("Japan", result.Target.CountryName);

            Assert.IsTrue(result.Target.Credentials.AccessToken.StartsWith("access_token$"));
            Assert.IsTrue(result.Target.Credentials.RefreshToken.StartsWith("refresh_token$"));
            Assert.IsTrue(result.Target.Credentials.ExpiresAt > DateTime.Now);
            Assert.AreEqual("bearer", result.Target.Credentials.TokenType);

            Assert.AreEqual(1, result.Target.MerchantAccounts.Length);

            var merchantAccount = result.Target.MerchantAccounts[0];
            Assert.AreEqual("JPY", merchantAccount.CurrencyIsoCode);
            Assert.IsTrue(merchantAccount.IsDefault.Value);
        }