当前位置: 首页>>代码示例>>C#>>正文


C# Braintree.NodeWrapper类代码示例

本文整理汇总了C#中Braintree.NodeWrapper的典型用法代码示例。如果您正苦于以下问题:C# NodeWrapper类的具体用法?C# NodeWrapper怎么用?C# NodeWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NodeWrapper类属于Braintree命名空间,在下文中一共展示了NodeWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MerchantAccountBusinessDetails

 protected internal MerchantAccountBusinessDetails(NodeWrapper node)
 {
     DbaName = node.GetString("dba-name");
     LegalName = node.GetString("legal-name");
     TaxId = node.GetString("tax-id");
     Address = new Address(node.GetNode("address"));
 }
开发者ID:zxed,项目名称:braintree_dotnet,代码行数:7,代码来源:MerchantAccountBusinessDetails.cs

示例2: Customer

        internal Customer(NodeWrapper node, BraintreeService service)
        {
            if (node == null) return;

            Id = node.GetString("id");
            FirstName = node.GetString("first-name");
            LastName = node.GetString("last-name");
            Company = node.GetString("company");
            Email = node.GetString("email");
            Phone = node.GetString("phone");
            Fax = node.GetString("fax");
            Website = node.GetString("website");
            CreatedAt = node.GetDateTime("created-at");
            UpdatedAt = node.GetDateTime("updated-at");

            var creditCardXmlNodes = node.GetList("credit-cards/credit-card");
            CreditCards = new CreditCard[creditCardXmlNodes.Count];
            for (int i = 0; i < creditCardXmlNodes.Count; i++)
            {
                CreditCards[i] = new CreditCard(creditCardXmlNodes[i], service);
            }

            var addressXmlNodes = node.GetList("addresses/address");
            Addresses = new Address[addressXmlNodes.Count];
            for (int i = 0; i < addressXmlNodes.Count; i++)
            {
                Addresses[i] = new Address(addressXmlNodes[i]);
            }

            CustomFields = node.GetDictionary("custom-fields");
        }
开发者ID:toantran,项目名称:braintree_dotnet,代码行数:31,代码来源:Customer.cs

示例3: Create

        public Result<PaymentMethod> Create(PaymentMethodRequest request)
        {
            NodeWrapper response = new NodeWrapper(service.Post("/payment_methods", request));

            if (response.GetName() == "paypal-account")
            {
                return new ResultImpl<PayPalAccount>(response, service);
            }
            else if (response.GetName() == "credit-card")
            {
                return new ResultImpl<CreditCard>(response, service);
            }
            else if (response.GetName() == "apple-pay-card")
            {
                return new ResultImpl<ApplePayCard>(response, service);
            }
            else if (response.GetName() == "android-pay-card")
            {
                return new ResultImpl<AndroidPayCard>(response, service);
            }
            else if (response.GetName() == "coinbase-account")
            {
                return new ResultImpl<CoinbaseAccount>(response, service);
            }
            else
            {
                return new ResultImpl<UnknownPaymentMethod>(response, service);
            }
        }
开发者ID:zxed,项目名称:braintree_dotnet,代码行数:29,代码来源:PaymentMethodGateway.cs

示例4: Plan

 public Plan(NodeWrapper node)
 {
     if (node == null) return;
     BillingDayOfMonth = node.GetInteger("billing-day-of-month");
     BillingFrequency = node.GetInteger("billing-frequency");
     CurrencyIsoCode = node.GetString("currency-iso-code");
     Description = node.GetString("description");
     Id = node.GetString("id");
     Name = node.GetString("name");
     NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles");
     Price = node.GetDecimal("price");
     TrialPeriod = node.GetBoolean("trial-period");
     TrialDuration = node.GetInteger("trial-duration");
     string trialDurationUnitStr = node.GetString("trial-duration-unit");
     if (trialDurationUnitStr != null) {
         TrialDurationUnit = (PlanDurationUnit) CollectionUtil.Find(PlanDurationUnit.ALL, trialDurationUnitStr, PlanDurationUnit.UNRECOGNIZED);
     }
     AddOns = new List<AddOn> ();
     foreach (var addOnResponse in node.GetList("add-ons/add-on")) {
         AddOns.Add(new AddOn(addOnResponse));
     }
     Discounts = new List<Discount> ();
     foreach (var discountResponse in node.GetList("discounts/discount")) {
         Discounts.Add(new Discount(discountResponse));
     }
 }
