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

Refund transaction reference on EVENT_AFTER_REFUND_TRANSACTION #2081

Closed
aryehischechter opened this issue Apr 11, 2021 · 2 comments
Closed
Assignees
Labels

Comments

@aryehischechter
Copy link

What are you trying to do?
Get the refund transaction on the EVENT_AFTER_REFUND_TRANSACTION event.
Right now, the event only passes the parent transaction and the amount.
But if we need the reference, or more specifically the transactionId, of the refund itself we need to make another query for the latest transaction where the parentId is the transaction we're refunding.
This is a race condition and a poor implementation when the refund transaction could be passed in the event.

What's your proposed solution?
The code here triggers the event and creates a RefundTransactionEvent.
The Event structure should have an optional property reference to the $refundTransaction, which is created a few lines earlier.
It can't be a required property since the BEFORE event wont have it.

@lukeholder
Copy link
Member

This has been fixed and will be in the 3.3.1 release tomorrow.

@lukeholder
Copy link
Member

3.3.1 is now out!

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

No branches or pull requests

3 participants