mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-13 17:30:18 +08:00
增加授权状态
This commit is contained in:
@@ -15,10 +15,16 @@ import java.util.Map;
|
||||
public interface AdvancedPayService extends PayService {
|
||||
/**
|
||||
* 获取授权页面
|
||||
* @param payeeId 收款id
|
||||
* @param payeeId 用户id
|
||||
* @return 返回请求结果
|
||||
*/
|
||||
String getAuthorizationPage(String payeeId);
|
||||
|
||||
/**
|
||||
* 授权状态
|
||||
* @param payeeId 用户id
|
||||
* @return 返回是否认证 true 已认证
|
||||
*/
|
||||
boolean getAuthorizationStatus(String payeeId);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ import java.util.Map;
|
||||
* @author Actinia
|
||||
* @author egan
|
||||
* <pre>
|
||||
* email: egzosn@gmail.com
|
||||
* email: hayesfu@qq.com
|
||||
* create 2018-01-19
|
||||
* </pre>
|
||||
* email: egzosn@gmail.com
|
||||
* email: hayesfu@qq.com
|
||||
* create 2018-01-19
|
||||
* </pre>
|
||||
*/
|
||||
public class PayoneerPayService extends BasePayService implements AdvancedPayService {
|
||||
/**
|
||||
@@ -54,7 +54,6 @@ public class PayoneerPayService extends BasePayService implements AdvancedPaySer
|
||||
private final static String OUT_TRADE_NO = "client_reference_id";
|
||||
|
||||
|
||||
|
||||
public PayoneerPayService(PayConfigStorage payConfigStorage) {
|
||||
super(payConfigStorage);
|
||||
}
|
||||
@@ -81,6 +80,19 @@ public class PayoneerPayService extends BasePayService implements AdvancedPaySer
|
||||
throw new PayErrorException(new PayException("fail", "Payoneer获取授权页面失败,原因:" + response.getString("hint"), response.toJSONString()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权状态
|
||||
*
|
||||
* @param payeeId 用户id
|
||||
*
|
||||
* @return 返回是否认证 true 已认证
|
||||
*/
|
||||
@Override
|
||||
public boolean getAuthorizationStatus(String payeeId) {
|
||||
JSONObject result = (JSONObject) secondaryInterface(null, payeeId, PayoneerTransactionType.PAYEES_STATUS);
|
||||
return "0".equals(result.get(CODE).toString())/* && "ACTIVE".equals(result.getString("status"))*/;
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调校验
|
||||
*
|
||||
@@ -91,7 +103,7 @@ public class PayoneerPayService extends BasePayService implements AdvancedPaySer
|
||||
@Override
|
||||
public boolean verify(Map<String, Object> params) {
|
||||
if (params != null && 0 == Integer.parseInt(params.get(CODE).toString())) {
|
||||
if (params.containsKey(OUT_TRADE_NO)){
|
||||
if (params.containsKey(OUT_TRADE_NO)) {
|
||||
return verifySource((String) params.get(OUT_TRADE_NO));
|
||||
}
|
||||
return true;
|
||||
@@ -277,7 +289,6 @@ public class PayoneerPayService extends BasePayService implements AdvancedPaySer
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
*
|
||||
|
||||
@@ -19,6 +19,10 @@ public enum PayoneerTransactionType implements TransactionType {
|
||||
* 注册授权
|
||||
*/
|
||||
REGISTRATION("payees/registration-link"),
|
||||
/**
|
||||
* 授权状态
|
||||
*/
|
||||
PAYEES_STATUS("payees/{payee_id}/status"),
|
||||
/**
|
||||
* 收款
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user