1 package com.foxinmy.weixin4j.pay.payment.mch;
2
3 import com.foxinmy.weixin4j.pay.model.WeixinPayAccount;
4 import com.foxinmy.weixin4j.pay.payment.PayRequest;
5 import com.foxinmy.weixin4j.pay.type.TradeType;
6
7
8
9
10
11
12
13
14
15
16
17
18
19 public class NATIVEPayRequest extends AbstractPayRequest {
20
21 private final String codeUrl;
22
23 public NATIVEPayRequest(String prePayId, String codeUrl,
24 WeixinPayAccount payAccount) {
25 super(prePayId, payAccount);
26 this.codeUrl = codeUrl;
27 }
28
29 @Override
30 public TradeType getPaymentType() {
31 return TradeType.NATIVE;
32 }
33
34
35
36
37 @Override
38 public PayRequest toRequestObject() {
39 return new PayRequest(getPaymentAccount().getId(), "code_url=" + codeUrl);
40 }
41
42 @Override
43 public String toRequestString() {
44 return this.codeUrl;
45 }
46 }