Skip to content

Commit 979e8be

Browse files
committed
Merge branch 'master' of github.com:bluerock-solutions/omnipay-authorizenet into dpm_support
Conflicts: src/AIMGateway.php
2 parents 648726b + e576b7c commit 979e8be

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

src/AIMGateway.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ public function getName()
1717
public function getDefaultParameters()
1818
{
1919
return array(
20-
'apiLoginId' => '',
21-
'transactionKey' => '',
22-
'testMode' => false,
23-
'developerMode' => false,
20+
'apiLoginId' => '',
21+
'transactionKey' => '',
22+
'testMode' => false,
23+
'developerMode' => false,
24+
'liveEndpoint' => 'https://secure.authorize.net/gateway/transact.dll',
25+
'developerEndpoint' => 'https://test.authorize.net/gateway/transact.dll'
2426
);
2527
}
2628

@@ -54,6 +56,12 @@ public function setDeveloperMode($value)
5456
return $this->setParameter('developerMode', $value);
5557
}
5658

59+
public function setEndpoints($endpoints)
60+
{
61+
$this->setParameter('liveEndpoint', $endpoints['live']);
62+
return $this->setParameter('developerEndpoint', $endpoints['developer']);
63+
}
64+
5765
public function authorize(array $parameters = array())
5866
{
5967
return $this->createRequest('\Omnipay\AuthorizeNet\Message\AIMAuthorizeRequest', $parameters);

src/Message/AbstractRequest.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
*/
88
abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
99
{
10-
protected $liveEndpoint = 'https://secure.authorize.net/gateway/transact.dll';
11-
protected $developerEndpoint = 'https://test.authorize.net/gateway/transact.dll';
12-
1310
public function getApiLoginId()
1411
{
1512
return $this->getParameter('apiLoginId');
@@ -60,6 +57,16 @@ public function setHashSecret($value)
6057
return $this->setParameter('hashSecret', $value);
6158
}
6259

60+
public function setLiveEndpoint($value)
61+
{
62+
return $this->setParameter('liveEndpoint', $value);
63+
}
64+
65+
public function setDeveloperEndpoint($value)
66+
{
67+
return $this->setParameter('developerEndpoint', $value);
68+
}
69+
6370
protected function getBaseData()
6471
{
6572
$data = array();
@@ -124,6 +131,6 @@ public function sendData($data)
124131

125132
public function getEndpoint()
126133
{
127-
return $this->getDeveloperMode() ? $this->developerEndpoint : $this->liveEndpoint;
134+
return $this->getDeveloperMode() ? $this->getParameter('developerEndpoint') : $this->getParameter('liveEndpoint');
128135
}
129136
}

src/Message/SIMAuthorizeRequest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public function getData()
2525
// "Response/Receipt URLs" URL, but not necessarily the default.
2626
$data['x_relay_url'] = $this->getReturnUrl();
2727
$data['x_cancel_url'] = $this->getCancelUrl();
28+
if ($this->getCustomerId() !== null) {
29+
$data['x_cust_id'] = $this->getCustomerId();
30+
}
2831

2932
if ($this->getTestMode()) {
3033
$data['x_test_request'] = 'TRUE';

0 commit comments

Comments
 (0)