From 1ac3e837d2b7cae2bb1b40a1d26c3786504f3eff Mon Sep 17 00:00:00 2001 From: as2252258 Date: Thu, 19 Jul 2018 19:27:26 +0800 Subject: [PATCH] add --- wx/Recharge.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wx/Recharge.php b/wx/Recharge.php index 3dd155d..5641c9f 100644 --- a/wx/Recharge.php +++ b/wx/Recharge.php @@ -120,7 +120,13 @@ class Recharge extends Base $array['sign'] = $this->sign($array); return Http::post($transfers, $this->toXml($array), function ($data) { - return $this->toArray($data); + $array = $this->toArray($data); + if ($array['result_code'] != 'SUCCESS') { + $data = ['code' => $array['err_code'], 'message' => $array['err_code_des']]; + } else { + $data = ['code' => 0, 'message' => '支付成功']; + } + return new Result($data); }, NULL, [$this->ssl_cert, $this->ssl_key]); }