-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGatewayTest.php
65 lines (51 loc) · 1.91 KB
/
GatewayTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace OmnipayTest\Gvp;
use Omnipay\Gvp\Gateway;
use Omnipay\Gvp\Messages\AuthorizeRequest;
use Omnipay\Gvp\Messages\CaptureRequest;
use Omnipay\Gvp\Messages\PurchaseRequest;
use Omnipay\Gvp\Messages\RefundRequest;
use Omnipay\Gvp\Messages\VoidRequest;
use Omnipay\Tests\GatewayTestCase;
class GatewayTest extends GatewayTestCase
{
public function setUp(): void
{
$this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest());
}
public function testPurchase(): void
{
/** @var PurchaseRequest $request */
$request = $this->gateway->purchase(['orderId' => '41838239']);
self::assertInstanceOf(PurchaseRequest::class, $request);
self::assertSame('41838239', $request->getOrderId());
}
public function testAuthorize(): void
{
/** @var AuthorizeRequest $request */
$request = $this->gateway->authorize(['orderId' => '41838239']);
self::assertInstanceOf(AuthorizeRequest::class, $request);
self::assertSame('41838239', $request->getOrderId());
}
public function testCapture(): void
{
/** @var AuthorizeRequest $request */
$request = $this->gateway->capture(['orderId' => '41838239']);
self::assertInstanceOf(CaptureRequest::class, $request);
self::assertSame('41838239', $request->getOrderId());
}
public function testRefund(): void
{
/** @var RefundRequest $request */
$request = $this->gateway->refund(['orderId' => '41838239']);
self::assertInstanceOf(RefundRequest::class, $request);
self::assertSame('41838239', $request->getOrderId());
}
public function testVoid(): void
{
/** @var VoidRequest $request */
$request = $this->gateway->void(['orderId' => '41838239']);
self::assertInstanceOf(VoidRequest::class, $request);
self::assertSame('41838239', $request->getOrderId());
}
}