Skip to content

Commit 28abc1d

Browse files
committed
fix
1 parent 093e287 commit 28abc1d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Message/CompletePurchaseRequest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Omnipay\YiPay\Message;
44

5-
use Omnipay\Common\Exception\InvalidResponseException;
5+
use Omnipay\Common\Exception\InvalidRequestException;
66
use Omnipay\YiPay\Traits\HasYiPay;
77

88
class CompletePurchaseRequest extends PurchaseRequest
99
{
1010
use HasYiPay;
1111

1212
/**
13-
* @throws InvalidResponseException
13+
* @throws InvalidRequestException
1414
*/
1515
public function getData()
1616
{
@@ -21,12 +21,11 @@ public function getData()
2121
if (array_key_exists('transactionNo', $data)) {
2222
$checkCode = $this->checkCode($this->getSignedKeys((int) $data['type']), $data);
2323

24-
if (! hash_equals($checkCode, $data['checkCode'])) {
25-
throw new InvalidResponseException('Invalid check code');
24+
if (! hash_equals($checkCode, $data['checkCode'] ?: '')) {
25+
throw new InvalidRequestException('Incorrect checkCode');
2626
}
2727
}
2828

29-
3029
return $data;
3130
}
3231

0 commit comments

Comments
 (0)