Add PayPal support for add-on and gift voucher checkout

This commit is contained in:
Codex Agent
2026-02-04 14:54:40 +01:00
parent 7025418d9e
commit 17025df47b
24 changed files with 1599 additions and 34 deletions

View File

@@ -28,6 +28,25 @@ class GiftVoucherLookupTest extends TestCase
->assertJsonPath('data.currency', 'EUR');
}
public function test_it_returns_voucher_by_paypal_order_id(): void
{
$voucher = GiftVoucher::factory()->create([
'code' => 'GIFT-PAYPAL',
'amount' => 59.00,
'currency' => 'EUR',
'paypal_order_id' => 'ORDER-PAYPAL-1',
'paypal_capture_id' => 'CAPTURE-PAYPAL-1',
'status' => GiftVoucher::STATUS_ISSUED,
]);
$response = $this->getJson('/api/v1/marketing/gift-vouchers/lookup?order_id=CAPTURE-PAYPAL-1');
$response->assertOk()
->assertJsonPath('data.code', $voucher->code)
->assertJsonPath('data.amount', 59)
->assertJsonPath('data.currency', 'EUR');
}
public function test_it_returns_voucher_by_code(): void
{
$voucher = GiftVoucher::factory()->create([