易支付四方支付系统对接杉德(河马)支付接口
二次开发
admin
发布时间:2026-02-04 19:07:02
浏览: 次
最近为客户在其易支付系统上对接了一个杉德(河马)支付接口,下面简单分享一下开发心得。
1.首先用支付宝的RSA秘钥生成工具生成一对公私钥,公钥上传到河马后台,私钥开发用。
一下直接上源码:
//统一下单
static private function addOrder($pay_type, $pay_mode, $sub_openid = null, $sub_appid = null){
global $channel, $order, $ordername, $conf, $clientip, $siteurl;
require(PAY_ROOT."inc/SandpayClient.php");
$client = new SandpayClient($channel['appid'], $channel['appkey'], $channel['appswitch']);
$params = [
'app_id' => $channel['appid'],
'method' => 'trade.percreate',
//'method' => 'trade.create.cashier',
//'marketProduct' => $channel['product'],
'timestamp' => date('Y-m-d H:i:s'),
'nonce' => rand(10000,99999),
'format' => 'JSON',
'sign_type' => 'RSA2',
//'description' => $ordername,
/*
'notify_url' => $conf['localurl'].'pay/notify/'.TRADE_NO.'/',
'total_amount' => $order['realmoney'],
'out_order_no' => TRADE_NO,
'body' => $ordername,
'store_id' => '100001',
"func_code_list" => [
"01040001",
"01000001",
"01020002"
],
*/
];
$biz_content = [
'create_ip' => $clientip,
//'create_time' => date("YmdHis",time()),
//'pay_way' => $pay_type,
//'pay_type' => $pay_mode,
'total_amount' => $order['realmoney'],
'out_order_no' => TRADE_NO,
'body' => $ordername,
'store_id' => '100001',
'notify_url' => $conf['localurl'].'pay/notify/'.TRADE_NO.'/',
'redirect_url' => $siteurl.'pay/return/'.TRADE_NO.'/',
/*
'sd_cashier_type' => 'H5',
"func_code_list" => [
"01010002", // 云函数H5(微信小程序
"01020002" // 支付宝生活号H5(支付宝)
],
*/
];
有需要开发易支付杉德支付插件的朋友,可以联系我QQ:804752009
1.首先用支付宝的RSA秘钥生成工具生成一对公私钥,公钥上传到河马后台,私钥开发用。
一下直接上源码:
//统一下单
static private function addOrder($pay_type, $pay_mode, $sub_openid = null, $sub_appid = null){
global $channel, $order, $ordername, $conf, $clientip, $siteurl;
require(PAY_ROOT."inc/SandpayClient.php");
$client = new SandpayClient($channel['appid'], $channel['appkey'], $channel['appswitch']);
$params = [
'app_id' => $channel['appid'],
'method' => 'trade.percreate',
//'method' => 'trade.create.cashier',
//'marketProduct' => $channel['product'],
'timestamp' => date('Y-m-d H:i:s'),
'nonce' => rand(10000,99999),
'format' => 'JSON',
'sign_type' => 'RSA2',
//'description' => $ordername,
/*
'notify_url' => $conf['localurl'].'pay/notify/'.TRADE_NO.'/',
'total_amount' => $order['realmoney'],
'out_order_no' => TRADE_NO,
'body' => $ordername,
'store_id' => '100001',
"func_code_list" => [
"01040001",
"01000001",
"01020002"
],
*/
];
$biz_content = [
'create_ip' => $clientip,
//'create_time' => date("YmdHis",time()),
//'pay_way' => $pay_type,
//'pay_type' => $pay_mode,
'total_amount' => $order['realmoney'],
'out_order_no' => TRADE_NO,
'body' => $ordername,
'store_id' => '100001',
'notify_url' => $conf['localurl'].'pay/notify/'.TRADE_NO.'/',
'redirect_url' => $siteurl.'pay/return/'.TRADE_NO.'/',
/*
'sd_cashier_type' => 'H5',
"func_code_list" => [
"01010002", // 云函数H5(微信小程序
"01020002" // 支付宝生活号H5(支付宝)
],
*/
];
有需要开发易支付杉德支付插件的朋友,可以联系我QQ:804752009

售前咨询专员