示例#1
0
        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));
        }
示例#2
0
        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;
        }
示例#3
0
        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));
        }