Closed sbrow closed 4 weeks ago
Upon further thought, I decided that $order
should be nullable. Even though I highly doubt anyone is manually creating CouponRedeemed
events, adding an additional, non-optional argument does constitute a breaking change, which would break semantic versioning.
I've added another test to ensure it is nullable.
Ran Laravel pint on the files so they'd pass the check.
Do you require anything else from me to get this merged? :)
Nope, I just need to find some time to get this reviewed.
Released as part of v7.3.0.
On my shop, we have an affiliate program. We primarily use coupon codes to track which orders are assigned to which affiliate users. I created a listener for this (on the
CouponRedeemed
event), only to find that it didn't include the order on which the coupon was redeemed.This PR fixes that. I added a test to ensure that it works, and AFAIK it should be backwards compatible with base simple-commerce, however any custom packages that emit
CouponRedeemed
will break. This could however be made more compatible by making$order
default to null, and then waiting until the v8 release to make it non-optional- I leave that to you to decide.