#fazilhussain015
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- fazilhussain015, 3 days ago, 24 messages
Hi
Could you please share more details ?
Sure, as I explore the documentation and try to implement it, when the DOM is ready, we need to send a Stripe request to create a UI and mount it on our ID. However, when we send the request, we need to pass the product ID or a custom item list with pricing.
What I actually want to do is send the request to render the UI, and in the submit payment information, I want to let them decide the customer to input the amount
here is the refference to the code
$paymentIntent = $stripe->paymentIntents->create([
'line_items' => [[
'price_data' => [
'currency' => 'usd',
'product_data' => [
'name' => 'T-shirt',
],
'unit_amount' => 2000,
],
'quantity' => 1,
]],
'currency' => 'usd',
// In the latest version of the API, specifying the automatic_payment_methods parameter is optional because Stripe enables its functionality by default.
'automatic_payment_methods' => [
'enabled' => true,
],
]);
other way
$paymentIntent = $stripe->paymentIntents->create([
'amount' => calculateOrderAmount($jsonObj->items),
'currency' => 'usd',
// In the latest version of the API, specifying the automatic_payment_methods parameter is optional because Stripe enables its functionality by default.
'automatic_payment_methods' => [
'enabled' => true,
],
]);
What you can do is to update the PaymentIntent's price and then fetch the update from the js Element:
https://stripe.com/docs/js/elements_object/fetch_updates
okay you means i will create request with dummy price and than will update it to the next submit request of payment informatin im right ?