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 WAPPayRequest extends AbstractPayRequest {
20
21
22
23 private final String payUrl;
24
25 public WAPPayRequest(String prePayId, String payUrl,
26 WeixinPayAccount payAccount) {
27 super(prePayId, payAccount);
28 this.payUrl = payUrl;
29
30 }
31
32 @Override
33 public TradeType getPaymentType() {
34 return TradeType.MWEB;
35 }
36
37
38
39
40 @Override
41 public PayRequest toRequestObject() {
42 PayRequest payRequest = new PayRequest(getPaymentAccount().getId(),
43 getPaymentType().name());
44 payRequest.setPrepayId(getPrePayId());
45 return payRequest;
46 }
47
48 @Override
49 public String toRequestString() {
50
51
52
53
54
55
56
57
58
59 return this.payUrl;
60 }
61 }