src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Ecommerce/readme.md
本模块实现了微信支付V3电商收付通相关的API接口,为电商平台提供完整的支付解决方案。
所有电商收付通相关API的基础路径为:v3/ecommerce
EcommerceApis.cs:主要API类,包含所有电商收付通相关接口Entities/RequestData/:请求数据类
EcommerceSubMerchantRequestData.cs:二级商户管理请求数据EcommerceCombineRequestData.cs:合单支付请求数据EcommerceProfitsharingRequestData.cs:分账相关请求数据(待补充)EcommerceSubsidiesRequestData.cs:补差相关请求数据(待补充)Entities/ReturnJson/:响应数据类
EcommerceReturnJson.cs:所有API响应数据Entities/NotifyJson/:回调通知数据类(待补充)// 二级商户进件
var applymentData = new SubMerchantApplymentRequestData
{
out_request_no = "APPLYMENT_00000000001",
organization_type = "SUBJECT_TYPE_ENTERPRISE",
business_license_info = new BusinessLicenseInfo
{
license_copy = "MediaID",
license_number = "123456789012345678",
merchant_name = "腾讯科技有限公司",
legal_person = "张三"
},
// ... 其他字段
};
var applymentResult = await ecommerceApis.SubMerchantApplymentAsync(applymentData);
// 合单下单
var combineData = new CombineTransactionsRequestData
{
combine_appid = "wxd678efh567hg6787",
combine_mchid = "1900000109",
combine_out_trade_no = "P20150806125346",
sub_orders = new CombineSubOrder[]
{
new CombineSubOrder
{
mchid = "1900000110",
out_trade_no = "20150806125347",
description = "腾讯充值中心-QQ会员充值",
amount = 100
}
},
// ... 其他字段
};
var combineResult = await ecommerceApis.CombineTransactionsAsync(combineData);
// 请求分账
var profitsharingData = new EcommerceProfitsharingRequestData
{
transaction_id = "1217752501201407033233368018",
out_order_no = "P20150806125346",
receivers = new ProfitsharingReceiver[]
{
new ProfitsharingReceiver
{
type = "MERCHANT_ID",
account = "1900000109",
amount = 100,
description = "分给商户1900000109"
}
}
};
var profitsharingResult = await ecommerceApis.EcommerceProfitsharingAsync(profitsharingData);