Skip to content

Add returns/RMA foundation hooks to Lunar v1.x#2443

Open
tazzytazzy wants to merge 3 commits intolunarphp:1.xfrom
tazzytazzy:feat/additional-checkout-hooks
Open

Add returns/RMA foundation hooks to Lunar v1.x#2443
tazzytazzy wants to merge 3 commits intolunarphp:1.xfrom
tazzytazzy:feat/additional-checkout-hooks

Conversation

@tazzytazzy
Copy link
Copy Markdown
Contributor

Preliminary release of adding to the hook surface needed to unblock reusable returns/RMA integrations in Lunar v1.x.

Let me know what you think. Probably few tweaks here and there might be needed to help align with your goals. Let me know and I'll work on it.

  • add OrderPaid plus canonical refund orchestration via RefundTransaction
  • add pre-refund authorization DTOs/contracts and refund lifecycle events
  • expand PaymentRefund with refund transaction context and allocation passthrough
  • add OrderLineCapabilitiesInterface with the default conservative resolver
  • route admin refund actions through the orchestration path
  • document the new refund and order hook surface in the Lunar docs

Test coverage:

  • refund allowed, denied, driver-failed, and thrown-exception paths
  • RefundRequested ordering before the driver call
  • RefundCompleted and RefundFailed dispatch behavior
  • allocation passthrough and refund transaction hydration
  • default and override order-line capability behavior, including unplaced lines
  • admin header and bulk refund flows
  • OrderPaid coverage for Offline, Stripe, Opayo, and Paypal
  • Paypal expanded PaymentRefund coverage

Verified with:

  • vendor/bin/pint --dirty --format agent
  • vendor/bin/pest tests/core/Unit/Actions/Orders/RefundTransactionTest.php tests/core/Unit/Base/OrderLineCapabilitiesTest.php tests/core/Unit/PaymentTypes/OfflinePaymentTypeTest.php tests/stripe/Unit/StripePaymentTypeTest.php tests/opayo/Feature/OpayoPaymentTypeTest.php tests/admin/Feature/Filament/Resources/OrderResource/Pages/ManageOrderTest.php tests/paypal/Unit/PaypalPaymentTypeTest.php

Result:

  • 34 tests passed
  • 207 assertions

…ble returns/RMA integrations in Lunar v1.x

- add OrderPaid plus canonical refund orchestration via RefundTransaction
- add pre-refund authorization DTOs/contracts and refund lifecycle events
- expand PaymentRefund with refund transaction context and allocation passthrough
- add OrderLineCapabilitiesInterface with the default conservative resolver
- route admin refund actions through the orchestration path
- document the new refund and order hook surface in the Lunar docs

Test coverage:
- refund allowed, denied, driver-failed, and thrown-exception paths
- RefundRequested ordering before the driver call
- RefundCompleted and RefundFailed dispatch behavior
- allocation passthrough and refund transaction hydration
- default and override order-line capability behavior, including unplaced lines
- admin header and bulk refund flows
- OrderPaid coverage for Offline, Stripe, Opayo, and Paypal
- Paypal expanded PaymentRefund coverage

Verified with:
- vendor/bin/pint --dirty --format agent
- vendor/bin/pest tests/core/Unit/Actions/Orders/RefundTransactionTest.php tests/core/Unit/Base/OrderLineCapabilitiesTest.php tests/core/Unit/PaymentTypes/OfflinePaymentTypeTest.php tests/stripe/Unit/StripePaymentTypeTest.php tests/opayo/Feature/OpayoPaymentTypeTest.php tests/admin/Feature/Filament/Resources/OrderResource/Pages/ManageOrderTest.php tests/paypal/Unit/PaypalPaymentTypeTest.php

Result:
- 34 tests passed
- 207 assertions
@tazzytazzy
Copy link
Copy Markdown
Contributor Author

I'm working on resolving these failures.

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant