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

org.yes.tools.pay.module.request.WxAppletPayRequest Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package org.yes.tools.pay.module.request;

import io.micrometer.common.util.StringUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.yes.tools.core.exception.YesBaseException;
import org.yes.tools.pay.config.PayConfig;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class WxAppletPayRequest extends PayRequest {
    private static final long serialVersionUID = 522565152886671850L;

    //微信子商户appId app跳转银商微信小程序需要上送该参数,值为app应用在微信开放平台分配的appid;云闪付、支付宝/支付宝小程序方式不用上送该参数
    private String subAppId;
    //	用户子标识 微信必传,需要商户自行调用微信平台接口获取,
    private String subOpenId;


    @Override
    public void checkAndSign(PayConfig payConfig) {
        if (StringUtils.isBlank(payConfig.getAppletAppId())) {
            throw new YesBaseException("小程序APPID不存在");
        }
        if (StringUtils.isBlank(this.subOpenId)) {
            throw new YesBaseException("用户OPENID不存在");
        }
        this.subAppId = payConfig.getAppletAppId();
        super.checkAndSign(payConfig);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy