至少要求 .NET 4.6 及以上。
- namespace 由 pingpp 改为 Pingpp
- 所有方法名更改,首字母大写
- 如果您的项目中 .NET Framework版本低于 4.6,请切换至 1.4.5 版本
// 设置 API-KEY
Pingpp.Pingpp.SetApiKey("sk_test_ibbTe5jLGCi5rzfH4OqPW9KC");
密钥需要你自己生成,公钥请填写到 Ping++ Dashboard
Pingpp.Pingpp.SetPrivateKeyPath(@"你生成的私钥文件的路径");
设置重试次数,0
表示不重试,默认为 1
。
Pingpp.Pingpp.SetMaxNetworkRetries(1);
当服务端返回 502
时,是否根据返回内容(阿里高防返回)来判断是否重试。true
表示只要是 502
,全部重试,false
关闭重试功能。默认为 true
。
Pingpp.Pingpp.SetBadGateWayMatch(true);
Charge ch = Charge.Create(Dictionary<String, Object> param);
Charge ch = Charge.Retrieve(String id);
ChargeList chs = Charge.List(Dictionary<String, Object> listParam);
Charge ch = Charge.Reverse(String chargeId);
Refund re = Refund.Create(String chId, Dictionary<String, Object> param);
Refund re = Refund.Retrieve(String chId, String reId);
RefundList res = Refund.List(String chId, Dictionary<String, Object> listParam);
RedEnvelope red = RedEnvelope.Create(Dictionary<String, Object> param);
RedEnvelope red = RedEnvelope.Retrieve(String id);
RedEnvelopeList reds = RedEnvelope.List(Dictionary<String, Object> listParam);
Transfer tr = Transfer.Create(Dictionary<String, Object> param);
Transfer tr = Transfer.Retrieve(String id);
TransferList trs = Transfer.List(Dictionary<String, Object> listParam);
Identification.Identify(new Dictionary<string, object> iParams);
Customs.Create(Dictionary<string, object> cuParams);
Customs.Retrieve(string Id);
BatchRefund.Create(Dictionary<string, object> btParams);
BatchRefund.List(Dictionary<string, object> listParams)
BatchRefund.Retrieve(string Id)
BatchTransfer.Create(Dictionary<string, object> btParams);
BatchTransfer.Retrieve(string batchTransterId)
BatchTransfer.List(Dictionary<string, object> btParams)
Event evt = Event.Retrieve(string id);
BatchTransfer.Create(Dictionary<string, object> btParams);
BatchTransfer.List(Dictionary<string, object> listParams)
BatchTransfer.Retrieve(string Id)
Order.Create(Dictionary<string, object> orParams);
Order.Cancel(string Id);
Order.Retrieve(string Id);
Order.List(Dictionary<string, object> orParams});
Order.Pay(or.Id, Dictionary<string, object> payParams);
Order.ChargeList(or.Id);
Order.ChargeRetrieve(or.Id, string chargeId);
OrderRefund.Create(string orderId, Dictionary<string, object> reParams);
OrderRefund.Retrieve(string orderId, string refundId)
OrderRefund.List(string orderId)
Recharge.Create(appId, Dictionary<string, object> createParams);
Recharge.Retrieve(appId, string Id)
Recharge.List(appId)
RechargeRefund.Create(appId, string Id, Dictionary<string, object> refundParams)
RechargeRefund.Create(appId, string Id, string refundId)
RechargeRefund.List(appId, string Id));
User.Create(string appId, Dictionary<string, object> uParams);
User.List(string appId);
User.Retrieve(string appId, string userId);
User.Update(string appId, string userId, Dictionary<string, object>);
User.Enable(string appId, string userId);
User.Disable(string appId, string userId)
BalanceTransaction.List(string appId, string userId, Dictionary<string, object> listParams);
BalanceTransaction.Retrieve(string appId, string uid, string txnId);
Withdrawal.Request(string appId, string uid, Dictionary<string, object> wdParams);
Withdrawal.List(string appId, string uid, Dictionary<string, object> wdParams);
Withdrawal.Retrieve(string appId, string uid, string wrId);
Withdrawal.Cancel(string appId, string uid, string withDramalsId)
Withdrawal.Confirm(string appId, string uid, string withDramalsId)
Coupon.Create(string appId, string uid, Dictionary<string, object> couponParams);
Coupon.Retrieve(string appId, string uid, string couId)
Coupon.Update(string appId, string uid, string couId, Dictionary<string, object> { { "metadata", Dictionary<string, string> couponParams)
Coupon.Delete(string appId, string uid, string couId)
CouponTemplate.Create(string appId, Dictionary<string, object> couTmplParams);
CouponTemplate.List(string appId)
CouponTemplate.Retrieve(string appId, string couTmplId)
CouponTemplate.Update(string appId, string couTmplId,Dictionary<string, object> ctplParams)
CouponTemplate.Delete(string appId, string couTmplId)
Coupon.BatchCreate(string appId, string couTmplId, Dictionary<string, object> couponParams)
Coupon.ListInTemplate(string appId, string couId)
BatchTransfer.Create(Dictionary<string, object> btParams);
BatchTransfer.Retrieve(string batchTransterId)
BatchWithdrawal.Create(string appId, Dictionary<string, object> batchwrParams);
BatchWithdrawal.Create(string appId, string batchWithdrawalId);
var param = new Dictionary<string, object> {
{"display_name", "sub_app_display_name"},
{"user", "user_006"},
{"metadata", new Dictionary<string,object>{
{"key", "value"}
}},
{"description", "Your description"},
};
SubApp.Create(appId, param)
SubApp.Retrieve(appId, "app_L0GyTKKqfnnPynD4")
var upParam = new Dictionary<string, object> {
{"display_name", "sub_app_display_name2"},
{"metadata", new Dictionary<string,object>{
{"key", "value2"}
}},
{"description", "Your description2"},
};
SubApp.Update(appId, "app_L0GyTKKqfnnPynD4", upParam)
SubApp.Delete(appId, "app_L0GyTKKqfnnPynD4")
SubApp.List(appId)
var param = new Dictionary<string, object> {
{"channel", "bfb"},
{"banned", false},
{"banned_msg", null},
{"description", "The description for bfb"},
{"params", new Dictionary<string,object>{
{"bfb_sp", "bfb sp"},
{"fee_rate", 30},
{"bfb_key", "Your key"}
}}
};
SubAppChannel.Create(appId, subAppId, param)
var upParam = new Dictionary<string, object> {
{"banned", false},
{"banned_msg", null},
{"description", "The new description for bfb"},
{"params", new Dictionary<string,object>{
{"bfb_sp", "1500300006"},
{"fee_rate", 35},
{"bfb_key", "w837cG3xQk2KMQ3EZVdByEryJpTN7MzC"}
}}
};
SubAppChannel.Update(appId, subAppId, "bfb", upParam)
SubAppChannel.Delete(appId, subAppId, "bfb")
SubAppChannel.Retrieve(appId, subAppId, "bfb")
var paramUnionPay = new Dictionary<string, object> {
{"channel","unionpay"},
{"recipient", new Dictionary<string,object>{
{"account", "6214666666666666"},
{"name", "张三"},
{"type", "b2c"}, //转账类型。b2c:企业向个人付款,b2b:企业向企业付款。
{"open_bank", "招商银行"},
{"open_bank_code", "0308"}
}}
};
SettleAccount.Create(appId, "test_user_002", paramUnionPay))
SettleAccount.Retrieve(appId, "test_user_002", "320217032111554400000901")
SettleAccount.Delete(appId, "test_user_002", "320217032111554400000901")
SettleAccount.List(appId, "test_user_002")
var updateParam = new Dictionary<string, object> {
{"ids", new List<string>{
"170301124238000111",
"170301124238000211"
}},
{"method", "manual"},
{"description", "Your description"}
};
Royaltie.Update(updateParam)
Royaltie.Retrieve("421170321093600003")
var listParams = new Dictionary<string, object>{
{"payer_app", "app_LibTW1n1SOq9Pin1"},
{"source_app","app_LibTW1n1SOq9Pin1"},
{"page", 1},
{"per_page", 1}
};
Royaltie.List(listParams)
var createParam = new Dictionary<string, object> {
{"payer_app", "app_LibTW1n1SOq9Pin1"},
{"method", "alipay"},
{"recipient_app", "app_1Gqj58ynP0mHeX1q"},
{"created", new Dictionary<string,object>{
{"gt" , 1488211200},
{"lte" , 1488297600}
}}
};
RoyaltySettlement.Create(createParam)
RoyaltySettlement.Retrieve("431170321101800001")
var updateParam = new Dictionary<string, object> {
{"status", "canceled"}
};
Console.("**** 更新royalty_settlement 对象 ****");
RoyaltySettlement.Update("431170321101800001", updateParam)
var listParam = new Dictionary<string, object> {
{"payer_app", "app_LibTW1n1SOq9Pin1"}
};
RoyaltySettlement.List(listParam)
RoyaltyTransaction.Retrieve("441170321101800003")
var listParam = new Dictionary<string, object> {
{"page", 1},
{"per_page", 10}
};
RoyaltyTransaction.List(listParam)
RoyaltyTemplate.Create(Dictionary<string, object> createParam)
RoyaltyTemplate.Retrieve(string Id)
RoyaltyTemplate.Update("451170814105500001", Dictionary<string, object> updateParam)
RoyaltyTemplate.Delete(string Id);
RoyaltyTemplate.List();
BalanceTransfer.Create(appId, Dictionary<string, object> createParams);
BalanceTransfer.Retrieve(appId, string balanceTransferId);
BalanceTransfer.List(appId);
BalanceBonus.Create(appId, Dictionary<string, object> createParams));
BalanceBonus.Retrieve(appId, string balanceBonusId)
BalanceBonus.List(appId);
BalanceSettlement.List(appId)
BalanceSettlement.Retrieve(appId, string balaneSettlementId)
CardInfo.Query(List<string> params)
详细信息请参考 API 文档
Agreement.Create( Dictionary<string, object> createParams)
Agreement.Retrieve(string Id)
Agreement.Cancel(string Id)
Agreement.List( Dictionary<string, object> listParams)
WxPubUtils.GetOpenId(string appId, string appSecret, string code)
WxPubUtils.GetWxLiteOpenId(string appId, string appSecret, string code)