#bwurtz999-paymentintent

1 messages · Page 1 of 1 (latest)

old marsh
#

Do you have an example Payment Intent ID that you see this happening with?

fluid bolt
#

production or testing?

old marsh
#

Testing will work!

fluid bolt
#

pi_3JcBZFCXMuDrMdnf1HZhSNyp

#

it captures even though I return true; and attempt to stop the function. The capture is later in the function

#

I'm using a Stripe fake CC with a physical terminal reader

old marsh
#

That particular Payment Intent hasn't been captured yet... is there a reason you believe it has? Its most recent status is requires_capture.

fluid bolt
#

hmmm

#

the logs show a call to a /confirm route

#

also

#

the display on the reader says your card was charged $X.XX and shows the green check mark

old marsh
#

The /confirm route is not what's capturing payment though - that's what authorizing the charge/grabbing the hold

fluid bolt
#

oh ok

#

but then the reader says it's been charged

old marsh
#

It's not being captured because you created the Payment Intent w/ capture_method: "manual", so you need a separate request to capture it after you grab the hold

fluid bolt
#

right

#

which I don't do here. but the reader says the card was charged

#

so basically, my main issue is this error message that I am getting multiple times per day: Stripe\Exception\InvalidRequestException: 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. I'm doing all this to try and recreate the error in an attempt to deal with it

#

Because I can't find what is actually causing that error. something wrong with my frontend most likely

#

but so when this happens I don't want the card reader to say that the customer has been charged. because they haven't been

#

does that make sense?

old marsh
#

Yes, that all makes sense - putting aside the reader display issue for now (we'll circle back to this in a bit), can you share one of the Payment Intent IDs that's actually giving you the This PaymentIntent could not be captured because it has a status of requires_payment_method error?

fluid bolt
#

here is the most recent one from production

#

pi_3JcBqECXMuDrMdnf16VzTjrh

#

this is all the activity

#

also - not sure if this is relevant but I think nearly all of these failed requests are coming from one specific unit. I'd have to dig deeper to confirm that though

#

I don't understand what is calling the capture method. I only trigger that from the front end after terminal.processPayment succeeds

#

which means a customer has scanned their card

old marsh
#

So looking at that Payment Intent pi_3JcBqECXMuDrMdnf16VzTjrh, I see that it was created but it was never successfully confirmed (and therefore never transitioned to requires_capture). As a result, your subsequent request to capture it failed.

You mention that you only trigger the call to capture after terminal.processPayment succeeds, so now the question is why is it telling you it succeeded when it actually hasn't

fluid bolt
#

ok interesting. and when using a card reader the scanning of the card is what confirms the payment intent, correct?

#

I'm now getting errors from multiple units, so it's not just one unit

#

and they are starting to increase in frequency

#

8 yesterday. and 13 already today

#

could this be user error in anyway? pulling the card out before processing is complete?

old marsh
#

Let me try and pull in some people on my end to look into this - in the mean time, can you share the code you're using to call terminal.processPayment and the reader ID (tmr_xxx) of the reader that was used with pi_3JcBqECXMuDrMdnf16VzTjrh?

fluid bolt
#
function checkout()
{
    var clientSecret = $('#clientSecret').val();

    // clientSecret is the client_secret from the PaymentIntent you created in Step 1.
    terminal.collectPaymentMethod(clientSecret).then(function(result)
    {
        // hide the cancel button
        $('#cancelCardPayment').hide();
        $('#cardConfirmText').text('Processing');

        if(result.error)
        {
            // Placeholder for handling result.error
            console.log('stripe error');
            console.log(result);
            $('#cancelCardPayment').show();
        }
        else
        {
            // Placeholder for processing result.paymentIntent
            console.log('stripe success');
            console.log(result);

            terminal.processPayment(result.paymentIntent).then(function(processPaymentResult)
            {
                if (processPaymentResult.error)
                {
                    // Placeholder for handling result.error
                    console.log('processPayment error');
                    console.log(processPaymentResult);
                    console.log(processPaymentResult.error.message);
                    $('#cancelCardPayment').show();
                }
                else if (processPaymentResult.paymentIntent)
                {
                    // Placeholder for notifying your backend to capture result.paymentIntent.id
                    console.log('processPayment success');
                    console.log(processPaymentResult);
                    Livewire.emit('capturePaymentIntent');
                }
            });
        }
    });
}
#

I've been using this code for a while with no changes recently

#

checkout() is called when the cashier hits a 'Scan Card' button on the aoo

#

app

#

I now have this as an issue at two of my units. I don't think either of them can process a payment right now. I'm getting updates from managers

old marsh
#

Thanks for sending that over - do you also have a reader ID?

fluid bolt
#

one: tmr_ERH1vwErr7HKOH

#

two: tmr_ESDNDg9AsVTQd7

#

being used at separate units. both reporting the same issue

old marsh
#

thank you! Give me some time to pull in some other folks to dig in some more

fluid bolt
#

Ok

old marsh
#

Quick question for you - I notice that you're logging processPaymentResult. Do you have any of those logs available right now so we can see what the result was?

fluid bolt
#

I won't have them for any of the production readers unfortunately. That's just local console logging

#

I could run one locally in dev and send you the result

old marsh
#

Is your dev setup also able to reproduce the issue?

fluid bolt
#

Unfortunately not. This issue has been driving me crazy

#

I'm probably going to have to go to one of these units tomorrow and observe it happening in person

old marsh
#

No worries - was just hoping to get some more information, but we're going to keep looking

fluid bolt
#

Ok thank you. I have to step away for a few hours but I'd like to keep this thread open. If you or your team have any ideas for me to try please let me know because I will be back at my desk tonight

old marsh
#

Will do!

old marsh
#

Let me know whenever you're back @fluid bolt - there's a few questions I'd like to ask:

  • Are there any other places in your integration that would lead to the "capture" request being made?
  • What specifically does the line Livewire.emit('capturePaymentIntent'); do?
  • If you have any logs of the results from collectPaymentMethod and processPayment that would be hugely helpful.

A quick update from me - we've looked through our logs, but we don't see anything coming through on our end that show collectPaymentMethod and processPayment being called for pi_3JcBqECXMuDrMdnf16VzTjrh. We're a bit confused about why this is happening, and hopefully the above questions will clear things up!

fluid bolt
#

@old marsh thanks so much for getting back to me. I'm still away from my desk but I'll be back in about two hours. The emit calls a function that processes the payment intent server-side and calls the Stripe capture

#

I don't think I can get any of those logs from any production units but I will check

#

I'll physically go to one on the units tomorrow any try and observe this behavior first hand and see what's going on for myself. Maybe that'll help

#

I think there is only one place on the front end that calls capturePaymentIntent but I will double check that

#

And that happens after terminal.processPayment

old marsh
#

Thanks for that extra info! When you get the chance, do you also mind writing into https://support.stripe.com/contact/email and mentioning that you were speaking to "karbi" on Discord? It'll just ensure we have a way of getting back in touch with you if we need to