weizong song 2 years ago
parent f2d1d31858
commit 9f9fbcdcdc

@ -95,17 +95,18 @@ class Refund extends SoftDeletesModel
*/ */
public function weixinRefund() public function weixinRefund()
{ {
$order = $this->order;
$url = "https://api.mch.weixin.qq.com/secapi/pay/refund"; $url = "https://api.mch.weixin.qq.com/secapi/pay/refund";
$CommonUtilPub = new \CommonUtilPub(); $CommonUtilPub = new \CommonUtilPub($order->project_id);
$WxPayConfPub = new \WxPayConfPub(); $WxPayConfPub = new \WxPayConfPub($order->project_id);
$inputObj = []; $inputObj = [];
$inputObj["transaction_id"] = $this->relatedRecharge->payment_serial; $inputObj["transaction_id"] = $this->relatedRecharge->payment_serial;
$inputObj["out_refund_no"] = $this->serial; $inputObj["out_refund_no"] = $this->serial;
$inputObj["total_fee"] = $this->relatedRecharge->money * 100; $inputObj["total_fee"] = $this->relatedRecharge->money * 100;
$inputObj["refund_fee"] = $this->money * 100; $inputObj["refund_fee"] = $this->money * 100;
$inputObj["nonce_str"] = $CommonUtilPub->createNoncestr(); $inputObj["nonce_str"] = $CommonUtilPub->createNoncestr();
$inputObj["appid"] = $WxPayConfPub::APPID; $inputObj["appid"] = $WxPayConfPub::$APPID;
$inputObj["mch_id"] = $WxPayConfPub::MCHID; $inputObj["mch_id"] = $WxPayConfPub::$MCHID;
$inputObj["sign"] = $CommonUtilPub->getSign($inputObj); $inputObj["sign"] = $CommonUtilPub->getSign($inputObj);
$xml = $CommonUtilPub->arrayToXml($inputObj); $xml = $CommonUtilPub->arrayToXml($inputObj);

Loading…
Cancel
Save