javascript - Variable amount with stripe elements

one text

Solution:

You could follow an example like this, but when creating the payment intent replace the calculation of amount based on items to just be an amount sent from the client on the body:

// Create a PaymentIntent with the order amount and currency
$payment_intent = \Stripe\PaymentIntent::create([
  "amount" => $body->amount_entered,
  "currency" => $body->currency
]);

Source