Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
payment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 15079145
authored
Feb 22, 2023
by
丁铜欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微诺付退款
1 parent
7673908e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
3 deletions
src/Client/Refund.php
src/Common/WNFpay/Data/RefundData.php
src/Common/WnfConfig.php
src/Config.php
src/Refund/WNFRefund.php
src/RefundContext.php
src/Client/Refund.php
View file @
1507914
...
...
@@ -41,6 +41,8 @@ class Refund
Config
::
YS_REFUND
,
//易生支付
Config
::
YSE_REFUND
,
//银盛支付
Config
::
WNF_REFUND
//微诺付
];
/**
...
...
src/Common/WNFpay/Data/RefundData.php
0 → 100644
View file @
1507914
<?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
src/Common/WnfConfig.php
View file @
1507914
...
...
@@ -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
;
...
...
src/Config.php
View file @
1507914
...
...
@@ -271,4 +271,6 @@ final class Config{
const
WNF_ALI_APP
=
'wnf_ali_lite'
;
//支付宝支付
const
WNF_QUERY
=
'wnf_query'
;
//支付查询
const
WNF_REFUND
=
'wnf_refund'
;
//支付退款
}
src/Refund/WNFRefund.php
0 → 100644
View file @
1507914
<?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
src/RefundContext.php
View file @
1507914
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment