支付

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

  1. 设置 API-Key
  2. SDK 验证签名设置
  3. 从服务端发起创建请求,获取 Charge 对象
  4. 将获得的 Charge 传给 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 开关。

第三步:从服务端发起创建请求,获取 Charge 对象

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

alipay
\Pingpp\Charge::create(array('order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'alipay',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body')
);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "alipay");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "alipay",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='alipay',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "alipay",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "alipay",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "alipay"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
alipay_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
// 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
'channel' => 'alipay_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
'success_url' => 'http://example.com/success',
'cancel_url' => 'http://example.com/cancel'
)
));
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
// 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
chargeParams.put("channel", "alipay_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
extra.put("success_url", "http://example.com/success");
extra.put("cancel_url", "http://example.com/cancel");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
// 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
channel: "alipay_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
success_url: "http://example.com/success",
cancel_url: "http://example.com/cancel"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
# 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
channel='alipay_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
#success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
success_url='http://example.com/success',
cancel_url='http://example.com/cancel')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
# 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
:channel => "alipay_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
# success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
:success_url => "http://example.com/success",
:cancel_url => "http://example.com/success"
}
)
extra := make(map[string]interface{})
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
extra["success_url"] = "http://example.com/success"
extra["cancel_url"] = "http://example.com/cancel"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
// 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
Channel: "alipay_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
// 2016 年 6 月 16 日(不含当日)之前登录 Ping++ 管理平台填写支付宝手机网站的渠道参数的商户,请更新接口:https://help.pingxx.com/article/174737
{"channel", "alipay_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
//success_url 和 cancel_url 在本地测试不要写 localhost ,写 127.0.0.1,URL 后面不要加自定义参数
{"success_url", "http://example.com/success"},
{"cancel_url":"http://example.com/cancel"}
}}
};
var ch = Charge.Create(chParams);
alipay_lite
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'alipay_lite',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('buyer_user_id' => '208870267336****')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "alipay_lite");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("buyer_user_id", "208870267336****");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "alipay_lite",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {buyer_user_id: "208870267336****"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='alipay_lite',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(buyer_user_id ='208870267336****')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "alipay_lite",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {: buyer_user_id => "208870267336****"}
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "alipay_lite",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "alipay_lite"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"buyer_user_id", "208870267336****"}}}
};
var ch = Charge.Create(chParams);
alipay_pc_direct
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'alipay_pc_direct',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('success_url' => 'http://example.com/success')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "alipay_pc_direct");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("success_url", "http://example.com/success");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "alipay_pc_direct",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {success_url: "http://example.com/success"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='alipay_pc_direct',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(success_url='http://example.com/success')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "alipay_pc_direct",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:success_url => "http://example.com/success"}
)
extra := make(map[string]interface{})
extra["success_url"] = "http://example.com/success"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "alipay_pc_direct",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "alipay_pc_direct"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"success_url", "http://example.com/success"}}}
};
var ch = Charge.Create(chParams);
wx
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'wx',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body'
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "wx");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "wx",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='wx',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "wx",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "wx",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "wx"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
wx_pub
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'wx_pub',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('open_id' => 'User OpenId')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "wx_pub");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("open_id", "User OpenId");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "wx_pub",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {open_id: "User OpenId"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='wx_pub',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(open_id='User OpenId')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "wx_pub",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:open_id => "User OpenId"}
)
extra := make(map[string]interface{})
extra["open_id"] = "User OpenId"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "wx_pub",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "wx_pub"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"open_id", "User OpenId"}}}
};
var ch = Charge.Create(chParams);
wx_lite
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'wx_lite',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('open_id' => 'User OpenId')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "wx_lite");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("open_id", "User OpenId");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "wx_lite",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {open_id: "User OpenId"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='wx_lite',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(open_id='User OpenId')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "wx_lite",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:open_id => "User OpenId"}
)
extra := make(map[string]interface{})
extra["open_id"] = "User OpenId"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "wx_lite",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "wx_lite"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"open_id", "User OpenId"}}}
};
var ch = Charge.Create(chParams);
wx_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'wx_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body'
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "wx_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "wx_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='wx_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "wx_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "wx_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "wx_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
bfb_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'bfb_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'result_url' => 'http://example.com/result',
'bfb_login' => false)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "bfb_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("result_url", "http://example.com/result");
extra.put("bfb_login", false);
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "bfb_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
result_url: "http://example.com/result",
bfb_login: false
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='bfb_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(result_url='http://example.com/result',bfb_login=false)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "bfb_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:result_url => "http://example.com/result",
:bfb_login => false
}
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/result"
extra["bfb_login"] = false
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "bfb_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "bfb_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"result_url", "http://example.com/result"},
{"bfb_login": false}
}}
};
var ch = Charge.Create(chParams);
upacp
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'upacp',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body'
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "upacp");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "upacp",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='upacp',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "upacp",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "upacp",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "upacp"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
upacp_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'upacp_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('result_url' => 'http://example.com/result')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "upacp_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("result_url", "http://example.com/result");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "upacp_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {result_url: "http://example.com/result"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='upacp_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(result_url='http://example.com/result')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "upacp_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:result_url => "http://example.com/result"}
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/result"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "upacp_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "upacp_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"result_url", "http://example.com/result"}}}
};
var ch = Charge.Create(chParams);
upacp_pc
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'upacp_pc',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('result_url' => 'http://example.com/result')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "upacp_pc");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("result_url", "http://example.com/result");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "upacp_pc",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {result_url: "http://example.com/result"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='upacp_pc',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(result_url='http://example.com/result')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "upacp_pc",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:result_url => "http://example.com/result"}
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/result"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "upacp_pc",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "upacp_pc"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"result_url", "http://example.com/result"}}}
};
var ch = Charge.Create(chParams);
cp_b2b
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cp_b2b',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body'
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cp_b2b");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cp_b2b",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cp_b2b',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,#订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cp_b2b",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cp_b2b",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cp_b2b"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
upacp_b2b
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'upacp_b2b',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array('result_url' => 'http://example.com/result')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "upacp_b2b");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("result_url", "http://example.com/result");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "upacp_b2b",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {result_url: "http://example.com/result"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='upacp_b2b',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(result_url='http://example.com/result')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "upacp_b2b",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {:result_url => "http://example.com/result"}
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/result"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "upacp_b2b",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "upacp_b2b"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {{"result_url", "http://example.com/result"}}}
};
var ch = Charge.Create(chParams);
yeepay_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'yeepay_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'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'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "yeepay_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
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");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "yeepay_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
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"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='yeepay_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
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'
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "yeepay_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
: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"
}
)
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"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "yeepay_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "yeepay_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"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/result"}
}}
};
var ch = Charge.Create(chParams);
jdpay_wap
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'jdpay_wap',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'success_url' => 'http://example.com/success',
'fail_url'=> 'http://example.com/fail',
'token' => 'Your Token',
'is_mobile' => false,
'order_type' => '1'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "jdpay_wap");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
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");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "jdpay_wap",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
success_url: "http://example.com/success",
fail_url: "http://example.com/fail",
token: "Your Token",
is_mobile: false,
order_type:"1"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='jdpay_wap',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
success_url='http://example.com/success',
fail_url='http://example.com/fail',
token='Your Token',
is_mobile=false,
order_type='1'
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "jdpay_wap",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:success_url => "http://example.com/success",
:fail_url => "http://example.com/fail",
:token => "Your Token"
:is_mobile => false,
:order_type => "1"
}
)
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"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "jdpay_wap",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "jdpay_wap"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"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 ch = Charge.Create(chParams);
applepay_upacp
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'applepay_upacp',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body'
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "applepay_upacp");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "applepay_upacp",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='applepay_upacp',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "applepay_upacp",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "applepay_upacp",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "applepay_upacp"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
cmb_wallet
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cmb_wallet',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'result_url' => 'https://example.com/result',
'p_no'=> '2016062901',
'seq'=>'2016062901',
'm_uid'=>'2016062901',
'mobile'=>'18512343456'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cmb_wallet");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
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");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cmb_wallet",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
result_url: "https://example.com/result",
p_no: "2016062901",
seq: "2016062901",
m_uid: "2016062901",
mobile: "18512343456"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cmb_wallet',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
result_url='https://example.com/result',
p_no='2016062901',
seq="2016062901",
m_uid="2016062901",
mobile="18512343456"
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cmb_wallet",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:result_url => "https://example.com/result",
:p_no => "2016062901",
:seq => "2016062901",
:m_uid => "2016062901",
:mobile => "18512343456"
}
)
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"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cmb_wallet",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cmb_wallet"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"result_url", "https://example.com/result"},
{"p_no": "2016062901"},
{"seq": "2016062901"},
{"m_uid": "2016062901"},
{"mobile": "18512343456"}
}}
};
var ch = Charge.Create(chParams);
cmb_pc_qr
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cmb_pc_qr',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'result_url' => 'https://example.com/result',
'p_no'=> '2016062901',
'seq'=>'2016062901',
'm_uid'=>'2016062901',
'mobile'=>'18512343456'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cmb_pc_qr");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
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");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cmb_pc_qr",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
result_url: "https://example.com/result",
p_no: "2016062901",
seq: "2016062901",
m_uid: "2016062901",
mobile: "18512343456"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cmb_pc_qr',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
result_url='https://example.com/result',
p_no='2016062901',
seq="2016062901",
m_uid="2016062901",
mobile="18512343456"
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cmb_pc_qr",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:result_url => "https://example.com/result",
:p_no => "2016062901",
:seq => "2016062901",
:m_uid => "2016062901",
:mobile => "18512343456"
}
)
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"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cmb_pc_qr",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cmb_pc_qr"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"result_url", "https://example.com/result"},
{"p_no": "2016062901"},
{"seq": "2016062901"},
{"m_uid": "2016062901"},
{"mobile": "18512343456"}
}}
};
var ch = Charge.Create(chParams);
qpay
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '200000',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'qpay',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'device' => 'ios'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 200000);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "qpay");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("device", "ios");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 200000,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "qpay",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
device : "ios"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount= 200000, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='qpay',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
device ='ios'
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 200000,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "qpay",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
: device => "ios"
}
)
extra := make(map[string]interface{})
extra["device"] = "ios"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 200000,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "qpay",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 200000},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "qpay"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"device", "ios"}
}}
};
var ch = Charge.Create(chParams);
qpay_pub
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '200000',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'qpay_pub',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'attach' => 'Ping++ 分店',
'limit_pay' => 'no_balance',
'promotion_tag' => 'evel_tag=xxx&sale_tag=xxx',
'device_info' => '13467007045764'
)
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 200000);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "qpay_pub");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
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");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 200000,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "qpay_pub",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
attach : "Ping++ 分店",
limit_pay : "no_balance",
promotion_tag : "level_tag=xxx&sale_tag=xxx",
device_info : "13467007045764"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount= 200000, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='qpay_pub',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
attach ='Ping++ 分店',
limit_pay ='no_balance',
promotion_tag ='level_tag=xxx&sale_tag=xxx',
device_info ='13467007045764'
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 200000,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "qpay_pub",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
: attach => "Ping++ 分店",
: limit_pay => "no_balance",
: promotion_tag => "level_tag=xxx&sale_tag=xxx",
: device_info => "13467007045764"
}
)
extra := make(map[string]interface{})
extra["attach"] = "Ping++ 分店"
extra["limit_pay"] = "no_balance"
extra["promotion_tag"] = "level_tag=xxx&sale_tag=xxx"
extra["device_info"] = "13467007045764"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 200000,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "qpay_pub",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 200000},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "qpay_pub"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"attach", "Ping++ 分店"},
{"limit_pay", "no_balance"},
{"promotion_tag", "level_tag=xxx&sale_tag=xxx"},
{"device_info", "13467007045764"}
}}
};
var ch = Charge.Create(chParams);
ccb_pay
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'ccb_pay',
'currency' => 'cny',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'pos_id' => '025547632',
'remark' => 'test')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "ccb_pay");
chargeParams.put("currency", "cny");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("pos_id", "025547632");
extra.put("remark", "test",);
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "ccb_pay",
currency: "cny",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
pos_id: "025547632",
remark: "test"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='ccb_pay',
currency='cny',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(pos_id ='025547632', remark ='test')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "ccb_pay",
:currency => "cny",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
: pos_id => '025547632',
: remark => 'test'
}
)
extra := make(map[string]interface{})
extra["pos_id"] = "025547632"
extra["remark"] = "test"
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "ccb_pay",
Currency: "cny",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "ccb_pay"},
{"currency", "cny"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"pos_id", "025547632"},
{"remark": "test"}
}}
};
var ch = Charge.Create(chParams);
cb_alipay
\Pingpp\Charge::create(array('order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cb_alipay',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body')
);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cb_alipay");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cb_alipay",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cb_alipay',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cb_alipay",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cb_alipay",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cb_alipay"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
cb_alipay_wap
\Pingpp\Charge::create(array('order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cb_alipay_wap',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body')
);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cb_alipay_wap");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cb_alipay_wap",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cb_alipay_wap',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cb_alipay_wap",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cb_alipay_wap",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cb_alipay_wap"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
cb_alipay_pc_direct
\Pingpp\Charge::create(array('order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cb_alipay_pc_direct',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body')
);
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cb_alipay_pc_direct");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cb_alipay_pc_direct",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cb_alipay_pc_direct',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body'
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cb_alipay_pc_direct",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"}
)
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cb_alipay_pc_direct",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cb_alipay_pc_direct"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}}
};
var ch = Charge.Create(chParams);
cb_wx
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cb_wx',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'limit_pay' => 'no_credit',
'goods_list' => array(
'goods_name' => 'iPhone',
'goods_num' => '1'
)
)
));
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cb_wx");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, Object> extra = new HashMap<>();
// 可选,指定支付方式,指定不能使用信用卡支付可设置为 no_credit 。
extra.put("limit_pay", "no_credit");
// 必填,商品列表
List<Object> goodsList = goodsListForCbWx();
extra.put("goods_list", goodsList);
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cb_wx",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
limit_pay: "no_credit",
goods_list: goods_list // 商品列表数组
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cb_wx',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
limit_pay='no_credit',
goods_list = goods_list #商品列表数组
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cb_wx",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:limit_pay => "no_credit",
:goods_list => goods_list #商品列表数组
}
)
extra := make(map[string]interface{})
extra["limit_pay"] = "no_credit"
extra["goods_list"] = goods_list //商品列表数组
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cb_wx",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cb_wx"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"limit_pay", "no_credit"},
{"goods_list": goods_list} //商品列表数组
}}
};
var ch = Charge.Create(chParams);
cb_wx_pub
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'cb_wx_pub',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'limit_pay' => 'no_credit',
'open_id' => 'openidxxxxxxxxxxxx',
'goods_list' => array(
'goods_name' => 'iPhone',
'goods_num' => '1'
)
)
));
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "cb_wx_pub");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, Object> extra = new HashMap<>();
// 可选,指定支付方式,指定不能使用信用卡支付可设置为 no_credit 。
extra.put("limit_pay", "no_credit");
// 必填,用户在商户 appid 下的唯一标识。
extra.put("open_id", "openidxxxxxxxxxxxx");
// 必填,商品列表
List<Object> goodsList = goodsListForCbWx();
extra.put("goods_list", goodsList);
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "cb_wx_pub",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
limit_pay: "no_credit",
open_id: "openidxxxxxxxxxxxx",
goods_list: goods_list // 商品列表数组
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='cb_wx_pub',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(
limit_pay='no_credit',
open_id='openidxxxxxxxxxxxx',
goods_list = goods_list #商品列表数组
)
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "cb_wx_pub",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:limit_pay => "no_credit",
:open_id => "openidxxxxxxxxxxxx",
:goods_list => goods_list #商品列表数组
}
)
extra := make(map[string]interface{})
extra["limit_pay"] = "no_credit"
extra["open_id"] = "openidxxxxxxxxxxxx"
extra["goods_list"] = goods_list //商品列表数组
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "cb_wx_pub",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "cb_wx_pub"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"limit_pay", "no_credit"},
{"open_id","openidxxxxxxxxxxxx"},
{"goods_list": goods_list} //商品列表数组
}}
};
var ch = Charge.Create(chParams);
paypal
\Pingpp\Charge::create(array(
'order_no' => '123456789',
'amount' => '100',//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
'app' => array('id' => 'app_1Gqj58ynP0mHeX1q'),
'channel' => 'paypal',
'currency' => 'usd',
'client_ip' => '127.0.0.1',
'subject' => 'Your Subject',
'body' => 'Your Body',
'extra' => array(
'result_url' => 'http://example.com/result',
'cancel_url' => 'http://example.com/result')
));
Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("order_no", "123456789");
chargeParams.put("amount", 100);//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Map<String, String> app = new HashMap<String, String>();
app.put("id", "app_1Gqj58ynP0mHeX1q");
chargeParams.put("app", app);
chargeParams.put("channel", "paypal");
chargeParams.put("currency", "usd");
chargeParams.put("client_ip", "127.0.0.1");
chargeParams.put("subject", "Your Subject");
chargeParams.put("body", "Your Body");
Map<String, String> extra = new HashMap<String, String>();
extra.put("result_url", "http://example.com/result");
extra.put("cancel_url", "http://example.com/result");
chargeParams.put("extra", extra);
Charge.create(chargeParams);
pingpp.charges.create({
subject: "Your Subject",
body: "Your Body",
amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
order_no: "123456789",
channel: "paypal",
currency: "usd",
client_ip: "127.0.0.1",
app: {id: "app_1Gqj58ynP0mHeX1q"},
extra: {
result_url: "http://example.com/result",
cancel_url: "http://example.com/result"
}
}, function(err, charge) {
// YOUR CODE
});
ch = pingpp.Charge.create(
order_no='123456789',
amount=100, #订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
app=dict(id='app_1Gqj58ynP0mHeX1q'),
channel='paypal',
currency='usd',
client_ip='127.0.0.1',
subject='Your Subject',
body='Your Body',
extra=dict(result_url='http://example.com/result', cancel_url='http://example.com/result')
)
Pingpp::Charge.create(
:order_no => "123456789",
:amount => 100,# 订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
:subject => "Your Subject",
:body => "Your Body",
:channel => "paypal",
:currency => "usd",
:client_ip=> "127.0.0.1",
:app => {:id => "app_1Gqj58ynP0mHeX1q"},
:extra => {
:result_url => "http://example.com/result",
:cancel_url => "http://example.com/result"
}
)
extra := make(map[string]interface{})
extra["result_url"] = "http://example.com/result"
extra["bfb_login"] = false
params := &pingpp.ChargeParams{
Order_no: "123456789",
App: pingpp.App{Id: "app_1Gqj58ynP0mHeX1q"},
Amount: 100,//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
Channel: "paypal",
Currency: "usd",
Client_ip: "127.0.0.1",
Subject: "Your Subject",
Body: "Your Body",
Extra: extra,
}
//返回的第一个参数是 charge 对象,你需要将其转换成 json 给客户端,或者客户端接收后转换。
ch, err := charge.New(params)
var chParams = new Dictionary<string, object>
{
{"order_no", "123456789"},
{"amount", 100},//订单总金额, 人民币单位:分(如订单总金额为 1 元,此处请填 100)
{"channel", "paypal"},
{"currency", "usd"},
{"subject", "Your Subject"},
{"body", "Your Body"},
{"client_ip", "127.0.0.1"},
{"app", new Dictionary<string, string> {{"id", "app_1Gqj58ynP0mHeX1q"}}},
{"extra", new Dictionary<string, object> {
{"result_url", "http://example.com/result"},
{"cancel_url": "http://example.com/result"}
}}
};
var ch = Charge.Create(chParams);

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

