#nerd-terminal-serverdriven

1 messages · Page 1 of 1 (latest)

north frostBOT
quick oasis
#

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

high mulch
#

`$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

north frostBOT
high mulch
#

And $stripe is coming from $stripe = new \Stripe\StripeClient(env('STRIPE_SECRET'));

quick oasis
#

And you're having some issue with this, as it is currently?

high mulch
#

I am not getting amount_received

quick oasis
#

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

rugged escarp
#

nerd-terminal-serverdriven

quick oasis
high mulch
#

Thats why I originally had the paymentIntent->retrieve. But I am getting no data back.

quick oasis
#

You mean to do not get the payment intent object back, or it doesn't include what you expect it to include?

rugged escarp
#

👋 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

high mulch
#

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

rugged escarp
#

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

high mulch
#

I was trying to avoid awaiting the webhook, but, it appears as though I will need to

rugged escarp
#

I mean you can poll, but you have to wait for status: "succeeded" really. And a webhook is way better in this situation

high mulch
#

I just wanted to verify that $total and paid amount were the same before processing out the point of sale cart

rugged escarp
#

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