增加demo,回调处理

This commit is contained in:
egan
2018-05-06 13:31:37 +08:00
parent 8621950384
commit c98840b8ba
3 changed files with 38 additions and 0 deletions

View File

@@ -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);

View File

@@ -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()
;
}

View File

@@ -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", "失败");
}
}