易支付四方支付系統對接杉德(河馬)支付接口
二次開發
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

售前咨詢專員