#Tony4455-payments

1 messages · Page 1 of 1 (latest)

muted dock
#

could you share the exact code you're using?

ocean dirge
#

okay give me 5 mins i share it then

muted dock
#

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

ocean dirge
#

I am using this sample code

#

provided by stripe

#

okay let me do the testing and I will get back to you then

ocean dirge
#

That error is fixed now this error is coming

#

dont know why

#

when I click on pay now button then this error comes

muted dock
#

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.

ocean dirge
#

okay

#

content.js is stripe file I think nvm I will check it now on my end

ocean dirge
#

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

muted dock
#

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.

ocean dirge
#

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

muted dock
ocean dirge
#

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

dusk portal
#

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

ocean dirge
#

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

fickle idol
#

Hi there 👋 can you provide the ID of the payment intent that you tried to update?

fickle idol
# ocean dirge I changed the amount here

@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?

ocean dirge
#

okay that could be a possibility that this code is not working because I also not see that amount there

#

will debug it and get back to you tommorrow then