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

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

        public void Create_DefaultsToUSDForNonUSMerchantIfOnboardingApplicationIsInternalAndCountryCurrencyNotSupported()
        {
            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 = "YEM",
                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("YEM", result.Target.CountryCodeAlpha3);
            Assert.AreEqual("YE", result.Target.CountryCodeAlpha2);
            Assert.AreEqual("887", result.Target.CountryCodeNumeric);
            Assert.AreEqual("Yemen", 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("USD", merchantAccount.CurrencyIsoCode);
            Assert.IsTrue(merchantAccount.IsDefault.Value);
        }