1 | /* |
||
2 | * To change this license header, choose License Headers in Project Properties. |
||
3 | * To change this template file, choose Tools | Templates |
||
4 | * and open the template in the editor. |
||
5 | */ |
||
6 | package com.github.theresasogunle; |
||
7 | |||
8 | import com.github.theresasogunle.RaveConstant; |
||
9 | |||
10 | |||
11 | /** |
||
12 | * |
||
13 | * @author Theresa |
||
14 | */ |
||
15 | public class Endpoints { |
||
16 | RaveConstant key= new RaveConstant(); |
||
17 | String staging_url="https://ravesandboxapi.flutterwave.com/"; |
||
18 | String live_url="https://api.ravepay.co/"; |
||
19 | String url; |
||
20 | public String BANK_ENDPOINT; |
||
21 | public static String CHARGE_ENDPOINT; |
||
0 ignored issues
–
show
|
|||
22 | public static String CARD_VALIDATE_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
CARD_VALIDATE_ENDPOINT final.
![]() |
|||
23 | public static String ACCOUNT_VALIDATE_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
ACCOUNT_VALIDATE_ENDPOINT final.
![]() |
|||
24 | public static String TIMEOUT_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
TIMEOUT_ENDPOINT final.
![]() |
|||
25 | public static String POLL_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
POLL_ENDPOINT final.
![]() |
|||
26 | public static String FEES_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
FEES_ENDPOINT final.
![]() |
|||
27 | public static String REFUND_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
REFUND_ENDPOINT final.
![]() |
|||
28 | public static String FOREX_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
FOREX_ENDPOINT final.
![]() |
|||
29 | public static String VERIFY_TRANSACTION_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
VERIFY_TRANSACTION_ENDPOINT final.
![]() |
|||
30 | public static String VERIFY_XREQUERY_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
VERIFY_XREQUERY_ENDPOINT final.
![]() |
|||
31 | public static String CAPTURE_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
CAPTURE_ENDPOINT final.
![]() |
|||
32 | public static String REFUNDVOID_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
REFUNDVOID_ENDPOINT final.
![]() |
|||
33 | public static String CHARGE_TIMEOUT_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
CHARGE_TIMEOUT_ENDPOINT final.
![]() |
|||
34 | public static String VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT final.
![]() |
|||
35 | public static String VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT; |
||
0 ignored issues
–
show
public static fields should always be marked final to prevent them being overwritten in unexpected ways. Consider making
VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT final.
![]() |
|||
36 | |||
37 | |||
38 | |||
39 | void init(){ |
||
40 | |||
41 | |||
42 | if(RaveConstant.ENVIRONMENT.toString().equalsIgnoreCase("live")){ |
||
0 ignored issues
–
show
|
|||
43 | |||
44 | url=live_url; |
||
45 | |||
46 | } |
||
47 | else { |
||
48 | url=staging_url; |
||
49 | } |
||
50 | |||
51 | BANK_ENDPOINT= url+"flwv3-pug/getpaidx/api/flwpbf-banks.js?json=1"; |
||
52 | CHARGE_ENDPOINT =url+"flwv3-pug/getpaidx/api/charge"; |
||
0 ignored issues
–
show
|
|||
53 | CARD_VALIDATE_ENDPOINT = url+"flwv3-pug/getpaidx/api/validatecharge"; |
||
0 ignored issues
–
show
|
|||
54 | ACCOUNT_VALIDATE_ENDPOINT=url+"flwv3-pug/getpaidx/api/validate"; |
||
0 ignored issues
–
show
|
|||
55 | TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/charge?use_polling=1"; |
||
0 ignored issues
–
show
|
|||
56 | POLL_ENDPOINT=url+"flwv3-pug/getpaidx/api/requests/RCORE_CHREQ_3FC28781846AD8E1C598"; |
||
0 ignored issues
–
show
|
|||
57 | FEES_ENDPOINT=url+"flwv3-pug/getpaidx/api/fee"; |
||
0 ignored issues
–
show
|
|||
58 | REFUND_ENDPOINT=url+"gpx/merchant/transactions/refund"; |
||
0 ignored issues
–
show
|
|||
59 | FOREX_ENDPOINT=url+"flwv3-pug/getpaidx/api/forex"; |
||
0 ignored issues
–
show
|
|||
60 | VERIFY_TRANSACTION_ENDPOINT=url+"flwv3-pug/getpaidx/api/verify"; |
||
0 ignored issues
–
show
|
|||
61 | VERIFY_XREQUERY_ENDPOINT=url+"flwv3-pug/getpaidx/api/xrequery"; |
||
0 ignored issues
–
show
|
|||
62 | CAPTURE_ENDPOINT=url+"flwv3-pug/getpaidx/api/capture"; |
||
0 ignored issues
–
show
|
|||
63 | REFUNDVOID_ENDPOINT=url+"flwv3-pug/getpaidx/api/refundorvoid"; |
||
0 ignored issues
–
show
|
|||
64 | CHARGE_TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/charge?use_polling=1"; |
||
0 ignored issues
–
show
|
|||
65 | VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/validatecharge?use_polling=1"; |
||
0 ignored issues
–
show
|
|||
66 | VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT= url+"flwv3-pug/getpaidx/api/validate?use_polling=1"; |
||
0 ignored issues
–
show
|
|||
67 | |||
68 | } |
||
69 | |||
70 | public String getBankEndPoint(){ |
||
71 | init(); |
||
72 | return BANK_ENDPOINT; |
||
73 | |||
74 | } |
||
75 | |||
76 | public String getChargeEndPoint(){ |
||
77 | init(); |
||
78 | return CHARGE_ENDPOINT; |
||
79 | |||
80 | } |
||
81 | public String getValidateCardChargeEndPoint(){ |
||
82 | init(); |
||
83 | return CARD_VALIDATE_ENDPOINT; |
||
84 | |||
85 | } |
||
86 | public String getValidateAccountChargeEndPoint(){ |
||
87 | init(); |
||
88 | return ACCOUNT_VALIDATE_ENDPOINT; |
||
89 | |||
90 | } |
||
91 | public String getFeesEndPoint(){ |
||
92 | init(); |
||
93 | return FEES_ENDPOINT; |
||
94 | |||
95 | } |
||
96 | public String getRefundEndPoint(){ |
||
97 | init(); |
||
98 | return REFUND_ENDPOINT; |
||
99 | |||
100 | } |
||
101 | public String getForexEndPoint(){ |
||
102 | init(); |
||
103 | return FOREX_ENDPOINT; |
||
104 | |||
105 | } |
||
106 | public String getVerifyEndPoint(){ |
||
107 | init(); |
||
108 | return VERIFY_TRANSACTION_ENDPOINT; |
||
109 | |||
110 | } |
||
111 | public String getVerifyXrequeryEndPoint(){ |
||
112 | init(); |
||
113 | return VERIFY_XREQUERY_ENDPOINT; |
||
114 | |||
115 | } |
||
116 | public String getCaptureEndPoint(){ |
||
117 | init(); |
||
118 | return CAPTURE_ENDPOINT; |
||
119 | |||
120 | } |
||
121 | public String getRefundOrVoidEndPoint(){ |
||
122 | init(); |
||
123 | return REFUNDVOID_ENDPOINT; |
||
124 | |||
125 | } |
||
126 | public String getChargeTimeoutEndpoint(){ |
||
127 | init(); |
||
128 | return CHARGE_TIMEOUT_ENDPOINT; |
||
129 | |||
130 | } |
||
131 | public String getValidateCardChargeTimeoutEndpoint(){ |
||
132 | init(); |
||
133 | return VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT; |
||
134 | |||
135 | } |
||
136 | public String getValidateAccountChargeTimeoutEndpoint(){ |
||
137 | init(); |
||
138 | return VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT; |
||
139 | |||
140 | } |
||
141 | |||
142 | |||
143 | |||
144 | |||
145 | |||
146 | } |
||
147 |
See this CWE advisory on why this is a security issue.