alipay
{
"id": "ch_a5OinLGyzzjLXPSOy9rPKKiL",
"object": "charge",
"created": 1458186221,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay",
"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": 1458272621,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL/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"
}
alipay_wap
{
"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"
}
alipay_lite
{
"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
}
alipay_pc_direct
{
"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"
}
bfb_wap
{
"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"
}
upacp
{
"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"
}
upacp_wap
{
"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"
}
upacp_pc
{
"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"
}
cp_b2b
{
"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"
}
upacp_b2b
{
"id": "ch_Xf1yL8nXnL4SbbHarPCSevnH",
"object": "charge",
"created": 1528880743,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_b2b",
"order_no": "149572338024362",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "https://www.example.com"
},
"time_paid": null,
"time_expire": 1528967143,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_Xf1yL8nXnL4SbbHarPCSevnH/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": null
}
wx
{
"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"
}
wx_pub
{
"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"
}
wx_lite
{
"id": "ch_zXnfHGDOurL4LubPa15CeXf5",
"object": "charge",
"created": 1458187589,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_lite",
"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_lite": {
"appId": "wx95dt8698h12152c7",
"timeStamp": "1458187589",
"nonceStr": "723d051e687d5ad68e0d53717024e951",
"package": "prepay_id=wx20167317120629437b16dede0665849747",
"signType": "MD5",
"paySign": "64C91296E3A9F1C50E3343B5717E636E"
}
},
"description": "Your Description"
}
wx_wap
{
"id": "ch_zjbDC8j5CSiTPenDK4C0qLaD",
"object": "charge",
"created": 1467944440,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_wap",
"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": 1467947828,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_zjbDC8j5CSiTPenDK4C0qLaD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"wx_wap": "https://pay.swiftpass.cn/pay/wappay?token_id=34e0a0251d2dc5579e50d3ced9220143&service=pay.weixin.wappay"
},
"description": "Your Description"
}
yeepay_wap
{
"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"
}
jdpay_wap
{
"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"
}
applepay_upacp
{
"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"
}
cmb_wallet
{
"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
}
cmb_pc_qr
{
"id": "ch_KyLOOCb1mzrPXn5iH0r1SyXD",
"object": "charge",
"created": 1532412542,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cmb_pc_qr",
"order_no": "912111532412543",
"client_ip": "127.0.0.1",
"amount": 11000,
"amount_settle": 10998,
"currency": "cny",
"subject": "Pingxx测试订单1532412543",
"body": "Pingxx测试订单1532412543",
"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": 1532498942,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_KyLOOCb1mzrPXn5iH0r1SyXD/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
}
qpay
{
"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
}
qpay_pub
{
"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": 1,
"amount_settle": 1,
"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
}
ccb_pay
{
"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"
}
cb_alipay
{
"id": "ch_a5OinLGyzzjLXPSOy9rPKKiL",
"object": "charge",
"created": 1458186221,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458272621,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cb_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"
}
cb_alipay_wap
{
"id": "ch_a5OinLGyzzjLXPSOy9rPKKiL",
"object": "charge",
"created": 1458186221,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458272621,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cb_alipay_wap": {
"service": "create_forex_trade_wap",
"partner": "2088866886666666",
"_input_charset": "utf-8",
"notify_url": "https://notify.pingxx.com/notify/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL",
"subject": "Ping++测试订单",
"body": "Ping++ 测试订单",
"out_trade_no": "123456789",
"currency": "USD",
"total_fee": "0.15",
"timeout_rule": "1d",
"product_code": "NEW_WAP_OVERSEAS_SELLER",
"sign": "npKs+z1h8iaXjy8U9ZUOnRWXpK7GZg7AzgPrcSCQDcYX0OHHsJQueCEsxr9b+v1IfH44BA1ZXAv197hRFQkbWOeYmoD4yEatUPfI0nh4og4dhPD7ebxicuazD70qUjdGLEaYO/c8bbH881HBC2Y3/DRtB9q0TF/c/2hKSHTNh1U=",
"sign_type": "RSA",
"channel_url": "https://intlmapi.alipay.com/gateway.do"
}
},
"description": "Your Description"
}
cb_alipay_pc_direct
{
"id": "ch_a5OinLGyzzjLXPSOy9rPKKiL",
"object": "charge",
"created": 1458186221,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay_pc_direct",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {},
"time_paid": null,
"time_expire": 1458272621,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"cb_alipay_wap": {
"service": "create_forex_trade",
"partner": "2088866886666666",
"_input_charset": "utf-8",
"notify_url": "https://notify.pingxx.com/notify/charges/ch_a5OinLGyzzjLXPSOy9rPKKiL",
"subject": "Ping++测试订单",
"body": "Ping++ 测试订单",
"out_trade_no": "123456789",
"currency": "USD",
"total_fee": "0.15",
"timeout_rule": "1d",
"product_code": "NEW_OVERSEAS_SELLER",
"sign": "Spu5f6HT9rvuUHGsybNQZjU4R+PxY8tT+kXhPRrtrKlWt2pNG5z9XDR8Rm2rG8w0Nt5dRuq51C/kelXLeFLODgnFC/DrEgpidSKGDyQ1NjMr7v0liyH4JlIdJ7Z3j1c7nSPyqLiBw0Bw3GVaJfnLgdO5WMpZ0amDuXRezFnk4wo=",
"sign_type": "RSA",
"channel_url": "https://openapi.alipaydev.com/gateway.do"
}
},
"description": "Your Description"
}
cb_wx
{
"id": "ch_9O44yLSy98iDjLaPmD1S48qT",
"object": "charge",
"created": 1458186436,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_wx",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"goods_list": [
{
"goods_name": "iPhone",
"goods_num": "1"
}
],
"limit_pay": "no_credit"
},
"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",
"cb_wx": {
"appId": "wxoal0y5rdutyhz1mn",
"partnerId": "7698899816",
"prepayId": "1101000000180620gifz9ob5atwdlud0",
"nonceStr": "a3c933338c5eaffa219d3757196edee2",
"timeStamp": 1529475351,
"packageValue": "Sign=WXPay",
"sign": "C812FC5171449EDA66E7370988741B4B"
}
},
"description": "Your Description"
}
cb_wx_pub
{
"id": "ch_9O44yLSy98iDjLaPmD1S48qT",
"object": "charge",
"created": 1458186436,
"livemode": true,
"paid": false,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_wx_pub",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"open_id": "openidxxxxxxxxxxxx",
"goods_list": [
{
"goods_name": "iPhone",
"goods_num": "1"
}
],
"limit_pay": "no_credit"
},
"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",
"cb_wx_pub": {
"appId": "wxbxn9e1r1mxhoubxj",
"timeStamp": 1529475647,
"nonceStr": "ba01cdc76a7aab5b419cbd109f3be77e",
"package": "prepay_id=1101000000180620g4ifj1vvdossj5ge",
"signType": "MD5",
"paySign": "84B23CE658F980F2F7E21EECFBA01DAB"
}
},
"description": "Your Description"
}
paypal
{
"id": "ch_80yjHCWDOGiHyPu1mP1qnfPC",
"object": "charge",
"created": 1523264939,
"livemode": true,
"paid": false,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "paypal",
"order_no": "91211201803191000000",
"client_ip": "1.1.1.1",
"amount": 100000,
"amount_settle": 100000,
"currency": "usd",
"subject": "如果有任何问题,请联系我们",
"body": "Ping++ 测试订单",
"extra": {
"result_url": "https://www.pingxx.com",
"cancel_url": "https://www.pingxx.com",
"payment_id": "PAY-2R367595H48716456LLFS3LI"
},
"time_paid": null,
"time_expire": 1523524139,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_80yjHCWDOGiHyPu1mP1qnfPC/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {
"object": "credential",
"paypal": "https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-111760764G4999111"
},
"description": "Ping++测试订单"
}

第四步:将获得的 Charge 传给 Client

你的服务器需要按照 JSON 字符串格式将支付凭据返回给你的客户端,Ping++ SDK 对此做了相应的处理,你只需要将获得的支付凭据 Charge 对象直接传给客户端。客户端接收后使用该支付凭据用于调起支付控件,而支付凭据的传送方式需要你自行实现。

注:

  • 扫码支付请勿将 Charge 传给客户端,请参考 扫码支付

  • 线下扫码渠道接口流程请参考 线下扫码

第五步:接收 Webhooks 通知

当用户完成交易后 Ping++ 会给你配置在 Ping++ 管理平台的 Webhooks 通知地址主动发送支付结果,我们称之为 Webhooks 通知。 Webhooks 通知是以 POST 形式发送的 JSON,放在请求的 body 里,内容是 Event 对象,支付成功的事件类型为 charge.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 "charge.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 ("charge.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 "charge.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'] == 'charge.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'] == 'charge.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 == "charge.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 通知地址配置的 charge.succeeded 对象的示例:

alipay
{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uzTivLH4KubHWHmvfHSajXj5",
"object": "charge",
"created": 1458736738,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"buyer_account": "13803659614"
},
"time_paid": 1458736743,
"time_expire": 1458823138,
"time_settle": null,
"transaction_no": "2016032321001004920229421275",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uzTivLH4KubHWHmvfHSajXj5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 32,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
alipay_wap
{
"id": "evt_2ersVj0xe6N1T4GEWvSyg4Yb",
"created": 1458736877,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_bLOivPXjvj1OWvfH44WLenrD",
"object": "charge",
"created": 1458736849,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_wap",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"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",
"buyer_account": "xinxinzhilianode@126.com"
},
"time_paid": 1458736875,
"time_expire": 1458823249,
"time_settle": null,
"transaction_no": "2016032321001004770283682851",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_bLOivPXjvj1OWvfH44WLenrD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 71,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
alipay_lite
{
"id": "evt_c6XY09f3AwYjQlAtFTAyEm53",
"created": 1458737118,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_fH4anHmXTijP9O8qfTLGOyLS",
"object": "charge",
"created": 1542781721,
"livemode": false,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_lite",
"order_no": "15427817222016100****",
"client_ip": "180.168.1.1",
"amount": 10,
"amount_settle": 10,
"currency": "cny",
"subject": "测试订单-15427817222016100****",
"body": "订单内容-15427817222016100****",
"extra": {
"buyer_user_id": "208870267336****",
"buyer_account": "157****0000",
"fund_bill_list": [{
"amount": 10,
"fund_channel": "ALIPAYACCOUNT"
}]
},
"time_paid": 1542781787,
"time_expire": 1542868121,
"time_settle": null,
"transaction_no": "201811212200146692543379****",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_fH4anHmXTijP9O8qfTLGOyLS/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": null
}
},
"object": "event",
"pending_webhooks": 117,
"request": "iar_W5SSuDqvPu98Lifjv5uTWLqD"
}
alipay_pc_direct
{
"id": "evt_c6XY09f3AwYjQlAtFTAyEm53",
"created": 1458737118,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_18qn1K8m1iLOvTebvHabzn18",
"object": "charge",
"created": 1458737100,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "alipay_pc_direct",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"success_url": "http://example.com/success",
"buyer_account": "xingxingzhilianwode@126.com"
},
"time_paid": 1458737117,
"time_expire": 1458823500,
"time_settle": null,
"transaction_no": "2016032321001004770289042439",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_18qn1K8m1iLOvTebvHabzn18/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 117,
"request": "iar_W5SSuDqvPu98Lifjv5uTWLqD"
}
bfb_wap
{
"id": "evt_rrzk8MwqyjCezrFzQ1CwwYgE",
"created": 1458737013,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_vLi1SG1C4WvTjbv1uDnnbzDO",
"object": "charge",
"created": 1458736996,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "bfb_wap",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"bfb_login": true,
"result_url": "http://115.29.205.93:8080/tests/bfb_result.php"
},
"time_paid": 1458737013,
"time_expire": 1458823396,
"time_settle": null,
"transaction_no": "2016032315003000061111318800430",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_vLi1SG1C4WvTjbv1uDnnbzDO/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 99,
"request": "iar_u9CK0Cf14KS4yzb9aLazbvDG"
}
upacp
{
"id": "evt_m8fLLHw2jBKWtQfIwD9WoIq9",
"created": 1458736779,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_SmPOy5qXvXT4rjTSq5CyDSm5",
"object": "charge",
"created": 1458736764,
"livemode": true,
"paid": true,
"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": 1458736764,
"time_expire": 1458740364,
"time_settle": null,
"transaction_no": "201603232039247474258",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_SmPOy5qXvXT4rjTSq5CyDSm5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 45,
"request": "iar_ij9S40KyH84OfvzDO0H8qnDC"
}
upacp_wap
{
"id": "evt_sRUEeosZwdJKF26sA8v7kMcf",
"created": 1458736830,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_SiLur1f9e9S4GyzfnPqDqPuD",
"object": "charge",
"created": 1458736774,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_wap",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"result_url": "http://115.29.205.93:8080/tests/up_result.php?code="
},
"time_paid": 1458736774,
"time_expire": 1458740374,
"time_settle": null,
"transaction_no": "201603232039347406678",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_SiLur1f9e9S4GyzfnPqDqPuD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 62,
"request": "iar_HeTOeTrfbbD0jnj1SOaLyzDO"
}
upacp_pc
{
"id": "evt_42G8ONw1Q6Q3Tgu3WwOMrOFm",
"created": 1458737177,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_rL0a1G8CGeXPbjzn58K48SiP",
"object": "charge",
"created": 1458737130,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_pc",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"result_url": "http://www.baidu.com"
},
"time_paid": 1458737130,
"time_expire": 1458823530,
"time_settle": null,
"transaction_no": "201603232045308241708",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_rL0a1G8CGeXPbjzn58K48SiP/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 123,
"request": "iar_9W9OWTGC8u5SHW9uXPrnv5OK"
}
cp_b2b
{
"id": "evt_AYpxA7Dex6RwPD5nOiv7lqcm",
"created": 1452680525,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_Sq948SHWznbLWz1WrPKaLi18",
"object": "charge",
"created": 1452678581,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cp_b2b",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {},
"time_paid": 1452680445,
"time_expire": 1452764981,
"time_settle": null,
"transaction_no": "0000000007285111",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_Sq948SHWznbLWz1WrPKaLi18/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 93,
"request": "iar_4ujfPCS8KuP4jvXT00KGS408"
}
upacp_b2b
{
"id": "evt_sRUEeosZwdJKF26sA8v7kMcf",
"created": 1528880745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_Xf1yL8nXnL4SbbHarPCSevnH",
"object": "charge",
"created": 1528880743,
"livemode": true,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "upacp_b2b",
"order_no": "149572338024362",
"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",
"acc_no": "6228***********0000",
"pay_card_type": "01",
"pay_type": "0201"
},
"time_paid": 1528880745,
"time_expire": 1528967143,
"time_settle": null,
"transaction_no": null,
"refunds": {
"object": "list",
"url": "/v1/charges/ch_Xf1yL8nXnL4SbbHarPCSevnH/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": null
}
},
"object": "event",
"pending_webhooks": 62,
"request": "iar_HeTOeTrfbbD0jnj1SOaLyzDO"
}
wx
{
"id": "evt_MMArSZxWRxWfsoiDuIOemIYY",
"created": 1458736762,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_vj9840v9Wj9GTOeTKOOqzLKG",
"object": "charge",
"created": 1458736756,
"livemode": true,
"paid": true,
"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": {
"open_id": "opePLvjpGYT_CQYCbANB3uxlOSlA",
"bank_type": "CFT"
},
"time_paid": 1458736761,
"time_expire": 1458743956,
"time_settle": null,
"transaction_no": "4000002001201603234221760039",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_vj9840v9Wj9GTOeTKOOqzLKG/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 43,
"request": "iar_b50K4C5SSuHGz9OKSGznz08O"
}
wx_pub
{
"id": "evt_FTixXlFYxUUbQryza63V9gGC",
"created": 1458736940,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uD8GeTrTSy9K04m9G0qb10S0",
"object": "charge",
"created": 1458736934,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_pub",
"order_no": "123456789",
"client_ip": "121.40.97.234",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"open_id": "o9zpMs1xDDmFehwLaPfz2ga6wzSs",
"bank_type": "CFT"
},
"time_paid": 1458736939,
"time_expire": 1458744134,
"time_settle": null,
"transaction_no": "4000002001201603234221805062",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uD8GeTrTSy9K04m9G0qb10S0/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 83,
"request": "iar_8mr9mDjDyLi1yfP8SGrP4yTK"
}
wx_lite
{
"id": "evt_FTixXlFYxUUbQryza63V9gGC",
"created": 1458736940,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uD8GeTrTSy9K04m9G0qb10S0",
"object": "charge",
"created": 1458736934,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_lite",
"order_no": "123456789",
"client_ip": "121.40.97.234",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"open_id": "o9zpMs1xDDmFehwLaPfz2ga6wzSs",
"bank_type": "CFT"
},
"time_paid": 1458736939,
"time_expire": 1458744134,
"time_settle": null,
"transaction_no": "4000002001201603234221805062",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uD8GeTrTSy9K04m9G0qb10S0/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 83,
"request": "iar_8mr9mDjDyLi1yfP8SGrP4yTK"
}
yeepay_wap
{
"id": "evt_3BFHY8FSn7e4LqttLztq1cnJ",
"created": 1458737039,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_a1aHePvrnHOC4uHCiHKunH88",
"object": "charge",
"created": 1458737027,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "yeepay_wap",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"product_category": 7,
"identity_id": "d2:bf:11:78:09:88",
"identity_type": "0",
"terminal_type": "1",
"terminal_id": "d2:bf:11:78:09:88",
"user_ua": "PingppSDK",
"result_url": "http://115.29.205.93/tests/yeepay_wap_result.php"
},
"time_paid": 1458737039,
"time_expire": 1458823427,
"time_settle": null,
"transaction_no": "411603237462969363",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_a1aHePvrnHOC4uHCiHKunH88/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"keyyyy": "valueeeee"
},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 105,
"request": "iar_8OWjL4vzL8G8Lq9yf1qDiTGC"
}
jdpay_wap
{
"id": "evt_tHII7PhwM8a6v3NLEOuAKl5N",
"created": 1458737093,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_Hivjz9KKyTuHrb5aP81ejPCK",
"object": "charge",
"created": 1458189392,
"livemode": true,
"paid": true,
"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": 1458189400,
"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": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 111,
"request": "iar_0K0Kq1bfL8WPj1ezrLnPKe94"
}
applepay_upacp
{
"id": "evt_SdR2dDK2O1rBmkLR8FhGVvHf",
"created": 1458792799,
"livemode": false,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_zffTS0rXrnz5nvnHaPa9mvfP",
"object": "charge",
"created": 1458792688,
"livemode": false,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"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": 1458792799,
"time_expire": 1458796288,
"time_settle": null,
"transaction_no": "201603241213197065160",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_zffTS0rXrnz5nvnHaPa9mvfP/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 126,
"request": "iar_DWPGm5rjPuP81an94Gm1uTaL"
}
cmb_wallet
{
"id": "evt_c6XY09f3AwYjQlAtFTAyEm53",
"created": 1467254760,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_8a1mvHGKq1y1GuHqDSHiD0S8",
"object": "charge",
"created": 1467169019,
"livemode": true,
"paid": true,
"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": 1467254760,
"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": {},
"description": null
}
},
"object": "event",
"pending_webhooks": 117,
"request": "iar_W5SSuDqvPu98Lifjv5uTWLqD"
}
cmb_pc_qr
{
"id": "evt_c6XY09f3AwYjQlAtFTAyEm53",
"created": 1467254760,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_q5inv1ezrn10bnrj9COi1OS4",
"object": "charge",
"created": 1532664248,
"livemode": true,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_4OOi9SGuD88GGqbL",
"channel": "cmb_pc_qr",
"order_no": "912111532664248",
"client_ip": "127.0.0.1",
"amount": 15,
"amount_settle": 15,
"currency": "cny",
"subject": "Pingxx测试订单1532664248",
"body": "Pingxx测试订单1532664248",
"extra": {
"result_url": "https://www.pingxx.com",
"p_no": "10001",
"mobile": "13111111111",
"register_time": 1532334494,
"new_register": true,
"city_code": "200111",
"address_city": "200111",
"address_mobile": "13111111111",
"product_type": "1001",
"card_type": "03"
},
"time_paid": 1532664275,
"time_expire": 1532750648,
"time_settle": null,
"transaction_no": "18272721100000004040",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_q5inv1ezrn10bnrj9COi1OS4/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": null
}
},
"object": "event",
"pending_webhooks": 117,
"request": "iar_W5SSuDqvPu98Lifjv5uTWLqD"
}
wx_wap
{
"id": "evt_l5Hk7cW2mH5OdKGrGopdRSAZ",
"created": 1468292151,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_zjbDC8j5CSiTPenDK4C0qLaD",
"object": "charge",
"created": 1468292142,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "wx_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "cny",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"bank_type": "CFT",
"open_id": "opePLvjpGYT_CQYCbANB3uxlOSlA"
},
"time_paid": 1468292149,
"time_expire": 1468378542,
"time_settle": null,
"transaction_no": "4000002001201603234221760000",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_zjbDC8j5CSiTPenDK4C0qLaD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 43,
"request": "iar_b50K4C5SSuHGz9OKSGzn1111"
}
qpay
{
"id": "evt_YGyc34nD7X5PcjsPffochaIS",
"object": "event",
"type": "charge.succeeded",
"livemode": false,
"created": 1476856919,
"data": {
"object": {
"id": "ch_HybzX9zPO0mDGGKSe9zf5m5G",
"object": "charge",
"created": 1476853028,
"livemode": false,
"paid": true,
"refunded": false,
"app": "app_KSqrT0jPKabD1qjz",
"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": 1476856919,
"time_expire": 1476939428,
"time_settle": null,
"transaction_no": "201610191401594349830",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_HybzX9zPO0mDGGKSe9zf5m5G/refunds",
"has_more": false,
"data": [
]
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
},
"credential": {
},
"description": null
}
},
"pending_webhooks": 4,
"request": "iar_jT4eTKW9mPKKXfXbX15ujH44"
}
qpay_pub
{
"id": "evt_YGyc34nD7X5PcjsPffocha3S",
"object": "event",
"type": "charge.succeeded",
"livemode": false,
"created": 1476853028,
"data": {
"object": {
"id": "ch_rLWvj9HizLGKyrbXPCOunjfD",
"object": "charge",
"created": 1476853028,
"livemode": false,
"paid": true,
"refunded": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "qpay_pub",
"order_no": "1478766781655",
"client_ip": "127.0.0.1",
"amount": 1,
"amount_settle": 1,
"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": 1476853200
"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
}
},
"pending_webhooks": 4,
"request": "iar_jT4eTKW9mPKKXfXbX15ujH44"
}
qpay_pub
{
"id": "evt_YGyc34nD7X5PcjsPffocha3S",
"object": "event",
"type": "charge.succeeded",
"livemode": false,
"created": 1476853028,
"data": {
"object": {
"id": "ch_9yrT8KHqvDC89eTmvHqDqf54",
"object": "charge",
"created": 1541729246,
"livemode": true,
"paid": true,
"refunded": false,
"reversed": false,
"app": "app_QSqrT0jPKabD1qjz",
"channel": "ccb_pay",
"order_no": "91211E1naAUcKbkC9B0L",
"client_ip": "185.53.60.93",
"amount": 10,
"amount_settle": 10,
"currency": "cny",
"subject": "sub1541729245ccb_pay",
"body": "PHP Body for @测试支付",
"extra": {
"support_account_type": "3",
"pos_id": "009806933",
"remark": "xolC8BjIRxZpp76u0BYaXNvfRwvrldia",
"buyer_account": "***************1978"
},
"time_paid": 1541729246,
"time_expire": 1541815646,
"time_settle": null,
"transaction_no": "N59962645618",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_9yrT8KHqvDC89eTmvHqDqf54/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {
"userStr": "KTs/YDg3ZFUFONZUC10SuA=="
},
"credential": {},
"description": "Testing in + PHP, Ping++ 测试,此处仅用于测试模式测试 @1541729245"
}
},
"pending_webhooks": 4,
"request": "iar_jT4eTKW9mPKKXfXbX15ujH44"
}
cb_alipay
{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uzTivLH4KubHWHmvfHSajXj5",
"object": "charge",
"created": 1458736738,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"buyer_account": "alipay_account",
"buyer_user_id": "alipay_id",
"rate":6.7,
"pay_amount":100
},
"time_paid": 1458736743,
"time_expire": 1458823138,
"time_settle": null,
"transaction_no": "2016032321001004920229421275",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uzTivLH4KubHWHmvfHSajXj5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 32,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
cb_alipay_wap
{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uzTivLH4KubHWHmvfHSajXj5",
"object": "charge",
"created": 1458736738,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay_wap",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"buyer_account": "alipay_account",
"buyer_user_id": "alipay_id",
"rate":6.7,
"pay_amount":100
},
"time_paid": 1458736743,
"time_expire": 1458823138,
"time_settle": null,
"transaction_no": "2016032321001004920229421275",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uzTivLH4KubHWHmvfHSajXj5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 2,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
cb_alipay_pc_direct
{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uzTivLH4KubHWHmvfHSajXj5",
"object": "charge",
"created": 1458736738,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_alipay_pc_direct",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"buyer_account": "alipay_account",
"buyer_user_id": "alipay_id",
"rate":6.7,
"pay_amount":100
},
"time_paid": 1458736743,
"time_expire": 1458823138,
"time_settle": null,
"transaction_no": "2016032321001004920229421275",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uzTivLH4KubHWHmvfHSajXj5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 32,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
cb_wx
{
"id": "evt_2ersVj0xe6N1T4GEWvSyg4Yb",
"created": 1458736877,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_9O44yLSy98iDjLaPmD1S48qT",
"object": "charge",
"created": 1458736849,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_wx",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"goods_list": [
{
"goods_name": "iPhone",
"goods_num": "1"
}
],
"limit_pay": "no_credit",
"bank_type": "your bank type",
"is_subscribe": "N",
"cash_fee": 1,
"cash_fee_type": "cny",
"rate": 100000000
},
"time_paid": 1458736875,
"time_expire": 1458823249,
"time_settle": null,
"transaction_no": "2016032321001004770283682851",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_bLOivPXjvj1OWvfH44WLenrD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 2,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
cb_wx_pub
{
"id": "evt_2ersVj0xe6N1T4GEWvSyg4Yb",
"created": 1458736877,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_9O44yLSy98iDjLaPmD1S48qT",
"object": "charge",
"created": 1458736849,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "cb_wx_pub",
"order_no": "123456789",
"client_ip": "116.228.208.114",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body.",
"extra": {
"open_id": "openidxxxxxxxxxxxx",
"goods_list": [
{
"goods_name": "iPhone",
"goods_num": "1"
}
],
"limit_pay": "no_credit",
"bank_type": "your bank type",
"is_subscribe": "N",
"cash_fee": 1,
"cash_fee_type": "cny",
"rate": 100000000
},
"time_paid": 1458736875,
"time_expire": 1458823249,
"time_settle": null,
"transaction_no": "2016032321001004770283682851",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_bLOivPXjvj1OWvfH44WLenrD/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"object": "event",
"pending_webhooks": 2,
"request": "iar_ebTWPK8KGivPbD4OaPOeb1q5"
}
paypal
{
"id": "evt_sqJ9N7fQS7cCfmTFkhmWyQbR",
"created": 1458736745,
"livemode": true,
"type": "charge.succeeded",
"data": {
"object": {
"id": "ch_uzTivLH4KubHWHmvfHSajXj5",
"object": "charge",
"created": 1458736738,
"livemode": true,
"paid": true,
"refunded": false,
"app": "app_1Gqj58ynP0mHeX1q",
"channel": "paypal",
"order_no": "123456789",
"client_ip": "127.0.0.1",
"amount": 100,
"amount_settle": 100,
"currency": "usd",
"subject": "Your Subject",
"body": "Your Body",
"extra": {
"result_url": "https://www.baidu.com/",
"cancel_url": "https://www.baidu.com/",
"payment_id": "PAY-11117152NW4841328LM11111",
"payee": {
"merchant_id": "11144NYWM111",
"email": "111@test.com"
},
"payer_info": {
"email": "111@qq.com",
"first_name": "111",
"last_name": "111",
"payer_id": "1111KHCFNZ111",
"shipping_address": {
"recipient_name": "111 111",
"line1": "test",
"city": "New York",
"state": "NY",
"postal_code": "10451",
"country_code": "US"
},
"country_code": "US"
}
},
"time_paid": 1458736743,
"time_expire": 1458823138,
"time_settle": null,
"transaction_no": "2016032321001004920229421275",
"refunds": {
"object": "list",
"url": "/v1/charges/ch_uzTivLH4KubHWHmvfHSajXj5/refunds",
"has_more": false,
"data": []
},
"amount_refunded": 0,
"failure_code": null,
"failure_msg": null,
"metadata": {},
"credential": {},
"description": "Your Description"
}
},
"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 没有收到或者延缓更新时,可以主动调用支付查询接口来获得交易的状态。

单笔支付查询

\Pingpp\Charge::retrieve('ch_id');
Charge ch = Charge.retrieve("ch_id");
pingpp.charges.retrieve(
"ch_id",
function(err, charge) {
// YOUR CODE
}
);
ch = pingpp.Charge.retrieve('ch_id')
Pingpp::Charge.retrieve("ch_id")
ch, err := charge.Get("ch_id")
var ch = Charge.Retrieve("ch_id");

支付列表查询

\Pingpp\Charge::all(array('limit' => 3));
Map chargeParams = new HashMap<String, Object>();
chargeParams.put("limit", 3);
Charge.all(chargeParams);
pingpp.charges.list({ limit: 3 }, function(err, charges) {
// YOUR CODE
});
res = pingpp.Charge.all(limit=3)
Pingpp::Charge.all(:limit => 3)
params := &pingpp.ChargeListParams{}
params.Filters.AddFilter("limit", "", "3")
//设置是不是只需要之前设置的 limit 这一个查询参数
params.Single = true
i := charge.List(params)
for i.Next() {
c := i.Charge()
ch, _ := json.Marshal(c)
fmt.Println(string(ch))
}
var chs = Charge.List(new Dictionary<string, object> {{"limit", 3}});

注意事项

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

下一步扫码支付