Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mikkas70's avatar

Testing Stripe Cashier one-time fee/charge

Hello, I have implemented Stripe's Cashier on my application to perform one-time payments, following the official documentation. When making one-time payments/charges, the process is the following (official documentation):

  1. User has a form where he inserts Credit card information, submits the form;
  2. An AJAX call is sent to stripe, stripe validates and returns a payment ID/token that will be used to perform the charge operation;
  3. A request is done to the application itself with the token returned from stripe;
  4. Application performs (new User)->charge($token, 100) to charge the customer using a token.

Now, here's the issue - How am I supposed to feature test this, as I am required to retrieve a token from the frontend in order to proceed with the charge?

0 likes
1 reply

Please or to participate in this conversation.