Skip to content

Commit bae2561

Browse files
committed
get payment info url
1 parent a296f7f commit bae2561

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

src/Message/PurchaseRequest.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
use Omnipay\Common\Exception\InvalidRequestException;
66
use Omnipay\NewebPay\Traits\HasDefaults;
7+
use Omnipay\NewebPay\Traits\HasPaymentInfo;
78

89
class PurchaseRequest extends AbstractRequest
910
{
1011
use HasDefaults;
12+
use HasPaymentInfo;
1113

1214
public function getEndpoint()
1315
{
@@ -119,15 +121,15 @@ public function getExpireDate()
119121
*/
120122
public function setCustomerURL($value)
121123
{
122-
return $this->setParameter('CustomerURL', $value);
124+
return $this->setPaymentInfoUrl($value);
123125
}
124126

125127
/**
126128
* @return ?string
127129
*/
128130
public function getCustomerURL()
129131
{
130-
return $this->getParameter('CustomerURL');
132+
return $this->getPaymentInfoUrl();
131133
}
132134

133135
/**
@@ -905,19 +907,6 @@ public function getTokenTermDemand()
905907
return $this->getParameter('TokenTermDemand');
906908
}
907909

908-
public function setPaymentInfoUrl($value)
909-
{
910-
return $this->setCustomerURL($value);
911-
}
912-
913-
/**
914-
* @return ?string
915-
*/
916-
public function getPaymentInfoUrl()
917-
{
918-
return $this->getCustomerURL();
919-
}
920-
921910
/**
922911
* @throws InvalidRequestException
923912
*/
@@ -938,7 +927,7 @@ public function getData(): array
938927
'ExpireDate' => $this->getExpireDate(),
939928
'ReturnURL' => $this->getReturnUrl(),
940929
'NotifyURL' => $this->getNotifyUrl(),
941-
'CustomerURL' => $this->getCustomerURL(),
930+
'CustomerURL' => $this->getPaymentInfoUrl(),
942931
'ClientBackURL' => $this->getCancelUrl(),
943932
'Email' => $this->getEmail(),
944933
'EmailModify' => $this->getEmailModify(),

src/Traits/HasPaymentInfo.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace Omnipay\NewebPay\Traits;
4+
5+
trait HasPaymentInfo
6+
{
7+
/**
8+
* @param string $value
9+
* @return self
10+
*/
11+
public function setPaymentInfoUrl($value)
12+
{
13+
return $this->setParameter('paymentInfoUrl', $value);
14+
}
15+
16+
/**
17+
* @return string
18+
*/
19+
public function getPaymentInfoUrl()
20+
{
21+
return $this->getParameter('paymentInfoUrl');
22+
}
23+
}

0 commit comments

Comments
 (0)