com.foxinmy.weixin4j.payment.mch.NATIVEPayRequest Maven / Gradle / Ivy
package com.foxinmy.weixin4j.payment.mch;
import com.foxinmy.weixin4j.model.WeixinPayAccount;
import com.foxinmy.weixin4j.payment.PayRequest;
import com.foxinmy.weixin4j.type.TradeType;
/**
* NATIVE扫码支付(模式二)
*
* @className NATIVEPayRequest
* @author jinyu([email protected])
* @date 2015年12月25日
* @since JDK 1.6
* @see com.foxinmy.weixin4j.payment.mch.PrePay
* @see com.foxinmy.weixin4j.payment.PayRequest
* @see NATIVE扫码支付(模式二)
*/
public class NATIVEPayRequest extends AbstractPayRequest {
private final String codeUrl;
public NATIVEPayRequest(String prePayId, String codeUrl,
WeixinPayAccount payAccount) {
super(prePayId, payAccount);
this.codeUrl = codeUrl;
}
@Override
public TradeType getPaymentType() {
return TradeType.NATIVE;
}
/**
* 只做查看之用,请不要尝试作为支付请求
*/
@Override
public PayRequest toRequestObject() {
return new PayRequest(getPaymentAccount().getId(), "code_url=" + codeUrl);
}
@Override
public String toRequestString() {
return this.codeUrl;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy