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

Trace Number and time() with multiple fast transactions #2

Open
jas8522 opened this issue May 12, 2020 · 1 comment
Open

Trace Number and time() with multiple fast transactions #2

jas8522 opened this issue May 12, 2020 · 1 comment

Comments

@jas8522
Copy link

jas8522 commented May 12, 2020

The sample code indicates the use of time() to generate a unique (enough) trace number. This had worked fine for us for years but suddenly and randomly became a problem sometime last year.

Although I can't confirm this yet, I believe the issue is that newer versions of PHP (and perhaps also the speed of networking and the Orbital systems) have become fast enough that rapid-fire transaction processing can actually occur (occasionally) more than one per second. When this happens, the same trace number can be sent for two adjacent transactions. This causes the successful return of the first transaction to work as normal, while the return of the second transaction indicates a successful response, but in reference to the first transaction.

Unless you're verifying additional data, like the amounts or card number before and after, this will cause the second transaction to appear successful, when no transaction has actually occurred.

To solve this, make sure to use hrtime() rather than time() which provides the unix timestamp down to the microsecond rather than the second, ensuring unique trace number values.

@jas8522
Copy link
Author

jas8522 commented Oct 21, 2020

This is confirmed. hrtime() fixes it.

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

No branches or pull requests

1 participant