Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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" },
                },
            };
        }
Ejemplo n.º 4
0
        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);
        }