mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-14 09:47:25 +08:00
增加demo,回调处理
This commit is contained in:
@@ -222,6 +222,8 @@ public enum PayType implements BasePayType {
|
||||
@Override
|
||||
public PayService getPayService(ApyAccount apyAccount) {
|
||||
PayPalConfigStorage storage = new PayPalConfigStorage();
|
||||
//配置的附加参数的使用
|
||||
storage.setAttach(apyAccount.getPayId());
|
||||
storage.setClientID(apyAccount.getAppid());
|
||||
storage.setClientSecret(apyAccount.getPrivateKey());
|
||||
storage.setTest(true);
|
||||
|
||||
@@ -118,6 +118,11 @@ public class PayResponse {
|
||||
.payType(PayType.payoneer.name())
|
||||
.handler(autowire(new PayoneerMessageHandler(payId)))
|
||||
.end()
|
||||
.rule()
|
||||
.msgType(MsgType.text.name())
|
||||
.payType(PayType.payPal.name())
|
||||
.handler(spring.getBean(AliPayMessageHandler.class))
|
||||
.end()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.egzosn.pay.demo.service.handler;
|
||||
|
||||
import com.egzosn.pay.common.api.PayMessageHandler;
|
||||
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 org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* PayPal支付回调处理器
|
||||
* Created by ZaoSheng on 2016/6/1.
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class PayPalPayMessageHandler implements PayMessageHandler {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PayOutMessage handle(PayMessage payMessage, Map<String, Object> context, PayService payService) throws PayErrorException {
|
||||
|
||||
|
||||
return payService.getPayOutMessage("fail", "失败");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user