Skip to content

confirmCardPayment() fails with 400 Bad Request #253

@aniongithub

Description

@aniongithub

Summary

The confirmCardPayment() method in localstripe's JavaScript client fails with a 400 Bad Request error when processing payments that require 3DS authentication. This affects the standard Stripe payment flow and prevents successful payment completion.

Environment

  • localstripe version: latest (docker container)
  • Browser: Chrome 140.0.0.0 on Linux
  • Test card: 4242424242424242 (standard Stripe test card)

Steps to Reproduce

  1. Create a PaymentIntent via the API
  2. Use Stripe().confirmCardPayment() with any card number (even non-3DS cards trigger authentication unexpectedly)
  3. Complete the 3DS authentication popup that appears
  4. Observe 400 Bad Request error

Expected Behavior

  • Non-3DS cards like 4242424242424242 should complete without authentication
  • 3DS cards should complete successfully after authentication
  • Webhooks should fire upon successful payment

Actual Behavior

  • All cards trigger 3DS authentication (unexpected for 4242424242424242)
  • Authentication fails with 400 Bad Request
  • Payment never completes
  • No webhooks are fired

Logs

localstripe container logs:

::ffff:172.24.0.8 [19/Oct/2025:06:24:53 +0000] "POST /v1/payment_intents HTTP/1.1" 200 860 "-" "Stripe/V1 .NetBindings/47.0.0"
::ffff:172.24.0.8 [19/Oct/2025:06:24:53 +0000] "GET /v1/payment_intents/pi_VW7ht0vF2JtFyD HTTP/1.1" 200 860 "-" "Stripe/V1 .NetBindings/47.0.0"
::ffff:172.24.0.1 [19/Oct/2025:06:24:55 +0000] "POST /v1/payment_intents/pi_VW7ht0vF2JtFyD/_authenticate?success=true HTTP/1.1" 400 418 "http://localhost:8888/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36"

Client-side logs:

Creating payment intent for amount: 10
Payment intent created: pi_VW7ht0vF2JtFyD
localstripe: Stripe().confirmCardPayment()
POST http://localhost:8420/v1/payment_intents/pi_VW7ht0vF2JtFyD/_authenticate?success=true 400 (Bad Request)
Payment confirmation error: {message: 'Bad request', type: 'invalid_request_error'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions