#Paddy-terminal
1 messages · Page 1 of 1 (latest)
Hi Tarzan
Yeah basically
It’s ‘connecting to the reader
And creating a payment intent but nothing is coming up on the read the reader
BPOS WISE E
Python & Java script
could you share the Payment Intent id please? pi_xxx
they do that some times 😛
pi_3KxUa6A49TfUQ5yT0rSdJ8Ka
PaymentIntent looks good. So what happens on the frontend when you call collectPaymentMethod with it?
nothing really
its meant to call the card reader
but it doesnt
thats the javascript error we get in the above message
so , you have code that looks like this, correct? https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=js#collect-payment
I see no error above actually.
you know in the array message
when you console.log(result) from collectPaymentMethod, what is that?
that's the response to connectReader I think, which is not where the problem is
also please share the complete code you've written so I can help you with it!
for the collectpayment bit
its not getting that far
this is the javascript file
it seems we are stuck on the check out funciton
when does checkout get called?
in that code nothing actually calls it so that code wouldn't run.
ok cool. So when you debug into that function, how far does it get?
you have console.log("checkout"), is that getting logged?
also location.href='http://localhost:5000/payment' is really really weird
no its not getting to that log
that will stop all the code
since you're navigating the browser to an entirely different page and all the JS context is lost
right okay, makes sense
we are navigating to a payment window where people have a display of the price
then click pay now
that was the reason
yeah that doesn't really make sense. You can have them select a price and then do the Terminal stuff. Maybe for now don't make it complicated
just have it so when the button is pressed you do the Terminal payment with some fixed amount, once you have the payment actually working you can come back and redesign it for more flexibility!
Okay makes sense to try that for now reallty
really
because previously on a different UI we had done it
but we've changed UI and its not doing the same thign
so we will do as you suggested
in regards to this comment
what did you mean
I meant you're navigating the browser to an entirely different page and all the JS context is lost
setting location.href moves the browser to that page. All the Javascript after that point will never actually run, since the browser is now on a new page. It doesn't really make sense to redirect that way in the middle of an action.
Got you