Skip to content

Commit c852f12

Browse files
committed
get payment info
1 parent bf72834 commit c852f12

File tree

12 files changed

+56
-31
lines changed

12 files changed

+56
-31
lines changed

src/Gateway.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use Omnipay\Common\Message\RequestInterface;
88
use Omnipay\Payware\Message\AcceptNotificationRequest;
99
use Omnipay\Payware\Message\CompletePurchaseRequest;
10+
use Omnipay\Payware\Message\GetPaymentInfoRequest;
1011
use Omnipay\Payware\Message\PurchaseRequest;
11-
use Omnipay\Payware\Message\ReceiveTransactionInfoRequest;
1212
use Omnipay\Payware\Traits\HasMerchant;
1313

1414
/**
@@ -137,8 +137,8 @@ public function acceptNotification(array $options = [])
137137
/**
138138
* @return RequestInterface
139139
*/
140-
public function receiveTransactionInfo(array $options = [])
140+
public function getPaymentInfo(array $options = [])
141141
{
142-
return $this->createRequest(ReceiveTransactionInfoRequest::class, $options);
142+
return $this->createRequest(GetPaymentInfoRequest::class, $options);
143143
}
144144
}

src/Message/ReceiveTransactionInfoRequest.php renamed to src/Message/GetPaymentInfoRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Omnipay\Common\Message\ResponseInterface;
66

7-
class ReceiveTransactionInfoRequest extends AbstractRequest
7+
class GetPaymentInfoRequest extends AbstractRequest
88
{
99
/**
1010
* @return array
@@ -20,6 +20,6 @@ public function getData()
2020
*/
2121
public function sendData($data)
2222
{
23-
return $this->response = new ReceiveTransactionInfoResponse($this, $data);
23+
return $this->response = new GetPaymentInfoResponse($this, $data);
2424
}
2525
}

src/Message/ReceiveTransactionInfoResponse.php renamed to src/Message/GetPaymentInfoResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Omnipay\Common\Message\AbstractResponse;
66

7-
class ReceiveTransactionInfoResponse extends AbstractResponse
7+
class GetPaymentInfoResponse extends AbstractResponse
88
{
99
/**
1010
* Is the response successful?

src/Message/PurchaseRequest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
use Omnipay\Payware\Support\Helper;
77
use Omnipay\Payware\Traits\HasAmount;
88
use Omnipay\Payware\Traits\HasMerchant;
9+
use Omnipay\Payware\Traits\HasPaymentInfo;
910

1011
class PurchaseRequest extends AbstractRequest
1112
{
1213
use HasMerchant;
1314
use HasAmount;
15+
use HasPaymentInfo;
1416

1517
/**
1618
* @param string $orderNo
@@ -30,20 +32,20 @@ public function getOrderNo()
3032
}
3133

3234
/**
33-
* @param string $receiveUrl
35+
* @param string $value
3436
* @return PurchaseRequest
3537
*/
36-
public function setReceiveUrl($receiveUrl)
38+
public function setReceiveUrl($value)
3739
{
38-
return $this->setParameter('ReceiveUrl', $receiveUrl);
40+
return $this->setPaymentInfoUrl($value);
3941
}
4042

4143
/**
4244
* @return string
4345
*/
4446
public function getReceiveUrl()
4547
{
46-
return $this->getParameter('ReceiveUrl');
48+
return $this->getPaymentInfoUrl();
4749
}
4850

4951
/**
@@ -240,7 +242,7 @@ public function getData()
240242
'Amount' => $this->getAmount(),
241243
'OrderNo' => $this->getTransactionId(),
242244
'ReturnURL' => $this->getReturnUrl(),
243-
'ReceiveURL' => $this->getReceiveUrl(),
245+
'ReceiveURL' => $this->getPaymentInfoUrl(),
244246
'OrderDesc' => $this->getDescription(),
245247
'PayType' => $this->getPayType() ?: 1,
246248
'ValidateKey' => $this->getValidateKey(),

src/Traits/HasBooking.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait HasBooking
66
{
77
/**
88
* @param string $bookingId
9-
* @return $this
9+
* @return self
1010
*/
1111
public function setBookingId($bookingId)
1212
{
@@ -23,7 +23,7 @@ public function getBookingId()
2323

2424
/**
2525
* @param string $custOrderNo
26-
* @return $this
26+
* @return self
2727
*/
2828
public function setCustOrderNo($custOrderNo)
2929
{
@@ -40,7 +40,7 @@ public function getCustOrderNo()
4040

4141
/**
4242
* @param string $sendType
43-
* @return $this
43+
* @return self
4444
*/
4545
public function setSendType($sendType)
4646
{

src/Traits/HasCVS.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait HasCVS
66
{
77
/**
88
* @param string $barcode
9-
* @return $this
9+
* @return self
1010
*/
1111
public function setBarcode1_3($barcode)
1212
{
@@ -23,7 +23,7 @@ public function getBarcode1_3()
2323

2424
/**
2525
* @param string $paymentNo
26-
* @return $this
26+
* @return self
2727
*/
2828
public function setPaymentNo($paymentNo)
2929
{

src/Traits/HasCreditCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait HasCreditCard
66
{
77
/**
88
* @param string $card4No
9-
* @return $this
9+
* @return self
1010
*/
1111
public function setCard4No($card4No)
1212
{

src/Traits/HasMerchant.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
trait HasMerchant
88
{
99
/**
10-
* @return $this
10+
* @return self
1111
*/
1212
public function setEndpoint($endpoint)
1313
{
@@ -24,7 +24,7 @@ public function getEndpoint()
2424

2525
/**
2626
* @param string $merchantId
27-
* @return $this
27+
* @return self
2828
*/
2929
public function setMerchantId($merchantId)
3030
{
@@ -41,7 +41,7 @@ public function getMerchantId()
4141

4242
/**
4343
* @param string $terminalId
44-
* @return $this
44+
* @return self
4545
*/
4646
public function setTerminalId($terminalId)
4747
{
@@ -58,7 +58,7 @@ public function getTerminalId()
5858

5959
/**
6060
* @param string $merchantName
61-
* @return $this
61+
* @return self
6262
*/
6363
public function setMerchantName($merchantName)
6464
{

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\Payware\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+
}

src/Traits/HasWebATM.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ trait HasWebATM
66
{
77
/**
88
* @param string $bankCode
9-
* @return $this
9+
* @return self
1010
*/
1111
public function setBankCode($bankCode)
1212
{
@@ -23,7 +23,7 @@ public function getBankCode()
2323

2424
/**
2525
* @param string $atmNo
26-
* @return $this
26+
* @return self
2727
*/
2828
public function setAtmNo($atmNo)
2929
{

0 commit comments

Comments
 (0)