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

Careful with the max vars_trans_id value = 899999 #17

Open
nicolas-san opened this issue Jul 8, 2019 · 0 comments
Open

Careful with the max vars_trans_id value = 899999 #17

nicolas-san opened this issue Jul 8, 2019 · 0 comments
Assignees
Milestone

Comments

@nicolas-san
Copy link

nicolas-san commented Jul 8, 2019

Reading the payZen doc make me think about this var, is you have a very active shop, or very big amount of little payments, or even a long lasting implementation you could run into this issue because the id_transaction will be bigger.

An approach could be to add time values and concatenate the last 2 digits of the id_transaction (and zerofill for the 9 first) to generate a number:
(Year + Day + Month + Hour + Minute + Second) . xx
2019+8+7+11+51+27 = 2123
if the id_transaction is 250, you will end with 212350, one day in a long long long time, you will face the same issue in year 8814 if I'm correct ^^...

The best way is perhaps to simply store a daily counter, but it requires DB schema changes.

$this->mandatoryFields['trans_id'] = sprintf('%06d', $this->transaction->getId());

https://payzen.io/fr-FR/payment-file/oneclick-payment/vads-trans-id.html

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

No branches or pull requests

2 participants