#Tony4455-payments
1 messages · Page 1 of 1 (latest)
okay give me 5 mins i share it then
ok!
the error though is from
document
.querySelector("#payment-form")
and it means you have no HTML element with id="payment-form" on the page at the time you run that code.
seems like your form is actually called msform so maybe you want
document
.querySelector("#msform")
instead
I am using this sample code
provided by stripe
okay let me do the testing and I will get back to you then
That error is fixed now this error is coming
dont know why
when I click on pay now button then this error comes
I actually visited your page just now and the payment worked.
Ultimately though I can't help you with generic questions about debugging your own page and its setup and Javascript, can try to help if you have specific questions about snippets of your code that use Stripe directlty.
okay like you said it worked
I need to add one more input in the stripe form for amount where customer can input any amount he wants to pay
can you help me out on how should I do that
sure, you'd add some <form> <inputs> to your existing flow that collects an amount from the customer, POST it your server and then use those values when you call the PaymentIntent API in your backend PHP code to pass the user-specified amount to the "amount" parameter.
okay but test transactions are not showing in stripe dashboard
where can I see those ?
can I pass some variable in the url so that I can get that value on success also to insert the data in database also
you'd use webhooks https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-post-payment . You can add metadata to the PaymentIntent when you create it, in order to recognise it on the incoming webhook.
okay I should replace this amount right ? I can send ajax post in create.php and then replace the amount. is that what you are saying
Hey there! Yes you could use that function to calculate the PI amount based on an array of items
Otherwise it'll be the same, fixed amount each time
payment succeeded but still same amount showing in backend
I changed the amount here
but still amount showing in backend is 14.99 euros
whats wrong I am doing here
Hi there 👋 can you provide the ID of the payment intent that you tried to update?
@ocean dirge I've got to step away soon. I wasn't able to find any payment intents created on your account with this amount, is this code being executed? Is it erroring?