Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| PaymentChargeData | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Domain\Stripe\Data; |
| 6 | |
| 7 | /** |
| 8 | * Outcome of a Stripe PaymentIntent charge attempt. |
| 9 | * |
| 10 | * On a successful immediate capture, {@see $status} is "succeeded". On a |
| 11 | * decline, the PaymentIntent surfaces a decline message via Stripe's |
| 12 | * `last_payment_error.message` — captured here as {@see $declineMessage}. |
| 13 | * |
| 14 | * 3DS flows that need redirect (`requires_action`) or further action are |
| 15 | * not yet supported in this domain model; the service layer translates |
| 16 | * those into a domain exception. |
| 17 | */ |
| 18 | final readonly class PaymentChargeData |
| 19 | { |
| 20 | public function __construct( |
| 21 | public string $id, |
| 22 | public string $status, |
| 23 | public ?string $declineMessage = null, |
| 24 | ) {} |
| 25 | } |