#juicy28-function-arguments
1 messages · Page 1 of 1 (latest)
Hey there! You'd pass the arguments when invoking the function. There's an example on the page you linked:
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => calculateOrderAmount($jsonObj->items),
'currency' => 'eur',
'automatic_payment_methods' => [
'enabled' => true,
],
]);
So I'd assume that's some kind of array of cart items from your application state
Thanks for your response!I I have a single item
single price
I have this variable price in checkout.html
how send it from checkout.html to create.php
How are you calling your PHP function from the HTML? You will need some client JS (i.e. fetch). See Fetch a Payment Intent section here: https://stripe.com/docs/payments/quickstart
yes i copy this code
use checkout.js
work fine but only if use const data not wit variable
Can you share your code?