Closed (fixed)
Project:
Commerce Worldline
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2017 at 19:18 UTC
Updated:
15 Oct 2020 at 07:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
apsylone commentedOk, i've found why... The module for the transactionReference is based on the payment ID just created.
I think it is an error, because in development mode (cleaning databases multiple times), we recreated some payment ID that already exists for transactionReference bank side.
I think the transactionReference should use http://php.net/manual/fr/function.uniqid.php for resolving it.
Comment #3
borisson_Setting to needs review to let the testbot have a look at the patch, I like the idea and I think it makes a ton of sense.
Comment #4
apsylone commentedIt was a bit more complex. I've added transaction_reference as fields for payment and check it again SIPS Response. WIP.
Comment #6
apsylone commentedError with the method loading payment on payment storage corrected.
Comment #7
apsylone commentedOk, removed WIP patches. This one is ok and worked.
Comment #8
borisson_Comment #10
lalop commentedWhat is the status of this issue ?
Are you looking for a reviewer ?
Comment #11
DeFr commentedNot really fond of adding another base field for that to the payment entities. Those entities already have a globally unique identifier : the UUID, using that instead of generating another unique id through uniqid() would be better.
As far as I can tell looking at least at the Sogenactif doc, the UUID can't be used as is because it's 36 characters long and transaction reference is only allowed to be up to 35 characters, but stripping the '-' from the uuid in TransformOrder, and then adding them back in the the callback should work, with no needs for needs for database schema change.
Comment #12
DeFr commentedUpdated patch based on the approach above, and allowing both old transaction reference (with a plain order number) and uuid as transaction refs. That should allow a store to transition smoothly.
Comment #13
DeFr commentedI think the attached patch is in fact even better ; it stores the uuid without the dash as the remote id by default, but developers can chose to alter it if needed in a pre save hook. It's then passed as is everywhere.
Comment #14
thony commentedHi, thx for the patch, I believe it contain a syntax error there : + $payment->setRemoteId(str_replace('-', '', $payment->uuid());
should be : + $payment->setRemoteId(str_replace('-', '', $payment->uuid()));
I also created a version that apply to the current 1.0 alpha3 (and does seem to fix the issue)
Comment #15
DeFr commentedYup ; sorry about the typo in the patch in #13, uploaded it quickly.
I think I'm going to commit this patch this week and release an alpha 4 of the module with the various fixes that went in.
Comment #16
DeFr commentedRe-uploading a patch against the latest dev for the testbot.
Comment #18
DeFr commentedMocking the correct storage.
Comment #20
DeFr commented