本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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"));
}
}
}
示例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();
}
}
示例7: XPathToNode
private String XPathToNode(NodeWrapper node)
{
if (this.IsSameNode(node))
return "";
return XPathToNode(node.GetParent()) + "/" + node.GetName();
}