feat: add invoice

This commit is contained in:
2026-05-27 13:14:09 +02:00
parent a01387bb09
commit 1216c8a073
17 changed files with 352 additions and 2 deletions
@@ -28,6 +28,8 @@ class PaymentTransactionRecorder
?int $creditsExpected = null,
?int $creditsGranted = null,
?CreditLedgerEntry $ledgerEntry = null,
?string $invoiceUrl = null,
?string $invoicePdfUrl = null,
?string $errorMessage = null,
?array $payload = null,
): PaymentTransaction {
@@ -47,6 +49,8 @@ class PaymentTransactionRecorder
'currency' => $currency,
'credits_expected' => $creditsExpected ?? $product?->credits,
'credits_granted' => $creditsGranted ?? 0,
'invoice_url' => $invoiceUrl,
'invoice_pdf_url' => $invoicePdfUrl,
'error_message' => $errorMessage,
'payload' => $payload,
'processed_at' => $status === PaymentTransactionStatus::PENDING ? null : now(),
@@ -72,6 +76,8 @@ class PaymentTransactionRecorder
?int $creditsExpected = null,
?int $creditsGranted = null,
?CreditLedgerEntry $ledgerEntry = null,
?string $invoiceUrl = null,
?string $invoicePdfUrl = null,
?string $errorMessage = null,
?array $payload = null,
): PaymentTransaction {
@@ -93,6 +99,8 @@ class PaymentTransactionRecorder
'currency' => $currency,
'credits_expected' => $creditsExpected ?? $product?->credits,
'credits_granted' => $creditsGranted ?? 0,
'invoice_url' => $invoiceUrl,
'invoice_pdf_url' => $invoicePdfUrl,
'error_message' => $errorMessage,
'payload' => $payload,
'processed_at' => now(),