Feature: Abstraction on Payments based on their operations
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Payment\Events;
|
||||
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Modules\Core\Payment\DTOs\PaymentResult;
|
||||
|
||||
/**
|
||||
* Dispatched when SupportsAuthorization::authorize() (or a
|
||||
* HandlesPaymentCallback::handleCallback() resolving it later) determines
|
||||
* the gateway did not grant the requested hold. $result->retriable is how
|
||||
* a listener knows whether "try again with the same method" is reasonable
|
||||
* — see PaymentResult's own docblock.
|
||||
*/
|
||||
class PaymentAuthorizationFailed
|
||||
{
|
||||
use Dispatchable;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $type,
|
||||
public readonly PaymentResult $result,
|
||||
public readonly array $context = [],
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user