|
@@ -156,9 +156,9 @@ class PayPlus
|
|
|
|
|
|
|
|
public function decryptPayinResponse(array $response, $aesKey, $iv)
|
|
public function decryptPayinResponse(array $response, $aesKey, $iv)
|
|
|
{
|
|
{
|
|
|
- $componentDelta = $response['data']['componentDelta'] ?? $response['componentDelta'] ?? '';
|
|
|
|
|
|
|
+ $componentDelta = $response['data']['componentDelta'] ?? '';
|
|
|
if ($componentDelta === '') {
|
|
if ($componentDelta === '') {
|
|
|
- return $response;
|
|
|
|
|
|
|
+ return [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
return json_decode($this->decryptComponentDelta($componentDelta, $aesKey, $iv), true) ?: [];
|
|
return json_decode($this->decryptComponentDelta($componentDelta, $aesKey, $iv), true) ?: [];
|
|
@@ -177,6 +177,7 @@ class PayPlus
|
|
|
$decoded = json_decode($response, true) ?: [];
|
|
$decoded = json_decode($response, true) ?: [];
|
|
|
Util::WriteLog('PayPlus', 'PayPlus raw response: ' . json_encode($decoded));
|
|
Util::WriteLog('PayPlus', 'PayPlus raw response: ' . json_encode($decoded));
|
|
|
$componentDelta = $this->decryptPayinResponse($decoded, $encrypted['aes_key'], $encrypted['iv']);
|
|
$componentDelta = $this->decryptPayinResponse($decoded, $encrypted['aes_key'], $encrypted['iv']);
|
|
|
|
|
+ Util::WriteLog('PayPlus', 'PayPlus raw response111: ' . json_encode($decoded));
|
|
|
if (!empty($componentDelta)) {
|
|
if (!empty($componentDelta)) {
|
|
|
Util::WriteLog('PayPlus', 'PayPlus decrypted componentDelta: ' . json_encode($componentDelta));
|
|
Util::WriteLog('PayPlus', 'PayPlus decrypted componentDelta: ' . json_encode($componentDelta));
|
|
|
return $componentDelta;
|
|
return $componentDelta;
|