开发者ID:ronin1,项目名称:braintree_dotnet,代码行数:26,代码来源:Plan.cs

示例5: Descriptor

 protected internal Descriptor(NodeWrapper node)
 {
     if (node != null) {
         Name = node.GetString("name");
         Phone = node.GetString("phone");
     }
 }
开发者ID:khorvat,项目名称:braintree_dotnet,代码行数:7,代码来源:Descriptor.cs

示例6: CreditCardVerification

        public CreditCardVerification(NodeWrapper node, BraintreeGateway gateway)
        {
            if (node == null) return;

            AvsErrorResponseCode = node.GetString("avs-error-response-code");
            AvsPostalCodeResponseCode = node.GetString("avs-postal-code-response-code");
            AvsStreetAddressResponseCode = node.GetString("avs-street-address-response-code");
            CvvResponseCode = node.GetString("cvv-response-code");
            GatewayRejectionReason = (TransactionGatewayRejectionReason)CollectionUtil.Find(
                TransactionGatewayRejectionReason.ALL,
                node.GetString("gateway-rejection-reason"),
                null
            );
            ProcessorResponseCode = node.GetString("processor-response-code");
            ProcessorResponseText = node.GetString("processor-response-text");
            MerchantAccountId = node.GetString("merchant-account-id");
            Status = (VerificationStatus)CollectionUtil.Find(VerificationStatus.ALL, node.GetString("status"), VerificationStatus.UNRECOGNIZED);
            Id = node.GetString("id");
            BillingAddress = new Address(node.GetNode("billing"));
            CreditCard = new CreditCard(node.GetNode("credit-card"), gateway);
            CreatedAt = node.GetDateTime("created-at");

            var riskDataNode = node.GetNode("risk-data");
            if (riskDataNode != null) {
                RiskData = new RiskData(riskDataNode);
            }
        }
开发者ID:ronin1,项目名称:braintree_dotnet,代码行数:27,代码来源:CreditCardVerification.cs

示例7: UnknownPaymentMethod

 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");
 }
开发者ID:ronin1,项目名称:braintree_dotnet,代码行数:7,代码来源:UnknownPaymentMethod.cs

示例8: CoinbaseDetails

 protected internal CoinbaseDetails(NodeWrapper node)
 {
     UserId = node.GetString("user-id");
     UserEmail = node.GetString("user-email");
     UserName = node.GetString("user-name");
     Token = node.GetString("token");
 }
开发者ID:zxed,项目名称:braintree_dotnet,代码行数:7,代码来源:CoinbaseDetails.cs

示例9: Find

        public PaymentMethod Find(string token)
        {
            if(token == null || token.Trim().Equals(""))
                throw new NotFoundException();

            var response = new NodeWrapper(service.Get(service.MerchantPath() + "/payment_methods/any/" + token));

            if (response.GetName() == "paypal-account")
            {
                return new PayPalAccount(response, gateway);
            }
            else if (response.GetName() == "credit-card")
            {
                return new CreditCard(response, gateway);
            }
            else if (response.GetName() == "apple-pay-card")
            {
                return new ApplePayCard(response, gateway);
            }
            else if (response.GetName() == "android-pay-card")
            {
                return new AndroidPayCard(response, gateway);
            }
            else if (response.GetName() == "coinbase-account")
            {
                return new CoinbaseAccount(response, gateway);
            }
            else
            {
                return new UnknownPaymentMethod(response);
            }
        }
开发者ID:ronin1,项目名称:braintree_dotnet,代码行数:32,代码来源:PaymentMethodGateway.cs

示例10: AndroidPayCard

        protected internal AndroidPayCard(NodeWrapper node, IBraintreeGateway gateway)
        {
            CardType = node.GetString("virtual-card-type");
            VirtualCardType = node.GetString("virtual-card-type");
            SourceCardType = node.GetString("source-card-type");
            Last4 = node.GetString("virtual-card-last-4");
            SourceCardLast4 = node.GetString("source-card-last-4");
            VirtualCardLast4 = node.GetString("virtual-card-last-4");
            SourceDescription = node.GetString("source-description");
            Bin = node.GetString("bin");
            ExpirationMonth = node.GetString("expiration-month");
            ExpirationYear = node.GetString("expiration-year");
            GoogleTransactionId = node.GetString("google-transaction-id");
            Token = node.GetString("token");
            IsDefault = node.GetBoolean("default");
            ImageUrl = node.GetString("image-url");
            CustomerId = node.GetString("customer-id");

            CreatedAt = node.GetDateTime("created-at");
            UpdatedAt = node.GetDateTime("updated-at");

            var subscriptionXmlNodes = node.GetList("subscriptions/subscription");
            Subscriptions = new Subscription[subscriptionXmlNodes.Count];
            for (int i = 0; i < subscriptionXmlNodes.Count; i++)
            {
                Subscriptions[i] = new Subscription(subscriptionXmlNodes[i], gateway);
            }
        }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:28,代码来源:AndroidPayCard.cs

示例11: Update

        public Result<PaymentMethod> Update(string token, PaymentMethodRequest request)
        {
            var response = new NodeWrapper(service.Put(service.MerchantPath() + "/payment_methods/any/" + token, request));

            if (response.GetName() == "paypal-account")
            {
                return new ResultImpl<PayPalAccount>(response, gateway);
            }
            else if (response.GetName() == "credit-card")
            {
                return new ResultImpl<CreditCard>(response, gateway);
            }
            else if (response.GetName() == "apple-pay-card")
            {
                return new ResultImpl<ApplePayCard>(response, gateway);
            }
            else if (response.GetName() == "android-pay-card")
            {
                return new ResultImpl<AndroidPayCard>(response, gateway);
            }
            else
            {
                return new ResultImpl<UnknownPaymentMethod>(response, gateway);
            }
        }
开发者ID:ronin1,项目名称:braintree_dotnet,代码行数:25,代码来源:PaymentMethodGateway.cs

示例12: MerchantAccount

 protected internal MerchantAccount(NodeWrapper node)
 {
   Id = node.GetString("id");
   CurrencyIsoCode = node.GetString("currency-iso-code");
   Status = (MerchantAccountStatus) CollectionUtil.Find(MerchantAccountStatus.ALL, node.GetString("status"), null);
   NodeWrapper masterNode = node.GetNode("master-merchant-account");
   if (masterNode != null)
       MasterMerchantAccount = new MerchantAccount(masterNode);
   else
       MasterMerchantAccount = null;
   NodeWrapper individualNode = node.GetNode("individual");
   if (individualNode != null)
       IndividualDetails = new MerchantAccountIndividualDetails(individualNode);
   else
       IndividualDetails = null;
   NodeWrapper businessNode = node.GetNode("business");
   if (businessNode != null)
       BusinessDetails = new MerchantAccountBusinessDetails(businessNode);
   else
       BusinessDetails = null;
   NodeWrapper fundingNode = node.GetNode("funding");
   if (fundingNode != null)
       FundingDetails = new MerchantAccountFundingDetails(fundingNode);
   else
       FundingDetails = null;
 }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:26,代码来源:MerchantAccount.cs

示例13: Parse

 public virtual WebhookNotification Parse(string signature, string payload)
 {
     ValidateSignature(signature, payload);
     var xmlPayload = Encoding.Default.GetString(Convert.FromBase64String(payload));
     var node = new NodeWrapper(service.StringToXmlNode(xmlPayload));
     return new WebhookNotification(node, gateway);
 }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:7,代码来源:WebhookNotificationGateway.cs

示例14: Modification

 internal Modification(NodeWrapper node)
 {
     Amount = node.GetDecimal("amount");
     Id = node.GetString("id");
     NeverExpires = node.GetBoolean("never-expires");
     NumberOfBillingCycles = node.GetInteger("number-of-billing-cycles");
     Quantity = node.GetInteger("quantity");
 }
开发者ID:sdether,项目名称:braintree_dotnet,代码行数:8,代码来源:Modification.cs

示例15: Search

        public virtual ResourceCollection<CreditCardVerification> Search(CreditCardVerificationSearchRequest query)
        {
            var response = new NodeWrapper(service.Post(service.MerchantPath() + "/verifications/advanced_search_ids", query));

            return new ResourceCollection<CreditCardVerification>(response, delegate(string[] ids) {
                return FetchCreditCardVerifications(query, ids);
            });
        }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:8,代码来源:CreditCardVerificationGateway.cs


注:本文中的Braintree.NodeWrapper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。