Commit 15079145 by 丁铜欣

微诺付退款

1 parent 7673908e
......@@ -41,6 +41,8 @@ class Refund
Config::YS_REFUND,//易生支付
Config::YSE_REFUND,//银盛支付
Config::WNF_REFUND //微诺付
];
/**
......
<?php
namespace Payment\Common\WNFpay\Data;
use Payment\Common\PayException;
use Payment\Common\WNFpay\WNFBaseData;
class RefundData extends WNFBaseData
{
/**
* 构建用于支付退款的签名相关数据
*
* @return void
*/
protected function buildData(){
$data = [
'orderNo' => $this->orderNo ,
'refundReason' => $this->refundReason ,
];
$this->retData = $data;
}
/**
* 参数校验
* @return mixed|void
* @throws PayException
*/
protected function checkDataParam(){
if(empty($this->orderNo)){
throw new PayException('退款订单号不能为空');
}
}
}
\ No newline at end of file
......@@ -12,11 +12,15 @@ class WnfConfig extends ConfigInterface
*/
// 下单url
const PAY_URL = 'http://124.128.23.122:8081/api/pay';
//const PAY_URL = 'http://mall.sdinvoice.com:8081/api/pay';
//const PAY_URL = 'http://mall.sdinvoice.com/api/pay';
// 查询url
const QUERY_URL = 'http://124.128.23.122:8081/api/query';
//const QUERY_URL = 'http://mall.sdinvoice.com:8081/api/query';
//const QUERY_URL = 'http://mall.sdinvoice.com/api/query';
// 退款url
const REFUND_URL = 'http://124.128.23.122:8081/api/refund';
// const REFUND_URL = 'http://mall.sdinvoice.com/api/query';
// 指定回调页面
public $returnUrl;
......
......@@ -271,4 +271,6 @@ final class Config{
const WNF_ALI_APP = 'wnf_ali_lite'; //支付宝支付
const WNF_QUERY = 'wnf_query'; //支付查询
const WNF_REFUND = 'wnf_refund'; //支付退款
}
<?php
namespace Payment\Refund;
use Payment\Common\WnfConfig;
use Payment\Common\WNFpay\Data\RefundData;
use Payment\Common\WNFpay\WNFBaseStrategy;
class WNFRefund extends WNFBaseStrategy
{
public function getBuildDataClass(){
return RefundData::class;
}
public function getReqUrl($url = null){
return parent::getReqUrl($url ?? WnfConfig::REFUND_URL);
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ use Payment\Refund\MiRefund;
use Payment\Refund\SwRefund;
use Payment\Refund\SwThreeRefund;
use Payment\Refund\TLRefund;
use Payment\Refund\WNFRefund;
use Payment\Refund\WxRefund;
use Payment\Refund\YSRefund;
use Payment\Refund\YSERefund;
......@@ -77,8 +78,11 @@ class RefundContext
case Config::YSE_REFUND:
$this->refund = new YSERefund($config);
break;
case Config::WNF_REFUND:
$this->refund = new WNFRefund($config);
break;
default:
throw new PayException('当前仅支持:ALI WEIXIN CMB TL MI SW FU');
throw new PayException('当前仅支持:ALI WEIXIN CMB TL MI SW FU WNF');
}
} catch (PayException $e) {
throw $e;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!