#mangel_terminal-error

1 messages ¡ Page 1 of 1 (latest)

rich mauveBOT
serene shadowBOT
#

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.

rich mauveBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1260653047101784158

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

celest nebula
#

@pallid bolt uyes we would start fresh. We help in real time in this server and if you prefer async help it's best to work directly with our support team instead: https://support.stripe.com/contact

pallid bolt
#

If you read through the old thread, you can see that the previous tech could not see any errors with the intent that was sent be presentPaymentMethod. The device shows the correct ammount, and allows me to tap my test card and get "Approved"- then the async call happens to processPaymentMethod, and it never retruns, hanging the script. He suggested it is a network problem and I should try another network. That seems like a red hearing- if I can communicated to it with presentPaymentMethod, that would indicate all inbound/outbound traffic is working.

celest nebula
#

I'm sorry I am helping many people at once. Can you please write a clear question with a clear summary of what you need help with and the relevant object ids

pallid bolt
#

Code
processResult = await stripe.terminal.readers.processPaymentIntent(reader.id,{payment_intent: intent.id});

Question
I have been using my server based code in test mode with a simulated reader very successfully. I am now attempting to use my physical WisePose which is registered in the HQ location in test mode. The only change I have made is the reader ID of the WisePos. The await processPaymentIntent never return (hangs). The paymentIntent has an error that the sim reader never showed.

