#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, 15 minutes ago, 8 messages
- fazilhussain015, 3 days ago, 24 messages
hello.
could you please tell me how i can do this,
that was suggested by another support person in last chat
"yes you start with a price and then once the customer update the price field, you update the payment_intent and re-fetch/update the Element using that js function"
what specific part are you having trouble with, what code have you tried to implement so far following that suggestion?
okay let me share the code snippet with you
$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,
],
]);
i want to load the payment methods ui first on the page and want to give the option to the customer to put the amount with bank details for the payment method and I want to go with an amount that is not predecided when ui is going to be build by stipe.
well maybe then you want the deferred flow instead.
https://stripe.com/docs/payments/accept-a-payment-deferred , in that integration you don't need to create the PaymentIntent when the page loads, you can create it later when the submit button is pressed.
or as my colleague said in the other thread, you can use the Intents-first integration and use fetchUpdates when you manually update the PaymentIntent using AJAX calls to your backend based on what is happening on the frontend.
okay if i want to load the payment ui in my web page to show the customer payment methods options and by chosing the payment method i want to add the amount he want to pay
okay if i go with 2nd option than what i need to do
out of curiosity why are you picking the second option instead of the first one, the deferred integration? what criteria did you use to decide that?
I'm not sure the first one provides us a complete UI for the payment options when the page is loaded
maybe try it out and see
it uses the settings for the payment methods from your dashboard
here you can see its using same options and passing the amount paramter
const options = {
mode: 'payment',
amount: 1099,
currency: 'usd',
// Fully customizable with appearance API.
appearance: {/.../},
};
// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);
// Create and mount the Payment Element
const paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
im talking about the first section