#Paddy-terminal

1 messages · Page 1 of 1 (latest)

south cradle
#

👋 happy to help

#

what seems to be the issue?

mint olive
#

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

south cradle
#

could you share the Payment Intent id please? pi_xxx

mint olive
#

One second

#

Computer has decided to do a reboot

south cradle
#

they do that some times 😛

mint olive
#

pi_3KxUa6A49TfUQ5yT0rSdJ8Ka

lethal mauve
#

PaymentIntent looks good. So what happens on the frontend when you call collectPaymentMethod with it?

mint olive
#

nothing really

#

its meant to call the card reader

#

but it doesnt

#

thats the javascript error we get in the above message

lethal mauve
lethal mauve
mint olive
#

you know in the array message

lethal mauve
#

when you console.log(result) from collectPaymentMethod, what is that?

lethal mauve
#

also please share the complete code you've written so I can help you with it!

mint olive
#

for the collectpayment bit

#

its not getting that far

#

this is the javascript file

#

it seems we are stuck on the check out funciton

lethal mauve
#

when does checkout get called?

#

in that code nothing actually calls it so that code wouldn't run.

mint olive
#

it gets called in an html file at the bottom there

lethal mauve
#

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

mint olive
#

no its not getting to that log

lethal mauve
#

that will stop all the code

#

since you're navigating the browser to an entirely different page and all the JS context is lost

mint olive
#

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

lethal mauve
#

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!

mint olive
#

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

mint olive
#

what did you mean

lethal mauve
#

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.

mint olive
#

Got you