What have you already attempted?
{"id":"tmr_Fopv6whhPid2at","object":"terminal.reader","action":{"failure_code":null,"failure_message":null,"process_payment_intent":{"payment_intent":"pi_3Pb1u6EPuIFxKCqt18Xeo2i6"},"status":"in_progress","type":"process_payment_intent"},"device_sw_version":"2.24.2.0","device_type":"bbpos_wisepos_e","ip_address":"192.168.87.124","label":"Machine WisePose","last_seen_at":1720623208573,"livemode":false,"location":"tml_FiuXCQpknBASRm","metadata":{},"serial_number":"WSC51315102060

What are you working on?
Trying to get my node.js serverd based code to work with my WisePos in test mode.

#

Intent ID: pi_3Pb1u6EPuIFxKCqt18Xeo2i6

#

The "what have you attempted" is the paymentIntent retruned by the reader which got cut off. I can provide it again. I have also tried to change the paymentIntents JSON:

const paymentIntent = await stripe.paymentIntents.create(
{
amount: adjustedAmount,
currency: 'usd',
payment_method_types: ['card_present'],
capture_method: 'manual',
// automatic_payment_methods: {
// enabled: true
// }
}

celest nebula
#

that was from hours ago. Can you please try with a fresh attempt on the reader and then share the exact relevant newer ids to ensure we are looking at the same thing?

pallid bolt
#

Sure

#

I will make a new purchase and post results in real time.

celest nebula
#

thanks, please try to send one clear message all in one, not many separate messages. Then I'll have a look into our logs

#

mangel_terminal-error

pallid bolt
#

I made a purchase, and the reader is displaying the ammount and asking me to tap:
INTENT ID:pi_3Pb4iHEPuIFxKCqt0B8bm5CY

#

processResult: {"id":"tmr_Fopv6whhPid2at","object":"terminal.reader","action":{"failure_code":null,"failure_message":null,"process_payment_intent":{"payment_intent":"pi_3Pb4iHEPuIFxKCqt0B8bm5CY"},"status":"in_progress","type":"process_payment_intent"},"device_sw_version":"2.24.2.0","device_type":"bbpos_wisepos_e","ip_address":"192.168.87.124","label":"Machine WisePose","last_seen_at":1720633982790,"livemode":false,"location":"tml_FiuXCQpknBASRm","metadata":{},"serial_number":"WSC513151020607","status":"online"}

#

I will now go tap the test card

celest nebula
#

please read my message above. Don't post small short sentence. Write a clear one message with a full summary

pallid bolt
#

The reader says "Approved" and went back to splash screen

#

And now the script is hung on:
reader = await stripe.testHelpers.terminal.readers.presentPaymentMethod(reader.id);

celest nebula
#

Why are you using TestHelpers?

pallid bolt
#

I was using the sim with success previously. Registered the reader in my location in Test Mode, and changed the terminal ID to the registered WisePos (in test mode), and proceeded.

#

I'm not sure what test helpers are, other than my location is in test mode in the dashboard.

#

I'm not sure what other information I can provide at this point to describe the flow I am using.

celest nebula
#

TestHelpers are used to simulate something happening on the Reader without having to do a physical presentment.
Try to move away from that for now and call the real API to accept a payment

pallid bolt
#

Where do I do that in the code?

celest nebula
pallid bolt
#

Ah. Ok. That was code from a while back that always worked with the sim. I will try it without that.

#

Ok- just tried it now with

processResult = await stripe.terminal.readers.processPaymentIntent(reader.id,{payment_intent: intent.id});

#

Hold...

celest nebula
#

Okay, what's the exact PaymentIntent id? And what happened? Like did you present the card on the Reader? Did it succeed? Are you seeing Events on your WebhookEndpoint?

pallid bolt
#

there are other areas that have testHelper.

#

Ok- I was wrong. This is what the code looks like now

// reader = await stripe.testHelpers.terminal.readers.presentPaymentMethod(reader.id);
reader = await stripe.terminal.readers.presentPaymentMethod(reader.id);

celest nebula
#

koopajah: Okay, what's the exact PaymentIntent id? And what happened? Like did you present the card on the Reader? Did it succeed? Are you seeing Events on your WebhookEndpoint?

pallid bolt
#

Only place where testHelpers was present. To answer your questions

This is what I get back from processResult = await stripe.terminal.readers.processPaymentIntent(reader.id,{payment_intent: intent.id});

processResult: {"id":"tmr_Fopv6whhPid2at","object":"terminal.reader","action":{"failure_code":null,"failure_message":null,"process_payment_intent":{"payment_intent":"pi_3Pb4trEPuIFxKCqt0eP5Btu4"},"status":"in_progress","type":"process_payment_intent"},"device_sw_version":"2.24.2.0","device_type":"bbpos_wisepos_e","ip_address":"192.168.87.124","label":"Machine WisePose","last_seen_at":1720634743345,"livemode":false,"location":"tml_FiuXCQpknBASRm","metadata":{},"serial_number":"WSC513151020607","status":"online"}

#

And that is what is returned after I tap my test card and see "Approved"

celest nebula
#

looking

#

So if you are still having the issue, can you explain what the problem is?

pallid bolt
#

Yes.

This is the relevant code:
processResult = await stripe.terminal.readers.processPaymentIntent(reader.id,{payment_intent: intent.id});
console.log("processResult: "+JSON.stringify(processResult));

// reader = await stripe.testHelpers.terminal.readers.presentPaymentMethod(reader.id);
reader = await stripe.terminal.readers.presentPaymentMethod(reader.id);
console.log("READER2: "+JSON.stringify(reader));

WHen using the WisePos, the log for READER2 is never executed. Using the simluator with the testHelpers, everything works.

#

that's where I got testHelpers from, but now that is not there, and still having same issues with the async on the WisePos.

celest nebula
#

why ae you calling presentPaymentMethod()? processPaymentIntent does everything for you already

pallid bolt
#

That's how I read it in the docs- the sim was working perfectly. My recollection was that I was advised I had to do that- maybe just for the sim?

#

Let me remove it and see what happens.

celest nebula
#

yeah I think it's just for the sim maybe

#

My understanding is that you have a Terminal Reader, you create a PaymentIntent and you tell us "please handle accepting payments for pi_1234 on the Reader tmr_abc" and then we do everything like showing the UI screen to ask to tap, detect the card, confirm the PaymentIntent, etc.

pallid bolt
#

Let me try it out now!

#

Now I get:

Error: StripeInvalidRequestError: This PaymentIntent could not be captured because it has a status of requires_payment_method. Only a PaymentIntent with one of the following statuses may be captured: requires_capture.
at StripeError.generate (/home/mangell/vend/server/node_modules/stripe/cjs/Error.js:10:20)
at res.toJSON.then.Error_js_1.StripeAPIError.message (/home/mangell/vend/server/node_modules/stripe/cjs/RequestSender.js:105:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'StripeInvalidRequestError',
raw: {

#

Is that because there are more discrpeancies with the Sim? Maybe the create intent:

const paymentIntent = await stripe.paymentIntents.create(
{
amount: adjustedAmount,
currency: 'usd',
payment_method_types: ['card_present'],
capture_method: 'manual',
// automatic_payment_methods: {
// enabled: true
// }
}

#

The sim seems to provide a false sense of security,

celest nebula
#

What is the status of that PaymentIntent exactly? Make sure to carefully check the relevant objects, look at the associated Events, etc.

pallid bolt
#

INTENT: {"id":"pi_3Pb5NzEPuIFxKCqt1nCgs3pF","object":"payment_intent","amount":2200,"amount_capturable":0,"amount_details":{"tip":{}},"amount_received":0,"application":null,"application_fee_amount":null,"automatic_payment_methods":null,"canceled_at":null,"cancellation_reason":null,"capture_method":"manual","client_secret":"pi_3Pb5NzEPuIFxKCqt1nCgs3pF_secret_Go6yfku0BNJFnw53omvqGPZzy","confirmation_method":"automatic","created":1720636623,"currency":"usd","customer":null,"description":null,"invoice":null,"last_payment_error":null,"latest_charge":null,"livemode":false,"metadata":{},"next_action":null,"on_behalf_of":null,"payment_method":null,"payment_method_configuration_details":null,"payment_method_options":{"card_present":{"request_extended_authorization":false,"request_incremental_authorization_support":false}},"payment_method_types":["card_present"],"processing":null,"receipt_email":null,"review":null,"setup_future_usage":null,"shipping":null,"source":null,"statement_descriptor":null,"statement_descriptor_suffix":null,"status":"requires_payment_method","transfer_data":null,"transfer_group":null}

celest nebula
#

Please take the time to look at it and debug first