diff --git a/api/handlers/cart.go b/api/handlers/cart.go index ecd4415..c1620e3 100644 --- a/api/handlers/cart.go +++ b/api/handlers/cart.go @@ -392,17 +392,15 @@ func (h *CartHandler) ConvertCart(w http.ResponseWriter, r *http.Request) { // Charge the card. The idempotency key is tied to the order ID so retries // never produce a double charge. piParams := &stripe.PaymentIntentParams{ - Amount: stripe.Int64(int64(total)), - Currency: stripe.String(string(stripe.CurrencyUSD)), - Customer: stripe.String(user.StripeCustomerID), - PaymentMethod: stripe.String(paymentMethodID), - OffSession: stripe.Bool(true), - AutomaticPaymentMethods: &stripe.PaymentIntentAutomaticPaymentMethodsParams{ - Enabled: stripe.Bool(true), - AllowRedirects: stripe.String("never"), - }, - Confirm: stripe.Bool(true), - Description: stripe.String(fmt.Sprintf("terminal.shop order #%d", order.ID)), + Amount: stripe.Int64(int64(total)), + Currency: stripe.String(string(stripe.CurrencyUSD)), + Customer: stripe.String(user.StripeCustomerID), + PaymentMethod: stripe.String(paymentMethodID), + OffSession: stripe.Bool(true), + PaymentMethodTypes: stripe.StringSlice([]string{"card"}), + ReturnURL: stripe.String(h.appURL + "/post-3ds"), + Confirm: stripe.Bool(true), + Description: stripe.String(fmt.Sprintf("terminal.shop order #%d", order.ID)), Shipping: &stripe.ShippingDetailsParams{ Name: stripe.String(address.Name), Address: &stripe.AddressParams{ diff --git a/api/routes/routes.go b/api/routes/routes.go index 144fd79..670efb8 100644 --- a/api/routes/routes.go +++ b/api/routes/routes.go @@ -61,6 +61,10 @@ func SetupRoutes( w.Header().Set("Content-Type", "text/html") _, _ = w.Write([]byte(`
You can close this tab.
`)) }) + r.Get("/post-3ds", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/html") + _, _ = w.Write([]byte(`Return to your terminal.
`)) + }) r.Handle("/metrics", middleware.MetricsHandler()) r.Route("/api/v1", func(r chi.Router) {