#nerd-terminal-serverdriven
1 messages · Page 1 of 1 (latest)
You mean verify that it succeeded?
Can you share any snippets of your terminal integration showing how you complete the payment there?
I would expect you to get a synchronous response when doing that that you could use
`$stripe->terminal->readers->processPaymentIntent(
$lane->terminal_id,
[
'payment_intent' => $paymentIntent['id'],
],
[
'stripe_account' => $team['connect_id'],
]
);
wait(2);
$payment_Intent = $stripe->paymentIntents->confirm(
$paymentIntent['id'],
[],
[
'stripe_account' => $team['connect_id'],
]
);
$amountReceived = $payment_Intent->amount_received;`
After that it goes to clearing my local customer cart. I just need to make sure that the amount_received is what was sent as a total
And $stripe is coming from $stripe = new \Stripe\StripeClient(env('STRIPE_SECRET'));
And you're having some issue with this, as it is currently?
If you're calling process payment intent like that, I don't expect the need to confirm it, can you clarify why you flow does that?
https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven&process=immediately#process-payment
I am not getting amount_received
Has the payment completed? I was slightly mistaken before, the synchronous response confirms the reader is handling the requested action, but the success is then async
You can retrieve the payment intent on your server, but you wouldn't expect it to be succeeded until the terminal.reader.action_succeeded event
nerd-terminal-serverdriven
Our docs show how you can optionally poll the payment intent, if needed: https://stripe.com/docs/terminal/payments/collect-payment?terminal-sdk-platform=server-driven#stripe-api
Thats why I originally had the paymentIntent->retrieve. But I am getting no data back.
You mean to do not get the payment intent object back, or it doesn't include what you expect it to include?
👋 taking over @quick oasis
Your code, on the server, calls processPayment() and then it waits. It doesn't wait one or 2 seconds, it waits for as long as needed for the transaction to complete on the reader.
And you use webhooks to know when the transaction completes
I have the pi without issue, and payments are being processed, but I need to get the amount_received and verify that it comes through
If you wait for the PaymentIntent to be confirmed successfully then you can see the PaymentIntent and the underlying Charge in latest_charge. There's no reason to look at amount_received in that integration path so I'm really struggling to understand what you are trying to achieve here
I was trying to avoid awaiting the webhook, but, it appears as though I will need to
I mean you can poll, but you have to wait for status: "succeeded" really. And a webhook is way better in this situation
I just wanted to verify that $total and paid amount were the same before processing out the point of sale cart
I don't know what "processing out" could mean. But if you have a PaymentIntent for $20 and you confirm it, you'll get $20 or a decline.
You can look at the various properties on the PaymentIntent and the related Charge in latest_charge to get all the information you need