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


C# NodeWrapper.GetName方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: Create

        public Result<PaymentMethod> Create(PaymentMethodRequest request)
        {
            var response = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods", 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 if (response.GetName() == "amex-express-checkout-card")
            {
                return new ResultImpl<AmexExpressCheckoutCard>(response, gateway);
            }
            else if (response.GetName() == "coinbase-account")
            {
                return new ResultImpl<CoinbaseAccount>(response, gateway);
            }
            else if (response.GetName() == "venmo-account")
            {
                return new ResultImpl<VenmoAccount>(response, gateway);
            }
            else
            {
                return new ResultImpl<UnknownPaymentMethod>(response, gateway);
            }
        }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:37,代码来源:PaymentMethodGateway.cs

示例5: PopulateErrors

        private void PopulateErrors(NodeWrapper node)
        {
            if (node.GetName() == "api-error-response")
            {
                node = node.GetNode("errors");
            }

            List<NodeWrapper> errorResponses = node.GetChildren();
            foreach (var errorResponse in errorResponses)
            {
                if (errorResponse.GetName() != "errors")
                {
                    nestedErrors[errorResponse.GetName()] = new ValidationErrors(errorResponse);
                }
                else
                {
                    PopulateTopLevelErrors(errorResponse.GetList("error"));
                }
            }
        }
开发者ID:Jammyhammy,项目名称:braintree_dotnet,代码行数:20,代码来源:ValidationErrors.cs

示例6: Search

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

            if (response.GetName() == "search-results") {
                return new ResourceCollection<Transaction>(response, delegate(string[] ids) {
                    return FetchTransactions(query, ids);
                });
            } else {
                throw new DownForMaintenanceException();
            }
        }
开发者ID:kevlut,项目名称:braintree_dotnet,代码行数:12,代码来源:TransactionGateway.cs

示例7: XPathToNode

        private String XPathToNode(NodeWrapper node)
        {
            if (this.IsSameNode(node))
                return "";

            return XPathToNode(node.GetParent()) + "/" + node.GetName();
        }
开发者ID:zxed,项目名称:braintree_dotnet,代码行数:7,代码来源:NodeWrapper.cs


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