有赞新零售社区

发帖
API使用问题»使用SDK调用跨境报关接口

使用SDK调用跨境报关接口

有赞-妮子 2019-04-24 1495 浏览 0 评论 | 只看楼主 [打印]
说明:

本帖主要是介绍说明原开放平台下的SDK如何调用跨境报关接口

方法:
##maven仓库:
  1.                  <dependency>
  2.                         <groupId>com.youzan</groupId>
  3.                         <artifactId>open-sdk-client</artifactId>
  4.                         <version>2.5.3-RELEASE</version>
  5.                 </dependency>
  6.                 <dependency>
  7.                         <groupId>com.youzan</groupId>
  8.                         <artifactId>open-sdk-gen</artifactId>
  9.                         <version>2.8.4-RELEASE</version>
  10.                 </dependency>
复制代码

##私服地址:
  1.              <repository>
  2.             <id>baymax-releases</id>
  3.             <name>Nexus Release Repository</name>
  4.             <url>http://maven.youzanyun.com/repository/maven-releases/</url>
  5.             </repository>
复制代码

#实例:--####youzan.pay.customs.declaration.reportpayment.query
  1. YouzanPayCustomsDeclarationReportpaymentQueryParams youzanPayCustomsDeclarationReportpaymentQueryParams = new YouzanPayCustomsDeclarationReportpaymentQueryParams();

  2.         youzanPayCustomsDeclarationReportpaymentQueryParams.setTid("E20190401154338080300013");
  3.         youzanPayCustomsDeclarationReportpaymentQueryParams.setKdtId(42587152L);
  4.         youzanPayCustomsDeclarationReportpaymentQueryParams.setTransaction("190401154341000067");

  5.         YouzanPayCustomsDeclarationReportpaymentQuery youzanPayCustomsDeclarationReportpaymentQuery = new YouzanPayCustomsDeclarationReportpaymentQuery();
  6.         youzanPayCustomsDeclarationReportpaymentQuery.setAPIParams(youzanPayCustomsDeclarationReportpaymentQueryParams);
  7.         YouzanPayCustomsDeclarationReportpaymentQueryResult result = client.invoke(youzanPayCustomsDeclarationReportpaymentQuery);
  8.         result.getCustomsInfo();
  9.         result.getCustomsStatus();
  10.         result.getCustomsTime();
  11.         result.getSubOrderNo();
  12.         result.getTid();
  13.         result.getTransaction();
  14.         
复制代码

#实例 --####youzan.pay.customs.declaration.reportpayment.report
  1. YZClient client = new DefaultYZClient(new Token("token"));
  2.         YouzanPayCustomsDeclarationReportpaymentReportParams youzanPayCustomsDeclarationReportpaymentReportParams = new YouzanPayCustomsDeclarationReportpaymentReportParams();

  3.         youzanPayCustomsDeclarationReportpaymentReportParams.setTid("E20190401154338080300013");
  4.         youzanPayCustomsDeclarationReportpaymentReportParams.setKdtId(42587152L);
  5.         youzanPayCustomsDeclarationReportpaymentReportParams.setCustomsCode("HZ");
  6.         youzanPayCustomsDeclarationReportpaymentReportParams.setCurrency("CNY");
  7.         youzanPayCustomsDeclarationReportpaymentReportParams.setActionType(1L);
  8.         youzanPayCustomsDeclarationReportpaymentReportParams.setTransaction("190401154341000067");

  9.         YouzanPayCustomsDeclarationReportpaymentReport youzanPayCustomsDeclarationReportpaymentReport = new YouzanPayCustomsDeclarationReportpaymentReport();
  10.         youzanPayCustomsDeclarationReportpaymentReport.setAPIParams(youzanPayCustomsDeclarationReportpaymentReportParams);
  11.         YouzanPayCustomsDeclarationReportpaymentReportResult invoke = client.invoke(youzanPayCustomsDeclarationReportpaymentReport);

  12.         invoke.getCustomsStatus();
  13.         invoke.getKdtId();
  14.         invoke.getSubOrderNo();
  15.         invoke.getTid();
  16.         invoke.getTransaction();        
  17.         
  18.         
复制代码





本帖最后由 有赞-妮子 于 2019-4-23 19:18 编辑
用手机打开
收藏 ··· 回复
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    复制链接
    新浪微博
    QQ空间
    微信扫码
    • 回复

    • 评分

    客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

    复制成功