public async Task <PaymentMethod> FindAsync(string token) { if (token == null || token.Trim().Equals("")) { throw new NotFoundException(); } var response = new NodeWrapper(await service.GetAsync(service.MerchantPath() + "/payment_methods/any/" + token).ConfigureAwait(false)); return(PaymentMethodParser.ParsePaymentMethod(response, gateway)); }
protected internal RevokedPaymentMethodMetadata(NodeWrapper node, IBraintreeGateway gateway) { if (node.GetChildren().Count == 0) { throw new UnexpectedException(); } RevokedPaymentMethod = PaymentMethodParser.ParsePaymentMethod(node.GetChildren()[0], gateway); CustomerId = RevokedPaymentMethod.CustomerId; Token = RevokedPaymentMethod.Token; }
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)); return(PaymentMethodParser.ParsePaymentMethod(response, gateway)); }