public UnknownPaymentMethod(NodeWrapper node)
 {
     Token = node.GetString("token");
     IsDefault = node.GetBoolean("default");
     ImageUrl = "https://assets.braintreegateway.com/payment_method_logo/unknown.png";
     CustomerId = node.GetString("customer-id");
 }
 protected internal VenmoAccountDetails(NodeWrapper node)
 {
     Token = node.GetString("token");
     Username = node.GetString("username");
     VenmoUserId = node.GetString("venmo-user-id");
     ImageUrl = node.GetString("image-url");
     SourceDescription = node.GetString("source-description");
 }
 protected internal Descriptor(NodeWrapper node)
 {
     if (node != null)
     {
         Name = node.GetString("name");
         Phone = node.GetString("phone");
         Url = node.GetString("url");
     }
 }
        public static string Create3DSVerification(BraintreeService service, string merchantAccountId, ThreeDSecureRequestForTests request)
        {
            string      url      = "/three_d_secure/create_verification/" + merchantAccountId;
            NodeWrapper response = new NodeWrapper(service.Post(service.MerchantPath() + url, request));

            Assert.IsTrue(response.IsSuccess());
            return(response.GetString("three-d-secure-token"));
        }
Exemple #5
0
        public static string Generate3DSNonce(BraintreeService service, CreditCardRequest request)
        {
            string      url      = "/three_d_secure/create_nonce/" + MerchantAccountIDs.THREE_D_SECURE_MERCHANT_ACCOUNT_ID;
            NodeWrapper response = new NodeWrapper(service.Post(service.MerchantPath() + url, request));

            Assert.IsTrue(response.IsSuccess());
            return(response.GetString("nonce"));
        }
        public Merchant(NodeWrapper node)
        {
            if (node == null)
            {
                return;
            }

            NodeWrapper merchantNode = node.GetNode("merchant");

            Id                 = merchantNode.GetString("id");
            Email              = merchantNode.GetString("email");
            CompanyName        = merchantNode.GetString("company-name");
            CountryCodeAlpha3  = merchantNode.GetString("country-code-alpha3");
            CountryCodeAlpha2  = merchantNode.GetString("country-code-alpha2");
            CountryCodeNumeric = merchantNode.GetString("country-code-numeric");
            CountryName        = merchantNode.GetString("country-name");

            Credentials = new OAuthCredentials(node.GetNode("credentials"));

            var merchantAccountXmlNodes = merchantNode.GetList("merchant-accounts/merchant-account");

            MerchantAccounts = new MerchantAccount[merchantAccountXmlNodes.Count];
            for (int i = 0; i < merchantAccountXmlNodes.Count; i++)
            {
                MerchantAccounts[i] = new MerchantAccount(merchantAccountXmlNodes[i]);
            }
        }
 protected internal UsBankAccountDetails(NodeWrapper node)
 {
     RoutingNumber      = node.GetString("routing-number");
     Last4              = node.GetString("last-4");
     AccountType        = node.GetString("account-type");
     AccountDescription = node.GetString("account-description");
     AccountHolderName  = node.GetString("account-holder-name");
     Token              = node.GetString("token");
     ImageUrl           = node.GetString("image-url");
     BankName           = node.GetString("bank-name");
 }
        public void Generate_CanBeGroupedByACustomField()
        {
            TransactionRequest request = new TransactionRequest
            {
                Amount     = 1000M,
                CreditCard = new TransactionCreditCardRequest
                {
                    Number         = "4111111111111111",
                    ExpirationDate = "05/2012",
                    CardholderName = "Tom Smith",
                },
                Options = new TransactionOptionsRequest
                {
                    SubmitForSettlement = true
                },
                CustomFields = new Dictionary <string, string>
                {
                    { "store_me", "custom value" }
                }
            };

            Transaction transaction      = gateway.Transaction.Sale(request).Target;
            NodeWrapper settlementResult = TestHelper.Settle(service, transaction.Id);
            var         settlementDate   = settlementResult.GetString("/transaction/settlement-batch-id").Split('_')[0];

            transaction = gateway.Transaction.Find(transaction.Id);

            var result       = gateway.SettlementBatchSummary.Generate(System.DateTime.Parse(settlementDate), "store_me");
            var customValues = new List <IDictionary <string, string> >();

            foreach (var row in result.Target.Records)
            {
                if ("custom value".Equals(row["store_me"]))
                {
                    customValues.Add(row);
                }
            }

            Assert.AreEqual(1, customValues.Count);
        }
        public void Generate_ReturnsTransactionsSettledOnAGivenDay()
        {
            TransactionRequest request = new TransactionRequest
            {
                Amount     = 1000M,
                CreditCard = new TransactionCreditCardRequest
                {
                    Number         = "4111111111111111",
                    ExpirationDate = "05/2012",
                    CardholderName = "Tom Smith",
                },
                Options = new TransactionOptionsRequest
                {
                    SubmitForSettlement = true
                },
            };

            Transaction transaction      = gateway.Transaction.Sale(request).Target;
            NodeWrapper settlementResult = TestHelper.Settle(service, transaction.Id);
            var         settlementDate   = settlementResult.GetString("/transaction/settlement-batch-id").Split('_')[0];

            transaction = gateway.Transaction.Find(transaction.Id);

            var result = gateway.SettlementBatchSummary.Generate(System.DateTime.Parse(settlementDate));
            var visas  = new List <IDictionary <string, string> >();

            foreach (var row in result.Target.Records)
            {
                if (Braintree.CreditCardCardType.VISA.ToString().Equals(row["card_type"]))
                {
                    visas.Add(row);
                }
            }

            Assert.AreEqual(1, visas.Count);
        }
 public OAuthAccessRevocation(NodeWrapper node)
 {
     MerchantId = node.GetString("merchant-id");
     OAuthApplicationClientId = node.GetString("oauth-application-client-id");
 }
Exemple #11
0
 public static string Create3DSVerification(BraintreeService service, string merchantAccountId, ThreeDSecureRequestForTests request)
 {
   string url = "/three_d_secure/create_verification/" + merchantAccountId;
   NodeWrapper response = new NodeWrapper(service.Post(service.MerchantPath() + url, request));
   Assert.IsTrue(response.IsSuccess());
   return response.GetString("three-d-secure-token");
 }
Exemple #12
0
 public OAuthAccessRevocation(NodeWrapper node)
 {
     MerchantId = node.GetString("merchant-id");
 }