Skip to content

Commit

Permalink
单笔转账到支付宝账户(老接口)
Browse files Browse the repository at this point in the history
  • Loading branch information
dedemao authored Jun 1, 2020
1 parent f4bb4b0 commit c816102
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions transfers.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AlipayService
public function __construct($appid, $saPrivateKey)
{
$this->appId = $appid;
$this->charset = 'utf8';
$this->charset = 'utf-8';
$this->rsaPrivateKey=$saPrivateKey;
}

Expand Down Expand Up @@ -60,12 +60,8 @@ public function doPay($totalFee, $outTradeNo, $account,$realName,$remark='')
'biz_content'=>json_encode($requestConfigs),
);
$commonConfigs["sign"] = $this->generateSign($commonConfigs, $commonConfigs['sign_type']);
$result = $this->curlPost('https://openapi.alipay.com/gateway.do',$commonConfigs);
$result = $this->curlPost('https://openapi.alipay.com/gateway.do?charset='.$this->charset,$commonConfigs);
$resultArr = json_decode($result,true);
if(empty($resultArr)){
$result = iconv('GBK','UTF-8//IGNORE',$result);
return json_decode($result,true);
}
return $resultArr;
}

Expand Down

0 comments on commit c816102

Please sign in to comment.