Skip to content

Commit e35e615

Browse files
committed
Use correct endpoints form DPM and SIM
1 parent 39542c3 commit e35e615

File tree

5 files changed

+75
-3
lines changed

5 files changed

+75
-3
lines changed

src/SIMGateway.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ public function getName()
1515
public function getDefaultParameters()
1616
{
1717
$parameters = parent::getDefaultParameters();
18-
$parameters['hashSecret'] = '';
18+
$parameters = array_merge($parameters, array(
19+
'hashSecret' => '',
20+
'liveEndpoint' => 'https://secure2.authorize.net/gateway/transact.dll',
21+
'developerEndpoint' => 'https://test.authorize.net/gateway/transact.dll'
22+
));
1923
return $parameters;
2024
}
2125

tests/AIMGatewayTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ public function setUp()
4040
);
4141
}
4242

43+
public function testLiveEndpoint()
44+
{
45+
$this->assertEquals(
46+
'https://api.authorize.net/xml/v1/request.api',
47+
$this->gateway->getLiveEndpoint()
48+
);
49+
}
50+
51+
public function testDeveloperEndpoint()
52+
{
53+
$this->assertEquals(
54+
'https://apitest.authorize.net/xml/v1/request.api',
55+
$this->gateway->getDeveloperEndpoint()
56+
);
57+
}
58+
4359
private function getExpiry($card)
4460
{
4561
return str_pad($card['expiryMonth'] . $card['expiryYear'], 6, '0', STR_PAD_LEFT);

tests/CIMGatewayTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ public function setUp()
4646
);
4747
}
4848

49+
public function testLiveEndpoint()
50+
{
51+
$this->assertEquals(
52+
'https://api.authorize.net/xml/v1/request.api',
53+
$this->gateway->getLiveEndpoint()
54+
);
55+
}
56+
57+
public function testDeveloperEndpoint()
58+
{
59+
$this->assertEquals(
60+
'https://apitest.authorize.net/xml/v1/request.api',
61+
$this->gateway->getDeveloperEndpoint()
62+
);
63+
}
64+
4965
public function testCreateCardSuccess()
5066
{
5167
$this->setMockHttpResponse(array('CIMCreateCardSuccess.txt','CIMGetPaymentProfileSuccess.txt'));

tests/DPMGatewayTest.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
namespace Omnipay\AuthorizeNet;
44

55
use Omnipay\Tests\GatewayTestCase;
6-
//use Omnipay\AuthorizeNet\SIMGatewayTest;
76

8-
class DPMGatewayTest extends GatewayTestCase //SIMGatewayTest
7+
class DPMGatewayTest extends GatewayTestCase
98
{
9+
/** @var DPMGateway */
10+
protected $gateway;
11+
/** @var array */
12+
private $options;
13+
1014
public function setUp()
1115
{
1216
parent::setUp();
@@ -23,6 +27,22 @@ public function setUp()
2327
);
2428
}
2529

30+
public function testLiveEndpoint()
31+
{
32+
$this->assertEquals(
33+
'https://secure2.authorize.net/gateway/transact.dll',
34+
$this->gateway->getLiveEndpoint()
35+
);
36+
}
37+
38+
public function testDeveloperEndpoint()
39+
{
40+
$this->assertEquals(
41+
'https://test.authorize.net/gateway/transact.dll',
42+
$this->gateway->getDeveloperEndpoint()
43+
);
44+
}
45+
2646
public function testAuthorize()
2747
{
2848
$response = $this->gateway->authorize($this->options)->send();

tests/SIMGatewayTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ public function setUp()
2424
);
2525
}
2626

27+
public function testLiveEndpoint()
28+
{
29+
$this->assertEquals(
30+
'https://secure2.authorize.net/gateway/transact.dll',
31+
$this->gateway->getLiveEndpoint()
32+
);
33+
}
34+
35+
public function testDeveloperEndpoint()
36+
{
37+
$this->assertEquals(
38+
'https://test.authorize.net/gateway/transact.dll',
39+
$this->gateway->getDeveloperEndpoint()
40+
);
41+
}
42+
2743
public function testAuthorize()
2844
{
2945
$response = $this->gateway->authorize($this->options)->send();

0 commit comments

Comments
 (0)