Authored by 郝肖肖

银联返回异步地址改成java

... ... @@ -7,7 +7,6 @@ use WebPlugin\Pay\Reqparams;
use WebPlugin\Pay\Rspparams;
use WebPlugin\UdpLog;
use WebPlugin\Helpers;
use Api\Yohobuy;
class Service extends PayAbstract
{
... ... @@ -68,9 +67,10 @@ class Service extends PayAbstract
return $responseData;
}
//https://open.unionpay.com/ajweb/help/faq/list?id=38&level=0&from=0
public function getPayRequestPars(Reqparams $params)
{
$front_notify_url = SDK_FRONT_NOTIFY_URL . '?order_code=' . $params->orderCode;
// $front_notify_url = SDK_FRONT_NOTIFY_URL . '?order_code=' . $params->orderCode;
$requestParams = array(
'version' => '5.0.0', //版本号
'encoding' => 'utf-8', //编码方式
... ... @@ -78,8 +78,8 @@ class Service extends PayAbstract
'txnType' => '01', //交易类型
'txnSubType' => '01', //交易子类
'bizType' => '000201', //业务类型
'frontUrl' => $front_notify_url, //前台通知地址--同步地址
'backUrl' => SDK_BACK_NOTIFY_URL,//后台通知地址--异步地址
'frontUrl' => Helpers::getHttpOrHttps() . Helpers::url(SDK_FRONT_NOTIFY_URL), //前台通知地址--同步地址
'backUrl' => SERVICE_NOTIFY . SDK_BACK_NOTIFY_URL,//后台通知地址--异步地址
'signMethod' => '01', //签名方法
'channelType' => '07', //渠道类型,07-PC,08-手机
'accessType' => '0', //接入类型
... ... @@ -88,8 +88,9 @@ class Service extends PayAbstract
'txnTime' => date('YmdHis', $params->orderTime), //订单发送时间
'txnAmt' => $params->totalFee, //交易金额,单位分
'currencyCode' => '156', //交易币种
'defaultPayType' => '0201', //默认支付方式
'defaultPayType' => '0201', //默认支付方式-网银支付
//'orderDesc' => '订单描述', //订单描述,网关支付和wap支付暂时不起作用
// 'payTimeout' => '',//超时时间
'reqReserved' => $params->goodsName //请求方保留域,透传字段,查询、通知、对账文件中均会原样出现
);
// 签名
... ...
... ... @@ -44,9 +44,9 @@ const SDK_App_Request_Url = 'https://101.231.204.80:5000/gateway/api/appTransReq
// 前台通知地址 (商户自行配置通知地址)
const SDK_FRONT_NOTIFY_URL = 'http://www.yohobuy.com/pay/notice/unionpaywebreturn';
const SDK_FRONT_NOTIFY_URL = '/pay/payreturn/unionpaywebreturn';
// 后台通知地址 (商户自行配置通知地址)
const SDK_BACK_NOTIFY_URL = 'http://www.yohobuy.com/pay/notice/unionpaywebnotice';
const SDK_BACK_NOTIFY_URL = 'payment/unionpay_newnotify';
//文件下载目录
const SDK_FILE_DOWN_PATH = '/Data/logs/pc_pay/unionpay/files/';
... ...
... ... @@ -266,6 +266,7 @@ class NoticeController extends WebAction
*/
public function unionpaywebreturnAction()
{
UdpLog::info("【银联web支付同步返回】,function:unionpaywebreturn,json参数", json_encode($_REQUEST));
$res = $this->getParseResponse($_REQUEST, 25);
$dealResult = $this->payResultProc($res, 25);
$dealResult['payData'] = array('payWay' => '银联在线支付');
... ... @@ -277,6 +278,7 @@ class NoticeController extends WebAction
*/
public function unionpaywebnoticeAction()
{
UdpLog::info("【银联web支付异步返回】,function:unionpaywebnotice,json参数", json_encode($_REQUEST));
$res = $this->getParseResponse($_REQUEST, 25);
if ($res->payResult != -1) {
$this->payResultProc($res, 25);
... ...
... ... @@ -65,6 +65,7 @@ class PayreturnController extends WebAction
*/
public function unionpaywebreturnAction()
{
UdpLog::info("【银联web支付同步返回】,function:unionpaywebreturn,json参数", json_encode($_REQUEST));
$res = $this->getParseResponse($_REQUEST, 25);
$dealResult = $this->payResultProc($res, 25);
$dealResult['payData'] = array('payWay' => '银联在线支付');
... ...