Feature: Order Service Provider, Order Events Observers
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Order\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Lunar\Models\Order;
|
||||
use Lunar\Models\Transaction;
|
||||
|
||||
/**
|
||||
* Dispatched by TransactionObserver::saved() when a Transaction's type
|
||||
* changes to 'capture' (from 'intent') and succeeds. Unlike refunds,
|
||||
* Lunar's Stripe driver (StoreCharges) reuses the same Transaction row
|
||||
* across intent -> capture rather than creating a new one, so this can't
|
||||
* key off `wasRecentlyCreated` the way OrderRefunded does.
|
||||
*/
|
||||
class OrderCaptured
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
public function __construct(
|
||||
public readonly Order $order,
|
||||
public readonly Transaction $transaction,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user