Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credit Card Charge Response getBody() method returns an empty value #30

Open
TM2020IT opened this issue Nov 20, 2021 · 3 comments · May be fixed by #31
Open

Credit Card Charge Response getBody() method returns an empty value #30

TM2020IT opened this issue Nov 20, 2021 · 3 comments · May be fixed by #31

Comments

@TM2020IT
Copy link

This wasn't an issue until today, no other website or code changes were made in the last week. My only guess is that intuit changed their API response handling.

Within the PaymentClient class the "charge" method has a duplicate httpClient->send method call. This is now causing the first call to have a valid "$response->getBody()" value, while the second call, which is the one that gets returned by the "charge" method to have an empty body value. Up until today the second "send" method call returned a valid body response. Today's issue caused the credit card to be charged successfully, but the order to fail because the body was empty and the response couldn't be verified as successful or not. Commenting out line 95 resolves the issue.

Line 95: $response = $this->httpClient->send($request);

Another item to note, there is also a duplicate "send" method call on line 110 within the voidChargeTransaction method of this same class.

@Nebual
Copy link

Nebual commented Nov 20, 2021

Seconded, we just started getting reports today of payments failing, and this seems to be the root.

I'd guess their API just implemented some sort of idempotency check today, ignoring duplicate requests (with the same request-id), and unfortunately this SDK specifically performs exactly that.

Nebual added a commit to Nebual/PHP-Payments-SDK that referenced this issue Nov 20, 2021
@Nebual Nebual linked a pull request Nov 20, 2021 that will close this issue
@sarmadmakhdoom
Copy link

Yeah we are also facing the same issue with charge from Friday. Can you please share any solution?

@sarmadmakhdoom
Copy link

Screen Shot 2021-11-22 at 12 02 16 AM

We see in the SDK source code, sending the same request twice in charge method. I am not sure why this is the case but removing the first send solves the problem. But why there were two of them in the first place. Are we missing anything here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants