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

Don't duplicate requests to charge or void payments #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nebual
Copy link

@Nebual Nebual commented Nov 20, 2021

Fixes #30

Both the charge() and voidChargeTransaction() methods are currently sending duplicate requests, and then ignoring the first response.

This seemingly wasn't a problem before (just would delay overall method time), however today the subsequent requests started returning empty responses (#30), which results in transactions going through that appear to have failed on the client's end. I'm guessing the API changed today to start checking the request-id or something as an idempotency key, and ignoring duplicates.

@Nebual
Copy link
Author

Nebual commented Nov 20, 2021

If anyone else happens to be looking to do a Friday deploy to workaround this issue, add this to your "repositories" in composer.json:

  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/Nebual/PHP-Payments-SDK.git"
    },
  ]

And then run:

composer require quickbooks/payments-sdk="dev-master#f6af73f85e412b7e87b8170c69c2647056641dfa"

That'll be release 1.0.8 + this PR's fix.

@brettgoss
Copy link

Hi @bsivalingam or @abisalehalliprasan - Since you both seem to have committed to this repository in the past, do you think you'd be able to approve and merge this pull request? It has been open for almost 3 years now, and will resolve issue #30.

It would be great if this issue could be resolved in this SDK so that we can stop pointing composer to @Nebual's fork.

Copy link

@brettgoss brettgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of any valid reason why the SDK would need to explicitly send duplicate requests, so LGTM!

@mavelo-llc
Copy link

Is anyone actively maintaining this project? Submitted #42 a few days ago, then noticed this pull, pending for nearly 3 years 🤯

mavelo-llc referenced this pull request in mavelo-llc/PHP-Payments-SDK Oct 11, 2024
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 this pull request may close these issues.

Credit Card Charge Response getBody() method returns an empty value
3 participants