Modifier and Type | Field and Description |
---|---|
protected KdtApiClient |
client |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<CouponConsume>> |
COUPON_CONSUME_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Coupon>> |
COUPON_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Coupons>> |
COUPONS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Item>> |
ITEM_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Items>> |
ITEMS_RESPONSE_TYPE_REF |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<SelfFetchTrade>> |
SELF_FETCH_TRADE_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Shop>> |
SHOP_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Sku>> |
SKU_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Skus>> |
SKUS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Success>> |
SUCCESS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<TimelimitedDiscounts>> |
TIMELIMITED_DISCOUNTS_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Trade>> |
TRADE_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Trades>> |
TRADES_RESPONSE_TYPE_REF |
protected static com.fasterxml.jackson.core.type.TypeReference<Response<Verifylogs>> |
VERIFYLOGS_RESPONSE_TYPE_REF |
Constructor and Description |
---|
TradeService(KdtApiClient client) |
Modifier and Type | Method and Description |
---|---|
boolean |
applySelfFetchTrade(String code)
|
TradeDetail |
closeTrade(String tid,
String closeReasonId,
String closeReason,
String fields)
|
Trades |
getForOuterSoldTrades(String outerType,
String outerUserId,
Integer pageSize,
Long pageNo,
Boolean useHasNext,
Instant startCreated,
Instant endCreated,
Instant startUpdate,
Instant endUpdate,
String type,
String status,
String fields)
|
SelfFetchTrade |
getSelfFetchTrade(String code,
String fields)
|
Trades |
getSoldTrades(Integer pageSize,
Long pageNo) |
Trades |
getSoldTrades(String version,
Integer pageSize,
Long pageNo,
Boolean useHasNext,
Instant startCreated,
Instant endCreated,
Instant startUpdate,
Instant endUpdate,
String type,
String status,
Long senderId,
Long buyerId,
String buyerNick,
String buyWay,
String keyword,
Integer weixinUserType,
Long weixinUserId,
String fields)
|
TradeDetail |
getTrade(String tid,
Integer subTradePageSize,
Long subTradePageNo,
String fields)
|
protected <T> T |
readValue(String method,
Map<String,String> params,
com.fasterxml.jackson.core.type.TypeReference valueTypeRef) |
TradeDetail |
updateTradeMemo(String tid,
String memo,
String flag,
String fields)
|
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Success>> SUCCESS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Item>> ITEM_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Items>> ITEMS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Sku>> SKU_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Skus>> SKUS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Shop>> SHOP_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Trade>> TRADE_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Trades>> TRADES_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<SelfFetchTrade>> SELF_FETCH_TRADE_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Coupons>> COUPONS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<CouponConsume>> COUPON_CONSUME_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Verifylogs>> VERIFYLOGS_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<Coupon>> COUPON_RESPONSE_TYPE_REF
protected static final com.fasterxml.jackson.core.type.TypeReference<Response<TimelimitedDiscounts>> TIMELIMITED_DISCOUNTS_RESPONSE_TYPE_REF
protected final KdtApiClient client
protected final com.fasterxml.jackson.databind.ObjectMapper mapper
public TradeService(KdtApiClient client)
public TradeDetail getTrade(@Nonnull String tid, @Nullable Integer subTradePageSize, @Nullable Long subTradePageNo, @Nullable String fields) throws IOException, YouzanException
tid
- 交易编号subTradePageSize
- 指定获取子交易每页条数,不传则获取全部,上限500subTradePageNo
- 指定获取子交易的第几页,不传则获取全部fields
- 需要返回的交易对象字段,如tid,title,receiver_city等IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public Trades getSoldTrades(@Nullable String version, @Nullable Integer pageSize, @Nullable Long pageNo, @Nullable Boolean useHasNext, @Nullable Instant startCreated, @Nullable Instant endCreated, @Nullable Instant startUpdate, @Nullable Instant endUpdate, @Nullable String type, @Nullable String status, @Nullable Long senderId, @Nullable Long buyerId, @Nullable String buyerNick, @Nullable String buyWay, @Nullable String keyword, @Nullable Integer weixinUserType, @Nullable Long weixinUserId, @Nullable String fields) throws IOException, YouzanException
version
- 版本号pageSize
- 每页条数pageNo
- 页码useHasNext
- 是否启用has_next的分页方式startCreated
- 交易创建开始时间endCreated
- 交易创建结束时间startUpdate
- 交易状态更新的开始时间endUpdate
- 交易状态更新的结束时间type
- 订单类型 ,默认查询所有交易状态的数据,除了默认值外每次只能查询一种状态。 可选值:
status
- 一次只能查询一种状态。 可选值:
senderId
- sender IDbuyerId
- 注册买家IDbuyerNick
- 买家昵称buyWay
- 购买方式keyword
- 搜索条件weixinUserType
- 微信粉丝类型weixinUserId
- 微信粉丝IDfields
- 需要返回的交易对象字段IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public Trades getSoldTrades(@Nullable Integer pageSize, @Nullable Long pageNo) throws IOException, YouzanException
IOException
YouzanException
public TradeDetail updateTradeMemo(@Nonnull String tid, @Nullable String memo, @Nullable String flag, @Nullable String fields) throws IOException, YouzanException
tid
- 交易编号memo
- 交易备注flag
- 交易备注加星标,取值为1-5fields
- 需要返回的交易对象字段,如tid,title,receiver_city等。可选值:TradeDetail交易结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public TradeDetail closeTrade(String tid, String closeReasonId, String closeReason, String fields) throws IOException, YouzanException
买家下单后未支付的情况下卖家关闭订单,在买家付款后该接口失效。
tid
- 交易订单编号closeReasonId
- 关闭原因代码closeReason
- 关闭交易的原因fields
- 需要返回的交易对象字段,如tid,title,receiver_city等。可选值:TradeDetail交易结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public boolean applySelfFetchTrade(@Nonnull String code) throws IOException, YouzanException
code
- 提货码IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public SelfFetchTrade getSelfFetchTrade(@Nonnull String code, @Nullable String fields) throws IOException, YouzanException
code
- 提货码fields
- 需要返回的交易对象字段,如tid,title,receiver_city等。可选值:TradeDetail交易结构体中所有字段均可返回;多个字段用“,”分隔。如果为空则返回所有IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.public Trades getForOuterSoldTrades(@Nonnull String outerType, @Nonnull String outerUserId, @Nullable Integer pageSize, @Nullable Long pageNo, @Nullable Boolean useHasNext, @Nullable Instant startCreated, @Nullable Instant endCreated, @Nullable Instant startUpdate, @Nullable Instant endUpdate, @Nullable String type, @Nullable String status, @Nullable String fields) throws IOException, YouzanException
outerType
- 三方用户uaouterUserId
- 三方用户userIdpageSize
- 每页条数pageNo
- 页码useHasNext
- 是否启用has_next的分页方式startCreated
- 交易创建开始时间endCreated
- 交易创建结束时间startUpdate
- 交易状态更新的开始时间endUpdate
- 交易状态更新的结束时间type
- 订单类型 ,默认查询所有交易状态的数据,除了默认值外每次只能查询一种状态。 可选值: FIXED (一口价) GIFT (送礼) BULK_PURCHASE(来自分销商的采购) PRESENT (赠品领取) GROUP (拼团订单) COD (货到付款) PEER (代付) QRCODE(扫码商家二维码直接支付的交易)status
- 交易状态 ,默认查询所有交易状态的数据,除了默认值外每次只能查询一种状态。 可选值: TRADE_NO_CREATE_PAY(没有创建支付交易) WAIT_BUYER_PAY(等待买家付款) WAIT_GROUP(等待成团,即:买家已付款,等待成团) WAIT_SELLER_SEND_GOODS(等待卖家发货,即:买家已付款) WAIT_BUYER_CONFIRM_GOODS(等待买家确认收货,即:卖家已发货) TRADE_BUYER_SIGNED(买家已签收) TRADE_CLOSED(付款以后用户退款成功,交易自动关闭) ALL_WAIT_PAY(包含:WAIT_BUYER_PAY、TRADE_NO_CREATE_PAY) ALL_CLOSED(所有关闭订单)fields
- 需要返回的交易对象字段IOException
- indicates I/O exception.YouzanException
- indicates Youzan business exception.protected <T> T readValue(@Nonnull String method, @Nullable Map<String,String> params, @Nonnull com.fasterxml.jackson.core.type.TypeReference valueTypeRef) throws IOException, YouzanException
IOException
YouzanException
Copyright © 2016–2017. All rights reserved.