async public Task <PaymentMethod> UpdatePaymentMethodAsync(string id) // , [FromBody] PaymentMethodUpdateOptions paymentMethodUpdateOptions) { var paymentMethodUpdateOptions = new PaymentMethodUpdateOptions { BillingDetails = new BillingDetailsOptions { Email = "*****@*****.**" } }; return(await _paymentMethodService.UpdateAsync(id, paymentMethodUpdateOptions, _requestOptions)); }
public async Task <PaymentMethod> UpdatePaymentMethodAsync(string paymentMethodId, long expMonth, long expYear) { var options = new PaymentMethodUpdateOptions { Card = new PaymentMethodCardUpdateOptions { ExpMonth = expMonth, ExpYear = expYear } }; return(await this.UpdateAsync(paymentMethodId, options)); }
public PaymentMethodServiceTest( StripeMockFixture stripeMockFixture, MockHttpClientFixture mockHttpClientFixture) : base(stripeMockFixture, mockHttpClientFixture) { this.service = new PaymentMethodService(this.StripeClient); this.attachOptions = new PaymentMethodAttachOptions { Customer = "cus_123", }; this.createOptions = new PaymentMethodCreateOptions { Card = new PaymentMethodCardOptions { Token = "tok_123", }, Type = "card", }; this.detachOptions = new PaymentMethodDetachOptions { }; this.listOptions = new PaymentMethodListOptions { Customer = "cus_123", Type = "card", }; this.updateOptions = new PaymentMethodUpdateOptions { Metadata = new Dictionary <string, string> { { "key", "value" }, }, }; }
public async Task UpdateCustomerPaymentMethod(string paymentMethodId, AddressDao newAddress, CancellationToken cancellationToken) { Guard.Argument(paymentMethodId, nameof(paymentMethodId)).NotNull().NotEmpty().NotWhiteSpace(); Guard.Argument(newAddress, nameof(newAddress)).NotNull(); var options = new PaymentMethodUpdateOptions { BillingDetails = new BillingDetailsOptions { Address = new AddressOptions { Line1 = newAddress.Line1, Line2 = newAddress.Line2, City = newAddress.City, State = newAddress.State, PostalCode = newAddress.Postcode, Country = newAddress.Country, } } }; await _paymentMethodService.UpdateAsync(paymentMethodId, options, cancellationToken : cancellationToken); }