All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.mingsoft.pay.util.PayUtil Maven / Gradle / Ivy

The newest version!
/**
 * Copyright (c) 2012-present 铭软科技(mingsoft.net)
 * 本软件及相关文档文件(以下简称“软件”)的版权归 铭软科技 所有
 * 遵循 铭软科技《服务协议》中的《保密条款》
 */

package net.mingsoft.pay.util;

import cn.hutool.json.JSONUtil;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.pay.biz.IPayNotify;
import net.mingsoft.pay.constant.Const;
import net.mingsoft.pay.entity.PayLogEntity;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.List;


/**
 * 支付工具类
 * @author 铭飞团队
 * @version
 * 版本号:100
* 创建日期:2018-2-9 13:32:03
* 历史修订:
*/ public class PayUtil { /** * 根据请求扩展参数{notifyBeanName:xxx,xx:xx}里面的notifyBeanName执行对应的支付回调扩展 * @param payLogEntity 支付日志 * @param attach json对象 * @return */ public static boolean callPayNotfiy(PayLogEntity payLogEntity , String attach) { if(attach!="") { HashMap hashMap = JSONUtil.toBean(attach, HashMap.class); Object notifyBeanName = hashMap.get(Const.Attach.NOTIFY_BEAN_NAME); if(notifyBeanName != null && StringUtils.isNotBlank(notifyBeanName.toString())) { IPayNotify payNotify = (IPayNotify)SpringUtil.getBean(notifyBeanName.toString()); payLogEntity.setPeopleId(hashMap.get(Const.Attach.USER_ID).toString()); return payNotify.notify(payLogEntity, hashMap); } } return false; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy