|
@@ -67,7 +67,10 @@ class UnionPay implements PayMerchantInterface
|
|
|
'merOrderId' => $trade_no,
|
|
|
];
|
|
|
$result = $this->request($query_params);
|
|
|
- if ($result->errCode === 'SUCCESS' && $result->status === 'TRADE_SUCCESS') {
|
|
|
+ if (
|
|
|
+ isset($result->errCode) && $result->errCode === 'SUCCESS' &&
|
|
|
+ isset($result->status) && $result->status === 'TRADE_SUCCESS'
|
|
|
+ ) {
|
|
|
return true;
|
|
|
} else {
|
|
|
\Log::info('union_pay.query: ');
|
|
@@ -78,7 +81,7 @@ class UnionPay implements PayMerchantInterface
|
|
|
|
|
|
public function notify(array $data)
|
|
|
{
|
|
|
- if ($data['status'] === 'TRADE_SUCCESS') {
|
|
|
+ if (isset($data['status']) && $data['status'] === 'TRADE_SUCCESS') {
|
|
|
$sign = $this->makeSign($data);
|
|
|
if ($sign === $data['sign']) {
|
|
|
return true;
|
|
@@ -102,7 +105,11 @@ class UnionPay implements PayMerchantInterface
|
|
|
'refundAmount' => $data['price'],
|
|
|
];
|
|
|
$result = $this->request($refund_params);
|
|
|
- if ($result->errCode === 'SUCCESS' && $result->refundStatus === 'SUCCESS' && $result->status === 'TRADE_SUCCESS') {
|
|
|
+ if (
|
|
|
+ isset($result->errCode) && $result->errCode === 'SUCCESS' &&
|
|
|
+ isset($result->refundStatus) && $result->refundStatus === 'SUCCESS' &&
|
|
|
+ isset($result->status) && $result->status === 'TRADE_SUCCESS'
|
|
|
+ ) {
|
|
|
return true;
|
|
|
} else {
|
|
|
\Log::info('union_pay.refund: ');
|