View Javadoc
1   package com.foxinmy.weixin4j.payment.mch;
2   
3   import com.foxinmy.weixin4j.model.WeixinPayAccount;
4   import com.foxinmy.weixin4j.payment.PayRequest;
5   import com.foxinmy.weixin4j.type.TradeType;
6   
7   /**
8    * NATIVE扫码支付(模式二)
9    * 
10   * @className NATIVEPayRequest
11   * @author jinyu(foxinmy@gmail.com)
12   * @date 2015年12月25日
13   * @since JDK 1.6
14   * @see com.foxinmy.weixin4j.payment.mch.PrePay
15   * @see com.foxinmy.weixin4j.payment.PayRequest
16   * @see <a
17   *      href="https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1">NATIVE扫码支付(模式二)</a>
18   * @deprecated 迁移到子模块weixin4j-pay
19   */
20  @Deprecated
21  public class NATIVEPayRequest extends AbstractPayRequest {
22  
23  	private final String codeUrl;
24  
25  	public NATIVEPayRequest(String prePayId, String codeUrl,
26  			WeixinPayAccount payAccount) {
27  		super(prePayId, payAccount);
28  		this.codeUrl = codeUrl;
29  	}
30  
31  	@Override
32  	public TradeType getPaymentType() {
33  		return TradeType.NATIVE;
34  	}
35  
36  	/**
37  	 * <font color="red">只做查看之用,请不要尝试作为支付请求</font>
38  	 */
39  	@Override
40  	public PayRequest toRequestObject() {
41  		return new PayRequest(getPaymentAccount().getId(), "code_url=" + codeUrl);
42  	}
43  
44  	@Override
45  	public String toRequestString() {
46  		return this.codeUrl;
47  	}
48  }