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

Wrong approach while letting initialize command creating transaction #373

Open
tuyennn opened this issue Aug 24, 2022 · 1 comment
Open

Comments

@tuyennn
Copy link

tuyennn commented Aug 24, 2022

See
https://github.com/omise/omise-magento/blob/v2.27.0/etc/di.xml#L967
https://github.com/omise/omise-magento/blob/v2.27.0/etc/di.xml#L973-L981
https://github.com/omise/omise-magento/blob/v2.27.0/etc/di.xml#L996-L1004

And how the Payment Handle Detail writing a transaction before order was created
https://github.com/omise/omise-magento/blob/v2.27.0/Gateway/Response/PaymentDetailsHandler.php#L67-L82

because

initialize: Instantiate state and set it to state object. writing a new payment transaction might lead
Integrity constraint violation foreign key constraint fails in sales_payment_transaction while model order be saved, it could create(insert) another row to sales_payment_transaction literally this action should be performed after order be saved which is authorize or capture

@aashishgurung
Copy link
Contributor

@tuyennn Thank you raising this issue with initialize command. We will look into 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

2 participants