Save Stripe payment details on order confirmation, add arrive early tip

- Retrieve PaymentIntent on success redirect, save payment_method, card_brand, card_last4
- Display payment info on /ma-commande page (card type + last 4 digits)
- Add "Il est recommande d'arriver en avance" to practical info on ticket PDF
- Migration for payment_method, card_brand, card_last4 columns

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-21 16:56:50 +01:00
parent c8faf76741
commit 7a29372b60
6 changed files with 139 additions and 1 deletions

View File

@@ -24,6 +24,9 @@ class BilletBuyerTest extends TestCase
self::assertSame(0.0, $buyer->getTotalHTDecimal());
self::assertSame(BilletBuyer::STATUS_PENDING, $buyer->getStatus());
self::assertNull($buyer->getStripeSessionId());
self::assertNull($buyer->getPaymentMethod());
self::assertNull($buyer->getCardBrand());
self::assertNull($buyer->getCardLast4());
self::assertNull($buyer->getPaidAt());
self::assertMatchesRegularExpression('/^ETICKET-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}$/', $buyer->getReference());
self::assertSame(32, \strlen($buyer->getAccessToken()));
@@ -94,6 +97,18 @@ class BilletBuyerTest extends TestCase
self::assertSame($buyer, $result);
}
public function testSetAndGetPaymentDetails(): void
{
$buyer = new BilletBuyer();
$buyer->setPaymentMethod('card');
$buyer->setCardBrand('visa');
$buyer->setCardLast4('4242');
self::assertSame('card', $buyer->getPaymentMethod());
self::assertSame('visa', $buyer->getCardBrand());
self::assertSame('4242', $buyer->getCardLast4());
}
public function testSetAndGetPaidAt(): void
{
$buyer = new BilletBuyer();