余额充值

接入 Ping++ 发起余额充值,服务器端需要做的就是向 Ping++ 请求 Recharge 对象,然后返回给客户端,并且监听和获取 Webhooks 通知,具体步骤如下:

  1. 设置 API-Key
  2. SDK 验证签名设置
  3. 从服务端发起支付请求,获取 Recharge 对象
  4. 将获得的 Recharge 对象传给 Client
  5. 接收 Webhooks 通知
  6. 验证 Webhooks 签名

第一步:设置 API-Key

Ping++ API 交易时需要设置 API-Key,Server SDK 提供了设置的方法。如果你直接使用 API ,需要在 header 中加入 Authorization,格式是 Authorization: Bearer API-Key。

\Pingpp\Pingpp::setApiKey('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
var pingpp = require('pingpp')('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
pingpp.api_key = 'sk_test_ibbTe5jLGCi5rzfH4OqPW9KC'
Pingpp.api_key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
pingpp.Key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
Pingpp.Pingpp.SetApiKey("sk_test_ibbTe5jLGCi5rzfH4OqPW9KC");

第二步:SDK 验证签名设置

为了进一步增强交易请求的安全性,Ping++ 交易接口针对所有的 POST 和 PUT 请求已经新增 RSA 加密验签功能。该接口必须使用该签名验证功能,你需要生成密钥,然后将私钥配置到你的代码中,公钥上传至 Ping++ 管理平台并启用验签开关。首先你需要本地生成 RSA 公钥和私钥,生成方法请参考:如何获取 RSA 公钥和私钥?

设置请求签名密钥

你需要在代码中设置请求签名的私钥(rsa_private_key.pem),可以读取配置私钥文件的路径或者直接定义变量。你如果通过 API 接口校验的话,需要生成 RSA 签名(SHA256)并在请求头中添加 Pingplusplus-Signature,如果使用 SDK 的话只需要配置私钥即可。

\Pingpp\Pingpp::setPrivateKeyPath(__DIR__ . '/your_rsa_private_key.pem');
Pingpp.privateKeyPath = "/path/to/your_rsa_private_key.pem";
pingpp.setPrivateKeyPath(__dirname + "/your_rsa_private_key.pem");
pingpp.private_key_path = 'your_rsa_private_key.pem'
Pingpp.private_key_path = File.dirname(__FILE__) + '/your_rsa_private_key.pem'
privateKey, err := ioutil.ReadFile("your_rsa_private_key.pem")
Pingpp.Pingpp.SetPrivateKeyPath(@"../../your_rsa_private_key.pem");

上传公钥至 Ping++ 管理平台

设置完代码中的私钥,你需要将已经生成的公钥(rsa_public_key.pem)填写到 Ping++ 管理平台上。 配置路径: 登录 Ping++ 管理平台->点击右上角公司名称->企业面板->开发参数->商户 RSA 公钥->将你的公钥复制粘贴进去并且保存->先启用 Test 模式进行测试->测试通过后启用 Live 模式

rsa_keys_setting

注意: 一旦上传公钥至 Ping++ 管理平台并启用 Live 模式,则验证签名功能即时生效,Ping++ 会立即验证你的真实线上交易验签请求。如果私钥为空或错误,则会交易失败,所以请确保测试模式正常后再启用 Live 开关。

第三步:从服务端发起充值请求,获取充值支付凭据

调用 Ping++ Server SDK 发起充值请求,发起请求所需参数具体可参考 API 文档,不同的渠道只需要切换 channel以及对应的 extra 参数即可。

alipay
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'alipay',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "alipay"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'alipay';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "alipay",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "alipay", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "alipay",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "alipay"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
alipay_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'alipay_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
'success_url' => 'http://example.com/success',
'cancel_url' => 'http://example.com/cancel']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "alipay_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("success_url", "http://www.pingxx.com");
extra.put("cancel_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'alipay_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "alipay_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"success_url"='http://example.com/success',
"cancel_url"='http://example.com/cancel'}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "alipay_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:success_url => "http://example.com/success",
:cancel_url => "http://example.com/cancel"}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
extra["cancel_url"] = "http://example.com/cancel"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "alipay_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "alipay_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"success_url", "http://example.com/success"},
{"cancel_url":"http://example.com/cancel"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
alipay_lite
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'alipay_lite',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
'buyer_user_id' => '208870267336****']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "alipay_lite"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("buyer_user_id", "208870267336****");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'alipay_lite';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "alipay_lite",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"buyer_user_id"='208870267336****'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "alipay_lite", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
: buyer_user_id => "208870267336****"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "alipay_lite",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "alipay_lite"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"buyer_user_id", "208870267336****"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
alipay_pc_direct
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'alipay_pc_direct',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
'success_url' => 'http://example.com/success']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "alipay_pc_direct"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("success_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'alipay_pc_direct';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "alipay_pc_direct",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"success_url"='http://example.com/success'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "alipay_pc_direct", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:success_url => "http://example.com/success"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "alipay_pc_direct",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "alipay_pc_direct"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"success_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
bfb_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'bfb_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'http://example.com/success'],
'bfb_login' => 'false']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "bfb_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "http://www.pingxx.com");
extra.put("bfb_login", "false");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'bfb_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "bfb_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='http://example.com/success',
"bfb_login"='false'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "bfb_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "http://example.com/success",
: bfb_login => "false"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "bfb_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "bfb_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "http://example.com/success"},
{"bfb_login", "false"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
upacp
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'upacp',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "upacp"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'upacp';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "upacp",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "upacp", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "upacp",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "upacp"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
upacp_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'upacp_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'http://example.com/success']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "upacp_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'upacp_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "upacp_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='http://example.com/success'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "upacp_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "http://example.com/success"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "upacp_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "upacp_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
upacp_qr
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'upacp_qr',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'http://example.com/success']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "upacp_qr"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'upacp_qr';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "upacp_qr",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='http://example.com/success'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "upacp_qr", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "http://example.com/success"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "upacp_qr",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "upacp_qr"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
upacp_pc
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'upacp_pc',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'http://example.com/success']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "upacp_pc"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'upacp_pc';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "upacp_pc",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='http://example.com/success'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "upacp_pc", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "http://example.com/success"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "upacp_pc",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "upacp_pc"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
cp_b2b
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'cp_b2b',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "cp_b2b"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'cp_b2b';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "cp_b2b",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "cp_b2b", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "cp_b2b",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "cp_b2b"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
upacp_b2b
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'upacp_b2b',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'http://example.com/success']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "upacp_b2b"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "http://www.pingxx.com");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'upacp_b2b';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "upacp_b2b",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='http://example.com/success'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "upacp_b2b", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "http://example.com/success"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/success"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "upacp_b2b",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "upacp_b2b"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
wx
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'wx',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "wx"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'wx';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "wx",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "wx", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "wx",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "wx"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
wx_pub
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'wx_pub',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'open_id' => 'User OpenId']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "wx_pub"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("open_id", "User OpenId");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'wx_pub';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "wx_pub",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"open_id"='User OpenId'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "wx_pub", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:open_id => "User OpenId"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["open_id"] = "User OpenId"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "wx_pub",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "wx_pub"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"open_id", "User OpenId"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
wx_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'wx_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "wx_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'wx_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "wx_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "wx_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "wx_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "wx_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
yeepay_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'yeepay_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'product_category' => '1',
'identity_id'=> 'Your identity_id',
'identity_type' => 1,
'terminal_type' => 1,
'terminal_id'=>'Your terminal_id',
'user_ua'=>'Your user_ua',
'result_url'=>'http://example.com/result']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "yeepay_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("product_category", "1");
extra.put("identity_id", "Your identity_id");
extra.put("identity_type", 1);
extra.put("terminal_type", 1);
extra.put("terminal_id", "Your terminal_id");
extra.put("user_ua", "Your user_ua");
extra.put("result_url", "http://example.com/result");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'yeepay_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "yeepay_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"product_category"='1',
"identity_id"='Your identity_id',
"identity_type"=1,
"terminal_type"=1,
"terminal_id"='Your terminal_id',
"user_ua"='Your user_ua',
"result_url"='http://example.com/result'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "yeepay_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:product_category => "1",
:identity_id => "Your identity_id",
:identity_type => 1,
:terminal_type => 1,
:terminal_id => "Your terminal_id",
:user_ua => "Your user_ua",
:result_url => "http://example.com/result"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["product_category"] = "1"
extra["identity_id"] = "Your identity_id"
extra["identity_type"] = 1
extra["terminal_type"] = 1
extra["terminal_id"] = "Your terminal_id"
extra["user_ua"] = "Your user_ua"
extra["result_url"] = "http://example.com/result"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "yeepay_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "yeepay_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"product_category", 1},
{"identity_id", "Your identity_id"},
{"identity_type" , 1},
{"terminal_type" , 1},
{"terminal_id","Your terminal_id"},
{"user_ua","Your user_ua"},
{"result_url", "http://example.com/success"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
jdpay_wap
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'jdpay_wap',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'success_url' => 'http://example.com/success',
'fail_url'=> 'http://example.com/fail',
'token' => 'Your Token',
'is_mobile' => false,
'order_type' => '1']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "jdpay_wap"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("success_url", "http://example.com/success");
extra.put("fail_url", "http://example.com/fail");
extra.put("token", "Your Token");
extra.put("is_mobile",false);
extra.put("order_type", "1");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'jdpay_wap';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "jdpay_wap",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"success_url"='http://example.com/success',
"fail_url"='http://example.com/fail',
"token"='Your Token',
"is_mobile"=false,
"order_type"='1'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "jdpay_wap", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:success_url => "http://example.com/success",
:fail_url => "http://example.com/fail",
:token => "Your Token"
:is_mobile => false,
:order_type => "1"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
extra["fail_url"] = "http://example.com/fail"
extra["token"] = "Your Token"
extra["is_mobile"] = false
extra["order_type"] = "1"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "jdpay_wap",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "jdpay_wap"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"success_url", "http://example.com/success"},
{"fail_url": "http://example.com/fail"},
{"token": "Your Token"},
{"is_mobile": false},
{"order_type":"1"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
applepay_upacp
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'applepay_upacp',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [],
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "applepay_upacp"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'applepay_upacp';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "applepay_upacp",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "applepay_upacp", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {} # 根据渠道填入参数 https://www.pingxx.com/api#支付渠道-extra-参数说明
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "applepay_upacp",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "applepay_upacp"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{ }},
}}
};
var recharge = Recharge.Create(appId, createParams);
cmb_wallet
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'cmb_wallet',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'https://example.com/result',
'p_no'=> '2016062901',
'seq'=>'2016062901',
'm_uid'=>'2016062901',
'mobile'=>'18512343456']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "cmb_wallet"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "https://example.com/result");
extra.put("p_no", "2016062901");
extra.put("seq", "2016062901");
extra.put("m_uid", "2016062901");
extra.put("mobile", "18512343456");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'cmb_wallet';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "cmb_wallet",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='https://example.com/result',
"p_no"='2016062901',
"seq"="2016062901",
"m_uid"="2016062901",
"mobile"="18512343456"
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "cmb_wallet", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "https://example.com/result",
:p_no => "2016062901",
:seq => "2016062901",
:m_uid => "2016062901",
:mobile => "18512343456"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "https://example.com/result"
extra["p_no"] = "2016062901"
extra["seq"] = "2016062901"
extra["m_uid"] = "2016062901"
extra["mobile"] = "18512343456"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "cmb_wallet",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "cmb_wallet"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "https://example.com/result"},
{"p_no": "2016062901"},
{"seq": "2016062901"},
{"m_uid": "2016062901"},
{"mobile": "18512343456"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
cmb_pc_qr
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'cmb_pc_qr',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'result_url' => 'https://example.com/result',
'p_no'=> '2016062901',
'seq'=>'2016062901',
'm_uid'=>'2016062901',
'mobile'=>'18512343456']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "cmb_pc_qr"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("result_url", "https://example.com/result");
extra.put("p_no", "2016062901");
extra.put("seq", "2016062901");
extra.put("m_uid", "2016062901");
extra.put("mobile", "18512343456");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'cmb_pc_qr';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "cmb_pc_qr",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"result_url"='https://example.com/result',
"p_no"='2016062901',
"seq"="2016062901",
"m_uid"="2016062901",
"mobile"="18512343456"
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "cmb_pc_qr", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
:result_url => "https://example.com/result",
:p_no => "2016062901",
:seq => "2016062901",
:m_uid => "2016062901",
:mobile => "18512343456"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["result_url"] = "https://example.com/result"
extra["p_no"] = "2016062901"
extra["seq"] = "2016062901"
extra["m_uid"] = "2016062901"
extra["mobile"] = "18512343456"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "cmb_pc_qr",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "cmb_pc_qr"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"result_url", "https://example.com/result"},
{"p_no": "2016062901"},
{"seq": "2016062901"},
{"m_uid": "2016062901"},
{"mobile": "18512343456"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
qpay
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'qpay',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'device' => 'ios']
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "qpay"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("device", "ios");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'qpay';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "qpay",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"device" ='ios'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "qpay", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
: qpay => "ios"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["device"] = "ios"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "qpay",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "qpay"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"device", "ios"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
qpay_pub
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'qpay_pub',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'attach' => 'Ping++ 分店',
'limit_pay' => 'no_balance',
'promotion_tag' => 'evel_tag=xxx&sale_tag=xxx',
'device_info' => '13467007045764'
]
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "qpay_pub"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("attach", "Ping++ 分店");
extra.put("limit_pay", "no_balance");
extra.put("promotion_tag", "level_tag=xxx&sale_tag=xxx");
extra.put("device_info", "13467007045764");
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'qpay_pub';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "qpay_pub",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
"attach" ='Ping++ 分店',
"limit_pay" ='no_balance',
"promotion_tag" ='level_tag=xxx&sale_tag=xxx',
"device_info" ='13467007045764'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "qpay_pub", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
: attach => "Ping++ 分店",
: limit_pay => "no_balance",
: promotion_tag => "level_tag=xxx&sale_tag=xxx",
: device_info => "13467007045764"
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["device"] = "ios"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "qpay_pub",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "qpay_pub"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"attach", "Ping++ 分店"},
{"limit_pay", "no_balance"},
{"promotion_tag", "level_tag=xxx&sale_tag=xxx"},
{"device_info", "13467007045764"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
ccb_pay
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'ccb_pay',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'pos_id' => '025547632',
'remark' => 'test')
]
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "ccb_pay"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("pos_id", "025547632");
extra.put("remark", "test",);
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'ccb_pay';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "ccb_pay",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
pos_id ='025547632', remark ='test'
}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "ccb_pay", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
: pos_id => '025547632',
: remark => 'test'
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["device"] = "ios"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "ccb_pay",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "ccb_pay"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"pos_id", "025547632"},
{"remark": "test"}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);
ccb_qr
\Pingpp\Recharge::create([
'user' => 'user_test_01',
'charge' => [
'amount' => 100,
'channel' => 'ccb_qr',
'order_no' => substr(md5(time()), 0, 10),
'subject' => 'Your subject',
'body' => 'Your recharge body',
'time_expire' => time()+ 3600,
'client_ip' => '127.0.0.1',
'extra' => [
'pos_id' => '025547632',
'remark' => 'test',
'return_type' => 1)
]
],
'balance_bonus' => [
'amount' => 10,
],
'from_user' => 'user_test_01',
'description' => 'Your description',
'metadata' => [],
]);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> params = new HashMap<>();
params.put("user", "user_test_02"); // 充值目标用户 ID, 必传
params.put("user_fee", 10); // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
params.put("description", "Recharge description."); // 描述, 可选
Map<String, Object> charge = new HashMap<>();
charge.put("amount", 100); // 用户实际支付金额,单位分, 必传
charge.put("channel", "ccb_qr"); // 支付使用的第三方支付渠道, 必传
charge.put("order_no", "2017" + System.currentTimeMillis()); // 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
charge.put("client_ip", "127.0.0.1"); // 客户端的 IP,IPv4,默认 127.0.0.1, 可选
charge.put("subject", "Recharge subject"); // 充值标题,该参数最长为 32 个 Unicode 字符, 必传
charge.put("body", "Recharge body"); // 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
Map<String, Object> extra = new HashMap<>(); // extra: 根据不同渠道传入相应的参数
extra.put("pos_id", "025547632");
extra.put("remark", "test",);
extra.put("return_type", 1,);
charge.put("extra", extra);
params.put("charge", charge);
Recharge obj = Recharge.create(params); // 创建 recharge 方法
var charge_extra = require('../charge_extra');
var order_no = new Date().getTime().toString().substr(0, 10);
var channel = 'ccb_qr';
var extra = charge_extra(channel);
var params = {
'user': 'user_test_02',// 充值目标用户 ID, 必传
'user_fee': 10,// 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。可选
'description': 'Recharge description.',// 描述, 可选
'charge': {
'amount': 30,// 用户实际支付金额,单位分, 必传
'channel': channel,// 支付使用的第三方支付渠道, 必传
'order_no': order_no,// 商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一, 必传
'client_ip': '127.0.0.1',// 客户端的 IP,IPv4,默认 127.0.0.1, 可选
'subject': 'Recharge subject',// 充值标题,该参数最长为 32 个 Unicode 字符, 必传
'body': 'Recharge body',// 充值描述信息,该参数最长为 128 个 Unicode 字符, 必传
'extra': extra // extra: 根据不同渠道传入相应的参数
}
};
pingpp.recharge.create(APP_ID, params, function(err, recharge) {
if (err != null) {
console.log('pingpp.recharge.create fail:', err)
}
// YOUR CODE
});
params = {
"user": "user_test_01",
"charge": {
"amount": 100,
"channel": "ccb_qr",
"order_no": str(int(random.uniform(100000000, 200000000))),
"subject": "Your subject",
"body": "Your body",
"time_expire": int(time.time()) + 3600,
"client_ip": "127.0.0.1",
"extra": {
pos_id ='025547632', remark ='test',return_type = 1}
},
# "user_fee": 0,
"balance_bonus": {
"amount": 100,
},
"from_user": "user_test_02",
"description": "Your description",
"metadata": {}
}
recharge = pingpp.Recharge.create(**params)
params = {
:user => get_user_id,
:charge => {
:order_no => order_no,
:channel => "ccb_qr", # 支付渠道
:client_ip => "127.0.0.1", # 发起支付请求客户端的 IP 地址,格式为 IPV4,如: 127.0.0.1
:amount => 100, # 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:body => "Your Body",
:subject => "You Subject",
:extra => {
: pos_id => '025547632',
: remark => 'test',
: return_type => 1
}
},
:description => "充值描述"
}
o = Pingpp::Recharge.create(
params,
{ :app => get_app_id } # App 信息
)
extra := make(map[string]interface{})
extra["device"] = "ios"
rechargeParams := &pingpp.RechargeParams{
User: "1477895856250",
Charge: pingpp.RechargeCharge{
Amount: 10,
Channel: "ccb_qr",
OrderNo: fmt.Sprintf("%d", orderno),
Subject: "Go SDK Subject",
Body: "Go SDK Body",
Extra: extra,
},
BalanceBonus: pingpp.RechargeBonus{
Amount: 1,
},
Description: "Go SDK Description",
}
return recharge.New(c.demoAppID, rechargeParams)
var createParams = new Dictionary<string, object>
{
{"user", "user_test_01"}, //充值目标用户 ID。
//{"user_fee", 0}, // 用户充值收取的手续费,单位分,不得大于 amount,不可和 balance_bonus[amount] 同时传,默认 0。
{"description", "Your Recharge description"}, //描述。
{"metadata", new Dictionary<string,object>{}},
{"balance_bonus", new Dictionary<string,object>{
{"amount",100} //充值额外赠送的余额,单位分,不可和 user_fee 同时传,默认 0。
}},
{"charge", new Dictionary<string,object>{
{"amount", 100}, //用户实际支付金额,单位分。
{"channel", "ccb_qr"}, //支付使用的第三方支付渠道。
{"order_no", new Random().Next(1, 999999999).ToString()}, //商户订单号,适配每个渠道对此参数的要求,必须在商户系统内唯一。
{"subject", "Your subject"}, //充值标题,该参数最长为 32 个 Unicode 字符。
{"body", "Your body"}, //充值描述信息,该参数最长为 128 个 Unicode 字符,yeepay_wap 对于该参数长度限制为 100 个 Unicode 字符。
{"time_expire", "1502766839"}, //支付失效时间,用 Unix 时间戳表示。时间范围在支付创建后的 5 分钟到 1 天,默认为 1 天,创建时间以 Ping++ 服务器时间为准。 微信对该参数的有效值限制为 2 小时内;银联对该参数的有效值限制为 1 小时内。
{"client_ip", "127.0.0.1"}, //客户端的 IP,IPv4,默认 127.0.0.1。
{"extra", new Dictionary<string,object>{
{"pos_id", "025547632"},
{"remark": "test"},
{"return_type":1}
}},
}}
};
var recharge = Recharge.Create(appId, createParams);

