Skip to content

Commit

Permalink
Fixed bug can not verify data signature send from OnePay gateway (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vuongxuongminh committed Jan 3, 2019
1 parent 29b5410 commit 0350460
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change Log

1.0.4 đang xây dựng
--------------------------
- Lỗi #12: Không thể kiểm tra chữ ký dữ liệu gửi từ OnePay (vuongxuongminh)

1.0.3
--------------------------
Expand Down
8 changes: 6 additions & 2 deletions src/RsaDataSignature.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ public function init()
{
if ($this->openSSLAlgo === null) {
throw new InvalidConfigException('Property `openSSLAlgo` must be set!');
} else if ($this->privateCertificate === null) {
}

if ($this->privateCertificate === null) {
throw new InvalidConfigException('Property `privateCertificate` must be set for generate signature!');
} else if ($this->publicCertificate === null) {
}

if ($this->publicCertificate === null) {
throw new InvalidConfigException('Property `publicCertificate` must be set for validate signature!');
}

Expand Down
8 changes: 5 additions & 3 deletions src/onepay/PaymentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ protected function requestInternal(\vxm\gatewayclients\RequestData $requestData,
protected function getVerifyRequestData($command, \yii\web\Request $request): array
{
$params = [
'vpc_Command', 'vpc_Locale', 'vpc_MerchTxnRef', 'vpc_Merchant', 'vpc_OrderInfo', 'vpc_Amount',
'vpc_TxnResponseCode', 'vpc_TransactionNo', 'vcp_Message', 'vpc_SecureHash', 'vpc_AcqResponseCode',
'vpc_Authorizeld', 'vpc_Card', 'vpc_3DSECI', 'vpc_3Dsenrolled', 'vpc_3Dsstatus', 'vpc_CommercialCard'
'vpc_Command', 'vpc_Locale', 'vpc_MerchTxnRef', 'vpc_TxnResponseCode',
'vpc_OrderInfo', 'vpc_Amount', 'vpc_SecureHash', 'vpc_AcqResponseCode',
'vpc_TransactionNo', 'vcp_Message', 'vpc_3Dsstatus', 'vpc_3Dsstatus',
'vpc_Authorizeld', 'vpc_Card', 'vpc_3DSECI', 'vpc_Merchant', 'vpc_Version',
'vpc_CurrencyCode', 'vpc_AdditionData', 'vpc_CommercialCard', 'vpc_3Dsenrolled'
];

$data = [];
Expand Down

0 comments on commit 0350460

Please sign in to comment.