登录
退出
首页
开放版图
苏宁有货
商家后台
文档中心
文档中心
API文档
消息中心
平台公告
工单
我的工单
提交工单
控制台
SDK调用示例
suning.govbus.mixpayorder.add/
调用示例(JAVA)
复制全部代码
import com.suning.api.entity.govbus.MixpayorderAddRequest; import com.suning.api.entity.govbus.MixpayorderAddResponse; MixpayorderAddRequest request = new MixpayorderAddRequest(); request.setAddress("江苏省南京市雨花区软件大道舜天集团"); request.setAmount("88.00"); request.setCityId("025"); request.setCompanyCustNo("15114631094@suning.com"); request.setCountyId("05"); request.setEmail("xxx@xxx.com"); request.setHopeArrivalTime("2019-11-06-3"); request.setInvoiceContent("1"); request.setInvoiceState("1"); request.setInvoiceTitle("江苏舜天有限公司"); request.setInvoiceType("1"); request.setMobile("15311351111"); request.setOrderType("1"); request.setPayment("08"); request.setProvinceId("100"); request.setReceiverName("张三"); request.setRemark("xxxxx"); request.setServFee("5.00"); Sku sku= new Sku(); sku.setNum("1"); sku.setSkuId("140272356"); sku.setUnitPrice("88.00"); List
skuList =new ArrayList
(); skuList.add(sku); request.setSku(skuList); SpecialVatTicket specialVatTicket= new SpecialVatTicket(); specialVatTicket.setCompanyName("江苏舜天有限公司"); specialVatTicket.setConsigneeAddress("江苏省南京市秦淮区法院"); specialVatTicket.setConsigneeMobileNum("15822222200"); specialVatTicket.setConsigneeName("张三"); specialVatTicket.setRegAccount("23235254664336"); specialVatTicket.setRegAdd("江苏省南京市雨花区软件大道舜天集团"); specialVatTicket.setRegBank("453453434534354"); specialVatTicket.setRegTel("18767890345"); specialVatTicket.setTaxNo("1234567890ABCDE"); request.setSpecialVatTicket(specialVatTicket); request.setSpecRemark("buyer:张三"); SubPaymentModes subPaymentModes= new SubPaymentModes(); subPaymentModes.setPayAmount("50"); subPaymentModes.setPayCode("7207"); List
subPaymentModesList =new ArrayList
(); subPaymentModesList.add(subPaymentModes); request.setSubPaymentModes(subPaymentModesList); request.setTelephone("010-84728989"); request.setTownId("01"); request.setTradeNo("1000001"); request.setZip("210000"); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 request.setCheckParam(true); String serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; String appKey = "你的appKey"; String appSecret = "你的appSecret"; DefaultSuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret, "json"); try { MixpayorderAddResponse response = client.excute(request); System.out.println("返回json/xml格式数据 :" + response.getBody()); } catch (SuningApiException e) { e.printStackTrace(); }
调用示例(PHP)
复制全部代码
$req = new MixpayorderAddRequest(); $req -> setAddress("江苏省南京市雨花区软件大道舜天集团"); $req -> setAmount("88.00"); $req -> setCityId("025"); $req -> setCompanyCustNo("15114631094@suning.com"); $req -> setCountyId("05"); $req -> setEmail("xxx@xxx.com"); $req -> setHopeArrivalTime("2019-11-06-3"); $req -> setInvoiceContent("1"); $req -> setInvoiceState("1"); $req -> setInvoiceTitle("江苏舜天有限公司"); $req -> setInvoiceType("1"); $req -> setMobile("15311351111"); $req -> setOrderType("1"); $req -> setPayment("08"); $req -> setProvinceId("100"); $req -> setReceiverName("张三"); $req -> setRemark("xxxxx"); $req -> setServFee("5.00"); $sku= new Sku(); $sku-> setNum("1"); $sku-> setSkuId("140272356"); $sku-> setUnitPrice("88.00"); $req -> setSku(array($sku)); $specialVatTicket= new SpecialVatTicket(); $specialVatTicket-> setCompanyName("江苏舜天有限公司"); $specialVatTicket-> setConsigneeAddress("江苏省南京市秦淮区法院"); $specialVatTicket-> setConsigneeMobileNum("15822222200"); $specialVatTicket-> setConsigneeName("张三"); $specialVatTicket-> setRegAccount("23235254664336"); $specialVatTicket-> setRegAdd("江苏省南京市雨花区软件大道舜天集团"); $specialVatTicket-> setRegBank("453453434534354"); $specialVatTicket-> setRegTel("18767890345"); $specialVatTicket-> setTaxNo("1234567890ABCDE"); $req -> setSpecialVatTicket($specialVatTicket); $req -> setSpecRemark("buyer:张三"); $subPaymentModes= new SubPaymentModes(); $subPaymentModes-> setPayAmount("50"); $subPaymentModes-> setPayCode("7207"); $req -> setSubPaymentModes(array($subPaymentModes)); $req -> setTelephone("010-84728989"); $req -> setTownId("01"); $req -> setTradeNo("1000001"); $req -> setZip("210000"); //api入参校验逻辑开关,当测试稳定之后建议设置为 false 或者删除该行 $req -> setCheckParam('true'); $serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; $appKey = "你的appKey"; $appSecret = "你的appSecret"; $client = new DefaultSuningClient($serverUrl,$appKey,$appSecret,'json'); $resp = $client -> execute($req); print_r("返回响应报文:".$resp);
调用示例(.NET)
复制全部代码
using suning_api_sdk.BizRequest.CustomGovbusRequest; using suning_api_sdk.BizResponse.CustomGovbusResponse; using suning_api_sdk.Models.CustomGovbusModel; MixpayorderAddRequest request = new MixpayorderAddRequest(); request.address="江苏省南京市雨花区软件大道舜天集团"; request.amount="88.00"; request.cityId="025"; request.companyCustNo="15114631094@suning.com"; request.countyId="05"; request.email="xxx@xxx.com"; request.hopeArrivalTime="2019-11-06-3"; request.invoiceContent="1"; request.invoiceState="1"; request.invoiceTitle="江苏舜天有限公司"; request.invoiceType="1"; request.mobile="15311351111"; request.orderType="1"; request.payment="08"; request.provinceId="100"; request.receiverName="张三"; request.remark="xxxxx"; request.servFee="5.00"; MixpayorderAddSkuReq sku= new MixpayorderAddSkuReq(); sku.num="1"; sku.skuId="140272356"; sku.unitPrice="88.00"; List
skuList =new ArrayList
(); skuList.add(sku); request.sku=skuList; MixpayorderAddSpecialVatTicketReq specialVatTicket= new MixpayorderAddSpecialVatTicketReq(); specialVatTicket.companyName="江苏舜天有限公司"; specialVatTicket.consigneeAddress="江苏省南京市秦淮区法院"; specialVatTicket.consigneeMobileNum="15822222200"; specialVatTicket.consigneeName="张三"; specialVatTicket.regAccount="23235254664336"; specialVatTicket.regAdd="江苏省南京市雨花区软件大道舜天集团"; specialVatTicket.regBank="453453434534354"; specialVatTicket.regTel="18767890345"; specialVatTicket.taxNo="1234567890ABCDE"; request.specialVatTicket=specialVatTicket; request.specRemark="buyer:张三"; MixpayorderAddSubPaymentModesReq subPaymentModes= new MixpayorderAddSubPaymentModesReq(); subPaymentModes.payAmount="50"; subPaymentModes.payCode="7207"; List
subPaymentModesList =new ArrayList
(); subPaymentModesList.add(subPaymentModes); request.subPaymentModes=subPaymentModesList; request.telephone="010-84728989"; request.townId="01"; request.tradeNo="1000001"; request.zip="210000"; //开启日志调试,当测试稳定之后建议设置为 false 或者删除该行 SuningLogger.IsLogDebug = true; string serverUrl = "https://openpre.cnsuning.com/api/http/sopRequest"; string appKey = "你的appKey"; string appSecret = "你的appSecret"; ISuningClient client = new DefaultSuningClient(serverUrl, appKey,appSecret); MixpayorderAddResponse response = client.Execute(request);
调用示例(PYTHON)
复制全部代码
# -*- coding: utf-8 -*- import suning.api request = suning.api.govbus.MixpayorderAddRequest() request.address="江苏省南京市雨花区软件大道舜天集团"; request.amount="88.00"; request.cityId="025"; request.companyCustNo="15114631094@suning.com"; request.countyId="05"; request.email="xxx@xxx.com"; request.hopeArrivalTime="2019-11-06-3"; request.invoiceContent="1"; request.invoiceState="1"; request.invoiceTitle="江苏舜天有限公司"; request.invoiceType="1"; request.mobile="15311351111"; request.orderType="1"; request.payment="08"; request.provinceId="100"; request.receiverName="张三"; request.remark="xxxxx"; request.servFee="5.00"; request. sku= [{ num:"1", skuId:"140272356", unitPrice:"88.00", }]; request. specialVatTicket= { companyName:"江苏舜天有限公司", consigneeAddress:"江苏省南京市秦淮区法院", consigneeMobileNum:"15822222200", consigneeName:"张三", regAccount:"23235254664336", regAdd:"江苏省南京市雨花区软件大道舜天集团", regBank:"453453434534354", regTel:"18767890345", taxNo:"1234567890ABCDE", }; request.specRemark="buyer:张三"; request. subPaymentModes= [{ payAmount:"50", payCode:"7207", }]; request.telephone="010-84728989"; request.townId="01"; request.tradeNo="1000001"; request.zip="210000"; domain = "https://openpre.cnsuning.com" appKey = "你的appKey" appSecret = "你的appSecret" request.setDomainInfo(domain,"80") request.setAppInfo(appKey,appSecret) try: result=request.getResponse() print(result) except Exception as e: print(e)