Ping++ 收到充值请求后返回给你的服务器一个 recharge 对象,我们称这个 recharge 对象为支付凭据。下面是支付凭据的一个示例:

alipay
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 1000,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_SejbHOrzbjvPunjHmD08SCi9",
"object": "charge",
"created": 1496740128,
"livemode": false,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay",
"order_no": "20170711102300167",
"client_ip": "127.0.0.1",
"amount": 1000,
"amount_settle": 1000,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1496826528,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_SejbHOrzbjvPunjHmD08SCi9/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"alipay": {
"orderInfo": "service=\"mobile.securitypay.pay\"&_input_charset=\"utf-8\"&notify_url=\"https%3A%2F%2Fapi.pingxx.com%2Fnotify%2Fcharges%2Fch_a5OinLGyzzjLXPSOy9rPKKiL\"&partner=\"2008010319263982\"&out_trade_no=\"123456789\"&subject=\"Your Subject\"&body=\"Your Body\"&total_fee=\"0.10\"&payment_type=\"1\"&seller_id=\"2088020116983982\"&it_b_pay=\"2016-03-18 11:43:41\"&sign=\"ODRJPReSwsH8om5fGTqvhia9453k4eUaaGMJTLMTnEYbBuceMyTathvKtdnUpsP6Q5%2F5jcEV887EdtBWi4tuMFHPQmm4dz1nG6b4Blafi6v2tvKaf8b0RiQTOycU4SxigugKoyfeR6E4AGA6uIzWUBRpkq%2BZf65eqT0qe712BJ0%3D\"&sign_type=\"RSA\""
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
alipay_wap
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_9O44yLSy98iDjLaPmD1S48qT",
"object": "charge",
"created": 1458186436,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"success_url": "http://example.com/success",
"cancel_url": "http://example.com/cancel"
},
"time_paid": null,
"time_expire": 1458272836,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_9O44yLSy98iDjLaPmD1S48qT/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"alipay_wap": {
"_input_charset": "utf-8",
"format": "xml",
"partner": "2098711316033982",
"req_data": "<auth_and_execute_req><request_token>20160317a4d74946da79c647f0c67ca9f5c17f71</request_token></auth_and_execute_req>",
"sec_id": "0001",
"service": "alipay.wap.auth.authAndExecute",
"v": "2.0",
"sign": "LSctKFOSV5tYcfAAwiuEhY/W13jKn3IY956vvrI4WZFNPz8TmOROeSBnryAnVOHIAG26SgTqQHj7mdMSvwhZyFTnYBKgPGHflRbxSC6IoxjTigJthGMguaxLTAtgRomuFF2BLqDR26dPDxf6LB+9q7N+Pa5kC5K/i7yv5b6YZ38="
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
alipay_lite
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 10,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 5,
"charge": {
"id": "ch_5OSeD8abzLiDufXj989GWfzD",
"object": "charge",
"created": 1542785719,
"livemode": false,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_lite",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 10,
"amount_settle": 10,
"currency": "cny",
"subject": "测试订单-123456789",
"body": "订单内容-123456789",
"extra": {
"buyer_user_id": "20887026733***"
},
"time_paid": null,
"time_expire": 1542872119,
"time_settle": null,
"transaction_no": "201811210243951322858400****",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_5OSeD8abzLiDufXj989GWfzD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"alipay_lite": "201811210243951322858400****"
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
alipay_pc_direct
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_CqPS8SbTyLSOur1uTSn9W9aP",
"object": "charge",
"created": 1458186553,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_pc_direct",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"success_url": "http://example.com/success"
},
"time_paid": null,
"time_expire": 1458272953,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_CqPS8SbTyLSOur1uTSn9W9aP/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"alipay_pc_direct": {
"service": "create_direct_pay_by_user",
"_input_charset": "utf-8",
"return_url": "http://example.com/success",
"notify_url": "https://api.pingxx.com/notify/charges/ch_CqPS8SbTyLSOur1uTSn9W9aP",
"partner": "2098021316900282",
"out_trade_no": "123456789",
"subject": "Your Subject",
"body": "Your Body",
"total_fee": "0.10",
"payment_type": 1,
"seller_id": "2088718916998982",
"it_b_pay": "1d",
"sign": "JwXwOCkFnrQgEXOShwSek7Fu4dzXFCN/ihwOraPFoJ1vhNbhnUHm6SSwYZ+uYFyEiv7LvJLASqknQn9y+TaD4XgE6CAg7ez0MncLy1T5eqTHl+EqTgszMATcFVwAxRu4HOmtTujLL3XqOxdc4LQmnVr2nMsmV0WjE7v73Cu+8vs=",
"sign_type": "RSA"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
bfb_wap
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_GSGGqTvXbLOKvr5CuDHiPKy5",
"object": "charge",
"created": 1458189944,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "bfb_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"bfb_login": false,
"result_url": "http://example.com/result"
},
"time_paid": null,
"time_expire": 1458276344,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_GSGGqTvXbLOKvr5CuDHiPKy5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"bfb_wap": {
"service_code": "1",
"sp_no": "1500308806",
"order_create_time": "20160317124544",
"order_no": "123456789",
"goods_name": "Your%20Subject",
"goods_desc": "Your%20Body",
"total_amount": 100,
"currency": "1",
"return_url": "https://api.pingxx.com/notify/charges/ch_GSGGqTvXbLOKvr5CuDHiPKy5",
"pay_type": "2",
"input_charset": "1",
"version": "2",
"sign_method": "1",
"extra": "ch_GSGGqTvXbLOKvr5CuDHiPKy5",
"page_url": "http://example.com/result",
"expire_time": "20160318124544",
"sign": "908f79e86e5be16c39a0e8cc7151ba72",
"url": "https://www.baifubao.com/api/0/pay/0/wapdirect/0"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
upacp
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_WzPaT8HKSyP89eLaH80mD440",
"object": "charge",
"created": 1458187740,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458191340,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_WzPaT8HKSyP89eLaH80mD440/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"upacp": {
"tn": "201603171209000472078",
"mode": "00"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
upacp_wap
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_mXfH40mL8OW9q1Ka9KW9eHSS",
"object": "charge",
"created": 1458187947,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "http://example.com/result"
},
"time_paid": null,
"time_expire": 1458191547,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_mXfH40mL8OW9q1Ka9KW9eHSS/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"upacp_wap": {
"accessType": "0",
"backUrl": "https://api.pingxx.com/notify/charges/ch_mXfH40mL8OW9q1Ka9KW9eHSS",
"bizType": "000000",
"certId": "69358489754",
"channelType": "08",
"currencyCode": "156",
"customerIp": "127.0.0.1",
"encoding": "UTF-8",
"frontUrl": "http://example.com/result",
"merId": "802310048993438",
"orderDesc": "Your Subject",
"orderId": "123456789",
"payTimeout": "20160317131227",
"reqReserved": "ch_mXfH40mL8OW9q1Ka9KW9eHSS",
"signMethod": "01",
"txnAmt": "10",
"txnSubType": "01",
"txnTime": "20160317121227",
"txnType": "01",
"version": "5.0.0",
"signature": "J4ruMZQ5FNcVBECN1foTW2qSTot6vYCaogpZm78eXAr8tOeupBevfjlapLDhv5WagdeFzobQAXBG8kjr6mh4rI4TqAkG1MHIDuNxNrh04jnBwSBzPfTVGRWSlfllv3M5+dfjtsFO5mP2nAoyjVRuYHqkX8YFeZ+bsTHL+H72RAA4WurKN1VAGH+icBzmjASzEa7nRKU/8kzScAdE6Muhm6g4zRD38cmC/gS8FF1d2+C2OemhSdGRDKCyHb36zlVO9TYiq6zMldBOmuBSHSrYhnCQugM+cdnM5yjvYiLWgRdkoIj8RrFHcJBqFsOCxlxarAixl6jKrEc5Ebdny0P8Pw=="
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
upacp_qr
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1539237945,
"livemode": false,
"amount": 1,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 0,
"charge": {
"id": "ch_Ce1q1CDSaPaTz9efP0afH4aH",
"object": "charge",
"created": 1539237945,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_qr",
"order_no": "201801009425",
"client_ip": "180.168.5.158",
"amount": 1,
"amount_settle": -9,
"currency": "cny",
"subject": "简米测试订单478",
"body": "订单内容",
"extra": {
"result_url": "https://www.pingxx.com"
},
"time_paid": null,
"time_expire": 1539324345,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_Ce1q1CDSaPaTz9efP0afH4aH/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"upacp_qr": "https://qr.95516.com/00010001/62262xxx"
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
upacp_pc
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_1q5OiHifXDq1nbvjnPz5mjTO",
"object": "charge",
"created": 1458190084,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_pc",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "http://example.com/result"
},
"time_paid": null,
"time_expire": 1458276484,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_1q5OiHifXDq1nbvjnPz5mjTO/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"upacp_pc": {
"accessType": "0",
"backUrl": "https://api.pingxx.com/notify/charges/ch_1q5OiHifXDq1nbvjnPz5mjTO",
"bizType": "000000",
"certId": "69566866070",
"channelType": "07",
"currencyCode": "156",
"customerIp": "127.0.0.1",
"encoding": "UTF-8",
"frontUrl": "http://example.com/result",
"merId": "802310048093617",
"orderDesc": "Your Subject",
"orderId": "123456789",
"payTimeout": "20160318124804",
"reqReserved": "ch_1q5OiHifXDq1nbvjnPz5mjTO",
"signMethod": "01",
"txnAmt": "10",
"txnSubType": "01",
"txnTime": "20160317124804",
"txnType": "01",
"version": "5.0.0",
"signature": "TCR83uPga+8ryD1xj5sEjOnEBSnhft7m4HXjQ8HdM4Siq/uRR9vSwG1zbAvU4MewOv/6Z5f0WR2U4WBmdvHDAzD863ONzRtrfEE2BUxBJYtdsIQ4uRfIL2SBELO8fENSLFGOk2e9IK+tYmEHO6dDzK8/mo6moAA/lcTzPmeR15zQiyEbNSYShxlXXpQmHZmLTjpdhEwpbFJF4tihGcwmeTLdV3maRpxo5F7+ahDkyBYgasG0f+pU/52HwhPDcyaZuOmn8CaDC/h/hHpXiOjtdz4yFGRZhqVRF849A4o8tBFtnQW6J5zYpSzTHgujlPaizTsNyLSoWZIRM2S+Tr7iYA=="
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
cp_b2b
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_WfvDmDyXjn5Gi9aTCOzjXPG4",
"object": "charge",
"created": 1458190411,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cp_b2b",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458276811,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_WfvDmDyXjn5Gi9aTCOzjXPG4/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cp_b2b": {
"Version": "20140728",
"MerId": "481611512088091",
"MerOrderNo": "123456789",
"TranDate": "20160317",
"TranTime": "125331",
"OrderAmt": 10,
"BusiType": "0001",
"MerBgUrl": "https://api.pingxx.com/notify/charges/ch_WfvDmDyXjn5Gi9aTCOzjXPG4",
"Signature": "H7eU9gLxln0l9kWDpUhhCT6BtMa4PQwNbKEE3WnekUrDJAsu1b7B9hSZHLI7XABziox0aJ+ldAxRr/7dv7DfJPnKiZzMasST8lYoNi5bHSyTv8nJ3OxQhZesSSqGUiWBCt7yDNPGeDsp02Jx0drsgfsyrPGxB2sG6yiXeH97Qyk="
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
upacp_b2b
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_mXfH40mL8OW9q1Ka9KW9eHSS",
"object": "charge",
"created": 1458187947,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "http://example.com/result"
},
"time_paid": null,
"time_expire": 1458191547,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_mXfH40mL8OW9q1Ka9KW9eHSS/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"upacp_b2b": {
"version": "5.1.0",
"encoding": "utf-8",
"bizType": "000202",
"txnTime": "20180613170543",
"backUrl": "http://218.244.151.190/notify/charges/ch_Xf1yL8nXnL4SbbHarPCSevnH",
"frontUrl": "https://www.example.com",
"currencyCode": "156",
"txnAmt": 100,
"txnType": "01",
"txnSubType": "01",
"accessType": "0",
"signMethod": "01",
"channelType": "07",
"merId": "777290058110048",
"orderId": "149572338024362",
"orderDesc": "Your Subject",
"certId": "68759663125",
"customerIp": "127.0.0.1",
"reqReserved": "ch_Xf1yL8nXnL4SbbHarPCSevnH",
"payTimeout": "20180614170543",
"signature": "GgCs2wrX0InHJGbqxWncB/qhrTcIZbtw/HVVZTjlU6MIa42zrRenxlZjCeF8wheBnIMDM/Gv3n7b+XUuKmE496cnIoXTcz/xsElAi1+f2BY/j1aTNY2GBa7F+kUhC0VdZCVJvDOvXbu5C8LnBX9HEaZou+Dtkidxm2uoIi71AfBRS1IQFYROiXrAOYqvqbR0tDc1cnpssl/aHQn8jsX6P1M/aQOfd4/RdD/Yqcd/g98yF2gzW6olCEdmr7tmS8WbGM3kDCZWhWMLlpFlCqkZ9aHhK8y2dX7nBQxhRHFQLvY/87ITFAk6Yo5UD5pgdpFcXiC0xHRWobbVGq5tOZekJw==",
"channel_url": "https://gateway.test.95516.com/gateway/api/frontTransReq.do"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
wx
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_a1aX1CzDmnz1jDCu5OGWfzfT",
"object": "charge",
"created": 1458186916,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458194116,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a1aX1CzDmnz1jDCu5OGWfzfT/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"wx": {
"appId": "wx3eua2486c6tcb2b6",
"partnerId": "1256019001",
"prepayId": "wx20160017195617e5ce0352b40504808939",
"nonceStr": "bb3cc8d0d56ebf2cfcfeb20c2303759e",
"timeStamp": 1458186917,
"packageValue": "Sign=WXPay",
"sign": "T8B4077A04491C1DBE15G446BED4B570"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
wx_pub
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_zXnfHGDOurL4LubPa15CeXf5",
"object": "charge",
"created": 1458187589,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_pub",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"open_id": "o9zpMs7Xk7e9aJbTXgufovuWGp8c"
},
"time_paid": null,
"time_expire": 1458194789,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_zXnfHGDOurL4LubPa15CeXf5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"wx_pub": {
"appId": "wx95dt8698h12152c7",
"timeStamp": "1458187589",
"nonceStr": "723d051e687d5ad68e0d53717024e951",
"package": "prepay_id=wx20167317120629437b16dede0665849747",
"signType": "MD5",
"paySign": "64C91296E3A9F1C50E3343B5717E636E"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
yeepay_wap
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_4e5qnLajLufL48eTmLKKGOS0",
"object": "charge",
"created": 1458189596,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "yeepay_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"product_category": 1,
"identity_id": "kBjVoNLgXIBHlJxaAJIPuUvIUGivLkgFPhIONksqKPCmHlTotN",
"identity_type": 1,
"terminal_type": 1,
"terminal_id": "gSvFOVTHTIJOwFMWvmka",
"user_ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:36.0) Gecko/20100101 Firefox/36.0",
"result_url": "http://example.com/result"
},
"time_paid": null,
"time_expire": 1458275996,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_4e5qnLajLufL48eTmLKKGOS0/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"yeepay_wap": {
"merchantaccount": "10012456009",
"encryptkey": "DNWDtBcCUtdpo+OthaxUkS7/qpxeAYEerEVYL2kI+dkMGYztlyvmvEFbkBxiq/h9TBnQxnRGu4UdODRjJmktT6NNWwIOWU5pLDcu7TsRTJMfvJH1o3425S86gLs28jl3+gqzQ6igyU2dIfQaX6NwtWX1OWLPP/ALcT3ydbIuPAU=",
"data": "hcacFk+TeY1uyUwi+8THY1LTZqS0pP2HMcf2gDE8sdeMsdy3hNc7ilrlDdgv3nqVi8QDSdE2C6nXNk8yvKex5Uz77lNH9uOJaIELRQzrfo0EpD/r3Go+2Qr3m8eHxD8xq05ZFhBbE3vms9qszScTi8UjVBeiyTNxXpT5I8NDm4mJxCPDwyjGkYyUgYdfvpvHt9VA5ShcmKuqZCnF7SZ4PcYezwYvdP6HqBE4is/KQqqME3q+sTpiPc1kFb2QMvKg2JLatTgvaB1QIZzR1UZCcgPc1vUA1gtxzSiWgu2/2Sm+wvWS6VzOX7mG33Ot74mj04SuDVU4jzXdtqJ7u7VG90p2PGYgX+blh4c511Dn39/VTi8zMQxkUVyUINsdHtJwtNPMJAMhPwCt6QAElZnAkpBjd7N8cKVE1GidSKJr1+b/wY7oo7rtV7syzgjAn8B1eDD27AD3OMP5ybGV4VTMtHy83p0hanGCE0H1UNdM8gcV+aLRc3+eHruIXX5ywAV9XQtuE/wdQ3+Tyi8hfgLO6IzaL/id4qGNsCOKmUsiZwk8MQsWHDtznMzEJ4A7RB7YeIO1NdJi9tJpFFEBVKgjyioCE6EVnJ18QuYp/4LXabxodoHwEs7WqUrF4jHaztdHij+Q3fPTp1T6wJE7oOmHSwhB7ACwxssuv634+sYH2wVnfWgq4R7JVp+q4g702psJyzBywmS8sQ0zeTmeoR4a1/SAzQJqhPE01cjy+CWVc9qtORfOABUF7PGjlA3FXKycJIIAK1TAOLuu5FYMgl5t9ATSOo/d1FZJswFYHE8PQutjAVF677u6+W4z/NX5BnTu52gTkN4JsMKCW5vk+TbdCqANy5VS8uNNqPjAtHwJSWfIuvQ+iETsUO+yEOzOPumRTdA9iOgTz4W1Eyb+rpSe+SuV3sMR3tgPqeVo5tCC3Fpi0bjywN6dM5kaJ+IH8+skrmslBKGIL9MwPM1V9+15kvAlm4xQIUCESdvIXFsASpxfTY/P4TwYu7Gvy0fyrjM9Ok0A5Q3V2uPXJoXaj4jP2nIgMOEzfK3E4v4qV0fw73w=",
"mode": "live"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
jdpay_wap
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_Hivjz9KKyTuHrb5aP81ejPCK",
"object": "charge",
"created": 1458189392,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "jdpay_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your body",
"extra": {
"success_url": "http://example.com/success",
"fail_url": "http://example.com/fail",
"token": "yGOKVwTPdCTvzobHmjeCySjzriZqEMIG",
"is_mobile": false,
"order_type": "1"
},
"time_paid": null,
"time_expire": 1458275792,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_Hivjz9KKyTuHrb5aP81ejPCK/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"jdpay_wap": {
"version": "V2.0",
"merchant": "22294512",
"tradeNum": "43b0e131b39889dae14975c9324ead11566cc29ba2719fdf",
"tradeName": "dc278f51509a1966a6b9814429t30d02350357dd77668fd85c8ab68f102d8b6898735c6e6e00db00",
"tradeDesc": "0043174e1ebbfd9da6b9804429e30d02d358065b49b273a801a5e003dbe3d644835159ecbe33797a5c6bb10d37a2093a405566af9891d357ed9611379c271e60f3faecc5491b6a5dc5566a77f671b010d80e90ec5c0ff09a83af6483de6a619968be9fd40a5d2f78ce4bc26bdce64fdbbe67e07b587c63a8c92534b7958ea811",
"tradeTime": "443c19l7a2d9ea88ffc26ca6cdacf533f846cc39ddd717e0",
"amount": "639bd998e3818709",
"orderType": "2e9e4c0049241b99",
"currency": "4eb4eba53ff53ee1",
"callbackUrl": "4308b99bf56a1070fe15eb4180b2ea829d2723679be69b3e5447e80d4535c1d8cc4bb09b027e4e54af6c0b09a3756091",
"notifyUrl": "25f901da8a8ec075e2304c0d2ba3ge079d2723679be69b3edad1c6d83077fcaf9ea43d0457b825581cc1bd630d9d89fb6ed1e4dc31b8ff88496e1c2ac468e7ceb56cb06fbee1d835",
"note": "bdec2f03d58e1b94b1bb45a9d84a33aa4ee4b289d260440f5c79483467285cc1c47448d3efc3f7cb1098d5967cc150597e37d49cdf062811ba6246af7702b9a971e923c7da2de903",
"expireTime": "e1394edcc9174d0fa2f22164468b6f0d",
"sign": "12kfGtzF4gYLuS/R3VxtZylWZkbHnyUpeygJrj5WUDL4Pt4VoIh+tDvmY3PgZrFbvHq4ZR6tWAzvskHD8cQk06G0/wibxWSL411Fyc4qmsLrQlEXQ0G/z0MX1SEZHPxg8G71LIqbEOT/QVp6HQpoMquesISvtR2rgHuUCYz3OUY=",
"channelUrl": "https://wepay.jd.com/jdpay/saveOrder"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
applepay_upacp
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_fLCuvDG4aPW94q10q5nXb9KC",
"object": "charge",
"created": 1458193512,
"livemode": false,
"paid": false,
"refunded": false,
"app": "app_LibTW1n1SOq9Pin1",
"channel": "applepay_upacp",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458197112,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_fLCuvDG4aPW94q10q5nXb9KC/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"applepay_upacp": {
"tn": "201603171345129563392",
"mode": "00",
"merchant_id": "Your app merchant id"
}
},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
cmb_wallet
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_8a1mvHGKq1y1GuHqDSHiD0S8",
"object": "charge",
"created": 1467169019,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cmb_wallet",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "https://example.com/result",
"p_no": "2016062901",
"seq": "2016062901",
"m_uid": "2016062901",
"mobile": "18512343456"
},
"time_paid": null,
"time_expire": 1467255419,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_8a1mvHGKq1y1GuHqDSHiD0S8/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cmb_wallet": {
"BranchID": "0011",
"CoNo": "002147",
"BillNo": "2016062901",
"Amount": "1.00",
"MerchantUrl": "https://api.pingxx.com/notify/charges/ch_8a1mvHGKq1y1GuHqDSHiD0S8",
"MerchantRetUrl": "https://example.com/result",
"Date": "20160629",
"MerchantCode": "|tuBbQcNPHmqrvPXyynSpv7noZiYgVr9TA1KOSjg/UkojROkBgTMO5e7z3COJoGTwWTbWkjcZExFQ5XILqK6FrojuUrrDJ8hYSD2zcLk09laLLRFt0DWmf4W1Lfa9cfZjDAH3cexgXXwpIckPoW9vdLIG10LufvgPTvIk0a9vShjyMDGvsIc*olXWM*FdAohRB8e5K777zjPJKrm6yuZTQKjDlafrGwQ1vbMtCs*z0nwVhXHCTLjk3mdZIIZyHDwPzrhSIlqG3H2nVdukUs9oC3wZ/EfZKWEly3NflJTUJDhaU*2gt2E/HzGQ4f*hhUh/oBYLZWrmmseGEt3GKrkBTDfOkMY/kNcIq2xQVeuQL4eT2lazTygeiZE1yEl5ZB9zh7pKqQOmzoGxIegpf3qWqOnmRXtI/WUqmlbpocSvN1YAUUBBZzbAyHkLUHEPXh96mMKLjDkG4AZ1pLtd3AmpZaIIsBJVkR0F/bLDjJ9ttP3VJshQ/S*fph5tGoUY2IwxWMFD4XFAeM5cPv3IeurTapRQTWnaHOcv9tHdpXgz09/z36sZBPIhVkTARJ*Ix14j5kWGDlfxyBVWHGH2pTX*wtIVCb5RkBdsa83p4QnW7RXuVMwVipJLC0beevaOJho5LThH/vlfKDZTuC*mwXNIWBHU6n42*D0q5J5Fmj9GKSMT2jPRcHMoPLv0T/o=|878102442b84173b6cf0d981cfc19f5a1d7412a2",
"ChannelUrl": "https://netpay.cmbchina.com/netpayment/BaseHttp.dll?PrePayEUserP"
}
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
cmb_pc_qr
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_8a1mvHGKq1y1GuHqDSHiD0S8",
"object": "charge",
"created": 1467169019,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cmb_pc_qr",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "https://www.pingxx.com",
"p_no": "10001",
"seq": "1",
"m_uid": "1",
"mobile": "13111111111",
"register_time": 1532334494,
"new_register": true,
"city_code": "200111",
"address_city": "200111",
"address_mobile": "13111111111",
"product_type": "1001"
},
"time_paid": null,
"time_expire": 1467255419,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_8a1mvHGKq1y1GuHqDSHiD0S8/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cmb_pc_qr": {
"charset": "UTF-8",
"jsonRequestData": "{\"version\":\"1.0\",\"charset\":\"UTF-8\",\"sign\":\"5f7f29fbe28ba1ece1e9e36f71e4ff514d6444aea8e494f523c24e23dbdb5288\",\"signType\":\"SHA-256\",\"reqData\":{\"dateTime\":\"20180724140902\",\"branchNo\":\"0021\",\"merchantNo\":\"000208\",\"date\":\"20180724\",\"orderNo\":\"912111532412543\",\"productDesc\":\"Pingxx测试订单1532412543\",\"amount\":\"110.00\",\"payNoticeUrl\":\"http://218.244.151.190/notify/charges/ch_KyLOOCb1mzrPXn5iH0r1SyXD\",\"payNoticePara\":\"ch_KyLOOCb1mzrPXn5iH0r1SyXD\",\"returnUrl\":\"https://www.pingxx.com\",\"agrNo\":\"10001\",\"merchantSerialNo\":\"1\",\"userID\":\"1\",\"mobile\":\"13111111111\",\"signNoticeUrl\":\"http://218.244.151.190/notify/protocol/10001/ch_KyLOOCb1mzrPXn5iH0r1SyXD\",\"signNoticePara\":\"1|1\",\"encrypType\":\"RC4\",\"encrypData\":\"418d82bb3d8f072405a72cce864bb155977db44749882f1bb572936c47e8e1cadfc29b1e616f0a66f85f53238673004bebcae06e256212315cd3426fd261e5a6eff80d5e734b1f3f0e84772b03a6f3f6d0c0a3323ae8cb04078ce377970c88ce3cad28618fd928992a9eaab2819de09cb9068bcb7839c36e5eb76321044f933bc521d39b45663e1adffeb2db71e293a7f6c39fb622c5db8c44eddc44cdfa0a60\"}}",
"channel_url": "http://121.15.180.66:801/netpayment/BaseHttp.dll?PC_EUserPay"
}
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
qpay
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_HybzX9zPO0mDGGKSe9zf5m5G",
"object": "charge",
"created": 1476853028,
"livemode": false,
"paid": false,
"refunded": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "qpay",
"order_no": "12345678",
"client_ip": "127.0.0.1",
"amount": 1,
"amount_settle": 1,
"currency": "cny",
"subject": "songsong test",
"body": "Your Body",
"extra": {
"device": "ios"
},
"time_paid": null,
"time_expire": 1476939428,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_HybzX9zPO0mDGGKSe9zf5m5G/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"qpay": {
"app_id": "1144223800",
"nonce": "f7ccb761532b994b1b29c3533d11ab00",
"bargainor_id": "1323854000",
"sign": "ZjdjY2I3NjE1MzJiOTk0YjFiMjljMzUzM2QxMWFiMKU=",
"token_id": "2016101912570872148427010048255829831098511100"
}
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
qpay_pub
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": true,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_rLWvj9HizLGKyrbXPCOunjfD",
"object": "charge",
"created": 1476853028,
"livemode": false,
"paid": false,
"refunded": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "qpay_pub",
"order_no": "1478766781655",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "测试订单001",
"body": "订单内容001",
"extra": {
"device_info": "13467007045764",
"limit_pay": "no_balance",
"promotion_tag": "level_tag=xxx&sale_tag=xxx",
"attach": "Ping++ 分店"
},
"time_paid": null,
"time_expire": 1478853181,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_rLWvj9HizLGKyrbXPCOunjfD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"qpay_pub": {
"token_id": "0V0530a6f65aaef85837531c41d70d8b"
}
},
"description": null
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
ccb_pay
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": true,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_0CO0y144eHaPm5SmPK98KGiT",
"object": "charge",
"created": 1540188097,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "ccb_pay",
"order_no": "912111810221540188097",
"client_ip": "180.168.5.158",
"amount": 10,
"amount_settle": 10,
"currency": "cny",
"subject": "ping++测试订单1540188097",
"body": "ping++订单内容1540188097",
"extra": {
"support_account_type": "1",
"pos_id": "025547632",
"remark": "test"
},
"time_paid": null,
"time_expire": 1540274497,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_0CO0y144eHaPm5SmPK98KGiT/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"ccb_pay": {
"orderinfo": "MERCHANTID=105001473994315&POSID=025547632&BRANCHID=110000000&ORDERID=912111810221540188097&PAYMENT=0.10&CURCODE=01&TXCODE=520100&REMARK1=ch_0CO0y144eHaPm5SmPK98KGiT&REMARK2=test&TYPE=1&GATEWAY=0&TIMEOUT=20181023140137&MAC=4a5426833973273bb20f0a638224ce5c"
}
},
"description": "Your description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
ccb_qr
{
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": true,
"amount": 100,
"succeeded": false,
"time_succeeded": null,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_bbnT0G44O088Hyzn94KKKyDC",
"object": "charge",
"created": 1540187487,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "ccb_qr",
"order_no": "912111810221540187487",
"client_ip": "180.168.5.158",
"amount": 10,
"amount_settle": 10,
"currency": "cny",
"subject": "ping++测试订单1540187487",
"body": "ping++订单内容1540187487",
"extra": {
"pos_id": "025547632",
"remark": "test",
"return_type": "1"
},
"time_paid": null,
"time_expire": 1540273887,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_bbnT0G44O088Hyzn94KKKyDC/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"ccb_qr": "9980001905035937882606"
},
"description": "Your description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}

