|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Omnipay\NABTransact; |
| 4 | + |
| 5 | +use Omnipay\Tests\GatewayTestCase; |
| 6 | + |
| 7 | +class SecureXMLGatewayTest extends GatewayTestCase |
| 8 | +{ |
| 9 | + public function setUp() |
| 10 | + { |
| 11 | + parent::setUp(); |
| 12 | + |
| 13 | + $this->gateway = new SecureXMLGateway($this->getHttpClient(), $this->getHttpRequest()); |
| 14 | + $this->gateway->setMerchantId('ABC0001'); |
| 15 | + } |
| 16 | + |
| 17 | + public function testEcho() |
| 18 | + { |
| 19 | + $request = $this->gateway->echoTest(array('amount' => '10.00', 'transactionId' => 'Order-YKHU67')); |
| 20 | + $this->assertInstanceOf('\Omnipay\NABTransact\Message\SecureXMLEchoTestRequest', $request); |
| 21 | + $this->assertSame('10.00', $request->getAmount()); |
| 22 | + $this->assertSame('Order-YKHU67', $request->getTransactionId()); |
| 23 | + } |
| 24 | + |
| 25 | + public function testAuthorize() |
| 26 | + { |
| 27 | + $request = $this->gateway->authorize(array('amount' => '10.00')); |
| 28 | + |
| 29 | + $this->assertInstanceOf('\Omnipay\NABTransact\Message\SecureXMLAuthorizeRequest', $request); |
| 30 | + $this->assertSame('10.00', $request->getAmount()); |
| 31 | + } |
| 32 | + |
| 33 | + public function testCapture() |
| 34 | + { |
| 35 | + $request = $this->gateway->capture(array('amount' => '10.00', 'transactionId' => 'Order-YKHU67')); |
| 36 | + |
| 37 | + $this->assertInstanceOf('\Omnipay\NABTransact\Message\SecureXMLCaptureRequest', $request); |
| 38 | + $this->assertSame('10.00', $request->getAmount()); |
| 39 | + $this->assertSame('Order-YKHU67', $request->getTransactionId()); |
| 40 | + } |
| 41 | + |
| 42 | + public function testPurchase() |
| 43 | + { |
| 44 | + $request = $this->gateway->purchase(array('amount' => '10.00')); |
| 45 | + |
| 46 | + $this->assertInstanceOf('\Omnipay\NABTransact\Message\SecureXMLPurchaseRequest', $request); |
| 47 | + $this->assertSame('10.00', $request->getAmount()); |
| 48 | + } |
| 49 | + |
| 50 | + public function testRefund() |
| 51 | + { |
| 52 | + $request = $this->gateway->refund(array('amount' => '10.00', 'transactionId' => 'Order-YKHU67')); |
| 53 | + |
| 54 | + $this->assertInstanceOf('\Omnipay\NABTransact\Message\SecureXMLRefundRequest', $request); |
| 55 | + $this->assertSame('10.00', $request->getAmount()); |
| 56 | + $this->assertSame('Order-YKHU67', $request->getTransactionId()); |
| 57 | + } |
| 58 | +} |
0 commit comments