Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
9 years ago
Commit
0aa76e8c6e126d61daf106eeac71ccacd47fe349
1 parent
ccf1ac20
支付宝银行回调地址修改
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 deletions
library/LibModels/Web/Product/PayData.php
library/WebPlugin/Pay/Alibank/Config.php
library/WebPlugin/Pay/Alibank/Service.php
yohobuy/www.yohobuy.com/application/modules/Pay/controllers/Payreturn.php
library/LibModels/Web/Product/PayData.php
View file @
0aa76e8
...
...
@@ -233,8 +233,6 @@ class PayData
public
static
function
pcpayNotify
(
$orderCode
,
$payment
,
$amount
,
$bankName
=
''
,
$bankCode
=
''
,
$tradeNo
=
''
,
$bankBillNo
=
''
)
{
$param
=
Yohobuy
::
param
();
$param
[
'client_type'
]
=
'web'
;
$param
[
'private_key'
]
=
Yohobuy
::
$privateKeyList
[
'web'
];
$param
[
'method'
]
=
'web.SpaceOrders.pcpayNotify'
;
$param
[
'order_code'
]
=
$orderCode
;
$param
[
'payment'
]
=
$payment
;
...
...
@@ -243,7 +241,6 @@ class PayData
$param
[
'amount'
]
=
$amount
;
$param
[
'trade_no'
]
=
$tradeNo
;
$param
[
'bank_bill_no'
]
=
$bankBillNo
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
...
...
library/WebPlugin/Pay/Alibank/Config.php
View file @
0aa76e8
...
...
@@ -33,14 +33,14 @@ class Config
* Enter description here ...
* @var String
*/
var
$notify_url
=
"
notice/alibank
notice"
;
var
$notify_url
=
"
payment/alibank_
notice"
;
/**
* 浏览器的返回
* Enter description here ...
* @var string
*/
var
$return_url
=
"
notice
/alibankreturn"
;
var
$return_url
=
"
/pay/payreturn
/alibankreturn"
;
/**
* 签名方式
...
...
library/WebPlugin/Pay/Alibank/Service.php
View file @
0aa76e8
...
...
@@ -7,6 +7,8 @@ use WebPlugin\Pay\PayAbstract;
use
WebPlugin\Pay\Reqparams
;
use
WebPlugin\Pay\Rspparams
;
use
WebPlugin\PhpLog
;
use
Api\Yohobuy
;
use
Plugin\Helpers
;
class
Service
extends
PayAbstract
{
...
...
@@ -42,19 +44,19 @@ class Service extends PayAbstract
public
function
getPayRequestPars
(
Reqparams
$params
)
{
$baseUrl
=
$this
->
getBaseNoticeUrl
(
$params
->
isTest
);
$loseTime
=
intval
((
$params
->
orderTime
+
7200
-
time
())
/
60
);
// $baseUrl = $this->getBaseNoticeUrl($params->isTest);
// $loseTime = intval(($params->orderTime + 7200 - time()) / 60);
// $loseTime = intval((strtotime(date("Y-m-d 10:00:00", strtotime("+1 day")))-time())/60);
$parameter
=
array
(
'service'
=>
$this
->
config
->
service
,
'partner'
=>
$this
->
config
->
partner
,
'_input_charset'
=>
$this
->
config
->
input_charset
,
'notify_url'
=>
$baseUrl
.
$this
->
config
->
notify_url
,
'return_url'
=>
$baseUrl
.
$this
->
config
->
return_url
,
'notify_url'
=>
Yohobuy
::
SERVICE_URL
.
$this
->
config
->
notify_url
,
'return_url'
=>
Helpers
::
url
(
$this
->
config
->
return_url
),
/* 业务参数 */
'subject'
=>
$params
->
goodsName
,
'out_trade_no'
=>
$params
->
orderCode
.
'_'
.
$params
->
paymentParameter
,
'out_trade_no'
=>
$params
->
orderCode
,
'total_fee'
=>
$params
->
totalFee
/
100
,
//单位为元
'payment_type'
=>
$this
->
config
->
payment_type
,
'defaultbank'
=>
$params
->
paymentParameter
,
...
...
@@ -134,14 +136,8 @@ class Service extends PayAbstract
// $outTradeNo = substr($outTradeNo, 2);
// }
//支付订单处理
$orderCodeArr
=
explode
(
'_'
,
$outTradeNo
);
if
(
count
(
$orderCodeArr
)
==
2
)
{
$rsp
->
orderCode
=
$orderCodeArr
[
0
];
$rsp
->
bankName
=
$orderCodeArr
[
1
];
}
else
{
$rsp
->
orderCode
=
$outTradeNo
;
$rsp
->
bankName
=
""
;
}
$rsp
->
orderCode
=
intval
(
$outTradeNo
);
$rsp
->
bankName
=
""
;
$rsp
->
payResult
=
$this
->
convertResult
(
$arrResponse
[
"trade_status"
]);
$rsp
->
payTime
=
isset
(
$arrResponse
[
"gmt_payment"
])
?
$arrResponse
[
"gmt_payment"
]
:
time
();
$rsp
->
totalFee
=
$arrResponse
[
"total_fee"
];
...
...
yohobuy/www.yohobuy.com/application/modules/Pay/controllers/Payreturn.php
View file @
0aa76e8
...
...
@@ -67,13 +67,26 @@ class PayreturnController extends WebAction
*/
public
function
unionpaywebreturnAction
()
{
$payment
=
PayModel
::
getPaymentById
(
25
);
$payment
=
Pay
ment
Model
::
getPaymentById
(
25
);
$payService
=
PayFactory
::
factory
(
$payment
);
$res
=
$payService
->
parseResponse
(
$_REQUEST
);
$dealResult
=
$this
->
payResultProc
(
$res
,
25
);
$dealResult
[
'payData'
]
=
array
(
'payWay'
=>
'银联在线支付'
);
$this
->
commonShowResult
(
$dealResult
);
}
/*
* 支付宝银行支付回调-同步地址
*/
public
function
alibankreturnAction
()
{
$payment
=
PaymentModel
::
getPaymentById
(
12
);
$payService
=
PayFactory
::
factory
(
$payment
);
$res
=
$payService
->
parseResponse
(
$_GET
);
$dealResult
=
$this
->
payResultProc
(
$res
,
12
);
$dealResult
[
'payData'
]
=
array
(
'payWay'
=>
'支联支付'
);
$this
->
commonShowResult
(
$dealResult
);
}
/**
* 通用显示结果的方法
* @param array $dealResult
...
...
@@ -115,7 +128,7 @@ class PayreturnController extends WebAction
if
(
!
empty
(
$payResult
->
orderCode
))
{
//支付成功,发送一次支付确认
$uid
=
$this
->
getUid
(
true
);
PaymentModel
::
sendPayConfirm
(
$payResult
,
$payment
,
$uid
);
PaymentModel
::
sendPayConfirm
(
$payResult
->
orderCode
,
$payment
,
$uid
);
}
//支付成功
...
...
Please
register
or
login
to post a comment