paymentMethodDetails;
93 | /**
94 | * 下订单的市场的标识符。
95 | */
96 | @JsonProperty("MarketplaceId")
97 | private String marketplaceId;
98 | /**
99 | * 订单的发货服务级别类别。
100 | *
101 | * 可能的值:Expedited、FreeEconomy、NextDay、SameDay、SecondDay、Scheduled、Standard。
102 | */
103 | @JsonProperty("ShipmentServiceLevelCategory")
104 | private String shipmentServiceLevelCategory;
105 | /**
106 | * 亚马逊 Easy Ship 订单的状态。此属性仅适用于 Amazon Easy Ship 订单。
107 | *
108 | * 可能的值:PendingPickUp、LabelCanceled、PickedUp、OutForDelivery、Damaged、Delivered、RejectedByBuyer、Undeliverable、ReturnedToSeller、ReturningToSeller
109 | */
110 | @JsonProperty("EasyShipShipmentStatus")
111 | private String easyShipShipmentStatus;
112 | /**
113 | * 亚马逊结账 (CBA) 的自定义发货标签。
114 | */
115 | @JsonProperty("CbaDisplayableShippingLabel")
116 | private String cbaDisplayableShippingLabel;
117 | /**
118 | * 订单的类型。
119 | */
120 | @JsonProperty("OrderType")
121 | private String orderType;
122 | /**
123 | * 最早发货日期
124 | */
125 | @JsonProperty("EarliestShipDate")
126 | private String earliestShipDate;
127 | /**
128 | * 最新发货日期
129 | */
130 | @JsonProperty("LatestShipDate")
131 | private String latestShipDate;
132 | /**
133 | * 最早交货日期
134 | */
135 | @JsonProperty("EarliestDeliveryDate")
136 | private String earliestDeliveryDate;
137 | /**
138 | * 最新交货日期
139 | */
140 | @JsonProperty("LatestDeliveryDate")
141 | private String latestDeliveryDate;
142 | /**
143 | * 如果为 true,则该订单是 Amazon Business 订单。亚马逊商业订单是买家是经过验证的商业买家的订单。
144 | */
145 | @JsonProperty("IsBusinessOrder")
146 | private Boolean isBusinessOrder;
147 | /**
148 | * 如果为真,则该订单是卖家自配送的 Amazon Prime 订单。
149 | */
150 | @JsonProperty("IsPrime")
151 | private Boolean isPrime;
152 | /**
153 | *如果为真,则订单具有优先配送服务水平协议。有关优先配送订单的更多信息,请参阅适用于您的商城的卖家平台帮助中的“优先配送选项”。
154 | */
155 | @JsonProperty("IsPremiumOrder")
156 | private Boolean isPremiumOrder;
157 | /**
158 | * 如果为真,则订单为 GlobalExpress 订单。
159 | */
160 | @JsonProperty("IsGlobalExpressEnabled")
161 | private Boolean isGlobalExpressEnabled;
162 | /**
163 | * 正在被替换的订单的订单 ID 值。仅当 IsReplacementOrder = true 时返回。
164 | */
165 | @JsonProperty("ReplacedOrderId")
166 | private String replacedOrderId;
167 | /**
168 | * 如果为真,这是一个替换订单
169 | */
170 | @JsonProperty("IsReplacementOrder")
171 | private Boolean isReplacementOrder;
172 | /**
173 | * 表示卖方必须以预计发货日期回复买方的日期。仅针对 Sourcing on Demand 订单退货。
174 | */
175 | @JsonProperty("PromiseResponseDueDate")
176 | private String promiseResponseDueDate;
177 | /**
178 | * 如果为真,则为订单设置预计发货日期。仅针对 Sourcing on Demand 订单退货。
179 | */
180 | @JsonProperty("IsEstimatedShipDateSet")
181 | private Boolean isEstimatedShipDateSet;
182 | /**
183 | * 如果为真,则此订单中的商品由 Amazon Business EU SARL (ABEU) 购买并转售。通过购买并立即转售您的商品,ABEU 成为记录卖家,将您的库存出售给不会从第三方卖家购买的客户。
184 | */
185 | @JsonProperty("IsSoldByAB")
186 | private Boolean isSoldByAB;
187 | /**
188 | * 如果为真,则此订单中的商品由 Amazon Business EU SARL (ABEU) 购买并转售。通过购买并立即转售您的商品,ABEU 成为记录卖家,将您的库存出售给不会从第三方卖家购买的客户。
189 | */
190 | @JsonProperty("IsIBA")
191 | private Boolean isIBA;
192 | /**
193 | *
194 | */
195 | @JsonProperty("DefaultShipFromLocationAddress")
196 | private DefaultShipFromLocationAddress defaultShipFromLocationAddress;
197 | @JsonProperty("BuyerInvoicePreference")
198 | private String buyerInvoicePreference;
199 | @JsonProperty("BuyerTaxInformation")
200 | private BuyerTaxInformation buyerTaxInformation;
201 | @JsonProperty("FulfillmentInstruction")
202 | private FulfillmentInstruction fulfillmentInstruction;
203 | @JsonProperty("IsISPU")
204 | private Boolean isISPU;
205 | @JsonProperty("MarketplaceTaxInfo")
206 | private MarketplaceTaxInfo marketplaceTaxInfo;
207 | @JsonProperty("SellerDisplayName")
208 | private String sellerDisplayName;
209 | @JsonProperty("ShippingAddress")
210 | private ShippingAddress shippingAddress;
211 | @JsonProperty("BuyerInfo")
212 | private BuyerInfo buyerInfo;
213 | @JsonProperty("AutomatedShippingSettings")
214 | private AutomatedShippingSettings automatedShippingSettings;
215 |
216 | @NoArgsConstructor
217 | @Data
218 | public static class OrderTotal {
219 | @JsonProperty("CurrencyCode")
220 | private String currencyCode;
221 | @JsonProperty("Amount")
222 | private String amount;
223 | }
224 |
225 | @NoArgsConstructor
226 | @Data
227 | public static class DefaultShipFromLocationAddress {
228 | @JsonProperty("Name")
229 | private String name;
230 | @JsonProperty("AddressLine1")
231 | private String addressLine1;
232 | @JsonProperty("AddressLine2")
233 | private String addressLine2;
234 | @JsonProperty("AddressLine3")
235 | private String addressLine3;
236 | @JsonProperty("City")
237 | private String city;
238 | @JsonProperty("County")
239 | private String county;
240 | @JsonProperty("District")
241 | private String district;
242 | @JsonProperty("StateOrRegion")
243 | private String stateOrRegion;
244 | @JsonProperty("Municipality")
245 | private String municipality;
246 | @JsonProperty("PostalCode")
247 | private String postalCode;
248 | @JsonProperty("CountryCode")
249 | private String countryCode;
250 | @JsonProperty("Phone")
251 | private String phone;
252 | @JsonProperty("AddressType")
253 | private String addressType;
254 | }
255 |
256 | @NoArgsConstructor
257 | @Data
258 | public static class BuyerTaxInformation {
259 | @JsonProperty("BuyerLegalCompanyName")
260 | private String buyerLegalCompanyName;
261 | @JsonProperty("BuyerBusinessAddress")
262 | private String buyerBusinessAddress;
263 | @JsonProperty("BuyerTaxRegistrationId")
264 | private String buyerTaxRegistrationId;
265 | @JsonProperty("BuyerTaxOffice")
266 | private String buyerTaxOffice;
267 | }
268 |
269 | @NoArgsConstructor
270 | @Data
271 | public static class FulfillmentInstruction {
272 | @JsonProperty("FulfillmentSupplySourceId")
273 | private String fulfillmentSupplySourceId;
274 | }
275 |
276 | @NoArgsConstructor
277 | @Data
278 | public static class MarketplaceTaxInfo {
279 | @JsonProperty("TaxClassifications")
280 | private List taxClassifications;
281 |
282 | @NoArgsConstructor
283 | @Data
284 | public static class TaxClassifications {
285 | @JsonProperty("Name")
286 | private String name;
287 | @JsonProperty("Value")
288 | private String value;
289 | }
290 | }
291 |
292 | @NoArgsConstructor
293 | @Data
294 | public static class ShippingAddress {
295 | @JsonProperty("Name")
296 | private String name;
297 | @JsonProperty("AddressLine1")
298 | private String addressLine1;
299 | @JsonProperty("AddressLine2")
300 | private String addressLine2;
301 | @JsonProperty("AddressLine3")
302 | private String addressLine3;
303 | @JsonProperty("City")
304 | private String city;
305 | @JsonProperty("County")
306 | private String county;
307 | @JsonProperty("District")
308 | private String district;
309 | @JsonProperty("StateOrRegion")
310 | private String stateOrRegion;
311 | @JsonProperty("Municipality")
312 | private String municipality;
313 | @JsonProperty("PostalCode")
314 | private String postalCode;
315 | @JsonProperty("CountryCode")
316 | private String countryCode;
317 | @JsonProperty("Phone")
318 | private String phone;
319 | @JsonProperty("AddressType")
320 | private String addressType;
321 | }
322 |
323 | @NoArgsConstructor
324 | @Data
325 | public static class BuyerInfo {
326 | @JsonProperty("BuyerEmail")
327 | private String buyerEmail;
328 | @JsonProperty("BuyerName")
329 | private String buyerName;
330 | @JsonProperty("BuyerCounty")
331 | private String buyerCounty;
332 | @JsonProperty("BuyerTaxInfo")
333 | private BuyerTaxInfo buyerTaxInfo;
334 | @JsonProperty("PurchaseOrderNumber")
335 | private String purchaseOrderNumber;
336 |
337 | @NoArgsConstructor
338 | @Data
339 | public static class BuyerTaxInfo {
340 | @JsonProperty("CompanyLegalName")
341 | private String companyLegalName;
342 | @JsonProperty("TaxingRegion")
343 | private String taxingRegion;
344 | @JsonProperty("TaxClassifications")
345 | private List taxClassifications;
346 |
347 | @NoArgsConstructor
348 | @Data
349 | public static class TaxClassifications {
350 | @JsonProperty("Name")
351 | private String name;
352 | @JsonProperty("Value")
353 | private String value;
354 | }
355 | }
356 | }
357 |
358 | @NoArgsConstructor
359 | @Data
360 | public static class AutomatedShippingSettings {
361 | @JsonProperty("HasAutomatedShippingSettings")
362 | private Boolean hasAutomatedShippingSettings;
363 | @JsonProperty("AutomatedCarrier")
364 | private String automatedCarrier;
365 | @JsonProperty("AutomatedShipMethod")
366 | private String automatedShipMethod;
367 | }
368 |
369 | @NoArgsConstructor
370 | @Data
371 | public static class PaymentExecutionDetail {
372 | @JsonProperty("Payment")
373 | private Payment payment;
374 | @JsonProperty("PaymentMethod")
375 | private String paymentMethod;
376 |
377 | @NoArgsConstructor
378 | @Data
379 | public static class Payment {
380 | @JsonProperty("CurrencyCode")
381 | private String currencyCode;
382 | @JsonProperty("Amount")
383 | private String amount;
384 | }
385 | }
386 | }
387 |
--------------------------------------------------------------------------------
/amazon-sdk/src/main/java/io/github/vo/order/AmazonOrderItems.java:
--------------------------------------------------------------------------------
1 | package io.github.vo.order;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/2/22 15:16
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class AmazonOrderItems {
15 |
16 | @JsonProperty("AmazonOrderId")
17 | private String amazonOrderId;
18 | @JsonProperty("NextToken")
19 | private String nextToken;
20 | @JsonProperty("OrderItems")
21 | private List orderItems;
22 | /**
23 | * Created by EalenXie on 2022/2/22 15:18
24 | */
25 | @NoArgsConstructor
26 | @Data
27 | public static class AmazonOrderItem {
28 |
29 | @JsonProperty("ASIN")
30 | private String asin;
31 | @JsonProperty("OrderItemId")
32 | private String orderItemId;
33 | @JsonProperty("QuantityOrdered")
34 | private Integer quantityOrdered;
35 | @JsonProperty("SellerSKU")
36 | private String sellerSKU;
37 | @JsonProperty("Title")
38 | private String title;
39 | @JsonProperty("QuantityShipped")
40 | private Integer quantityShipped;
41 | @JsonProperty("ProductInfo")
42 | private ProductInfo productInfo;
43 | @JsonProperty("PointsGranted")
44 | private PointsGranted pointsGranted;
45 | @JsonProperty("ItemPrice")
46 | private ItemPrice itemPrice;
47 | @JsonProperty("ShippingPrice")
48 | private ShippingPrice shippingPrice;
49 | @JsonProperty("ItemTax")
50 | private ItemTax itemTax;
51 | @JsonProperty("ShippingTax")
52 | private ShippingTax shippingTax;
53 | @JsonProperty("ShippingDiscount")
54 | private ShippingDiscount shippingDiscount;
55 | @JsonProperty("ShippingDiscountTax")
56 | private ShippingDiscountTax shippingDiscountTax;
57 | @JsonProperty("PromotionDiscount")
58 | private PromotionDiscount promotionDiscount;
59 | @JsonProperty("PromotionDiscountTax")
60 | private PromotionDiscountTax promotionDiscountTax;
61 | @JsonProperty("PromotionIds")
62 | private List promotionIds;
63 | @JsonProperty("CODFee")
64 | private CODFee cODFee;
65 | @JsonProperty("CODFeeDiscount")
66 | private CODFeeDiscount cODFeeDiscount;
67 | @JsonProperty("IsGift")
68 | private Boolean isGift;
69 | @JsonProperty("ConditionNote")
70 | private String conditionNote;
71 | @JsonProperty("ConditionId")
72 | private String conditionId;
73 | @JsonProperty("ConditionSubtypeId")
74 | private String conditionSubtypeId;
75 | @JsonProperty("ScheduledDeliveryStartDate")
76 | private String scheduledDeliveryStartDate;
77 | @JsonProperty("ScheduledDeliveryEndDate")
78 | private String scheduledDeliveryEndDate;
79 | @JsonProperty("PriceDesignation")
80 | private String priceDesignation;
81 | @JsonProperty("TaxCollection")
82 | private TaxCollection taxCollection;
83 | @JsonProperty("SerialNumberRequired")
84 | private Boolean serialNumberRequired;
85 | @JsonProperty("IsTransparency")
86 | private Boolean isTransparency;
87 | @JsonProperty("IossNumber")
88 | private String iossNumber;
89 | @JsonProperty("StoreChainStoreId")
90 | private String storeChainStoreId;
91 | @JsonProperty("DeemedResellerCategory")
92 | private String deemedResellerCategory;
93 | @JsonProperty("BuyerInfo")
94 | private BuyerInfo buyerInfo;
95 |
96 | @NoArgsConstructor
97 | @Data
98 | public static class ProductInfo {
99 | @JsonProperty("NumberOfItems")
100 | private Integer numberOfItems;
101 | }
102 |
103 | @NoArgsConstructor
104 | @Data
105 | public static class PointsGranted {
106 | @JsonProperty("PointsNumber")
107 | private Integer pointsNumber;
108 | @JsonProperty("PointsMonetaryValue")
109 | private PointsGranted.PointsMonetaryValue pointsMonetaryValue;
110 |
111 | @NoArgsConstructor
112 | @Data
113 | public static class PointsMonetaryValue {
114 | @JsonProperty("CurrencyCode")
115 | private String currencyCode;
116 | @JsonProperty("Amount")
117 | private String amount;
118 | }
119 | }
120 |
121 | @NoArgsConstructor
122 | @Data
123 | public static class ItemPrice {
124 | @JsonProperty("CurrencyCode")
125 | private String currencyCode;
126 | @JsonProperty("Amount")
127 | private String amount;
128 | }
129 |
130 | @NoArgsConstructor
131 | @Data
132 | public static class ShippingPrice {
133 | @JsonProperty("CurrencyCode")
134 | private String currencyCode;
135 | @JsonProperty("Amount")
136 | private String amount;
137 | }
138 |
139 | @NoArgsConstructor
140 | @Data
141 | public static class ItemTax {
142 | @JsonProperty("CurrencyCode")
143 | private String currencyCode;
144 | @JsonProperty("Amount")
145 | private String amount;
146 | }
147 |
148 | @NoArgsConstructor
149 | @Data
150 | public static class ShippingTax {
151 | @JsonProperty("CurrencyCode")
152 | private String currencyCode;
153 | @JsonProperty("Amount")
154 | private String amount;
155 | }
156 |
157 | @NoArgsConstructor
158 | @Data
159 | public static class ShippingDiscount {
160 | @JsonProperty("CurrencyCode")
161 | private String currencyCode;
162 | @JsonProperty("Amount")
163 | private String amount;
164 | }
165 |
166 | @NoArgsConstructor
167 | @Data
168 | public static class ShippingDiscountTax {
169 | @JsonProperty("CurrencyCode")
170 | private String currencyCode;
171 | @JsonProperty("Amount")
172 | private String amount;
173 | }
174 |
175 | @NoArgsConstructor
176 | @Data
177 | public static class PromotionDiscount {
178 | @JsonProperty("CurrencyCode")
179 | private String currencyCode;
180 | @JsonProperty("Amount")
181 | private String amount;
182 | }
183 |
184 | @NoArgsConstructor
185 | @Data
186 | public static class PromotionDiscountTax {
187 | @JsonProperty("CurrencyCode")
188 | private String currencyCode;
189 | @JsonProperty("Amount")
190 | private String amount;
191 | }
192 |
193 | @NoArgsConstructor
194 | @Data
195 | public static class CODFee {
196 | @JsonProperty("CurrencyCode")
197 | private String currencyCode;
198 | @JsonProperty("Amount")
199 | private String amount;
200 | }
201 |
202 | @NoArgsConstructor
203 | @Data
204 | public static class CODFeeDiscount {
205 | @JsonProperty("CurrencyCode")
206 | private String currencyCode;
207 | @JsonProperty("Amount")
208 | private String amount;
209 | }
210 |
211 | @NoArgsConstructor
212 | @Data
213 | public static class TaxCollection {
214 | @JsonProperty("Model")
215 | private String model;
216 | @JsonProperty("ResponsibleParty")
217 | private String responsibleParty;
218 | }
219 |
220 | @NoArgsConstructor
221 | @Data
222 | public static class BuyerInfo {
223 | @JsonProperty("BuyerCustomizedInfo")
224 | private BuyerInfo.BuyerCustomizedInfo buyerCustomizedInfo;
225 | @JsonProperty("GiftWrapPrice")
226 | private BuyerInfo.GiftWrapPrice giftWrapPrice;
227 | @JsonProperty("GiftWrapTax")
228 | private BuyerInfo.GiftWrapTax giftWrapTax;
229 | @JsonProperty("GiftMessageText")
230 | private String giftMessageText;
231 | @JsonProperty("GiftWrapLevel")
232 | private String giftWrapLevel;
233 |
234 | @NoArgsConstructor
235 | @Data
236 | public static class BuyerCustomizedInfo {
237 | @JsonProperty("value")
238 | private String value;
239 | }
240 |
241 | @NoArgsConstructor
242 | @Data
243 | public static class GiftWrapPrice {
244 | @JsonProperty("CurrencyCode")
245 | private String currencyCode;
246 | @JsonProperty("Amount")
247 | private String amount;
248 | }
249 |
250 | @NoArgsConstructor
251 | @Data
252 | public static class GiftWrapTax {
253 | @JsonProperty("CurrencyCode")
254 | private String currencyCode;
255 | @JsonProperty("Amount")
256 | private String amount;
257 | }
258 | }
259 | }
260 |
261 | }
262 |
--------------------------------------------------------------------------------
/amazon-sdk/src/main/java/io/github/vo/order/AmazonShippingAddress.java:
--------------------------------------------------------------------------------
1 | package io.github.vo.order;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/2/22 16:42
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class AmazonShippingAddress {
13 |
14 | @JsonProperty("AmazonOrderId")
15 | private String amazonOrderId;
16 | @JsonProperty("ShippingAddress")
17 | private ShippingAddress shippingAddress;
18 |
19 | @NoArgsConstructor
20 | @Data
21 | public static class ShippingAddress {
22 | @JsonProperty("Name")
23 | private String name;
24 | @JsonProperty("AddressLine1")
25 | private String addressLine1;
26 | @JsonProperty("AddressLine2")
27 | private String addressLine2;
28 | @JsonProperty("AddressLine3")
29 | private String addressLine3;
30 | @JsonProperty("City")
31 | private String city;
32 | @JsonProperty("County")
33 | private String county;
34 | @JsonProperty("District")
35 | private String district;
36 | @JsonProperty("StateOrRegion")
37 | private String stateOrRegion;
38 | @JsonProperty("Municipality")
39 | private String municipality;
40 | @JsonProperty("PostalCode")
41 | private String postalCode;
42 | @JsonProperty("CountryCode")
43 | private String countryCode;
44 | @JsonProperty("Phone")
45 | private String phone;
46 | @JsonProperty("AddressType")
47 | private String addressType;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/paypal-sdk/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | cross-border-electronic-commerce
7 | io.github
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | paypal-sdk
13 |
14 |
15 | 8
16 | 8
17 |
18 |
19 |
20 |
21 |
22 | org.projectlombok
23 | lombok
24 | 1.18.22
25 |
26 |
27 | org.springframework
28 | spring-web
29 | 5.3.16
30 |
31 |
32 | com.fasterxml.jackson.core
33 | jackson-databind
34 | 2.13.2
35 |
36 |
37 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/PayPalClient.java:
--------------------------------------------------------------------------------
1 | package io.github;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 |
5 | import io.github.dto.TransactionsDTO;
6 | import io.github.vo.BalancesVO;
7 | import io.github.vo.PayPalAccessToken;
8 | import io.github.vo.TransactionDetailsVO;
9 | import io.github.vo.UserInfo;
10 | import lombok.extern.slf4j.Slf4j;
11 | import org.springframework.http.*;
12 | import org.springframework.util.LinkedMultiValueMap;
13 | import org.springframework.web.client.RestOperations;
14 | import org.springframework.web.client.RestTemplate;
15 | import org.springframework.web.util.UriComponentsBuilder;
16 |
17 | import java.net.URI;
18 | import java.util.Collections;
19 | import java.util.SortedMap;
20 |
21 | /**
22 | * Created by EalenXie on 2022/3/29 11:36
23 | * https://developer.paypal.com/
24 | */
25 | @Slf4j
26 | @SuppressWarnings("all")
27 | public class PayPalClient {
28 |
29 | private final RestOperations restOperations;
30 |
31 | private final ObjectMapper mapper = new ObjectMapper();
32 | /**
33 | * 是否沙箱环境
34 | */
35 | private boolean sandBox = true;
36 | /**
37 | * 沙箱环境认证接口地址
38 | */
39 | private static final String HOST_SANDBOX = "https://api-m.sandbox.paypal.com/v1";
40 | /**
41 | * 正式环境接口地址
42 | */
43 | private static final String HOST = "https://api-m.paypal.com";
44 |
45 |
46 | public PayPalClient() {
47 | this(new RestTemplate());
48 | }
49 |
50 | public PayPalClient(RestOperations restOperations) {
51 | this.restOperations = restOperations;
52 | }
53 |
54 |
55 | public boolean isSandBox() {
56 | return sandBox;
57 | }
58 |
59 | public void setSandBox(boolean sandBox) {
60 | this.sandBox = sandBox;
61 | }
62 |
63 | public HttpHeaders getBearerHeader(String accessToken) {
64 | HttpHeaders headers = new HttpHeaders();
65 | headers.setBearerAuth(accessToken);
66 | return headers;
67 | }
68 |
69 | public HttpHeaders getBasicHeader(String clientId, String clientSecret) {
70 | HttpHeaders headers = new HttpHeaders();
71 | headers.setBasicAuth(clientId, clientSecret);
72 | return headers;
73 | }
74 |
75 |
76 | /**
77 | * 客户端模式获取访问令牌
78 | * https://developer.paypal.com/api/rest/authentication/
79 | *
80 | * @param accessToken 访问令牌
81 | * @param accountId 账号id
82 | * @param dto 请求参数
83 | */
84 | public ResponseEntity clientCredentialsAcessToken(String clientId, String clientSecret) {
85 | HttpHeaders headers = getBasicHeader(clientId, clientSecret);
86 | headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
87 | headers.set("Accept-Language", "en_US");
88 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/oauth2/token", sandBox ? HOST_SANDBOX : HOST));
89 | builder.queryParam("grant_type", "client_credentials");
90 | URI uri = builder.build().encode().toUri();
91 | return restOperations.exchange(uri, HttpMethod.POST, new HttpEntity<>(null, headers), PayPalAccessToken.class);
92 | }
93 |
94 | /**
95 | * 显示付款项目的详细信息
96 | *
97 | *
98 | * https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts_get_batch_details
99 | *
100 | * @param payoutsItemId
101 | * @return
102 | */
103 | public ResponseEntity> clientReferencedPayoutsItems(String payoutsItemId, String token) {
104 | HttpHeaders headers = new HttpHeaders();
105 | headers.set("Content-Type", "application/json");
106 | headers.setBearerAuth(token);
107 | headers.set("PayPal-Partner-Attribution-Id", "bn1234");
108 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/payments/referenced-payouts-items/%s", sandBox ? HOST_SANDBOX : HOST, payoutsItemId));
109 | URI uri = builder.build().encode().toUri();
110 | return restOperations.exchange(uri, HttpMethod.GET, new HttpEntity<>(null, headers), Object.class);
111 | }
112 |
113 | /**
114 | * 显示付款项目的详细信息
115 | *
116 | *
117 | * https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts_get_batch_details
118 | *
119 | * @param payoutsItemId
120 | * @return
121 | */
122 | public ResponseEntity getUserInfo(String token) {
123 | HttpHeaders headers = new HttpHeaders();
124 | headers.setContentType(MediaType.APPLICATION_JSON);
125 | headers.setBearerAuth(token);
126 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/identity/oauth2/userinfo?schema=paypalv1.1", sandBox ? HOST_SANDBOX : HOST));
127 | return restOperations.exchange(builder.build().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), UserInfo.class);
128 | }
129 |
130 |
131 | /**
132 | * 列出交易
133 | * https://developer.paypal.com/docs/api/transaction-search/v1/#transactions_get
134 | *
135 | * @param token 访问令牌
136 | * @param dto 请求参数封装的对象TransactionsDTO
137 | * @return
138 | */
139 | public ResponseEntity transactions(String token, TransactionsDTO dto) {
140 | HttpHeaders headers = new HttpHeaders();
141 | headers.setContentType(MediaType.APPLICATION_JSON);
142 | headers.setBearerAuth(token);
143 | //访问路径
144 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/reporting/transactions", sandBox ? HOST_SANDBOX : HOST));
145 | //判断dto不能为空
146 | if (dto != null) {
147 | @SuppressWarnings("unchecked") SortedMap sortedMap = mapper.convertValue(dto, SortedMap.class);
148 | LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>();
149 | if (!sortedMap.isEmpty()) {
150 | queryParams.setAll(sortedMap);
151 | builder.queryParams(queryParams);
152 | }
153 | }
154 | return restOperations.exchange(builder.build().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), TransactionDetailsVO.class);
155 | }
156 |
157 | /**
158 | * 列出所有余额
159 | * https://developer.paypal.com/docs/api/transaction-search/v1/#transactions_get
160 | *
161 | * @param token 访问令牌
162 | * @param currencCode 通过PayPal 交易货币的三字符 ISO-4217 货币代码过滤响应中的交易。
163 | * @param dasOfTimeto 在提供的日期时间在响应中列出余额,如果未提供,将返回系统中最后刷新的余额
164 | * @param includeCryptoCurrencies 是否包括加密货币:false 或 true
165 | * @return
166 | */
167 | public ResponseEntity balances(String token, String currencCode, String asOfTime, String includeCryptoCurrencies) {
168 | HttpHeaders headers = new HttpHeaders();
169 | headers.setContentType(MediaType.APPLICATION_JSON);
170 | headers.setBearerAuth(token);
171 | //访问路径
172 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/reporting/balances", sandBox ? HOST_SANDBOX : HOST));
173 | //判断入参不能为空
174 | if (asOfTime != null && currencCode != null) {
175 | //将请求参数按指定排序生成url参数
176 | LinkedMultiValueMap queryParams = new LinkedMultiValueMap<>();
177 | queryParams.put("currency_code", Collections.singletonList(currencCode));
178 | queryParams.put("as_of_time", Collections.singletonList(asOfTime));
179 | queryParams.put("include_crypto_currencies", Collections.singletonList(includeCryptoCurrencies));
180 | builder.queryParams(queryParams);
181 | }
182 | return restOperations.exchange(builder.build().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), BalancesVO.class);
183 | }
184 |
185 |
186 | /**
187 | * 列出参考批次付款中的项目
188 | *
189 | * https://developer.paypal.com/docs/api/referenced-payouts/v1/#referenced-payouts_get_batch_details
190 | *
191 | * @param payoutsBatchId
192 | * @param token
193 | * @return
194 | */
195 | public ResponseEntity> clientReferencedPayouts(String payoutsBatchId, String token) {
196 | HttpHeaders headers = new HttpHeaders();
197 | headers.setContentType(MediaType.APPLICATION_JSON);
198 | headers.setBearerAuth(token);
199 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/payments/referenced-payouts/%s", sandBox ? HOST_SANDBOX : HOST, payoutsBatchId));
200 | return restOperations.exchange(builder.encode().build().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), Object.class);
201 | }
202 | }
203 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/dto/BalancesDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonInclude;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | @Getter
9 | @Setter
10 | public class BalancesDTO {
11 |
12 | /**
13 | * PayPal 交易 ID
14 | * 有效的交易 ID 长度为 17 个字符,除了订单编号,长度为 19 个字符。
15 | */
16 | @JsonInclude(JsonInclude.Include.NON_NULL)
17 | @JsonProperty("transaction_id")
18 | private String transactionId;
19 |
20 | /**
21 | * PayPal 交易类型
22 | * 请参阅事务事件代码
23 | * https://developer.paypal.com/docs/transaction-search/transaction-event-codes/
24 | */
25 | @JsonInclude(JsonInclude.Include.NON_NULL)
26 | @JsonProperty("transaction_type")
27 | private String transactionType;
28 | }
29 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/dto/TransactionsDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonInclude;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | @Getter
9 | @Setter
10 | public class TransactionsDTO {
11 |
12 | /**
13 | * PayPal 交易 ID
14 | * 有效的交易 ID 长度为 17 个字符,除了订单编号,长度为 19 个字符。
15 | */
16 | @JsonInclude(JsonInclude.Include.NON_NULL)
17 | @JsonProperty("transaction_id")
18 | private String transactionId;
19 |
20 | /**
21 | * PayPal 交易类型
22 | * 请参阅事务事件代码
23 | * https://developer.paypal.com/docs/transaction-search/transaction-event-codes/
24 | */
25 | @JsonInclude(JsonInclude.Include.NON_NULL)
26 | @JsonProperty("transaction_type")
27 | private String transactionType;
28 |
29 | /**
30 | * PayPal 交易状态
31 | * 状态码描述
32 | * D PayPal 或商家规则拒绝交易。
33 | * P 交易待定。交易已创建,但在状态更改为 之前等待另一个支付流程完成,例如 ACH 交易S。
34 | * S 交易成功完成,没有拒绝并且在任何未决状态之后。
35 | * V 成功的交易被撤销,资金被退还给原始发件人。
36 | */
37 | @JsonInclude(JsonInclude.Include.NON_NULL)
38 | @JsonProperty("transaction_status")
39 | private String transactionStatus;
40 |
41 | /**
42 | * 总交易金额范围
43 | * 指定范围为 TO ,其中是 PayPal 交易总额的下限, 是交易总额的上限。指定较低面额的金额。
44 | * 例如,要搜索从 $5.00 到 $10.05 的交易,请指定[500 TO 1005]。
45 | */
46 | @JsonInclude(JsonInclude.Include.NON_NULL)
47 | @JsonProperty("transaction_amount")
48 | private String transactionAmount;
49 |
50 | /**
51 | * PayPal 交易货币
52 | */
53 | @JsonInclude(JsonInclude.Include.NON_NULL)
54 | @JsonProperty("transaction_currency")
55 | private String transactionCurrency;
56 |
57 | /**
58 | * 开始时间
59 | * 采用Internet 日期和时间格式。需要秒数。小数秒是可选的。
60 | * 最小长度:20.
61 | * 最大长度:64.
62 | */
63 | @JsonProperty("start_date")
64 | private String startDate;
65 |
66 | /**
67 | * 结束时间
68 | * 采用Internet 日期和时间格式。需要秒数。小数秒是可选的。支持的最大范围为 31 天。
69 | * 最小长度:20.
70 | * 最大长度:64.
71 | */
72 | @JsonProperty("end_date")
73 | private String endDate;
74 |
75 | /**
76 | * 支付工具类型
77 | * 值是:
78 | * CREDITCARD. 返回具有相应值的直接信用卡交易。
79 | * DEBITCARD. 返回具有相应值的借记卡交易。
80 | */
81 | @JsonInclude(JsonInclude.Include.NON_NULL)
82 | @JsonProperty("payment_instrument_type")
83 | private String paymentInstrumentType;
84 |
85 | /**
86 | * 商店 ID
87 | */
88 | @JsonInclude(JsonInclude.Include.NON_NULL)
89 | @JsonProperty("store_id")
90 | private String storeId;
91 |
92 | /**
93 | * 终端 ID
94 | */
95 | @JsonInclude(JsonInclude.Include.NON_NULL)
96 | @JsonProperty("terminal_id")
97 | private String terminalId;
98 |
99 | /**
100 | * 指示响应中出现的字段
101 | * 有效字段为:
102 | * transaction_info. 交易信息。包括收款人的 PayPal 账户 ID、PayPal 生成的交易 ID、PayPal 生成的基本 ID、PayPal 参考 ID 类型、交易事件代码、交易发起和最后更新的日期和时间,交易金额,包括 PayPal 费用、任何折扣、保险、交易状态以及有关交易的其他信息。
103 | * payer_info. 付款人信息。包括 PayPal 客户帐户 ID 和付款人的电子邮件地址、主要电话号码、姓名、国家/地区代码、地址以及付款人是否经过验证。
104 | * shipping_info. 运输信息。包括收件人姓名、此订单的送货方式、此订单的送货地址以及与此订单关联的辅助地址。
105 | * auction_info. 拍卖信息。包括拍卖网站的名称、拍卖网站的 URL、在拍卖中进行购买的客户的 ID 以及拍卖结束的日期和时间。
106 | * cart_info. 购物车信息。包括一系列商品详细信息,商品金额或运费是否已含税,以及 PayPal 生成的发票的发票 ID。
107 | * incentive_info. 一系列激励细节对象。每个对象包括诸如特别优惠或优惠券之类的激励、激励金额以及标识商家忠诚度或激励计划的激励计划代码。
108 | * store_info. 店铺信息。包括商户ID和商户收银台终端ID。
109 | */
110 | @JsonInclude(JsonInclude.Include.NON_NULL)
111 | @JsonProperty("fields")
112 | private String fields;
113 |
114 | /**
115 | * 响应是仅包括影响余额的交易还是所有交易。值是:
116 | * Y. 默认。响应仅包括余额交易。
117 | * N. 响应包括所有事务。
118 | */
119 | @JsonInclude(JsonInclude.Include.NON_NULL)
120 | @JsonProperty("balance_affecting_records_only")
121 | private String balanceAffectingRecordsOnly;
122 |
123 | /**
124 | * 分页大小
125 | */
126 | @JsonInclude(JsonInclude.Include.NON_NULL)
127 | @JsonProperty("page_size")
128 | private String pageSize;
129 |
130 | /**
131 | * 页码
132 | */
133 | @JsonInclude(JsonInclude.Include.NON_NULL)
134 | @JsonProperty("page")
135 | private String page;
136 | }
137 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/Address.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * @author 小小怪下士
9 | * @version 1.0.0
10 | */
11 | @NoArgsConstructor
12 | @Data
13 | public class Address {
14 | @JsonProperty("street_address")
15 | private String streetAddress;
16 | @JsonProperty("locality")
17 | private String locality;
18 | @JsonProperty("region")
19 | private String region;
20 | @JsonProperty("postal_code")
21 | private String postalCode;
22 | @JsonProperty("country")
23 | private String country;
24 | }
25 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/AuctionInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | @NoArgsConstructor
7 | @Data
8 | public class AuctionInfo {
9 | }
10 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/Balances.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class Balances {
10 |
11 | /**
12 | * 所列余额的货币代码。
13 | */
14 | @JsonProperty("currency")
15 | private String currency;
16 |
17 | /**
18 | * 表示货币是否为主要货币的可选字段。
19 | */
20 | @JsonProperty("primary")
21 | private Boolean primary;
22 |
23 | /**
24 | * PayPal 帐户中的总金额。它是所有其他余额的总和。
25 | */
26 | @JsonProperty("total_balance")
27 | private TotalBalance totalBalance;
28 |
29 | /**
30 | * 客户可支配的账户中的现金金额。此金额在为用户定义的用户时区中的结算截止时间捕获。
31 | */
32 | @JsonProperty("available_balance")
33 | private TotalBalance availableBalance;
34 |
35 | /**
36 | * 账户中预扣的余额。PayPal 为客户持有的资金中当前无法由客户支配的部分。
37 | */
38 | @JsonProperty("withheld_balance")
39 | private TotalBalance withheldBalance;
40 | }
41 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/BalancesVO.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | @NoArgsConstructor
10 | @Data
11 | public class BalancesVO {
12 |
13 | /**
14 | * 加密余额
15 | */
16 | @JsonProperty("crypto_balances")
17 | private List cryptoBalances;
18 |
19 | /**
20 | * 余额
21 | */
22 | @JsonProperty("balances")
23 | private List balances;
24 |
25 | /**
26 | * 账户 ID
27 | */
28 | @JsonProperty("account_id")
29 | private String accountId;
30 |
31 | /**
32 | * 截止时间
33 | */
34 | @JsonProperty("as_of_time")
35 | private String asOfTime;
36 |
37 | /**
38 | * 上次刷新时间
39 | */
40 | @JsonProperty("last_refresh_time")
41 | private String lastRefreshTime;
42 | }
43 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/CartInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | @NoArgsConstructor
7 | @Data
8 | public class CartInfo {
9 | }
10 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/CryptoBalances.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class CryptoBalances {
10 |
11 | /**
12 | * 资产符号
13 | */
14 | @JsonProperty("asset_symbol")
15 | private String assetSymbol;
16 |
17 | /**
18 | * 数量
19 | */
20 | @JsonProperty("quantity")
21 | private String quantity;
22 | }
23 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/Email.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * @author EalenXie
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Email {
13 | @JsonProperty("value")
14 | private String value;
15 | @JsonProperty("primary")
16 | private Boolean primary;
17 | }
18 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/IncentiveInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | @NoArgsConstructor
7 | @Data
8 | public class IncentiveInfo {
9 | }
10 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/Links.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class Links {
10 |
11 | /**
12 | * 完整的目标 URL。
13 | * 要进行相关调用,请将该方法与此URI 模板格式的链接结合使用。对于预处理,包括$、(和)字符。这href是关键的 HATEOAS 组件,它将已完成的调用与后续调用联系起来。
14 | */
15 | @JsonProperty("href")
16 | private String href;
17 |
18 | /**
19 | * 链接关系类型,用作明确描述链接语义的链接的 ID 。请参阅链接关系。
20 | * https://www.iana.org/assignments/link-relations/link-relations.xhtml
21 | */
22 | @JsonProperty("rel")
23 | private String rel;
24 |
25 | /**
26 | * 进行相关调用所需的 HTTP 方法。
27 | */
28 | @JsonProperty("method")
29 | private String method;
30 | }
31 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/PayPalAccessToken.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 |
7 | /**
8 | * Created by EalenXie on 2022/4/1 10:42
9 | */
10 | @Getter
11 | @Setter
12 | public class PayPalAccessToken {
13 | @JsonProperty("scope")
14 | private String scope;
15 | @JsonProperty("access_token")
16 | private String accessToken;
17 | @JsonProperty("token_type")
18 | private String tokenType;
19 | @JsonProperty("app_id")
20 | private String appId;
21 | @JsonProperty("expires_in")
22 | private Integer expiresIn;
23 | @JsonProperty("nonce")
24 | private String nonce;
25 | }
26 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/PayerInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class PayerInfo {
10 |
11 | /**
12 | * PayPal 付款人 ID
13 | */
14 | @JsonProperty("account_id")
15 | private String accountId;
16 |
17 | /**
18 | * 国际化的电子邮件地址。
19 | */
20 | @JsonProperty("email_address")
21 | private String emailAddress;
22 |
23 | /**
24 | * 付款人的地址状态。值是:
25 | * Y. 已验证。
26 | * N. 未经审核的。
27 | */
28 | @JsonProperty("address_status")
29 | private String addressStatus;
30 |
31 | /**
32 | * 付款人的状态。值为Y或N。
33 | */
34 | @JsonProperty("payer_status")
35 | private String payerStatus;
36 |
37 | /**
38 | * 付款人姓名。
39 | */
40 | @JsonProperty("payer_name")
41 | private PayerName payerName;
42 |
43 | /**
44 | * 标识付款人所在国家或地区的两字符 ISO 3166-1 代码。
45 | * https://developer.paypal.com/reference/country-codes/
46 | */
47 | @JsonProperty("country_code")
48 | private String countryCode;
49 | }
50 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/PayerName.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class PayerName {
10 |
11 | /**
12 | * 当当事人是一个人时,当事人的名字或名字。
13 | */
14 | @JsonProperty("given_name")
15 | private String givenName;
16 |
17 | /**
18 | * 当事人为人时,当事人的姓氏或姓氏。也称为姓氏
19 | */
20 | @JsonProperty("surname")
21 | private String surname;
22 |
23 | /**
24 | * 备用名
25 | */
26 | @JsonProperty("alternate_full_name")
27 | private String alternateFullName;
28 | }
29 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/ShippingInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class ShippingInfo {
10 |
11 | /**
12 | * 收件人的姓名。
13 | */
14 | @JsonProperty("name")
15 | private String name;
16 |
17 |
18 | /**
19 | * 与此订单关联的送货地址。
20 | */
21 | @JsonProperty("address")
22 | private ShopInfoAddress address;
23 | }
24 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/ShopInfoAddress.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class ShopInfoAddress {
10 |
11 | /**
12 | * 地址的第一行。例如,数字或街道。
13 | */
14 | @JsonProperty("line1")
15 | private String line1;
16 |
17 | /**
18 | * 地址的第二行。例如,套房或公寓号码。
19 | */
20 | @JsonProperty("line2")
21 | private String line2;
22 |
23 | /**
24 | * 城市名称。
25 | */
26 | @JsonProperty("city")
27 | private String city;
28 |
29 | /**
30 | * 标识国家或地区的两字符 ISO 3166-1 代码。
31 | * https://developer.paypal.com/reference/country-codes/
32 | */
33 | @JsonProperty("country_code")
34 | private String countryCode;
35 |
36 | /**
37 | * 邮政编码,即邮政编码或等价物。通常需要具有邮政编码或同等邮政编码的国家/地区。
38 | */
39 | @JsonProperty("postal_code")
40 | private String postalCode;
41 | }
42 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/StoreInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | @NoArgsConstructor
7 | @Data
8 | public class StoreInfo {
9 | }
10 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/TotalBalance.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class TotalBalance {
10 |
11 | /**
12 | * 标识货币的三字符 ISO-4217 货币代码。
13 | * https://developer.paypal.com/api/rest/reference/currency-codes/
14 | */
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 |
18 | /**
19 | * 值,可能是:
20 | * 像这样的货币的整数JPY通常不是小数。
21 | * 像这样的货币的小数部分TND被细分为千分之一。
22 | * 有关货币代码所需的小数位数,请参阅货币代码。
23 | * https://developer.paypal.com/reference/currency-codes/
24 | */
25 | @JsonProperty("value")
26 | private String value;
27 | }
28 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/TransactionAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class TransactionAmount {
10 |
11 | /**
12 | * 通过PayPal 交易货币的三字符 ISO-4217 货币代码过滤响应中的交易。
13 | * https://developer.paypal.com/api/rest/reference/currency-codes/
14 | */
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 |
18 | /**
19 | * 值,可能是:
20 | * 像这样的货币的整数JPY通常不是小数。
21 | * 像这样的货币的小数部分TND被细分为千分之一。
22 | * 有关货币代码所需的小数位数,请参阅货币代码。
23 | * https://developer.paypal.com/reference/currency-codes/
24 | */
25 | @JsonProperty("value")
26 | private String value;
27 | }
28 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/TransactionDetails.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class TransactionDetails {
10 | /**
11 | * 交易信息。
12 | */
13 | @JsonProperty("transaction_info")
14 | private TransactionInfo transactionInfo;
15 |
16 | /**
17 | * 付款人信息。
18 | */
19 | @JsonProperty("payer_info")
20 | private PayerInfo payerInfo;
21 |
22 | /**
23 | * 运输信息。
24 | */
25 | @JsonProperty("shipping_info")
26 | private ShippingInfo shippingInfo;
27 |
28 | /**
29 | * 购物车信息。
30 | */
31 | @JsonProperty("cart_info")
32 | private CartInfo cartInfo;
33 |
34 | /**
35 | * 店铺信息。
36 | */
37 | @JsonProperty("store_info")
38 | private StoreInfo storeInfo;
39 |
40 | /**
41 | * 拍卖信息。
42 | */
43 | @JsonProperty("auction_info")
44 | private AuctionInfo auctionInfo;
45 |
46 | /**
47 | * 激励信息。
48 | */
49 | @JsonProperty("incentive_info")
50 | private IncentiveInfo incentiveInfo;
51 | }
52 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/TransactionDetailsVO.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | @NoArgsConstructor
10 | @Data
11 | public class TransactionDetailsVO {
12 |
13 | /**
14 | * 一组交易明细对象。
15 | */
16 | @JsonProperty("transaction_details")
17 | private List transactionDetails;
18 |
19 | /**
20 | * 商户账号。
21 | */
22 | @JsonProperty("account_number")
23 | private String accountNumber;
24 |
25 | /**
26 | * 上次刷新数据的日期和时间,采用Internet 日期和时间格式。
27 | */
28 | @JsonProperty("last_refreshed_datetime")
29 | private String lastRefreshedDatetime;
30 |
31 | /**
32 | * 交易的零相对索引。
33 | */
34 | @JsonProperty("page")
35 | private Integer page;
36 |
37 | /**
38 | * 以整数形式的事务总数,page以完整结果中指定的开头,而不仅仅是在此响应中。
39 | */
40 | @JsonProperty("total_items")
41 | private Integer totalItems;
42 |
43 | /**
44 | * 总页数,作为integer,当total_items被划分为指定的页时page_size。
45 | */
46 | @JsonProperty("total_pages")
47 | private Integer totalPages;
48 |
49 | /**
50 | * 一组与请求相关的HATEOAS 链接。
51 | * https://developer.paypal.com/api/rest/responses/#hateoas-links
52 | */
53 | @JsonProperty("links")
54 | private List links;
55 | }
56 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/TransactionInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class TransactionInfo {
10 | /**
11 | * 交易信息。
12 | */
13 | @JsonProperty("paypal_account_id")
14 | private String paypalAccountId;
15 |
16 | /**
17 | * PayPal 生成的交易 ID
18 | */
19 | @JsonProperty("transaction_id")
20 | private String transactionId;
21 |
22 | /**
23 | * 个五位数的交易事件代码,根据资金流动和借记或贷记对交易类型进行分类
24 | * https://developer.paypal.com/docs/transaction-search/transaction-event-codes/
25 | */
26 | @JsonProperty("transaction_event_code")
27 | private String transactionEventCode;
28 |
29 | /**
30 | * 在 PayPal 系统中开始处理交易的日期和时间,以付款这一方的帐户时区表示
31 | */
32 | @JsonProperty("transaction_initiation_date")
33 | private String transactionInitiationDate;
34 |
35 | /**
36 | * 上次更改交易的日期和时间,以付款这边账户的时区表示。
37 | */
38 | @JsonProperty("transaction_updated_date")
39 | private String transactionUpdatedDate;
40 |
41 | /**
42 | * 通过 PayPal 在发送方和接收方之间转移的全包交易总额。
43 | */
44 | @JsonProperty("transaction_amount")
45 | private TransactionAmount transactionAmount;
46 |
47 | /**
48 | * PayPal 费用金额
49 | */
50 | @JsonProperty("fee_amount")
51 | private TransactionAmount feeAmount;
52 |
53 | /**
54 | * 一笔保险费。保证产品的质量或交付。
55 | */
56 | @JsonProperty("insurance_amount")
57 | private TransactionAmount insuranceAmount;
58 |
59 | /**
60 | * PayPal 或商家报告的交易运费。
61 | */
62 | @JsonProperty("shipping_amount")
63 | private TransactionAmount shippingAmount;
64 |
65 | /**
66 | * 运费折扣。
67 | */
68 | @JsonProperty("shipping_discount_amount")
69 | private TransactionAmount shippingDiscountAmount;
70 |
71 | /**
72 | * 交易状态的代码
73 | * D PayPal 或商家规则拒绝交易。
74 | * P 交易待定。交易已创建,但在状态更改为 之前等待另一个支付流程完成,例如 ACH 交易S。
75 | * S 交易成功完成,没有拒绝并且在任何未决状态之后。
76 | * V 成功的交易被完全撤销,资金被退还给原始发件人。
77 | */
78 | @JsonProperty("transaction_status")
79 | private String transactionStatus;
80 |
81 | /**
82 | * 付款的主体。付款人将此值传递给收款人。付款人通过他或她发送数据的接口来控制这些数据。
83 | */
84 | @JsonProperty("transaction_subject")
85 | private String transactionSubject;
86 |
87 | /**
88 | * 付款人传递给收款人的特殊说明。可能包含特殊的客户要求,例如运输说明。
89 | */
90 | @JsonProperty("transaction_note")
91 | private String transactionNote;
92 |
93 | /**
94 | * 商家随交易发送的发票 ID。
95 | * 注意:如果发票 ID 与请款请求一起发送,则会报告该值。否则,上报授权交易的发票编号。
96 | */
97 | @JsonProperty("invoice_id")
98 | private String invoiceId;
99 |
100 | /**
101 | * 商家提供的自定义文本。
102 | * 注意:通常,此字段包含使用 MassPay 类型交易进行的付款的唯一 ID。
103 | */
104 | @JsonProperty("custom_field")
105 | private String customField;
106 |
107 | /**
108 | * 交易是否有资格获得保护
109 | * 01. 有资格的。
110 | * 02. 不容忽视
111 | * 03. 部分合格。
112 | */
113 | @JsonProperty("protection_eligibility")
114 | private String protectionEligibility;
115 | }
116 |
--------------------------------------------------------------------------------
/paypal-sdk/src/main/java/io/github/vo/UserInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author EalenXie
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class UserInfo {
15 | @JsonProperty("user_id")
16 | private String userId;
17 | @JsonProperty("name")
18 | private String name;
19 | @JsonProperty("given_name")
20 | private String givenName;
21 | @JsonProperty("family_name")
22 | private String familyName;
23 | @JsonProperty("payer_id")
24 | private String payerId;
25 | @JsonProperty("address")
26 | private Address address;
27 | @JsonProperty("verified_account")
28 | private String verifiedAccount;
29 | @JsonProperty("emails")
30 | private List emails;
31 | }
32 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 4.0.0
6 |
7 | io.github
8 | cross-border-electronic-commerce
9 | pom
10 | 1.0-SNAPSHOT
11 |
12 | allegro-sdk
13 | amazon-sdk
14 | wish-sdk
15 | walmart-sdk
16 | paypal-sdk
17 |
18 |
19 |
20 | 8
21 | 8
22 |
23 |
24 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | Cross-Border Electronic Commerce
2 | ===========
3 | 此项目用于对接各大跨境电商平台的接口SDK整合
4 |
5 | allegro: https://developer.allegro.pl/documentation/
6 |
7 | amazon: https://developer-docs.amazon.com/sp-api
8 |
9 | wish: https://china-merchant.wish.com/partner-developer
10 |
11 | walmart: https://developer.walmart.com/
12 |
13 | shopee: https://open.shopee.com/
14 |
15 |
--------------------------------------------------------------------------------
/walmart-sdk/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | cross-border-electronic-commerce
7 | io.github
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | walmart-sdk
13 |
14 |
15 | 8
16 | 8
17 |
18 |
19 |
20 |
21 | org.projectlombok
22 | lombok
23 | 1.18.22
24 |
25 |
26 | org.springframework
27 | spring-web
28 | 5.3.16
29 |
30 |
31 | com.fasterxml.jackson.core
32 | jackson-databind
33 | 2.13.2
34 |
35 |
36 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/WalmartClient.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace;
2 |
3 | import io.github.marketplace.vo.WalmartToken;
4 | import org.springframework.http.*;
5 | import org.springframework.web.client.RestOperations;
6 | import org.springframework.web.client.RestTemplate;
7 |
8 | import java.net.URI;
9 | import java.util.Collections;
10 | import java.util.UUID;
11 |
12 | /**
13 | * Created by EalenXie on 2022/3/16 14:02
14 | */
15 | public abstract class WalmartClient {
16 |
17 | private final RestOperations restOperations;
18 | /**
19 | * Walmart Marketplace API Host地址 https://marketplace.walmartapis.com
20 | */
21 | public static final String HOST = "https://marketplace.walmartapis.com";
22 | /**
23 | * Walmart Marketplace API 沙箱环境地址
24 | */
25 | public static final String SANDBOX_HOST = "https://sandbox.walmartapis.com/v3/orders/released";
26 | /**
27 | * 沙箱模式
28 | */
29 | private boolean sandBoxMode = false;
30 |
31 | @SuppressWarnings("all")
32 | public static final String WM_SVC_NAME = "WM_SVC.NAME";
33 | @SuppressWarnings("all")
34 | public static final String WM_QOS_CORRELATION_ID = "WM_QOS.CORRELATION_ID";
35 | @SuppressWarnings("all")
36 | public static final String WM_SEC_ACCESS_TOKEN = "WM_SEC.ACCESS_TOKEN";
37 |
38 | private final String clientId;
39 |
40 | private final String clientSecret;
41 |
42 | protected WalmartClient(String clientId, String clientSecret) {
43 | this(clientId, clientSecret, new RestTemplate());
44 | }
45 |
46 | protected WalmartClient(String clientId, String clientSecret, RestOperations restOperations) {
47 | this.restOperations = restOperations;
48 | this.clientId = clientId;
49 | this.clientSecret = clientSecret;
50 | }
51 |
52 | public String getClientId() {
53 | return clientId;
54 | }
55 |
56 | public String getClientSecret() {
57 | return clientSecret;
58 | }
59 |
60 | public RestOperations getRestOperations() {
61 | return restOperations;
62 | }
63 |
64 | public boolean isSandBoxMode() {
65 | return sandBoxMode;
66 | }
67 |
68 | public void setSandBoxMode(boolean sandBoxMode) {
69 | this.sandBoxMode = sandBoxMode;
70 | }
71 |
72 | /**
73 | * 获取accessToken
74 | * https://developer.walmart.com/api/us/mp/auth#operation/tokenAPI
75 | *
76 | * @return 访问令牌
77 | */
78 | public ResponseEntity accessToken() {
79 | HttpHeaders headers = getCommonHeaders();
80 | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
81 | return getRestOperations().exchange(URI.create(String.format("%s/v3/token?grant_type=client_credentials", isSandBoxMode() ? SANDBOX_HOST : HOST)), HttpMethod.POST, new HttpEntity<>(null, headers), WalmartToken.class);
82 | }
83 |
84 | /**
85 | * 获取公共的请求头
86 | */
87 | public HttpHeaders getCommonHeaders() {
88 | HttpHeaders headers = new HttpHeaders();
89 | headers.setBasicAuth(getClientId(), getClientSecret());
90 | headers.set(WM_SVC_NAME, "Walmart Marketplace");
91 | headers.set(WM_QOS_CORRELATION_ID, UUID.randomUUID().toString());
92 | headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
93 | return headers;
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/WalmartOrderClient.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 | import io.github.marketplace.dto.CancelDTO;
5 | import io.github.marketplace.dto.OrdersDTO;
6 | import io.github.marketplace.dto.RefundDTO;
7 | import io.github.marketplace.dto.ShipmentDTO;
8 | import io.github.marketplace.vo.WalmartOrder;
9 | import io.github.marketplace.vo.WalmartOrders;
10 | import org.springframework.http.HttpEntity;
11 | import org.springframework.http.HttpHeaders;
12 | import org.springframework.http.HttpMethod;
13 | import org.springframework.http.ResponseEntity;
14 | import org.springframework.util.LinkedMultiValueMap;
15 | import org.springframework.web.client.RestOperations;
16 | import org.springframework.web.client.RestTemplate;
17 | import org.springframework.web.util.UriComponentsBuilder;
18 |
19 | import java.net.URI;
20 | import java.util.LinkedHashMap;
21 | import java.util.Map;
22 |
23 | /**
24 | * Created by EalenXie on 2022/3/16 14:02
25 | * https://developer.walmart.com/api/us/mp/orders
26 | */
27 | public class WalmartOrderClient extends WalmartClient {
28 |
29 | private final ObjectMapper mapper;
30 |
31 | public WalmartOrderClient(String clientId, String clientSecret) {
32 | this(clientId, clientSecret, new RestTemplate());
33 | }
34 |
35 | public WalmartOrderClient(String clientId, String clientSecret, RestOperations restOperations) {
36 | this(clientId, clientSecret, restOperations, new ObjectMapper());
37 | }
38 |
39 | public WalmartOrderClient(String clientId, String clientSecret, RestOperations restOperations, ObjectMapper objectMapper) {
40 | super(clientId, clientSecret, restOperations);
41 | this.mapper = objectMapper;
42 | }
43 |
44 | /**
45 | * https://developer.walmart.com/api/us/mp/orders#operation/getAllReleasedOrders
46 | */
47 | public ResponseEntity orders(String accessToken, OrdersDTO dto) {
48 | HttpHeaders headers = getCommonHeaders();
49 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
50 | @SuppressWarnings("unchecked") Map args = mapper.convertValue(dto, Map.class);
51 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/v3/orders", isSandBoxMode() ? SANDBOX_HOST : HOST));
52 | LinkedMultiValueMap req = new LinkedMultiValueMap<>();
53 | req.setAll(args);
54 | builder.queryParams(req);
55 | URI uri = builder.build().encode().toUri();
56 | return getRestOperations().exchange(uri, HttpMethod.GET, new HttpEntity<>(null, headers), WalmartOrders.class);
57 | }
58 |
59 | /**
60 | * https://developer.walmart.com/api/us/mp/orders#operation/getAnOrder
61 | */
62 | public ResponseEntity order(String accessToken, String orderId) {
63 | HttpHeaders headers = getCommonHeaders();
64 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
65 | return getRestOperations().exchange(URI.create(String.format("%s/v3/orders/%s", isSandBoxMode() ? SANDBOX_HOST : HOST, orderId)), HttpMethod.GET, new HttpEntity<>(null, headers), WalmartOrder.class);
66 | }
67 |
68 | /**
69 | * https://developer.walmart.com/api/us/mp/orders#operation/getAllReleasedOrders
70 | */
71 | public ResponseEntity releasedOrders(String accessToken) {
72 | HttpHeaders headers = getCommonHeaders();
73 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
74 | return getRestOperations().exchange(URI.create(String.format("%s/v3/orders/released", isSandBoxMode() ? SANDBOX_HOST : HOST)), HttpMethod.GET, new HttpEntity<>(null, headers), WalmartOrders.class);
75 | }
76 |
77 | /**
78 | * https://developer.walmart.com/api/us/mp/orders#operation/refundOrderLines
79 | */
80 | public ResponseEntity refund(String purchaseOrderId, String accessToken, RefundDTO dto) {
81 | HttpHeaders headers = getCommonHeaders();
82 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
83 | return getRestOperations().exchange(String.format("%s/v3/orders/%s/refund", isSandBoxMode() ? SANDBOX_HOST : HOST, purchaseOrderId), HttpMethod.POST, new HttpEntity<>(dto, headers), WalmartOrder.class);
84 | }
85 |
86 | /**
87 | * https://developer.walmart.com/api/us/mp/orders#operation/shippingUpdates
88 | */
89 | public ResponseEntity shipment(String purchaseOrderId, String accessToken, ShipmentDTO dto) {
90 | HttpHeaders headers = getCommonHeaders();
91 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
92 | return getRestOperations().exchange(String.format("%s/v3/orders/%s/shipping", isSandBoxMode() ? SANDBOX_HOST : HOST, purchaseOrderId), HttpMethod.POST, new HttpEntity<>(dto, headers), WalmartOrder.class);
93 | }
94 |
95 | /**
96 | * https://developer.walmart.com/api/us/mp/orders#operation/acknowledgeOrders
97 | */
98 | public ResponseEntity acknowledge(String purchaseOrderId, String accessToken) {
99 | HttpHeaders headers = getCommonHeaders();
100 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
101 | return getRestOperations().exchange(String.format("%s/v3/orders/%s/acknowledge", isSandBoxMode() ? SANDBOX_HOST : HOST, purchaseOrderId), HttpMethod.POST, new HttpEntity<>(null, headers), WalmartOrder.class);
102 | }
103 |
104 | /**
105 | * https://developer.walmart.com/api/us/mp/orders#operation/cancelOrderLines
106 | */
107 | public ResponseEntity cancel(String purchaseOrderId, String accessToken, CancelDTO dto) {
108 | HttpHeaders headers = getCommonHeaders();
109 | headers.set(WM_SEC_ACCESS_TOKEN, accessToken);
110 | return getRestOperations().exchange(String.format("%s/v3/orders/%s/cancel", isSandBoxMode() ? SANDBOX_HOST : HOST, purchaseOrderId), HttpMethod.POST, new HttpEntity<>(dto, headers), WalmartOrder.class);
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/dto/CancelDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/21 14:11
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class CancelDTO {
15 |
16 | @JsonProperty("orderCancellation")
17 | private OrderCancellation orderCancellation;
18 |
19 | @NoArgsConstructor
20 | @Data
21 | public static class OrderCancellation {
22 | @JsonProperty("orderLines")
23 | private OrderLines orderLines;
24 |
25 | @NoArgsConstructor
26 | @Data
27 | public static class OrderLines {
28 | @JsonProperty("orderLine")
29 | private List orderLine;
30 |
31 | @NoArgsConstructor
32 | @Data
33 | public static class OrderLine {
34 | @JsonProperty("lineNumber")
35 | private String lineNumber;
36 | @JsonProperty("orderLineStatuses")
37 | private OrderLineStatuses orderLineStatuses;
38 |
39 | @NoArgsConstructor
40 | @Data
41 | public static class OrderLineStatuses {
42 | @JsonProperty("orderLineStatus")
43 | private List orderLineStatus;
44 |
45 | @NoArgsConstructor
46 | @Data
47 | public static class OrderLineStatus {
48 | @JsonProperty("status")
49 | private String status;
50 | @JsonProperty("cancellationReason")
51 | private String cancellationReason;
52 | @JsonProperty("statusQuantity")
53 | private StatusQuantity statusQuantity;
54 |
55 | @NoArgsConstructor
56 | @Data
57 | public static class StatusQuantity {
58 | @JsonProperty("unitOfMeasurement")
59 | private String unitOfMeasurement;
60 | @JsonProperty("amount")
61 | private String amount;
62 | }
63 | }
64 | }
65 | }
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/dto/OrdersDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonFormat;
4 | import com.fasterxml.jackson.annotation.JsonInclude;
5 | import lombok.Data;
6 |
7 | import java.util.Date;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/16 15:51
11 | */
12 | @Data
13 | public class OrdersDTO {
14 |
15 | /**
16 | * 必填
17 | * The Distribution Facility “Distributor ID” which uniquely identifies each facility and is autogenerated during DSV account creation. Every time you add/update a facility in the Supplier Center, a new ID is generated
18 | */
19 | @JsonInclude(JsonInclude.Include.NON_NULL)
20 | private Integer limit;
21 | @JsonInclude(JsonInclude.Include.NON_NULL)
22 | private String sku;
23 | @JsonInclude(JsonInclude.Include.NON_NULL)
24 | private String customerOrderId;
25 | @JsonInclude(JsonInclude.Include.NON_NULL)
26 | private String purchaseOrderId;
27 | @JsonInclude(JsonInclude.Include.NON_NULL)
28 | private String status;
29 | @JsonInclude(JsonInclude.Include.NON_NULL)
30 | @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
31 | private Date createdStartDate;
32 | @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ssZ")
33 | private Date createdEndDate;
34 | @JsonInclude(JsonInclude.Include.NON_NULL)
35 | private String fromExpectedShipDate;
36 | @JsonInclude(JsonInclude.Include.NON_NULL)
37 | private String toExpectedShipDate;
38 | @JsonInclude(JsonInclude.Include.NON_NULL)
39 | private Boolean productInfo;
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/dto/RefundDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/21 13:40
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class RefundDTO {
15 |
16 | @JsonProperty("orderRefund")
17 | private OrderRefund orderRefund;
18 |
19 | @NoArgsConstructor
20 | @Data
21 | public static class OrderRefund {
22 | @JsonProperty("purchaseOrderId")
23 | private String purchaseOrderId;
24 | @JsonProperty("orderLines")
25 | private OrderLines orderLines;
26 |
27 | @NoArgsConstructor
28 | @Data
29 | public static class OrderLines {
30 | @JsonProperty("orderLine")
31 | private List orderLine;
32 |
33 | @NoArgsConstructor
34 | @Data
35 | public static class OrderLine {
36 | @JsonProperty("lineNumber")
37 | private String lineNumber;
38 | @JsonProperty("refunds")
39 | private Refunds refunds;
40 |
41 | @NoArgsConstructor
42 | @Data
43 | public static class Refunds {
44 | @JsonProperty("refund")
45 | private List refund;
46 |
47 | @NoArgsConstructor
48 | @Data
49 | public static class Refund {
50 | @JsonProperty("refundComments")
51 | private String refundComments;
52 | @JsonProperty("refundCharges")
53 | private RefundCharges refundCharges;
54 |
55 | @NoArgsConstructor
56 | @Data
57 | public static class RefundCharges {
58 | @JsonProperty("refundCharge")
59 | private List refundCharge;
60 |
61 | @NoArgsConstructor
62 | @Data
63 | public static class RefundCharge {
64 | @JsonProperty("refundReason")
65 | private String refundReason;
66 | @JsonProperty("charge")
67 | private Charge charge;
68 |
69 | @NoArgsConstructor
70 | @Data
71 | public static class Charge {
72 | @JsonProperty("chargeType")
73 | private String chargeType;
74 | @JsonProperty("chargeName")
75 | private String chargeName;
76 | @JsonProperty("chargeAmount")
77 | private ChargeAmount chargeAmount;
78 | @JsonProperty("tax")
79 | private Tax tax;
80 |
81 | @NoArgsConstructor
82 | @Data
83 | public static class ChargeAmount {
84 | @JsonProperty("currency")
85 | private String currency;
86 | @JsonProperty("amount")
87 | private Double amount;
88 | }
89 |
90 | @NoArgsConstructor
91 | @Data
92 | public static class Tax {
93 | @JsonProperty("taxName")
94 | private String taxName;
95 | @JsonProperty("taxAmount")
96 | private TaxAmount taxAmount;
97 |
98 | @NoArgsConstructor
99 | @Data
100 | public static class TaxAmount {
101 | @JsonProperty("currency")
102 | private String currency;
103 | @JsonProperty("amount")
104 | private Double amount;
105 | }
106 | }
107 | }
108 | }
109 | }
110 | }
111 | }
112 | }
113 | }
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/dto/ShipmentDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import io.github.marketplace.vo.OrderShipment;
5 | import lombok.Data;
6 | import lombok.NoArgsConstructor;
7 |
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/21 14:01
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class ShipmentDTO {
15 | @JsonProperty("orderShipment")
16 | private OrderShipment orderShipment;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/CarrierName.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class CarrierName {
13 | @JsonProperty("carrier")
14 | private String carrier;
15 | }
16 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Charge.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Charge {
13 | @JsonProperty("chargeType")
14 | private String chargeType;
15 | @JsonProperty("chargeName")
16 | private String chargeName;
17 | @JsonProperty("chargeAmount")
18 | private ChargeAmount chargeAmount;
19 | @JsonProperty("tax")
20 | private Tax tax;
21 | }
22 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/ChargeAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ChargeAmount {
13 | @JsonProperty("currency")
14 | private String currency;
15 | @JsonProperty("amount")
16 | private Integer amount;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Charges.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:12
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class Charges {
15 | @JsonProperty("charge")
16 | private List charge;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Elements.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:17
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class Elements {
15 | @JsonProperty("order")
16 | private List order;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Fulfillment.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Fulfillment {
13 | @JsonProperty("fulfillmentOption")
14 | private String fulfillmentOption;
15 | @JsonProperty("shipMethod")
16 | private String shipMethod;
17 | @JsonProperty("pickUpDateTime")
18 | private Long pickUpDateTime;
19 | }
20 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Item.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Item {
13 | @JsonProperty("productName")
14 | private String productName;
15 | @JsonProperty("sku")
16 | private String sku;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Meta.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:17
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Meta {
13 | @JsonProperty("totalCount")
14 | private Integer totalCount;
15 | @JsonProperty("limit")
16 | private Integer limit;
17 | @JsonProperty("nextCursor")
18 | private String nextCursor;
19 | }
20 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Order.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Order {
13 | @JsonProperty("purchaseOrderId")
14 | private String purchaseOrderId;
15 | @JsonProperty("customerOrderId")
16 | private String customerOrderId;
17 | @JsonProperty("customerEmailId")
18 | private String customerEmailId;
19 | @JsonProperty("orderType")
20 | private String orderType;
21 | @JsonProperty("originalCustomerOrderID")
22 | private String originalCustomerOrderID;
23 | @JsonProperty("orderDate")
24 | private Long orderDate;
25 | @JsonProperty("shippingInfo")
26 | private ShippingInfo shippingInfo;
27 | @JsonProperty("orderLines")
28 | private OrderLines orderLines;
29 | @JsonProperty("shipNode")
30 | private ShipNode shipNode;
31 | }
32 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderLine.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class OrderLine {
13 | @JsonProperty("lineNumber")
14 | private String lineNumber;
15 | @JsonProperty("item")
16 | private Item item;
17 | @JsonProperty("charges")
18 | private Charges charges;
19 | @JsonProperty("orderLineQuantity")
20 | private OrderLineQuantity orderLineQuantity;
21 | @JsonProperty("statusDate")
22 | private Long statusDate;
23 | @JsonProperty("orderLineStatuses")
24 | private OrderLineStatuses orderLineStatuses;
25 | @JsonProperty("fulfillment")
26 | private Fulfillment fulfillment;
27 | }
28 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderLineQuantity.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class OrderLineQuantity {
13 | @JsonProperty("unitOfMeasurement")
14 | private String unitOfMeasurement;
15 | @JsonProperty("amount")
16 | private String amount;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderLineStatus.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class OrderLineStatus {
13 | @JsonProperty("status")
14 | private String status;
15 | @JsonProperty("statusQuantity")
16 | private OrderLineQuantity statusQuantity;
17 | @JsonProperty("trackingInfo")
18 | private TrackingInfo trackingInfo;
19 | @JsonProperty("returnCenterAddress")
20 | private ReturnCenterAddress returnCenterAddress;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderLineStatuses.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:12
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class OrderLineStatuses {
15 | @JsonProperty("orderLineStatus")
16 | private List orderLineStatus;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderLines.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:12
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class OrderLines {
15 | @JsonProperty("orderLine")
16 | private List orderLine;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderList.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:17
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class OrderList {
13 | @JsonProperty("meta")
14 | private Meta meta;
15 | @JsonProperty("elements")
16 | private Elements elements;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/OrderShipment.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:39
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class OrderShipment {
13 | @JsonProperty("orderLines")
14 | private OrderLines orderLines;
15 | }
16 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/PostalAddress.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class PostalAddress {
13 | @JsonProperty("name")
14 | private String name;
15 | @JsonProperty("address1")
16 | private String address1;
17 | @JsonProperty("city")
18 | private String city;
19 | @JsonProperty("state")
20 | private String state;
21 | @JsonProperty("postalCode")
22 | private String postalCode;
23 | @JsonProperty("country")
24 | private String country;
25 | @JsonProperty("addressType")
26 | private String addressType;
27 | }
28 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/ReturnCenterAddress.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:39
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ReturnCenterAddress {
13 | @JsonProperty("name")
14 | private String name;
15 | @JsonProperty("address1")
16 | private String address1;
17 | @JsonProperty("city")
18 | private String city;
19 | @JsonProperty("state")
20 | private String state;
21 | @JsonProperty("postalCode")
22 | private String postalCode;
23 | @JsonProperty("country")
24 | private String country;
25 | @JsonProperty("dayPhone")
26 | private String dayPhone;
27 | @JsonProperty("emailId")
28 | private String emailId;
29 | }
30 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/ShipNode.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShipNode {
13 | @JsonProperty("type")
14 | private String type;
15 | }
16 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/ShippingInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingInfo {
13 | @JsonProperty("phone")
14 | private String phone;
15 | @JsonProperty("estimatedDeliveryDate")
16 | private Long estimatedDeliveryDate;
17 | @JsonProperty("estimatedShipDate")
18 | private Long estimatedShipDate;
19 | @JsonProperty("methodCode")
20 | private String methodCode;
21 | @JsonProperty("postalAddress")
22 | private PostalAddress postalAddress;
23 | }
24 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/StatusQuantity.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | @NoArgsConstructor
8 | @Data
9 | public class StatusQuantity {
10 | @JsonProperty("unitOfMeasurement")
11 | private String unitOfMeasurement;
12 | @JsonProperty("amount")
13 | private String amount;
14 | }
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/Tax.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Tax {
13 | @JsonProperty("taxName")
14 | private String taxName;
15 | @JsonProperty("taxAmount")
16 | private TaxAmount taxAmount;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/TaxAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class TaxAmount {
13 | @JsonProperty("currency")
14 | private String currency;
15 | @JsonProperty("amount")
16 | private Double amount;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/TrackingInfo.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:12
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class TrackingInfo {
13 | @JsonProperty("shipDateTime")
14 | private Long shipDateTime;
15 | @JsonProperty("carrierName")
16 | private CarrierName carrierName;
17 | @JsonProperty("methodCode")
18 | private String methodCode;
19 | @JsonProperty("trackingNumber")
20 | private String trackingNumber;
21 | @JsonProperty("trackingURL")
22 | private String trackingURL;
23 | }
24 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/WalmartOrder.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:11
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class WalmartOrder {
13 | @JsonProperty("order")
14 | private Order order;
15 | }
16 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/WalmartOrders.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:15
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class WalmartOrders {
13 |
14 |
15 | @JsonProperty("list")
16 | private OrderList list;
17 | }
18 |
--------------------------------------------------------------------------------
/walmart-sdk/src/main/java/io/github/marketplace/vo/WalmartToken.java:
--------------------------------------------------------------------------------
1 | package io.github.marketplace.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/16 15:08
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class WalmartToken {
13 |
14 | @JsonProperty("access_token")
15 | private String accessToken;
16 | @JsonProperty("token_type")
17 | private String tokenType;
18 | @JsonProperty("expires_in")
19 | private Integer expiresIn;
20 | }
21 |
--------------------------------------------------------------------------------
/wish-sdk/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | cross-border-electronic-commerce
7 | io.github
8 | 1.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | wish-sdk
13 |
14 |
15 | 8
16 | 8
17 |
18 |
19 |
20 | org.projectlombok
21 | lombok
22 | 1.18.22
23 |
24 |
25 | org.springframework
26 | spring-web
27 | 5.3.16
28 |
29 |
30 | com.fasterxml.jackson.core
31 | jackson-databind
32 | 2.13.2
33 |
34 |
35 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/WishClient.java:
--------------------------------------------------------------------------------
1 | package io.github;
2 |
3 | import io.github.vo.WishToken;
4 | import org.springframework.http.HttpEntity;
5 | import org.springframework.http.HttpHeaders;
6 | import org.springframework.http.HttpMethod;
7 | import org.springframework.http.ResponseEntity;
8 | import org.springframework.web.client.RestOperations;
9 | import org.springframework.web.client.RestTemplate;
10 |
11 | import java.net.URI;
12 |
13 |
14 | /**
15 | * Created by EalenXie on 2022/2/23 9:51
16 | */
17 | public abstract class WishClient {
18 |
19 |
20 | private final RestOperations restOperations;
21 | /**
22 | * Wish Host 地址 https://merchant.wish.co
23 | */
24 | public static final String HOST = "https://merchant.wish.com";
25 |
26 | /**
27 | * Wish Host 地址(沙箱环境) https://sandbox.merchant.wish.com
28 | */
29 | public static final String SANDBOX_HOST = "https://sandbox.merchant.wish.com";
30 | /**
31 | * 是否是沙箱环境
32 | */
33 | private boolean sandbox = false;
34 |
35 | public boolean isSandbox() {
36 | return sandbox;
37 | }
38 |
39 | public void setSandbox(boolean sandbox) {
40 | this.sandbox = sandbox;
41 | }
42 |
43 | protected WishClient() {
44 | this(new RestTemplate());
45 | }
46 |
47 | protected WishClient(RestOperations restOperations) {
48 | this.restOperations = restOperations;
49 | }
50 |
51 | public RestOperations getRestOperations() {
52 | return restOperations;
53 | }
54 |
55 | /**
56 | * 获取授权地址 文档: https://china-merchant.wish.com/documentation/api/v3/reference#section/Authentication
57 | *
58 | * @param state 应用程序生成的状态值。
59 | */
60 | public String authorize(String clientId, String state) {
61 | return String.format("%s/v3/oauth/authorize?client_id=%s&state=%s", isSandbox() ? SANDBOX_HOST : HOST, clientId, state);
62 | }
63 |
64 | /**
65 | * 获取包含认证的 Bearer 标准请求头
66 | *
67 | * @param accessToken 令牌
68 | */
69 | public HttpHeaders getBearerHeaders(String accessToken) {
70 | HttpHeaders bearTokenHeader = new HttpHeaders();
71 | bearTokenHeader.setBearerAuth(accessToken);
72 | return bearTokenHeader;
73 | }
74 |
75 | /**
76 | * 获取包含认证的 Basic 标准请求头
77 | *
78 | * @param clientId 客户端Id
79 | * @param clientSecret 客户端密钥
80 | */
81 | public HttpHeaders getBasicHeaders(String clientId, String clientSecret) {
82 | HttpHeaders basicHeader = new HttpHeaders();
83 | basicHeader.setBasicAuth(clientId, clientSecret);
84 | return basicHeader;
85 | }
86 |
87 | /**
88 | * 授权码模式获取accessToken 文档: https://china-merchant.wish.com/documentation/api/v3/reference#operation/oauthAccessToken
89 | *
90 | * @param clientId 客户端Id
91 | * @param clientSecret 客户端密钥
92 | * @param code 授权码
93 | * @param redirectUri 重定向地址
94 | */
95 | public ResponseEntity accessToken(String clientId, String clientSecret, String code, String redirectUri) {
96 | HttpHeaders headers = getBasicHeaders(clientId, clientSecret);
97 | return restOperations.exchange(URI.create(String.format("%s/api/v3/oauth/access_token?grant_type=authorization_code&code=%s&redirect_uri=%s", isSandbox() ? SANDBOX_HOST : HOST, code, redirectUri)), HttpMethod.POST, new HttpEntity<>(null, headers), WishToken.class);
98 | }
99 |
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/WishOrderClient.java:
--------------------------------------------------------------------------------
1 | package io.github;
2 |
3 | import com.fasterxml.jackson.databind.ObjectMapper;
4 | import io.github.dto.*;
5 | import io.github.vo.NameVO;
6 | import io.github.vo.WishDownloadJob;
7 | import io.github.vo.WishOrder;
8 | import org.springframework.core.ParameterizedTypeReference;
9 | import org.springframework.http.*;
10 | import org.springframework.util.LinkedMultiValueMap;
11 | import org.springframework.web.client.RestOperations;
12 | import org.springframework.web.client.RestTemplate;
13 | import org.springframework.web.util.UriComponentsBuilder;
14 |
15 | import java.net.URI;
16 | import java.util.List;
17 | import java.util.Map;
18 |
19 | /**
20 | * Created by EalenXie on 2022/2/23 9:51
21 | * https://china-merchant.wish.com/documentation/api/v3/reference#tag/Orders
22 | */
23 | public class WishOrderClient extends WishClient {
24 |
25 | private final ObjectMapper mapper;
26 |
27 | public WishOrderClient() {
28 | this(new RestTemplate());
29 | }
30 |
31 | public WishOrderClient(RestOperations restOperations) {
32 | this(new ObjectMapper(), restOperations);
33 | }
34 |
35 | public WishOrderClient(ObjectMapper objectMapper, RestOperations restOperations) {
36 | super(restOperations);
37 | this.mapper = objectMapper;
38 | }
39 |
40 | /**
41 | * 获取订单详情
42 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/GetOrder
43 | *
44 | * @param orderId 订单Id
45 | * @param accessToken 令牌
46 | * @return {@link WishOrder} 订单详情
47 | */
48 | public ResponseEntity getOrder(String orderId, String accessToken) {
49 | HttpHeaders headers = getBearerHeaders(accessToken);
50 | return getRestOperations().exchange(URI.create(String.format("%s/api/v3/orders/%s", isSandbox() ? SANDBOX_HOST : HOST, orderId)), HttpMethod.GET, new HttpEntity<>(null, headers), WishOrder.class);
51 | }
52 |
53 | /**
54 | * 获取订单列表
55 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/GetMultipleOrders
56 | *
57 | * @param dto 订单请求参数
58 | * @param accessToken 令牌
59 | * @return {@link WishOrder} 订单详情
60 | */
61 | public ResponseEntity> getOrders(OrdersDTO dto, String accessToken) {
62 | HttpHeaders headers = getBearerHeaders(accessToken);
63 | LinkedMultiValueMap req = queryParam(dto);
64 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/api/v3/orders", isSandbox() ? SANDBOX_HOST : HOST)).queryParams(req);
65 | return getRestOperations().exchange(builder.build().encode().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), new ParameterizedTypeReference>() {
66 | });
67 | }
68 |
69 | public LinkedMultiValueMap queryParam(Object dto) {
70 | @SuppressWarnings("unchecked") Map args = mapper.convertValue(dto, Map.class);
71 | LinkedMultiValueMap req = new LinkedMultiValueMap<>();
72 | req.setAll(args);
73 | return req;
74 | }
75 |
76 |
77 | /**
78 | * 获取货运公司
79 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/GetShippingCarriers
80 | *
81 | * @param dto 请求参数
82 | * @param accessToken 令牌
83 | * @return {@link NameVO} 物流公司
84 | */
85 | public ResponseEntity> shippingCarriers(ShippingCarriersDTO dto, String accessToken) {
86 | HttpHeaders headers = getBearerHeaders(accessToken);
87 | LinkedMultiValueMap req = queryParam(dto);
88 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/api/v3/shipping_carriers", isSandbox() ? SANDBOX_HOST : HOST)).queryParams(req);
89 | return getRestOperations().exchange(builder.build().encode().toUri(), HttpMethod.GET, new HttpEntity<>(null, headers), new ParameterizedTypeReference>() {
90 | });
91 | }
92 |
93 |
94 | /**
95 | * 批量获取订单下载
96 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/downloadOrders
97 | *
98 | * @param dto 请求参数
99 | * @param accessToken 令牌
100 | * @return {@link WishDownloadJob} 订单下载信息
101 | */
102 | public ResponseEntity batchDownloadOrders(OrdersDTO dto, String accessToken) {
103 | HttpHeaders headers = getBearerHeaders(accessToken);
104 | LinkedMultiValueMap req = queryParam(dto);
105 | UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(String.format("%s/api/v3/bulk_get", isSandbox() ? SANDBOX_HOST : HOST)).queryParams(req);
106 | return getRestOperations().exchange(builder.build().encode().toUri(), HttpMethod.POST, new HttpEntity<>(null, headers), WishDownloadJob.class);
107 | }
108 |
109 |
110 | /**
111 | * 获取订单下载
112 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/getOrderDownloadJob
113 | *
114 | * @param accessToken 令牌
115 | * @return {@link WishDownloadJob} 订单下载信息
116 | */
117 | public ResponseEntity batchDownloadJobStatus(String jobId, String accessToken) {
118 | HttpHeaders headers = getBearerHeaders(accessToken);
119 | return getRestOperations().exchange(String.format("%s/api/v3/bulk_get/%s", isSandbox() ? SANDBOX_HOST : HOST, jobId), HttpMethod.GET, new HttpEntity<>(null, headers), WishDownloadJob.class);
120 | }
121 |
122 | /**
123 | * 发货或更新跟踪订单。 此操作为异步操作。
124 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/ShipOrder
125 | *
126 | * @param orderId 订单id
127 | * @param dto 请求参数
128 | * @param accessToken 令牌
129 | * @return {@link WishOrder} 发货返回信息
130 | */
131 | public ResponseEntity shipOrUpdateTracking(String orderId, TrackingDTO dto, String accessToken) {
132 | HttpHeaders headers = getBearerHeaders(accessToken);
133 | headers.setContentType(MediaType.APPLICATION_JSON);
134 | HttpEntity httpEntity = new HttpEntity<>(dto, headers);
135 | return getRestOperations().exchange(String.format("%s/api/v3/orders/%s/tracking", isSandbox() ? SANDBOX_HOST : HOST, orderId), HttpMethod.PUT, httpEntity, WishOrder.class);
136 | }
137 |
138 | /**
139 | * 获取退货原因
140 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/GetValidRefundReasons
141 | *
142 | * @param orderId 订单id
143 | * @param accessToken 令牌
144 | */
145 | public ResponseEntity> refundReasons(String orderId, String accessToken) {
146 | HttpHeaders headers = getBearerHeaders(accessToken);
147 | return getRestOperations().exchange(String.format("%s/api/v3/orders/%s/refund_reasons", isSandbox() ? SANDBOX_HOST : HOST, orderId), HttpMethod.GET, new HttpEntity<>(null, headers), new ParameterizedTypeReference>() {
148 | });
149 | }
150 |
151 | /**
152 | * 取消订单
153 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/RefundOrder
154 | *
155 | * @param orderId 订单id
156 | * @param dto 请求参数
157 | * @param accessToken 令牌
158 | * @return {@link WishOrder} 取消订单返回结果
159 | */
160 | public ResponseEntity refund(String orderId, RefundDTO dto, String accessToken) {
161 | HttpHeaders headers = getBearerHeaders(accessToken);
162 | headers.setContentType(MediaType.APPLICATION_JSON);
163 | return getRestOperations().exchange(String.format("%s/api/v3/orders/%s/refund", isSandbox() ? SANDBOX_HOST : HOST, orderId), HttpMethod.PUT, new HttpEntity<>(dto, headers), WishOrder.class);
164 | }
165 |
166 |
167 | /**
168 | * 更新订单
169 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/UpdateOrder
170 | *
171 | * @param orderId 订单Id
172 | * @param accessToken 令牌
173 | * @return {@link WishOrder} 订单返回信息
174 | */
175 | public ResponseEntity updateLTLOrder(String orderId, UpdateLtlDTO dto, String accessToken) {
176 | HttpHeaders headers = getBearerHeaders(accessToken);
177 | return getRestOperations().exchange(URI.create(String.format("%s/api/v3/orders/%s", isSandbox() ? SANDBOX_HOST : HOST, orderId)), HttpMethod.PUT, new HttpEntity<>(dto, headers), WishOrder.class);
178 | }
179 |
180 | /**
181 | * 修改物流地址
182 | * 接口文档 https://china-merchant.wish.com/documentation/api/v3/reference#operation/ModifyAddress
183 | *
184 | * @param orderId 订单Id
185 | * @param accessToken 令牌
186 | * @return {@link WishOrder} 订单返回信息
187 | */
188 | public ResponseEntity modifyAddress(String orderId, ModifyAddressDTO dto, String accessToken) {
189 | HttpHeaders headers = getBearerHeaders(accessToken);
190 | return getRestOperations().exchange(URI.create(String.format("%s/api/v3/orders/%s/address", isSandbox() ? SANDBOX_HOST : HOST, orderId)), HttpMethod.PUT, new HttpEntity<>(dto, headers), WishOrder.class);
191 | }
192 |
193 | }
194 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/ModifyAddressDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/21 15:23
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ModifyAddressDTO {
13 |
14 |
15 | @JsonProperty("city")
16 | private String city;
17 | @JsonProperty("country")
18 | private String country;
19 | @JsonProperty("street_address3")
20 | private String streetAddress3;
21 | @JsonProperty("street_address2")
22 | private String streetAddress2;
23 | @JsonProperty("street_address1")
24 | private String streetAddress1;
25 | @JsonProperty("zipcode")
26 | private String zipcode;
27 | @JsonProperty("state")
28 | private String state;
29 | @JsonProperty("country_code")
30 | private String countryCode;
31 | @JsonProperty("phone_number")
32 | private PhoneNumber phoneNumber;
33 | @JsonProperty("region")
34 | private String region;
35 |
36 | @NoArgsConstructor
37 | @Data
38 | public static class PhoneNumber {
39 | @JsonProperty("number")
40 | private String number;
41 | @JsonProperty("country_code")
42 | private String countryCode;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/OrdersDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonInclude;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import lombok.Getter;
6 | import lombok.Setter;
7 |
8 | /**
9 | * Created by EalenXie on 2022/2/23 13:55
10 | */
11 | @Getter
12 | @Setter
13 | public class OrdersDTO {
14 | @JsonInclude(JsonInclude.Include.NON_NULL)
15 | private Integer limit;
16 | @JsonProperty("order_type")
17 | @JsonInclude(JsonInclude.Include.NON_NULL)
18 | private String orderType;
19 | @JsonProperty("released_at_max")
20 | @JsonInclude(JsonInclude.Include.NON_NULL)
21 | private String releasedAtMax;
22 | @JsonProperty("released_at_min")
23 | @JsonInclude(JsonInclude.Include.NON_NULL)
24 | private String releasedAtMin;
25 | @JsonProperty("sort_by")
26 | @JsonInclude(JsonInclude.Include.NON_NULL)
27 | private String sortBy;
28 | @JsonProperty("states")
29 | @JsonInclude(JsonInclude.Include.NON_NULL)
30 | private String[] states;
31 | @JsonProperty("updated_at_max")
32 | @JsonInclude(JsonInclude.Include.NON_NULL)
33 | private String updatedAtMax;
34 | @JsonProperty("updated_at_min")
35 | @JsonInclude(JsonInclude.Include.NON_NULL)
36 | private String updatedAtMin;
37 | }
38 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/RefundDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/21 15:14
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class RefundDTO {
13 |
14 | @JsonProperty("refund_reason_note")
15 | private String refundReasonNote;
16 | @JsonProperty("refund_reason")
17 | private String refundReason;
18 | }
19 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/ShippingCarriersDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Getter;
5 | import lombok.Setter;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/18 16:37
9 | */
10 | @Getter
11 | @Setter
12 | public class ShippingCarriersDTO {
13 |
14 | @JsonProperty("dest_country_code")
15 | private String destCountryCode;
16 | @JsonProperty("order_type")
17 | private String orderType;
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/TrackingDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/18 16:56
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class TrackingDTO {
13 |
14 |
15 | @JsonProperty("tracking_number")
16 | private String trackingNumber;
17 | @JsonProperty("origin_country")
18 | private String originCountry;
19 | @JsonProperty("ship_note")
20 | private String shipNote;
21 | @JsonProperty("shipping_provider")
22 | private String shippingProvider;
23 | }
24 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/dto/UpdateLtlDTO.java:
--------------------------------------------------------------------------------
1 | package io.github.dto;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/21 15:19
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class UpdateLtlDTO {
13 |
14 | @JsonProperty("delivery_receipt_file_url")
15 | private String deliveryReceiptFileUrl;
16 | @JsonProperty("delivered_at")
17 | private String deliveredAt;
18 | @JsonProperty("tracking_url")
19 | private String trackingUrl;
20 | }
21 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Amount.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 |
13 | public class Amount {
14 | @SuppressWarnings("all")
15 | @JsonProperty("amount")
16 | private Double amount;
17 | @JsonProperty("currency_code")
18 | private String currencyCode;
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/CarrierSubsidies.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class CarrierSubsidies {
13 | @JsonProperty("subsidy")
14 | private Amount subsidy;
15 | @JsonProperty("carrier_name")
16 | private String carrierName;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/CustomerPaidPricesDetail.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class CustomerPaidPricesDetail {
13 | @JsonProperty("total")
14 | private Amount total;
15 | @JsonProperty("product_price")
16 | private Amount productPrice;
17 | @JsonProperty("product_price_total")
18 | private Amount productPriceTotal;
19 | @JsonProperty("shipping_price")
20 | private Amount shippingPrice;
21 | @JsonProperty("shipping_price_total")
22 | private Amount shippingPriceTotal;
23 | }
24 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/EuVatCustomsDeclaration.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class EuVatCustomsDeclaration {
13 | @JsonProperty("product")
14 | private Product product;
15 | @JsonProperty("merchant_identity")
16 | private String merchantIdentity;
17 | @JsonProperty("vat_paid_in_authority_currency")
18 | private Amount vatPaidInAuthorityCurrency;
19 | @JsonProperty("vat_paid_in_customer_currency")
20 | private Amount vatPaidInCustomerCurrency;
21 | @JsonProperty("shipping_cost_in_customer_currency")
22 | private ShippingCostInCustomerCurrency shippingCostInCustomerCurrency;
23 | @JsonProperty("customer_identity")
24 | private String customerIdentity;
25 | @JsonProperty("vat_payer")
26 | private VatPayer vatPayer;
27 | @JsonProperty("merchant_address")
28 | private ShippingDetail merchantAddress;
29 | @JsonProperty("invoice_amount_in_customer_currency")
30 | private InvoiceAmountInCustomerCurrency invoiceAmountInCustomerCurrency;
31 | @JsonProperty("shipping_cost_in_authority_currency")
32 | private ShippingCostInAuthorityCurrency shippingCostInAuthorityCurrency;
33 | @JsonProperty("invoice_amount_in_authority_currency")
34 | private InvoiceAmountInAuthorityCurrency invoiceAmountInAuthorityCurrency;
35 | @JsonProperty("customer_address")
36 | private ShippingDetail customerAddress;
37 | @JsonProperty("merchant_name")
38 | private String merchantName;
39 | @JsonProperty("platform_status")
40 | private String platformStatus;
41 | @JsonProperty("customer_name")
42 | private String customerName;
43 | }
44 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/FbwFees.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class FbwFees {
13 | @JsonProperty("amount")
14 | private Amount amount;
15 | @JsonProperty("fee_name")
16 | private String feeName;
17 | @JsonProperty("fee_type")
18 | private String feeType;
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/FbwInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:47
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class FbwInformation {
15 | @JsonProperty("fbw_warehouse_code")
16 | private String fbwWarehouseCode;
17 | @JsonProperty("fbw_fees")
18 | private List fbwFees;
19 | @JsonProperty("lot_information")
20 | private List lotInformation;
21 | }
22 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/FulfillmentRecords.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class FulfillmentRecords {
13 | @JsonProperty("event_type")
14 | private String eventType;
15 | @JsonProperty("event_time")
16 | private String eventTime;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/FulfillmentRequirements.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class FulfillmentRequirements {
13 | @JsonProperty("expected_ship_time")
14 | private String expectedShipTime;
15 | @JsonProperty("expected_delivery_time")
16 | private String expectedDeliveryTime;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/FullAddress.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class FullAddress {
13 | @JsonProperty("shipping_detail")
14 | private ShippingDetail shippingDetail;
15 | }
16 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/GeneralPaymentDetails.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class GeneralPaymentDetails {
13 | @JsonProperty("shipping_merchant_payment")
14 | private ShippingMerchantPayment shippingMerchantPayment;
15 | @JsonProperty("payment_total")
16 | private PaymentTotal paymentTotal;
17 | @JsonProperty("product_price")
18 | private Amount productPrice;
19 | @JsonProperty("product_merchant_payment")
20 | private Amount productMerchantPayment;
21 | @JsonProperty("product_shipping_price")
22 | private ProductShippingPrice productShippingPrice;
23 | @JsonProperty("product_quantity")
24 | private Integer productQuantity;
25 | @JsonProperty("customer_paid_prices_detail")
26 | private CustomerPaidPricesDetail customerPaidPricesDetail;
27 | }
28 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/InvoiceAmountInAuthorityCurrency.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class InvoiceAmountInAuthorityCurrency {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/InvoiceAmountInCustomerCurrency.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class InvoiceAmountInCustomerCurrency {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/LotInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class LotInformation {
13 | @JsonProperty("lot_id")
14 | private String lotId;
15 | @JsonProperty("quantity")
16 | private Integer quantity;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/MerchantResponsibleAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class MerchantResponsibleAmount {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/NameVO.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/18 16:35
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class NameVO {
13 |
14 | @JsonProperty("name")
15 | private String name;
16 | }
17 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/OrderPayment.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:47
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class OrderPayment {
15 | @JsonProperty("carrier_subsidies")
16 | private List carrierSubsidies;
17 | @JsonProperty("shipping_reimbursements")
18 | private List shippingReimbursements;
19 | @JsonProperty("rev_share")
20 | private RevShare revShare;
21 | @JsonProperty("general_payment_details")
22 | private GeneralPaymentDetails generalPaymentDetails;
23 | }
24 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/PaymentTotal.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class PaymentTotal {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/PhoneNumber.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class PhoneNumber {
13 | @JsonProperty("number")
14 | private String number;
15 | @JsonProperty("country_code")
16 | private String countryCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Product.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Product {
13 | @JsonProperty("name")
14 | private String name;
15 | @JsonProperty("weight")
16 | private Weight weight;
17 | @JsonProperty("image_url")
18 | private String imageUrl;
19 | @JsonProperty("hs_code")
20 | private String hsCode;
21 | @JsonProperty("condition")
22 | private String condition;
23 | @JsonProperty("quantity")
24 | private Integer quantity;
25 | }
26 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ProductInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ProductInformation {
13 | @JsonProperty("sku")
14 | private String sku;
15 | @JsonProperty("name")
16 | private String name;
17 | @JsonProperty("color")
18 | private String color;
19 | @JsonProperty("manufactured_country")
20 | private String manufacturedCountry;
21 | @JsonProperty("variation_image_url")
22 | private String variationImageUrl;
23 | @JsonProperty("variation_id")
24 | private String variationId;
25 | @JsonProperty("id")
26 | private String id;
27 | @JsonProperty("size")
28 | private String size;
29 | }
30 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ProductShippingPrice.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ProductShippingPrice {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/RefundAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class RefundAmount {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Refunds.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Refunds {
13 | @JsonProperty("refund_reason_note")
14 | private String refundReasonNote;
15 | @JsonProperty("refund_source")
16 | private String refundSource;
17 | @JsonProperty("refund_amount")
18 | private RefundAmount refundAmount;
19 | @JsonProperty("merchant_responsible_amount")
20 | private MerchantResponsibleAmount merchantResponsibleAmount;
21 | @JsonProperty("refund_time")
22 | private String refundTime;
23 | @JsonProperty("refund_reason")
24 | private String refundReason;
25 | }
26 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/RequiredVatNumbers.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class RequiredVatNumbers {
13 | @JsonProperty("voec")
14 | private Voec voec;
15 | @JsonProperty("eori")
16 | private Voec eori;
17 | @JsonProperty("vat")
18 | private Vat vat;
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/RevShare.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class RevShare {
13 | @JsonProperty("destination_region")
14 | private String destinationRegion;
15 | @SuppressWarnings("all")
16 | @JsonProperty("rev_share")
17 | private Integer revShare;
18 | @JsonProperty("product_category")
19 | private String productCategory;
20 | @JsonProperty("entity_region")
21 | private String entityRegion;
22 | @JsonProperty("source_region")
23 | private String sourceRegion;
24 | @JsonProperty("shipping_type")
25 | private String shippingType;
26 | }
27 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ShippingCostInAuthorityCurrency.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingCostInAuthorityCurrency {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ShippingCostInCustomerCurrency.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingCostInCustomerCurrency {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ShippingDetail.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingDetail {
13 | @JsonProperty("city")
14 | private String city;
15 | @JsonProperty("country")
16 | private String country;
17 | @JsonProperty("street_address3")
18 | private String streetAddress3;
19 | @JsonProperty("street_address2")
20 | private String streetAddress2;
21 | @JsonProperty("street_address1")
22 | private String streetAddress1;
23 | @JsonProperty("zipcode")
24 | private String zipcode;
25 | @JsonProperty("state")
26 | private String state;
27 | @JsonProperty("country_code")
28 | private String countryCode;
29 | @JsonProperty("phone_number")
30 | private PhoneNumber phoneNumber;
31 | @JsonProperty("region")
32 | private String region;
33 | @JsonProperty("neighborhood")
34 | private String neighborhood;
35 | @JsonProperty("name")
36 | private String name;
37 | }
38 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ShippingMerchantPayment.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingMerchantPayment {
13 | @JsonProperty("amount")
14 | private Double amount;
15 | @JsonProperty("currency_code")
16 | private String currencyCode;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/ShippingReimbursements.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class ShippingReimbursements {
13 | @JsonProperty("status")
14 | private String status;
15 | @JsonProperty("amount")
16 | private Amount amount;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/TaxInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:47
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class TaxInformation {
15 | @JsonProperty("transaction_tax")
16 | private List transactionTax;
17 | @JsonProperty("customer_identity_number_type")
18 | private String customerIdentityNumberType;
19 | @JsonProperty("vat_information")
20 | private VatInformation vatInformation;
21 | @JsonProperty("customer_identity_number")
22 | private String customerIdentityNumber;
23 | }
24 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/TrackingInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class TrackingInformation {
13 | @JsonProperty("tracking_number")
14 | private String trackingNumber;
15 | @JsonProperty("origin_country")
16 | private String originCountry;
17 | @JsonProperty("ship_note")
18 | private String shipNote;
19 | @JsonProperty("shipping_provider")
20 | private ProductInformation shippingProvider;
21 | }
22 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/TransactionTax.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class TransactionTax {
13 | @JsonProperty("tax_amount_in_merchant_currency")
14 | private Amount taxAmountInMerchantCurrency;
15 | @JsonProperty("tax_amount_in_authority_currency")
16 | private Amount taxAmountInAuthorityCurrency;
17 | @JsonProperty("tax_type")
18 | private String taxType;
19 | @JsonProperty("remit_type")
20 | private String remitType;
21 | }
22 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Vat.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Vat {
13 | @JsonProperty("number")
14 | private String number;
15 | @JsonProperty("name")
16 | private String name;
17 | @JsonProperty("entity")
18 | private String entity;
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/VatAmount.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class VatAmount {
13 | @JsonProperty("shipping_level_vat")
14 | private Amount shippingLevelVat;
15 | @JsonProperty("final_vat")
16 | private Amount finalVat;
17 | @JsonProperty("product_level_vat")
18 | private Amount productLevelVat;
19 | }
20 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/VatInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/24 15:47
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class VatInformation {
15 | @JsonProperty("eu_vat_customs_declaration")
16 | private EuVatCustomsDeclaration euVatCustomsDeclaration;
17 | @JsonProperty("vat_amount")
18 | private VatAmount vatAmount;
19 | @JsonProperty("country_code")
20 | private String countryCode;
21 | @JsonProperty("required_vat_numbers")
22 | private RequiredVatNumbers requiredVatNumbers;
23 | @JsonProperty("vat_instructions")
24 | private String vatInstructions;
25 | @JsonProperty("additional_materials")
26 | private List additionalMaterials;
27 | }
28 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/VatPayer.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class VatPayer {
13 | @JsonProperty("ioss_number")
14 | private String iossNumber;
15 | @JsonProperty("tax_number")
16 | private String taxNumber;
17 | @JsonProperty("name")
18 | private String name;
19 | @JsonProperty("address")
20 | private ShippingDetail address;
21 | }
22 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Voec.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Voec {
13 | @JsonProperty("number")
14 | private String number;
15 | @JsonProperty("entity")
16 | private String entity;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/WarehouseInformation.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class WarehouseInformation {
13 | @JsonProperty("warehouse_type")
14 | private String warehouseType;
15 | @JsonProperty("warehouse_name")
16 | private String warehouseName;
17 | @JsonProperty("warehouse_id")
18 | private String warehouseId;
19 | @JsonProperty("fbw_information")
20 | private FbwInformation fbwInformation;
21 | }
22 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/Weight.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | /**
8 | * Created by EalenXie on 2022/3/24 15:47
9 | */
10 | @NoArgsConstructor
11 | @Data
12 | public class Weight {
13 | @JsonProperty("value")
14 | private Integer value;
15 | @JsonProperty("unit")
16 | private String unit;
17 | }
18 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/WishDownloadJob.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/3/18 16:43
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class WishDownloadJob {
15 | @JsonProperty("total_count")
16 | private Integer totalCount;
17 | @JsonProperty("processed_count")
18 | private Integer processedCount;
19 | @JsonProperty("status")
20 | private String status;
21 | @JsonProperty("expiry_time")
22 | private String expiryTime;
23 | @JsonProperty("created_at")
24 | private String createdAt;
25 | @JsonProperty("completed_at")
26 | private String completedAt;
27 | @JsonProperty("file_urls")
28 | private List fileUrls;
29 | @JsonProperty("id")
30 | private String id;
31 | }
32 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/WishOrder.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/2/23 13:38
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class WishOrder {
15 | @JsonProperty("tracking_information")
16 | private List trackingInformation;
17 | @JsonProperty("warehouse_information")
18 | private WarehouseInformation warehouseInformation;
19 | @JsonProperty("order_payment")
20 | private OrderPayment orderPayment;
21 | @JsonProperty("fulfillment_records")
22 | private List fulfillmentRecords;
23 | @JsonProperty("released_at")
24 | private String releasedAt;
25 | @JsonProperty("product_information")
26 | private ProductInformation productInformation;
27 | @JsonProperty("penalties")
28 | private List penalties;
29 | @JsonProperty("processing_status")
30 | private String processingStatus;
31 | @JsonProperty("updated_at")
32 | private String updatedAt;
33 | @JsonProperty("full_address")
34 | private FullAddress fullAddress;
35 | @JsonProperty("processing_source")
36 | private String processingSource;
37 | @JsonProperty("fulfillment_requirements")
38 | private FulfillmentRequirements fulfillmentRequirements;
39 | @JsonProperty("state")
40 | private String state;
41 | @JsonProperty("transaction_id")
42 | private String transactionId;
43 | @JsonProperty("tax_information")
44 | private TaxInformation taxInformation;
45 | @JsonProperty("refunds")
46 | private List refunds;
47 | @JsonProperty("id")
48 | private String id;
49 | @JsonProperty("fulfillment_order_types")
50 | private List fulfillmentOrderTypes;
51 | }
52 |
--------------------------------------------------------------------------------
/wish-sdk/src/main/java/io/github/vo/WishToken.java:
--------------------------------------------------------------------------------
1 | package io.github.vo;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import lombok.Data;
5 | import lombok.NoArgsConstructor;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by EalenXie on 2022/2/23 13:33
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class WishToken {
15 |
16 | @JsonProperty("access_token")
17 | private String accessToken;
18 | @JsonProperty("scopes")
19 | private List scopes;
20 | /**
21 | * 该令牌所链接的商家的ID
22 | */
23 | @JsonProperty("merchant_id")
24 | private String merchantId;
25 | @JsonProperty("expiry_time")
26 | private String expiryTime;
27 | @JsonProperty("refresh_token")
28 | private String refreshToken;
29 | }
30 |
--------------------------------------------------------------------------------