跨境系统-东方支付对接跨境系统常见问题

更新时间:2020-09-18 点击量:644


ecshop 东方支付对接到跨境系统,常用的有2个支付接口(微信支付宝以及微信公众号支付接口),一个海关接口

通过post固定数据,并且加签传值


微信支付宝调用的接口大同小异。


主要代码有(微信和支付宝返回信息不一样,微信返回是二维码图,支付宝是一串URL,需要自行生成二维码)

$mrchntCode = 'XXXXXX';//商户号 111111111
$outOrderNo = $order['order_sn'];
//$add_time = date("YmdHis",$order['add_time']);
$add_time = date("YmdHis",gmtime());
$ptime = date("Y-m-d\TH:i:s");
$order_total = $order['order_amount'];//总价order_amount	total_fee
$msgContent ='{"trxCd":"1302","outOrderNo":"'.$outOrderNo.'","outOrderTime":"'.$add_time.'","mrchntCode":"'.$mrchntCode.'","trxCcyCd":"CNY","trxAmt":"'.$order_total.'","goodsName":"'.$order_g_name.'","frontUrl":"","backUrl":"http://www.uuecs.com/easipay.php?act=respond","payMethod":"3","productType":"SCAN","tradeType":"aggregate","remoteIp":"","areaInfo":"1561234"}';
$msgContent = encrypt($msgContent,$pub_key);
$signValue = getSign($msgContent, $sh_siyao);//加签
$json = '{"msgVersion": "1.0","msgCode": "QR_PAY","msgSerialNo": "'.$order['order_sn'].'","msgSender": "XXXXXX","msgSenderKey": "XXXXXX_key","timestamp":"'.$ptime.'","msgContent":"'.$msgContent.'","sign": {"signType": "RSA","signValue":"'.$signValue.'"},"encryptType": "RSA"}';
$sign[sign_type]= 'md5';
$sign[version]	= '1.0';		
ksort($sign);
$sign[appsecret]= 'XXXXX000000';//密钥		
$link = '';
foreach($sign as $key=> $val){
	if($val){
		$link .= ($key."=".strtolower($val)."&");//strtolower
	}
}
$link = rtrim($link, "&");//签名OK		
$sign[sign] = md5($link);		
unset($sign[appsecret]);//注销掉
$url = 'https://api.easipay.net/scan/order/precreate';//正式接口
$headers ="Content-Type: application/json; charset=utf-8";
$text = $Http->doPost($url,$json,4,$headers);		
$text = json_decode($text,true);
$respons = decrypt3($text['body'],$key_path);
$respons = json_decode($respons,true);



支付宝扫码打赏 微信打赏

如果文章对您有帮助,就打赏一个吧

在线客服

客户服务

热线电话:

0755-36656507 15889489919 服务时间:

周一到周六:9:00-18:00

在线QQ客服

在线微信客服

关于我们 常见问题

支付方式 加盟合作

提交需求
优惠红包 购物车0 反馈留言 返回顶部