mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-06-09 19:02:19 +08:00
临时提交 更新主分支
This commit is contained in:
@@ -9,6 +9,9 @@ import com.egzosn.pay.common.bean.TransactionType;
|
||||
import com.egzosn.pay.fuiou.api.FuiouPayConfigStorage;
|
||||
import com.egzosn.pay.fuiou.api.FuiouPayService;
|
||||
import com.egzosn.pay.fuiou.bean.FuiouTransactionType;
|
||||
import com.egzosn.pay.payoneer.api.PayoneerConfigStorage;
|
||||
import com.egzosn.pay.payoneer.api.PayoneerPayService;
|
||||
import com.egzosn.pay.payoneer.bean.PayoneerTransactionType;
|
||||
import com.egzosn.pay.union.api.UnionPayConfigStorage;
|
||||
import com.egzosn.pay.union.api.UnionPayService;
|
||||
import com.egzosn.pay.union.bean.UnionTransactionType;
|
||||
@@ -170,6 +173,31 @@ public enum PayType implements BasePayType {
|
||||
}
|
||||
|
||||
|
||||
},payoneer{
|
||||
@Override
|
||||
public PayService getPayService(ApyAccount apyAccount) {
|
||||
PayoneerConfigStorage payoneerConfigStorage = new PayoneerConfigStorage();
|
||||
payoneerConfigStorage.setProgramId(apyAccount.getPartner());
|
||||
payoneerConfigStorage.setApiUserName(apyAccount.getSeller());
|
||||
payoneerConfigStorage.setApiPassword(apyAccount.getStorePassword());
|
||||
payoneerConfigStorage.setKeyPublic(apyAccount.getPublicKey());
|
||||
payoneerConfigStorage.setKeyPrivate(apyAccount.getPrivateKey());
|
||||
payoneerConfigStorage.setNotifyUrl(apyAccount.getNotifyUrl());
|
||||
payoneerConfigStorage.setReturnUrl(apyAccount.getReturnUrl());
|
||||
payoneerConfigStorage.setSignType(apyAccount.getSignType());
|
||||
payoneerConfigStorage.setPayType(apyAccount.getPayType().toString());
|
||||
payoneerConfigStorage.setMsgType(apyAccount.getMsgType());
|
||||
payoneerConfigStorage.setInputCharset(apyAccount.getInputCharset());
|
||||
payoneerConfigStorage.setTest(apyAccount.isTest());
|
||||
return new PayoneerPayService(payoneerConfigStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransactionType getTransactionType(String transactionType) {
|
||||
return PayoneerTransactionType.valueOf(transactionType);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
public abstract PayService getPayService(ApyAccount apyAccount);
|
||||
|
||||
@@ -115,6 +115,11 @@ public class PayResponse {
|
||||
.payType(PayType.unionPay.name())
|
||||
.handler(autowire(new UnionPayMessageHandler(payId)))
|
||||
.end()
|
||||
.rule()
|
||||
.msgType(MsgType.json.name())
|
||||
.payType(PayType.payoneer.name())
|
||||
.handler(autowire(new PayoneerMessageHandler(payId)))
|
||||
.end()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.egzosn.pay.demo.service.handler;
|
||||
|
||||
import com.egzosn.pay.common.api.PayService;
|
||||
import com.egzosn.pay.common.bean.PayMessage;
|
||||
import com.egzosn.pay.common.bean.PayOutMessage;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @descrption
|
||||
* @author Actinia
|
||||
* @email hayesfu@qq.com
|
||||
* @date 2018-01-19
|
||||
*/
|
||||
public class PayoneerMessageHandler extends BasePayMessageHandler {
|
||||
|
||||
|
||||
public PayoneerMessageHandler(Integer payId) {
|
||||
super(payId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PayOutMessage handle(PayMessage payMessage, Map<String, Object> context, PayService payService) throws PayErrorException {
|
||||
//交易状态
|
||||
if ("0".equals(payMessage.getPayMessage().get("code"))) {
|
||||
/////这里进行成功的处理
|
||||
|
||||
return payService.successPayOutMessage(payMessage);
|
||||
}
|
||||
|
||||
return payService.getPayOutMessage("fail", "失败");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user