Add PayPal support for add-on and gift voucher checkout
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user