Skip to content

Commit 6d5da95

Browse files
authored
Merge pull request #19 from sudiptpa/patch-2
Few more improvements in HPP
2 parents a52fc73 + a77f0e2 commit 6d5da95

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

src/HostedPaymentGateway.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ public function completePurchase(array $parameters = array())
1919
return $this->createRequest('\Omnipay\NABTransact\Message\HostedPaymentCompletePurchaseRequest', $parameters);
2020
}
2121

22+
/**
23+
* @return mixed
24+
*/
25+
public function getMerchantId()
26+
{
27+
return $this->getParameter('merchantId');
28+
}
29+
2230
public function getName()
2331
{
2432
return 'NAB Hosted Payment';
@@ -33,4 +41,14 @@ public function purchase(array $parameters = array())
3341
{
3442
return $this->createRequest('\Omnipay\NABTransact\Message\HostedPaymentPurchaseRequest', $parameters);
3543
}
44+
45+
/**
46+
* @param $value
47+
*
48+
* @return mixed
49+
*/
50+
public function setMerchantId($value)
51+
{
52+
return $this->setParameter('merchantId', $value);
53+
}
3654
}

src/Message/HostedPaymentPurchaseRequest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function getData()
2525
$this->validate(
2626
'amount',
2727
'returnUrl',
28-
'transactionReference',
28+
'transactionId',
2929
'merchantId',
3030
'paymentAlertEmail'
3131
);
@@ -44,6 +44,14 @@ public function getData()
4444
return $data;
4545
}
4646

47+
/**
48+
* @return mixed
49+
*/
50+
public function getMerchantId()
51+
{
52+
return $this->getParameter('merchantId');
53+
}
54+
4755
/**
4856
* @return mixed
4957
*/
@@ -87,6 +95,6 @@ public function setPaymentAlertEmail($value)
8795
*/
8896
public function setReturnUrlText($value)
8997
{
90-
return $this->getParameter('returnUrlText', $value);
98+
return $this->setParameter('returnUrlText', $value);
9199
}
92100
}

src/Message/HostedPaymentPurchaseResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function getRedirectData()
3737

3838
public function getRedirectMethod()
3939
{
40-
return 'GET';
40+
return 'POST';
4141
}
4242

4343
/**

0 commit comments

Comments
 (0)