第四步:将获得的支付凭据传给 Client

除了部分扫码及付款码(条码)支付渠道外,你的服务器需要按照 JSON 字符串格式将支付凭据返回给你的客户端,Ping++ SDK 对此做了相应的处理,你只需要将获得的支付凭据直接传给客户端(服务端应传递怎样的支付凭证给前端),客户端接收后使用该支付凭据用于调起支付控件,而支付凭据的传送方式需要你自行实现。注:scan 类渠道会在您请求支付 Recharge 后,若用户支付成功,Ping++ 直接返回带有支付状态的 Recharge 对象给你的服务端,详细流程可参考 扫码支付

第五步:接收 Webhooks 通知

当用户充值成功后 Ping++ 会给你配置在 Ping++ 管理平台的 Webhooks 通知地址主动发送支付结果,我们称之为 Webhooks 通知。 Webhooks 通知是以 POST 形式发送的 JSON,放在请求的 body 里,内容是 Event 对象,充值成功的事件类型为 recharge.succeeded ,你需要监听并接收 Webhooks 通知,接收到 Webhooks 后需要返回服务器状态码 2xx 表示接收成功,否则请返回状态码 500

$event = json_decode(file_get_contents("php://input"));
// 对异步通知做处理
if (!isset($event->type)) {
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
exit("fail");
}
switch ($event->type) {
case "recharge.succeeded":
// 开发者在此处加入对支付异步通知的处理代码
header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
break;
case "refund.succeeded":
// 开发者在此处加入对退款异步通知的处理代码
header($_SERVER['SERVER_PROTOCOL'] . ' 200 OK');
break;
default:
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
break;
}
import com.pingplusplus.model.Event;
import com.pingplusplus.model.Webhooks;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
public class ServletDemo extends HttpServlet {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF8");
//获取头部所有信息
Enumeration headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
String key = (String) headerNames.nextElement();
String value = request.getHeader(key);
System.out.println(key+" "+value);
}
// 获得 http body 内容
BufferedReader reader = request.getReader();
StringBuffer buffer = new StringBuffer();
String string;
while ((string = reader.readLine()) != null) {
buffer.append(string);
}
reader.close();
// 解析异步通知数据
Event event = Webhooks.eventParse(buffer.toString());
if ("recharge.succeeded".equals(event.getType())) {
response.setStatus(200);
} else if ("refund.succeeded".equals(event.getType())) {
response.setStatus(200);
} else {
response.setStatus(500);
}
}
}
var http = require('http');
http.createServer(function (req, res) {
req.setEncoding('utf8');
var postData = "";
req.addListener("data", function (chunk) {
postData += chunk;
});
req.addListener("end", function () {
var resp = function (ret, status_code) {
res.writeHead(status_code, {
"Content-Type": "text/plain; charset=utf-8"
});
res.end(ret);
}
try {
var event = JSON.parse(postData);
if (event.type === undefined) {
return resp('Event 对象中缺少 type 字段', 400);
}
switch (event.type) {
case "recharge.succeeded":
// 开发者在此处加入对支付异步通知的处理代码
return resp("OK", 200);
break;
case "refund.succeeded":
// 开发者在此处加入对退款异步通知的处理代码
return resp("OK", 200);
break;
default:
return resp("未知 Event 类型", 400);
break;
}
} catch (err) {
return resp('JSON 解析失败', 400);
}
});
}).listen(8080, "0.0.0.0");
import json
from flask import Flask, request, Response
# 使用 flask
@app.route('/webhooks', methods=['POST'])
def webhooks():
event = request.get_json()
if event['type'] == 'recharge.succeeded':
return Response(status=200)
elif event['type'] == 'refund.succeeded':
return Response(status=200)
return Response(status=500)
if __name__ == '__main__':
app.run(debug=False, host='0.0.0.0', port=8080)
require 'webrick'
require 'json'
class Webhooks < WEBrick::HTTPServlet::AbstractServlet
def do_POST(request, response)
status = 400
response_body = '' # 可自定义
begin
event = JSON.parse(request.body)
if event['type'].nil?
response_body = 'Event 对象中缺少 type 字段'
elsif event['type'] == 'recharge.succeeded'
# 开发者在此处加入对支付异步通知的处理代码
status = 200
response_body = 'OK'
elsif event['type'] == 'refund.succeeded'
# 开发者在此处加入对退款异步通知的处理代码
status = 200
response_body = 'OK'
else
response_body = '未知 Event 类型'
end
rescue JSON::ParserError
response_body = 'JSON 解析失败'
end
response.status = status
response['Content-Type'] = 'text/plain; charset=utf-8'
response.body = response_body
end
end
server = WEBrick::HTTPServer.new(:Port => 8000)
server.mount '/webhooks', Webhooks
trap 'INT' do server.shutdown end
server.start
func webhook(w http.ResponseWriter, r *http.Request) {
if strings.ToUpper(r.Method) == "POST" {
buf := new(bytes.Buffer)
buf.ReadFrom(r.Body)
signature := r.Header.Get("x-pingplusplus-signature")
webhook, err := pingpp.ParseWebhooks(buf.Bytes())
fmt.Println(webhook.Type)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, "fail")
return
}
if webhook.Type == "recharge.succeeded" {
// TODO your code for charge
w.WriteHeader(http.StatusOK)
} else if webhook.Type == "refund.succeeded" {
// TODO your code for refund
w.WriteHeader(http.StatusOK)
} else {
w.WriteHeader(http.StatusInternalServerError)
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pingpp.Models;
using System.IO;
namespace Example.Example
{
public class WebhooksDemo
{
public static Event Example()
{
var data = ReadFileToString(@"../../data.txt");
var evt = Webhooks.ParseWebhook(data);
Console.WriteLine(evt);
return evt;
}
public static string ReadFileToString(string path)
{
using (var sr = new StreamReader(path))
{
return sr.ReadToEnd();
}
}
}
}

以下是 Webhooks 通知地址配置的 recharge.succeeded 对象(以 alipay 渠道为例):

{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "recharge.succeeded",
"data": {
"object": {
"id": "220170713625155317880001",
"object": "recharge",
"app": "app_1Gqj58ynP0mHeX1q",
"created": 1496728534,
"livemode": false,
"amount": 1000,
"succeeded": true,
"time_succeeded": 1496728544,
"refunded": false,
"user": "user_007",
"from": "user_007",
"user_fee": 50,
"charge": {
"id": "ch_SejbHOrzbjvPunjHmD08SCi9",
"object": "charge",
"created": 1496740128,
"livemode": false,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay",
"order_no": "20170711102300167",
"client_ip": "127.0.0.1",
"amount": 1000,
"amount_settle": 1000,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": 1496728544,
"time_expire": 1496826528,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_SejbHOrzbjvPunjHmD08SCi9/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
},
"balance_bonus": null,
"balance_transaction": null,
"description": "Your Description",
"metadata": {}
}
},
"object": "event",
"pending_webhooks": 32,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}

第六步:验证 Webhooks 签名

签名简介

Ping++ 的 Webhooks 通知包含了签名字段,可以使用该签名验证 Webhooks 通知的合法性。签名放置在 header 的自定义字段 x-pingplusplus-signature 中,签名用 RSA 私钥对 Webhooks 通知使用 RSA-SHA256 算法进行签名,以 base64 格式输出。

验证签名

Ping++ 在管理平台中提供了 RSA 公钥,供验证签名,该公钥具体获取路径:点击管理平台右上角公司名称->开发信息-> Ping++ 公钥。验证签名需要以下几步:

  1. 从 header 取出签名字段并对其进行 base64 解码。
  2. 获取 Webhooks 请求的原始数据。
  3. 将获取到的 Webhooks 通知、 Ping++ 管理平台提供的 RSA 公钥、和 base64 解码后的签名三者一同放入 RSA 的签名函数中进行非对称的签名运算,来判断签名是否验证通过。 Ping++ 提供了验证签名的 Demo Demo Demo Demo Demo Demo Demo ,放在 SDK 的 example 里供参考,我们在此不再赘述。

充值查询

Ping++ 管理平台提供详细的订单信息和 Webhooks 功能,所以查询功能相对来说并不是那么必要。如果商户本身由于某种原因导致 Webhooks 没有收到或者延缓更新时,可以主动调用充值查询接口来获得交易的状态。

查询 Recharge 对象

\Pingpp\Recharge::retrieve('recharge_id');
Recharge obj = Recharge.retrieve("recharge_id");
pingpp.recharge.retrieve(APP_ID,
'recharge_id', // Recharge ID
function(err, recharge) {
if (err!=null){
console.log('pingpp.recharge.retrieve fail:',err)
}
// YOUR CODE
});
pingpp.Recharge.retrieve(recharge_id)
Pingpp::Recharge.retrieve(
existed_recharge_id, {: app => get_app_id
}#
App 信息
)
recharge.Get(c.demoAppID, c.demoRechargeID)
Recharge.Retrieve(appId, "recharge_id");

查询 Recharge 对象列表

$params = [
'page' => 1,
'per_page' => 100,
];
$recharge_list = \Pingpp\Recharge::all($params);
Map<String, Object> params = new HashMap<>();
params.put("page", 1);
params.put("per_page", 10);
params.put("succeeded", true);
params.put("refunded", true);
// 参数: params
RechargeCollection objs = Recharge.list(params);
var params_list = {
'page': 1,
'per_page': 3
};
pingpp.recharge.list(APP_ID, params_list, function(err, recharges) {
if (err!=null){
console.log('pingpp.recharge.list fail:',err)
}
// YOUR CODE
});
list_param = {
"page": 1,
"per_page": 10,
}
pingpp.Recharge.list(**list_param)
Pingpp::Recharge.list(
{ :per_page => 3, :page => 1 },
{ :app => get_app_id } # App 信息
)
recharge.List(c.demoAppID, params)
Recharge.List(appId, new Dictionary<string, object>
{
{"page", 1},
{"per_page", 10}
});

注意事项

  1. 接收到 Webhooks 说明充值成功,充值失败不会发送 Webhooks ,未成功的交易结果直接在客户端返回。
  2. 你需要在 Ping++ 的管理平台里填写 Webhooks 通知地址,详见 Webhooks 配置说明,你的服务器需要监听这个地址并且接收 Webhooks 通知,接收到 Webhooks 通知后需给 Ping++ 返回服务器状态 2xx 。此时事件类型是 recharge.succeeded,其字段 data 包含了 object 字段, object 字段的值是一个 recharge 对象。
  3. 若你的服务器未正确返回 2xx,Ping++ 会在 25 小时内向商户服务器最多发送 10 次 Webhooks 通知,时间间隔分别为 5s、10s、2min、5min、10min、30min、1h、2h、6h、15h,直到用户向 Ping++ 返回服务器状态 2xx 或者超过最大重发次数为止。
  4. 你的服务器必须以 Ping++ 的 Webhooks 通知的结果作为交易结果,不可用客户端获得的结果作为支付成功与否的判断条件。
  5. 如果没有收到 Webhooks 通知,可以调用 Ping++ 查询方法发起交易查询,该查询结果可以作为交易结果。

下一步充值退款