From ea03f94668c1dcbe0c5c9b40b17a98ae53c6e1b1 Mon Sep 17 00:00:00 2001 From: egan Date: Fri, 4 Dec 2020 14:56:43 +0800 Subject: [PATCH 1/5] update pay-java-wx/README.md. --- pay-java-wx/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pay-java-wx/README.md b/pay-java-wx/README.md index 488a177..da29557 100644 --- a/pay-java-wx/README.md +++ b/pay-java-wx/README.md @@ -112,6 +112,21 @@ ``` + +#### JSAPI支付 + +```java + + /*-----------JSAPI-------------------*/ + //公众号支付 + payOrder.setTransactionType(WxTransactionType.JSAPI); + //微信公众号对应微信付款用户的唯一标识 + payOrder.setOpenid(openid); + Map appOrderInfo = service.orderInfo(payOrder); + /*-----------/JSAPI-------------------*/ + +``` + #### 网页支付 ```java From 3805fcdc698c78ff37556f862cc1293116b05996 Mon Sep 17 00:00:00 2001 From: egzosn Date: Mon, 28 Dec 2020 10:23:30 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E9=80=80=E6=AC=BE=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8F=B7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../egzosn/pay/common/bean/RefundResult.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java index 50ca0c1..1304419 100644 --- a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java +++ b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java @@ -6,15 +6,16 @@ import java.util.Map; /** * 退款结果 - * + *

* 这里继承Map为兼容方案,后续版本进行删除 + * * @author Egan *

  * email egzosn@gmail.com
  * date 2020/8/16 9:55
  * 
*/ -public interface RefundResult extends Map, Serializable { +public interface RefundResult extends Serializable { /** * 获取退款结果原信息集 * @@ -29,6 +30,7 @@ public interface RefundResult extends Map, Serializable { * @return 属性值 */ Object getAttr(String key); + /** * 获取退款结果属性值 * @@ -36,6 +38,7 @@ public interface RefundResult extends Map, Serializable { * @return 属性值 */ String getAttrString(String key); + /** * 获取退款结果属性值 * @@ -47,42 +50,49 @@ public interface RefundResult extends Map, Serializable { /** * 获取退款请求结果状态码 + * * @return 状态码 */ String getCode(); /** * 获取退款请求结果状态提示信息 + * * @return 提示信息 */ String getMsg(); /** * 返回业务结果状态码 + * * @return 业务结果状态码 */ String getResultCode(); /** * 返回业务结果状态提示信息 + * * @return 业务结果状态提示信息 */ String getResultMsg(); /** * 退款金额 + * * @return 退款金额 */ BigDecimal getRefundFee(); + /** * 退款币种信息 + * * @return 币种信息 */ CurType getRefundCurrency(); /** - * 支付平台交易号 - * 发起支付时 支付平台(如支付宝)返回的交易订单号 + * 支付平台交易号 + * 发起支付时 支付平台(如支付宝)返回的交易订单号 * * @return 支付平台交易号 */ @@ -91,12 +101,14 @@ public interface RefundResult extends Map, Serializable { /** * 支付订单号 * 发起支付时,用户系统的订单号 + * * @return 支付订单号 */ String getOutTradeNo(); /** * 商户退款单号 + * * @return 商户退款单号 */ String getRefundNo(); From 6a72cc0906b9ec5ab484a2b74a386d375b53f987 Mon Sep 17 00:00:00 2001 From: egzosn Date: Mon, 28 Dec 2020 10:40:54 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=85=AC?= =?UTF-8?q?=E9=92=A5=E8=AF=81=E4=B9=A6=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/common/bean/BaseRefundResult.java | 259 ------------------ 1 file changed, 259 deletions(-) diff --git a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/BaseRefundResult.java b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/BaseRefundResult.java index b92763a..100a7b3 100644 --- a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/BaseRefundResult.java +++ b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/BaseRefundResult.java @@ -1,9 +1,7 @@ package com.egzosn.pay.common.bean; import java.math.BigDecimal; -import java.util.Collection; import java.util.Map; -import java.util.Set; /** * 基础的退款结果对象 @@ -77,261 +75,4 @@ public abstract class BaseRefundResult implements RefundResult { return new BigDecimal(getAttrString(key)); } - /** - * Returns the number of key-value mappings in this map. If the - * map contains more than Integer.MAX_VALUE elements, returns - * Integer.MAX_VALUE. - * - * @return the number of key-value mappings in this map - */ - @Override - public int size() { - return attrs.size(); - } - - /** - * Returns true if this map contains no key-value mappings. - * - * @return true if this map contains no key-value mappings - */ - @Override - public boolean isEmpty() { - return attrs.isEmpty(); - } - - /** - * Returns true if this map contains a mapping for the specified - * key. More formally, returns true if and only if - * this map contains a mapping for a key k such that - * (key==null ? k==null : key.equals(k)). (There can be - * at most one such mapping.) - * - * @param key key whose presence in this map is to be tested - * @return true if this map contains a mapping for the specified - * key - * @throws ClassCastException if the key is of an inappropriate type for - * this map - * (optional) - * @throws NullPointerException if the specified key is null and this map - * does not permit null keys - * (optional) - */ - @Override - public boolean containsKey(Object key) { - return attrs.containsKey(key); - } - - /** - * Returns true if this map maps one or more keys to the - * specified value. More formally, returns true if and only if - * this map contains at least one mapping to a value v such that - * (value==null ? v==null : value.equals(v)). This operation - * will probably require time linear in the map size for most - * implementations of the Map interface. - * - * @param value value whose presence in this map is to be tested - * @return true if this map maps one or more keys to the - * specified value - * @throws ClassCastException if the value is of an inappropriate type for - * this map - * (optional) - * @throws NullPointerException if the specified value is null and this - * map does not permit null values - * (optional) - */ - @Override - public boolean containsValue(Object value) { - return attrs.containsValue(value); - } - - /** - * Returns the value to which the specified key is mapped, - * or {@code null} if this map contains no mapping for the key. - * - *

More formally, if this map contains a mapping from a key - * {@code k} to a value {@code v} such that {@code (key==null ? k==null : - * key.equals(k))}, then this method returns {@code v}; otherwise - * it returns {@code null}. (There can be at most one such mapping.) - * - *

If this map permits null values, then a return value of - * {@code null} does not necessarily indicate that the map - * contains no mapping for the key; it's also possible that the map - * explicitly maps the key to {@code null}. The {@link #containsKey - * containsKey} operation may be used to distinguish these two cases. - * - * @param key the key whose associated value is to be returned - * @return the value to which the specified key is mapped, or - * {@code null} if this map contains no mapping for the key - * @throws ClassCastException if the key is of an inappropriate type for - * this map - * (optional) - * @throws NullPointerException if the specified key is null and this map - * does not permit null keys - * (optional) - */ - @Override - public Object get(Object key) { - return attrs.get(key); - } - - /** - * Associates the specified value with the specified key in this map - * (optional operation). If the map previously contained a mapping for - * the key, the old value is replaced by the specified value. (A map - * m is said to contain a mapping for a key k if and only - * if {@link #containsKey(Object) m.containsKey(k)} would return - * true.) - * - * @param key key with which the specified value is to be associated - * @param value value to be associated with the specified key - * @return the previous value associated with key, or - * null if there was no mapping for key. - * (A null return can also indicate that the map - * previously associated null with key, - * if the implementation supports null values.) - * @throws UnsupportedOperationException if the put operation - * is not supported by this map - * @throws ClassCastException if the class of the specified key or value - * prevents it from being stored in this map - * @throws NullPointerException if the specified key or value is null - * and this map does not permit null keys or values - * @throws IllegalArgumentException if some property of the specified key - * or value prevents it from being stored in this map - */ - @Override - public Object put(String key, Object value) { - return attrs.put(key, value); - } - - /** - * Removes the mapping for a key from this map if it is present - * (optional operation). More formally, if this map contains a mapping - * from key k to value v such that - * (key==null ? k==null : key.equals(k)), that mapping - * is removed. (The map can contain at most one such mapping.) - * - *

Returns the value to which this map previously associated the key, - * or null if the map contained no mapping for the key. - * - *

If this map permits null values, then a return value of - * null does not necessarily indicate that the map - * contained no mapping for the key; it's also possible that the map - * explicitly mapped the key to null. - * - *

The map will not contain a mapping for the specified key once the - * call returns. - * - * @param key key whose mapping is to be removed from the map - * @return the previous value associated with key, or - * null if there was no mapping for key. - * @throws UnsupportedOperationException if the remove operation - * is not supported by this map - * @throws ClassCastException if the key is of an inappropriate type for - * this map - * (optional) - * @throws NullPointerException if the specified key is null and this - * map does not permit null keys - * (optional) - */ - @Override - public Object remove(Object key) { - return attrs.remove(key); - } - - /** - * Copies all of the mappings from the specified map to this map - * (optional operation). The effect of this call is equivalent to that - * of calling {@link #put(Object, Object) put(k, v)} on this map once - * for each mapping from key k to value v in the - * specified map. The behavior of this operation is undefined if the - * specified map is modified while the operation is in progress. - * - * @param m mappings to be stored in this map - * @throws UnsupportedOperationException if the putAll operation - * is not supported by this map - * @throws ClassCastException if the class of a key or value in the - * specified map prevents it from being stored in this map - * @throws NullPointerException if the specified map is null, or if - * this map does not permit null keys or values, and the - * specified map contains null keys or values - * @throws IllegalArgumentException if some property of a key or value in - * the specified map prevents it from being stored in this map - */ - @Override - public void putAll(Map m) { - attrs.putAll(m); - } - - /** - * Removes all of the mappings from this map (optional operation). - * The map will be empty after this call returns. - * - * @throws UnsupportedOperationException if the clear operation - * is not supported by this map - */ - @Override - public void clear() { - attrs.clear(); - } - - /** - * Returns a {@link Set} view of the keys contained in this map. - * The set is backed by the map, so changes to the map are - * reflected in the set, and vice-versa. If the map is modified - * while an iteration over the set is in progress (except through - * the iterator's own remove operation), the results of - * the iteration are undefined. The set supports element removal, - * which removes the corresponding mapping from the map, via the - * Iterator.remove, Set.remove, - * removeAll, retainAll, and clear - * operations. It does not support the add or addAll - * operations. - * - * @return a set view of the keys contained in this map - */ - @Override - public Set keySet() { - return attrs.keySet(); - } - - /** - * Returns a {@link Collection} view of the values contained in this map. - * The collection is backed by the map, so changes to the map are - * reflected in the collection, and vice-versa. If the map is - * modified while an iteration over the collection is in progress - * (except through the iterator's own remove operation), - * the results of the iteration are undefined. The collection - * supports element removal, which removes the corresponding - * mapping from the map, via the Iterator.remove, - * Collection.remove, removeAll, - * retainAll and clear operations. It does not - * support the add or addAll operations. - * - * @return a collection view of the values contained in this map - */ - @Override - public Collection values() { - return attrs.values(); - } - - /** - * Returns a {@link Set} view of the mappings contained in this map. - * The set is backed by the map, so changes to the map are - * reflected in the set, and vice-versa. If the map is modified - * while an iteration over the set is in progress (except through - * the iterator's own remove operation, or through the - * setValue operation on a map entry returned by the - * iterator) the results of the iteration are undefined. The set - * supports element removal, which removes the corresponding - * mapping from the map, via the Iterator.remove, - * Set.remove, removeAll, retainAll and - * clear operations. It does not support the - * add or addAll operations. - * - * @return a set view of the mappings contained in this map - */ - @Override - public Set> entrySet() { - return attrs.entrySet(); - } } From 0636608876ca593943e0d0f6794e275292c3d57a Mon Sep 17 00:00:00 2001 From: egzosn Date: Mon, 28 Dec 2020 10:43:30 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=85=AC?= =?UTF-8?q?=E9=92=A5=E8=AF=81=E4=B9=A6=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pay-java-ali/pom.xml | 2 +- pay-java-baidu/pom.xml | 2 +- pay-java-common/pom.xml | 2 +- pay-java-demo/pom.xml | 2 +- pay-java-fuiou/pom.xml | 2 +- pay-java-payoneer/pom.xml | 2 +- pay-java-paypal/pom.xml | 2 +- pay-java-union/pom.xml | 2 +- .../egzosn/pay/union/api/UnionPayService.java | 2 +- pay-java-union/src/test/java/PayTest.java | 32 +++++++++---------- pay-java-wx-youdian/pom.xml | 2 +- pay-java-wx/pom.xml | 2 +- pay-java-yiji/pom.xml | 2 +- pom.xml | 6 ++-- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/pay-java-ali/pom.xml b/pay-java-ali/pom.xml index f31a779..f014c96 100644 --- a/pay-java-ali/pom.xml +++ b/pay-java-ali/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-ali diff --git a/pay-java-baidu/pom.xml b/pay-java-baidu/pom.xml index 228a3d0..d336160 100644 --- a/pay-java-baidu/pom.xml +++ b/pay-java-baidu/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-baidu diff --git a/pay-java-common/pom.xml b/pay-java-common/pom.xml index e0ad8d1..2ca60b8 100644 --- a/pay-java-common/pom.xml +++ b/pay-java-common/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 jar diff --git a/pay-java-demo/pom.xml b/pay-java-demo/pom.xml index 7c0de2a..6858975 100644 --- a/pay-java-demo/pom.xml +++ b/pay-java-demo/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 war diff --git a/pay-java-fuiou/pom.xml b/pay-java-fuiou/pom.xml index 6a834c7..52f09fc 100644 --- a/pay-java-fuiou/pom.xml +++ b/pay-java-fuiou/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-fuiou diff --git a/pay-java-payoneer/pom.xml b/pay-java-payoneer/pom.xml index 9df1ded..d7e29fa 100644 --- a/pay-java-payoneer/pom.xml +++ b/pay-java-payoneer/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-payoneer diff --git a/pay-java-paypal/pom.xml b/pay-java-paypal/pom.xml index 0abbb06..3886fb3 100644 --- a/pay-java-paypal/pom.xml +++ b/pay-java-paypal/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 diff --git a/pay-java-union/pom.xml b/pay-java-union/pom.xml index 6c539c1..a98787c 100644 --- a/pay-java-union/pom.xml +++ b/pay-java-union/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 diff --git a/pay-java-union/src/main/java/com/egzosn/pay/union/api/UnionPayService.java b/pay-java-union/src/main/java/com/egzosn/pay/union/api/UnionPayService.java index d1ef681..6e576fb 100644 --- a/pay-java-union/src/main/java/com/egzosn/pay/union/api/UnionPayService.java +++ b/pay-java-union/src/main/java/com/egzosn/pay/union/api/UnionPayService.java @@ -580,7 +580,7 @@ public class UnionPayService extends BasePayService { * @param type UnionTransactionType.REFUND 或者UnionTransactionType.CONSUME_UNDO * @return 返回支付方申请退款后的结果 */ - public Map unionRefundOrConsumeUndo(String origQryId, String orderId, BigDecimal refundAmount, UnionTransactionType type) { + public UnionRefundResult unionRefundOrConsumeUndo(String origQryId, String orderId, BigDecimal refundAmount, UnionTransactionType type) { return unionRefundOrConsumeUndo(new RefundOrder(orderId, origQryId, refundAmount), type); } diff --git a/pay-java-union/src/test/java/PayTest.java b/pay-java-union/src/test/java/PayTest.java index 93ef3d5..659ea4c 100644 --- a/pay-java-union/src/test/java/PayTest.java +++ b/pay-java-union/src/test/java/PayTest.java @@ -1,18 +1,18 @@ -import com.egzosn.pay.common.bean.MethodType; -import com.egzosn.pay.common.bean.PayOrder; -import com.egzosn.pay.common.bean.RefundOrder; -import com.egzosn.pay.union.api.UnionPayConfigStorage; -import com.egzosn.pay.union.api.UnionPayService; -import com.egzosn.pay.union.bean.UnionTransactionType; - import java.awt.image.BufferedImage; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Map; +import com.egzosn.pay.common.bean.MethodType; +import com.egzosn.pay.common.bean.PayOrder; +import com.egzosn.pay.common.bean.RefundOrder; +import com.egzosn.pay.union.api.UnionPayConfigStorage; +import com.egzosn.pay.union.api.UnionPayService; +import com.egzosn.pay.union.bean.UnionRefundResult; +import com.egzosn.pay.union.bean.UnionTransactionType; + /** - * * Descrption:银联支付测试 * Author:Actinia * Date:2017/12/19 21:12 @@ -52,7 +52,7 @@ public class PayTest { //支付服务 UnionPayService service = new UnionPayService(unionPayConfigStorage); //支付订单基础信息 - PayOrder payOrder = new PayOrder("订单title", "摘要", BigDecimal.valueOf(0.01) , new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis())); + PayOrder payOrder = new PayOrder("订单title", "摘要", BigDecimal.valueOf(0.01), new SimpleDateFormat("yyyyMMddHHmmss").format(System.currentTimeMillis())); /*----------- 网页支付-------------------*/ @@ -79,34 +79,34 @@ public class PayTest { /*-----------消费(被扫场景)待定------------------------------*/ payOrder.setTransactionType(UnionTransactionType.CONSUME); payOrder.setAuthCode("C2B码(条码号),1-20位数字"); - params = service.microPay(payOrder); + params = service.microPay(payOrder); /*-----------消费(被扫场景)------------------------------*/ // /*-----------消费撤销------------------------------*/ - params = service.unionRefundOrConsumeUndo(new RefundOrder( "订单号", "原交易查询流水号", new BigDecimal("退款金额" )),UnionTransactionType.CONSUME_UNDO); + UnionRefundResult refundResult = service.unionRefundOrConsumeUndo(new RefundOrder("订单号", "原交易查询流水号", new BigDecimal("退款金额")), UnionTransactionType.CONSUME_UNDO); // /*-----------消费撤销------------------------------*/ /*-----------交易状态查询交易:只有同步应答------------------------------*/ payOrder.setTransactionType(UnionTransactionType.QUERY); - params = service.query(null,"商户单号"); + params = service.query(null, "商户单号"); /*-----------交易状态查询交易:只有同步应答------------------------------*/ /*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/ payOrder.setTransactionType(UnionTransactionType.REFUND); - params = service.refund(new RefundOrder("原交易查询流水号", "订单号", null, new BigDecimal("退款金额" ))); + refundResult = service.refund(new RefundOrder("原交易查询流水号", "订单号", null, new BigDecimal("退款金额"))); /*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/ /*-----------文件传输类接口:后台获取对账文件交易,只有同步应答 ------------------------------*/ - Map fileConten = service.downloadbill(new Date(),"文件类型,一般商户填写00即可"); /*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/ + Map fileConten = service.downloadbill(new Date(), "文件类型,一般商户填写00即可"); /*-----------退货交易:后台资金类交易,有同步应答和后台通知应答------------------------------*/ - /*-----------回调处理-------------------*/ + /*-----------回调处理-------------------*/ // HttpServletRequest request // params = service.getParameter2Map(request.getParameterMap(), request.getInputStream()); - if (service.verify(params)){ + if (service.verify(params)) { System.out.println("支付成功"); return; } diff --git a/pay-java-wx-youdian/pom.xml b/pay-java-wx-youdian/pom.xml index 2081227..c0db493 100644 --- a/pay-java-wx-youdian/pom.xml +++ b/pay-java-wx-youdian/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-wx-youdian diff --git a/pay-java-wx/pom.xml b/pay-java-wx/pom.xml index dfe0e5d..b9d7a20 100644 --- a/pay-java-wx/pom.xml +++ b/pay-java-wx/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 pay-java-wx diff --git a/pay-java-yiji/pom.xml b/pay-java-yiji/pom.xml index 0a3ac4e..a03c038 100644 --- a/pay-java-yiji/pom.xml +++ b/pay-java-yiji/pom.xml @@ -5,7 +5,7 @@ pay-java-parent com.egzosn - 2.13.4-SNAPSHOT + 2.13.3-b1 4.0.0 diff --git a/pom.xml b/pom.xml index fc3322b..cfa1e34 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.egzosn pay-java-parent pom - 2.13.4-SNAPSHOT + 2.13.3-b1 Pay Java - Parent Pay Java Parent @@ -58,13 +58,13 @@ pay-java-paypal pay-java-yiji pay-java-baidu - pay-java-demo + - 2.13.4-SNAPSHOT + 2.13.3-b1 4.5.4 1.2.17 1.2.73 From 8b3e1f67917cb3e02beac7ba5cf39efbe8007040 Mon Sep 17 00:00:00 2001 From: egzosn Date: Mon, 28 Dec 2020 18:45:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E5=85=AC?= =?UTF-8?q?=E9=92=A5=E8=AF=81=E4=B9=A6=E6=A1=88=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- .../egzosn/pay/common/bean/RefundResult.java | 1 - .../pay/paypal/api/PayPalConfigStorage.java | 1 + .../egzosn/pay/paypal/bean/order/Amount.java | 3 + .../pay/paypal/bean/order/CartBase.java | 45 +-- .../egzosn/pay/paypal/bean/order/Error.java | 261 +++++++----------- .../pay/paypal/bean/order/ErrorDetails.java | 26 +- .../pay/paypal/bean/order/FmfDetails.java | 40 +-- .../egzosn/pay/paypal/bean/order/Order.java | 131 ++------- .../egzosn/pay/paypal/bean/order/Payee.java | 72 +---- .../egzosn/pay/paypal/bean/order/Phone.java | 40 +-- .../pay/paypal/bean/order/RedirectUrls.java | 26 +- .../egzosn/pay/paypal/bean/order/Refund.java | 121 ++------ pom.xml | 2 +- 14 files changed, 215 insertions(+), 556 deletions(-) diff --git a/README.md b/README.md index d904512..8675b94 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ com.egzosn {module-name} - 2.13.3 + 2.13.3-b1 ``` diff --git a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java index 1304419..db31a45 100644 --- a/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java +++ b/pay-java-common/src/main/java/com/egzosn/pay/common/bean/RefundResult.java @@ -7,7 +7,6 @@ import java.util.Map; /** * 退款结果 *

- * 这里继承Map为兼容方案,后续版本进行删除 * * @author Egan *

diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/api/PayPalConfigStorage.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/api/PayPalConfigStorage.java
index ccffe2e..3b29d41 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/api/PayPalConfigStorage.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/api/PayPalConfigStorage.java
@@ -59,6 +59,7 @@ public class PayPalConfigStorage extends BasePayConfigStorage {
 
     /**
      * 获取取消页面的url
+     * @return 取消页面的url
      */
     public String getCancelUrl() {
         return getNotifyUrl();
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Amount.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Amount.java
index 34d645b..9d1ebb3 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Amount.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Amount.java
@@ -22,6 +22,9 @@ public class Amount {
 
 	/**
 	 * Parameterized Constructor
+	 *
+	 * @param currency 类型
+	 * @param total 金额
 	 */
 	public Amount(String currency, String total) {
 		this.currency = currency;
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/CartBase.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/CartBase.java
index 077aceb..060b114 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/CartBase.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/CartBase.java
@@ -56,6 +56,7 @@ public class CartBase {
 
 	/**
 	 * Parameterized Constructor
+	 * @param amount 金额
 	 */
 	public CartBase(Amount amount) {
 		this.amount = amount;
@@ -63,72 +64,72 @@ public class CartBase {
 
 	/**
 	 * Merchant identifier to the purchase unit. Optional parameter
+	 * @return  identifier
 	 */
-	@SuppressWarnings("all")
 	public String getReferenceId() {
 		return this.referenceId;
 	}
 
 	/**
 	 * Amount being collected.
+	 * @return amount 金额
 	 */
-	@SuppressWarnings("all")
 	public Amount getAmount() {
 		return this.amount;
 	}
 
 	/**
 	 * Recipient of the funds in this transaction.
+	 * @return Recipient
 	 */
-	@SuppressWarnings("all")
 	public Payee getPayee() {
 		return this.payee;
 	}
 
 	/**
 	 * Description of what is being paid for.
+	 * @return Description
 	 */
-	@SuppressWarnings("all")
 	public String getDescription() {
 		return this.description;
 	}
 
 	/**
 	 * Note to the recipient of the funds in this transaction.
+	 * @return Note
 	 */
-	@SuppressWarnings("all")
 	public String getNoteToPayee() {
 		return this.noteToPayee;
 	}
 
 	/**
 	 * free-form field for the use of clients
+	 * @return custom
 	 */
-	@SuppressWarnings("all")
 	public String getCustom() {
 		return this.custom;
 	}
 
 	/**
 	 * invoice number to track this payment
+	 * @return invoice number
 	 */
-	@SuppressWarnings("all")
 	public String getInvoiceNumber() {
 		return this.invoiceNumber;
 	}
 
 	/**
 	 * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
+	 * @return SoftDescriptor
 	 */
-	@SuppressWarnings("all")
 	public String getSoftDescriptor() {
 		return this.softDescriptor;
 	}
 
 	/**
 	 * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card`
+	 * @return Soft descriptor
 	 */
-	@SuppressWarnings("all")
 	public String getSoftDescriptorCity() {
 		return this.softDescriptorCity;
 	}
@@ -136,25 +137,25 @@ public class CartBase {
 
 	/**
 	 * URL to send payment notifications
+	 * @return URL
 	 */
-	@SuppressWarnings("all")
 	public String getNotifyUrl() {
 		return this.notifyUrl;
 	}
 
 	/**
 	 * Url on merchant site pertaining to this payment.
+	 * @return URL
 	 */
-	@SuppressWarnings("all")
 	public String getOrderUrl() {
 		return this.orderUrl;
 	}
 
 	/**
 	 * Merchant identifier to the purchase unit. Optional parameter
+	 * @param referenceId identifier
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setReferenceId(final String referenceId) {
 		this.referenceId = referenceId;
 		return this;
@@ -162,9 +163,9 @@ public class CartBase {
 
 	/**
 	 * Amount being collected.
+	 * @param amount 金额
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setAmount(final Amount amount) {
 		this.amount = amount;
 		return this;
@@ -172,9 +173,9 @@ public class CartBase {
 
 	/**
 	 * Recipient of the funds in this transaction.
+	 * @param payee Recipient
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setPayee(final Payee payee) {
 		this.payee = payee;
 		return this;
@@ -182,9 +183,9 @@ public class CartBase {
 
 	/**
 	 * Description of what is being paid for.
+	 * @param description description
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setDescription(final String description) {
 		this.description = description;
 		return this;
@@ -192,9 +193,9 @@ public class CartBase {
 
 	/**
 	 * Note to the recipient of the funds in this transaction.
+	 * @param noteToPayee noteToPayee
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setNoteToPayee(final String noteToPayee) {
 		this.noteToPayee = noteToPayee;
 		return this;
@@ -202,9 +203,9 @@ public class CartBase {
 
 	/**
 	 * free-form field for the use of clients
+	 * @param custom custom
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setCustom(final String custom) {
 		this.custom = custom;
 		return this;
@@ -212,9 +213,9 @@ public class CartBase {
 
 	/**
 	 * invoice number to track this payment
+	 * @param invoiceNumber invoiceNumber
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setInvoiceNumber(final String invoiceNumber) {
 		this.invoiceNumber = invoiceNumber;
 		return this;
@@ -222,9 +223,9 @@ public class CartBase {
 
 	/**
 	 * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated
+	 * @param softDescriptor softDescriptor
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setSoftDescriptor(final String softDescriptor) {
 		this.softDescriptor = softDescriptor;
 		return this;
@@ -232,9 +233,9 @@ public class CartBase {
 
 	/**
 	 * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card`
+	 * @param softDescriptorCity softDescriptorCity
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setSoftDescriptorCity(final String softDescriptorCity) {
 		this.softDescriptorCity = softDescriptorCity;
 		return this;
@@ -244,9 +245,9 @@ public class CartBase {
 
 	/**
 	 * URL to send payment notifications
+	 * @param notifyUrl notifyUrl
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setNotifyUrl(final String notifyUrl) {
 		this.notifyUrl = notifyUrl;
 		return this;
@@ -254,9 +255,9 @@ public class CartBase {
 
 	/**
 	 * Url on merchant site pertaining to this payment.
+	 * @param orderUrl orderUrl
 	 * @return this
 	 */
-	@SuppressWarnings("all")
 	public CartBase setOrderUrl(final String orderUrl) {
 		this.orderUrl = orderUrl;
 		return this;
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Error.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Error.java
index 3d9069f..8543046 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Error.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Error.java
@@ -4,170 +4,121 @@ package com.egzosn.pay.paypal.bean.order;
 
 import java.util.List;
 
-public class Error  {
-	/**
-	 * Human readable, unique name of the error.
-	 */
-	private String name;
-	/**
-	 * Message describing the error.
-	 */
-	private String message;
-	/**
-	 * Additional details of the error
-	 */
-	private List details;
-	/**
-	 * URI for detailed information related to this error for the developer.
-	 */
-	private String informationLink;
-	/**
-	 * PayPal internal identifier used for correlation purposes.
-	 */
-	private String debugId;
+public class Error {
+    /**
+     * Human readable, unique name of the error.
+     */
+    private String name;
+    /**
+     * Message describing the error.
+     */
+    private String message;
+    /**
+     * Additional details of the error
+     */
+    private List details;
+    /**
+     * URI for detailed information related to this error for the developer.
+     */
+    private String informationLink;
+    /**
+     * PayPal internal identifier used for correlation purposes.
+     */
+    private String debugId;
 
-	/**
-	 * @deprecated This property is not available publicly
-	 * PayPal internal error code.
-	 */
-	@Deprecated
-	private String code;
+    /**
+     * @deprecated This property is not available publicly
+     * PayPal internal error code.
+     */
+    @Deprecated
+    private String code;
 
 
-	/**
-	 * Default Constructor
-	 */
-	public Error() {
-	}
+    /**
+     * Default Constructor
+     */
+    public Error() {
+    }
 
-	/**
-	 * Parameterized Constructor
-	 */
-	public Error(String name, String message, String informationLink, String debugId) {
-		this.name = name;
-		this.message = message;
-		this.informationLink = informationLink;
-		this.debugId = debugId;
-	}
+    /**
+     * Parameterized Constructor
+     */
+    public Error(String name, String message, String informationLink, String debugId) {
+        this.name = name;
+        this.message = message;
+        this.informationLink = informationLink;
+        this.debugId = debugId;
+    }
 
-	public String toString() {
-		return "name: " + this.name + "\tmessage: " + this.message + "\tdetails: " + this.details + "\tdebug-id: " + this.debugId + "\tinformation-link: " + this.informationLink;
-	}
-
-	/**
-	 * Human readable, unique name of the error.
-	 */
-	@SuppressWarnings("all")
-	public String getName() {
-		return this.name;
-	}
-
-	/**
-	 * Message describing the error.
-	 */
-	@SuppressWarnings("all")
-	public String getMessage() {
-		return this.message;
-	}
-
-	/**
-	 * Additional details of the error
-	 */
-	@SuppressWarnings("all")
-	public List getDetails() {
-		return this.details;
-	}
-
-	/**
-	 * URI for detailed information related to this error for the developer.
-	 */
-	@SuppressWarnings("all")
-	public String getInformationLink() {
-		return this.informationLink;
-	}
-
-	/**
-	 * PayPal internal identifier used for correlation purposes.
-	 */
-	@SuppressWarnings("all")
-	public String getDebugId() {
-		return this.debugId;
-	}
-
-	/**
-	 * @deprecated This property is not available publicly
-	 * PayPal internal error code.
-	 */
-	@Deprecated
-	@SuppressWarnings("all")
-	public String getCode() {
-		return this.code;
-	}
+    public String toString() {
+        return "name: " + this.name + "\tmessage: " + this.message + "\tdetails: " + this.details + "\tdebug-id: " + this.debugId + "\tinformation-link: " + this.informationLink;
+    }
 
 
-
-	/**
-	 * Human readable, unique name of the error.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
-	public Error setName(final String name) {
-		this.name = name;
-		return this;
-	}
-
-	/**
-	 * Message describing the error.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
-	public Error setMessage(final String message) {
-		this.message = message;
-		return this;
-	}
-
-	/**
-	 * Additional details of the error
-	 * @return this
-	 */
-	@SuppressWarnings("all")
-	public Error setDetails(final List details) {
-		this.details = details;
-		return this;
-	}
-
-	/**
-	 * URI for detailed information related to this error for the developer.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
-	public Error setInformationLink(final String informationLink) {
-		this.informationLink = informationLink;
-		return this;
-	}
-
-	/**
-	 * PayPal internal identifier used for correlation purposes.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
-	public Error setDebugId(final String debugId) {
-		this.debugId = debugId;
-		return this;
-	}
+    public String getName() {
+        return this.name;
+    }
 
 
-	/**
-	 * @deprecated This property is not available publicly
-	 * PayPal internal error code.
-	 * @return this
-	 */
-	@Deprecated
-	@SuppressWarnings("all")
-	public Error setCode(final String code) {
-		this.code = code;
-		return this;
-	}
+    public String getMessage() {
+        return this.message;
+    }
+
+
+    public List getDetails() {
+        return this.details;
+    }
+
+
+    public String getInformationLink() {
+        return this.informationLink;
+    }
+
+
+    public String getDebugId() {
+        return this.debugId;
+    }
+
+
+    public String getCode() {
+        return this.code;
+    }
+
+
+    public Error setName(final String name) {
+        this.name = name;
+        return this;
+    }
+
+
+    public Error setMessage(final String message) {
+        this.message = message;
+        return this;
+    }
+
+
+    public Error setDetails(final List details) {
+        this.details = details;
+        return this;
+    }
+
+
+    public Error setInformationLink(final String informationLink) {
+        this.informationLink = informationLink;
+        return this;
+    }
+
+
+    public Error setDebugId(final String debugId) {
+        this.debugId = debugId;
+        return this;
+    }
+
+
+    public Error setCode(final String code) {
+        this.code = code;
+        return this;
+    }
 
 
 }
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/ErrorDetails.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/ErrorDetails.java
index d054eb1..31c6486 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/ErrorDetails.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/ErrorDetails.java
@@ -19,46 +19,30 @@ public class ErrorDetails {
 	public ErrorDetails() {
 	}
 
-	/**
-	 * Parameterized Constructor
-	 */
+
 	public ErrorDetails(String field, String issue) {
 		this.field = field;
 		this.issue = issue;
 	}
 
-	/**
-	 * Name of the field that caused the error.
-	 */
-	@SuppressWarnings("all")
+
 	public String getField() {
 		return this.field;
 	}
 
-	/**
-	 * Reason for the error.
-	 */
-	@SuppressWarnings("all")
+
 	public String getIssue() {
 		return this.issue;
 	}
 
 
-	/**
-	 * Name of the field that caused the error.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
+
 	public ErrorDetails setField(final String field) {
 		this.field = field;
 		return this;
 	}
 
-	/**
-	 * Reason for the error.
-	 * @return this
-	 */
-	@SuppressWarnings("all")
+
 	public ErrorDetails setIssue(final String issue) {
 		this.issue = issue;
 		return this;
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/FmfDetails.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/FmfDetails.java
index 2ef402f..0341cc4 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/FmfDetails.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/FmfDetails.java
@@ -19,71 +19,46 @@ public class FmfDetails{
 	 */
 	private String description;
 
-	/**
-	 * Type of filter.
-	 */
+
 	public String getFilterType() {
 		return this.filterType;
 	}
 
-	/**
-	 * Filter Identifier.
-	 */
-	
+
 	public String getFilterId() {
 		return this.filterId;
 	}
 
-	/**
-	 * Name of the filter
-	 */
-	
 	public String getName() {
 		return this.name;
 	}
 
-	/**
-	 * Description of the filter.
-	 */
+
 	
 	public String getDescription() {
 		return this.description;
 	}
 
-	/**
-	 * Type of filter.
-	 * @return this
-	 */
-	
+
 	public FmfDetails setFilterType(final String filterType) {
 		this.filterType = filterType;
 		return this;
 	}
 
-	/**
-	 * Filter Identifier.
-	 * @return this
-	 */
-	
+
 	public FmfDetails setFilterId(final String filterId) {
 		this.filterId = filterId;
 		return this;
 	}
 
-	/**
-	 * Name of the filter
-	 * @return this
-	 */
+
 	
 	public FmfDetails setName(final String name) {
 		this.name = name;
 		return this;
 	}
 
-	/**
-	 * Description of the filter.
-	 * @return this
-	 */
+
 	
 	public FmfDetails setDescription(final String description) {
 		this.description = description;
@@ -119,7 +94,6 @@ public class FmfDetails{
 	}
 
 	@Override
-	
 	public int hashCode() {
 		final int PRIME = 59;
 		int result = 1;
diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Order.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Order.java
index a9ecd54..afb681a 100644
--- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Order.java
+++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Order.java
@@ -65,25 +65,16 @@ public class Order {
 	public Order() {
 	}
 
-	/**
-	 * Parameterized Constructor
-	 */
+
 	public Order(Amount amount) {
 		this.amount = amount;
 	}
 
 
-	/**
-	 * Identifier of the order transaction.
-	 */
-	
 	public String getId() {
 		return this.id;
 	}
 
-	/**
-	 * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base.
-	 */
 	
 	public String getPurchaseUnitReferenceId() {
 		return this.purchaseUnitReferenceId;
@@ -91,109 +82,73 @@ public class Order {
 
 
 
-	/**
-	 * Amount being collected.
-	 */
-	
+
 	public Amount getAmount() {
 		return this.amount;
 	}
 
-	/**
-	 * specifies payment mode of the transaction
-	 */
+
 	
 	public String getPaymentMode() {
 		return this.paymentMode;
 	}
 
-	/**
-	 * State of the order transaction.
-	 */
-	
+
 	public String getState() {
 		return this.state;
 	}
 
-	/**
-	 * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`.
-	 */
-	
+
 	public String getReasonCode() {
 		return this.reasonCode;
 	}
 
 
 
-	/**
-	 * The level of seller protection in force for the transaction.
-	 */
-	
+
 	public String getProtectionEligibility() {
 		return this.protectionEligibility;
 	}
 
-	/**
-	 * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - */ + public String getProtectionEligibilityType() { return this.protectionEligibilityType; } - /** - * ID of the Payment resource that this transaction is based on. - */ - + public String getParentPayment() { return this.parentPayment; } - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. - */ - + public FmfDetails getFmfDetails() { return this.fmfDetails; } - /** - * Time the resource was created in UTC ISO8601 format. - */ - + public String getCreateTime() { return this.createTime; } - /** - * Time the resource was last updated in UTC ISO8601 format. - */ public String getUpdateTime() { return this.updateTime; } - /** - */ - + public List getLinks() { return this.links; } - /** - * Identifier of the order transaction. - * @return this - */ + public Order setId(final String id) { this.id = id; return this; } - /** - * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. - * @return this - */ + public Order setPurchaseUnitReferenceId(final String purchaseUnitReferenceId) { this.purchaseUnitReferenceId = purchaseUnitReferenceId; @@ -202,112 +157,70 @@ public class Order { - /** - * Amount being collected. - * @return this - */ - public Order setAmount(final Amount amount) { this.amount = amount; return this; } - /** - * specifies payment mode of the transaction - * @return this - */ - + public Order setPaymentMode(final String paymentMode) { this.paymentMode = paymentMode; return this; } - /** - * State of the order transaction. - * @return this - */ - + public Order setState(final String state) { this.state = state; return this; } - /** - * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`. - * @return this - */ - + public Order setReasonCode(final String reasonCode) { this.reasonCode = reasonCode; return this; } - /** - * The level of seller protection in force for the transaction. - * @return this - */ - + public Order setProtectionEligibility(final String protectionEligibility) { this.protectionEligibility = protectionEligibility; return this; } - /** - * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - * @return this - */ + public Order setProtectionEligibilityType(final String protectionEligibilityType) { this.protectionEligibilityType = protectionEligibilityType; return this; } - /** - * ID of the Payment resource that this transaction is based on. - * @return this - */ - + public Order setParentPayment(final String parentPayment) { this.parentPayment = parentPayment; return this; } - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. - * @return this - */ + public Order setFmfDetails(final FmfDetails fmfDetails) { this.fmfDetails = fmfDetails; return this; } - /** - * Time the resource was created in UTC ISO8601 format. - * @return this - */ + public Order setCreateTime(final String createTime) { this.createTime = createTime; return this; } - /** - * Time the resource was last updated in UTC ISO8601 format. - * @return this - */ public Order setUpdateTime(final String updateTime) { this.updateTime = updateTime; return this; } - /** - * - * @return this - */ - + public Order setLinks(final List links) { this.links = links; return this; diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Payee.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Payee.java index 9c09ebd..10e3b8f 100644 --- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Payee.java +++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Payee.java @@ -40,116 +40,73 @@ public class Payee { public Payee() { } - /** - * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. - */ - @SuppressWarnings("all") + public String getEmail() { return this.email; } - /** - * Encrypted PayPal account identifier for the Payee. - */ - @SuppressWarnings("all") + public String getMerchantId() { return this.merchantId; } - /** - * First Name of the Payee. - */ - @SuppressWarnings("all") + public String getFirstName() { return this.firstName; } - /** - * Last Name of the Payee. - */ - @SuppressWarnings("all") + public String getLastName() { return this.lastName; } - /** - * Unencrypted PayPal account Number of the Payee - */ - @SuppressWarnings("all") + public String getAccountNumber() { return this.accountNumber; } - /** - * Information related to the Payee. - */ - @SuppressWarnings("all") + public Phone getPhone() { return this.phone; } - /** - * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. - * @return this - */ - @SuppressWarnings("all") + public Payee setEmail(final String email) { this.email = email; return this; } - /** - * Encrypted PayPal account identifier for the Payee. - * @return this - */ - @SuppressWarnings("all") + public Payee setMerchantId(final String merchantId) { this.merchantId = merchantId; return this; } - /** - * First Name of the Payee. - * @return this - */ - @SuppressWarnings("all") + public Payee setFirstName(final String firstName) { this.firstName = firstName; return this; } - /** - * Last Name of the Payee. - * @return this - */ - @SuppressWarnings("all") + public Payee setLastName(final String lastName) { this.lastName = lastName; return this; } - /** - * Unencrypted PayPal account Number of the Payee - * @return this - */ - @SuppressWarnings("all") + public Payee setAccountNumber(final String accountNumber) { this.accountNumber = accountNumber; return this; } - /** - * Information related to the Payee. - * @return this - */ - @SuppressWarnings("all") + public Payee setPhone(final Phone phone) { this.phone = phone; return this; } - @Override - @SuppressWarnings("all") + public boolean equals(final Object o) { if (o == this) return true; if (!(o instanceof Payee)) return false; @@ -177,13 +134,12 @@ public class Payee { return true; } - @SuppressWarnings("all") + protected boolean canEqual(final Object other) { return other instanceof Payee; } @Override - @SuppressWarnings("all") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Phone.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Phone.java index b820b1b..8276fe3 100644 --- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Phone.java +++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Phone.java @@ -26,70 +26,46 @@ public class Phone{ public Phone() { } - /** - * Parameterized Constructor - */ + public Phone(String countryCode, String nationalNumber) { this.countryCode = countryCode; this.nationalNumber = nationalNumber; } - /** - * Country code (from in E.164 format) - */ - @SuppressWarnings("all") + public String getCountryCode() { return this.countryCode; } - /** - * In-country phone number (from in E.164 format) - */ - @SuppressWarnings("all") + public String getNationalNumber() { return this.nationalNumber; } - /** - * Phone extension - */ - @SuppressWarnings("all") + public String getExtension() { return this.extension; } - /** - * Country code (from in E.164 format) - * @return this - */ - @SuppressWarnings("all") + public Phone setCountryCode(final String countryCode) { this.countryCode = countryCode; return this; } - /** - * In-country phone number (from in E.164 format) - * @return this - */ - @SuppressWarnings("all") + public Phone setNationalNumber(final String nationalNumber) { this.nationalNumber = nationalNumber; return this; } - /** - * Phone extension - * @return this - */ - @SuppressWarnings("all") + public Phone setExtension(final String extension) { this.extension = extension; return this; } @Override - @SuppressWarnings("all") public boolean equals(final Object o) { if (o == this) return true; if (!(o instanceof Phone)) return false; @@ -108,13 +84,11 @@ public class Phone{ return true; } - @SuppressWarnings("all") protected boolean canEqual(final Object other) { return other instanceof Phone; } @Override - @SuppressWarnings("all") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/RedirectUrls.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/RedirectUrls.java index a98b498..05ea842 100644 --- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/RedirectUrls.java +++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/RedirectUrls.java @@ -22,44 +22,30 @@ public class RedirectUrls{ public RedirectUrls() { } - /** - * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.** - */ - @SuppressWarnings("all") + public String getReturnUrl() { return this.returnUrl; } - /** - * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.** - */ - @SuppressWarnings("all") + public String getCancelUrl() { return this.cancelUrl; } - /** - * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.** - * @return this - */ - @SuppressWarnings("all") + public RedirectUrls setReturnUrl(final String returnUrl) { this.returnUrl = returnUrl; return this; } - /** - * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.** - * @return this - */ - @SuppressWarnings("all") + public RedirectUrls setCancelUrl(final String cancelUrl) { this.cancelUrl = cancelUrl; return this; } @Override - @SuppressWarnings("all") + public boolean equals(final Object o) { if (o == this) return true; if (!(o instanceof RedirectUrls)) return false; @@ -75,13 +61,11 @@ public class RedirectUrls{ return true; } - @SuppressWarnings("all") protected boolean canEqual(final Object other) { return other instanceof RedirectUrls; } @Override - @SuppressWarnings("all") public int hashCode() { final int PRIME = 59; int result = 1; diff --git a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Refund.java b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Refund.java index fa8fefe..72bc775 100644 --- a/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Refund.java +++ b/pay-java-paypal/src/main/java/com/egzosn/pay/paypal/bean/order/Refund.java @@ -64,233 +64,152 @@ public class Refund { } - /** - * ID of the refund transaction. 17 characters max. - */ - + public String getId() { return this.id; } - /** - * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. - */ - + public Amount getAmount() { return this.amount; } - /** - * State of the refund. - */ - + public String getState() { return this.state; } - /** - * Reason description for the Sale transaction being refunded. - */ - public String getReason() { return this.reason; } - /** - * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters. - */ - + public String getInvoiceNumber() { return this.invoiceNumber; } - /** - * ID of the Sale transaction being refunded. - */ + public String getSaleId() { return this.saleId; } - /** - * ID of the sale transaction being refunded. - */ public String getCaptureId() { return this.captureId; } - /** - * ID of the payment resource on which this transaction is based. - */ + public String getParentPayment() { return this.parentPayment; } - /** - * Description of what is being refunded for. - */ + public String getDescription() { return this.description; } - /** - * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - */ + public String getCreateTime() { return this.createTime; } - /** - * Time that the resource was last updated. - */ public String getUpdateTime() { return this.updateTime; } - /** - * The reason code for the refund state being pending - */ - + public String getReasonCode() { return this.reasonCode; } - /** - */ + public List getLinks() { return this.links; } - /** - * ID of the refund transaction. 17 characters max. - * @return this - */ - public Refund setId(final String id) { this.id = id; return this; } - /** - * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. - * @return this - */ - + public Refund setAmount(final Amount amount) { this.amount = amount; return this; } - /** - * State of the refund. - * @return this - */ + public Refund setState(final String state) { this.state = state; return this; } - /** - * Reason description for the Sale transaction being refunded. - * @return this - */ + public Refund setReason(final String reason) { this.reason = reason; return this; } - /** - * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters. - * @return this - */ + public Refund setInvoiceNumber(final String invoiceNumber) { this.invoiceNumber = invoiceNumber; return this; } - /** - * ID of the Sale transaction being refunded. - * @return this - */ public Refund setSaleId(final String saleId) { this.saleId = saleId; return this; } - /** - * ID of the sale transaction being refunded. - * @return this - */ - + public Refund setCaptureId(final String captureId) { this.captureId = captureId; return this; } - /** - * ID of the payment resource on which this transaction is based. - * @return this - */ - + public Refund setParentPayment(final String parentPayment) { this.parentPayment = parentPayment; return this; } - /** - * Description of what is being refunded for. - * @return this - */ + public Refund setDescription(final String description) { this.description = description; return this; } - /** - * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * @return this - */ + public Refund setCreateTime(final String createTime) { this.createTime = createTime; return this; } - /** - * Time that the resource was last updated. - * @return this - */ - + public Refund setUpdateTime(final String updateTime) { this.updateTime = updateTime; return this; } - /** - * The reason code for the refund state being pending - * @return this - */ public Refund setReasonCode(final String reasonCode) { this.reasonCode = reasonCode; return this; } - /** - * - * @return this - */ + public Refund setLinks(final List links) { this.links = links; diff --git a/pom.xml b/pom.xml index cfa1e34..2c2105e 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ pay-java-paypal pay-java-yiji pay-java-baidu - + pay-java-demo