|
1 | 1 | package ci.bamba.regis; |
2 | 2 |
|
3 | | -import com.google.gson.Gson; |
4 | | -import com.google.gson.GsonBuilder; |
5 | | - |
6 | 3 | import java.util.HashMap; |
7 | 4 | import java.util.concurrent.TimeUnit; |
8 | 5 |
|
| 6 | +import com.google.gson.Gson; |
| 7 | +import com.google.gson.GsonBuilder; |
| 8 | + |
9 | 9 | import ci.bamba.regis.models.AccountBalance; |
10 | 10 | import ci.bamba.regis.models.AccountStatus; |
11 | 11 | import ci.bamba.regis.models.ApiKey; |
12 | 12 | import ci.bamba.regis.models.ApiUser; |
13 | | -import ci.bamba.regis.models.CollectionsRequestToPay; |
14 | | -import ci.bamba.regis.models.DisbursementsTransfer; |
15 | | -import ci.bamba.regis.models.DisbursementsTransferBodyRequest; |
16 | | -import ci.bamba.regis.models.RemittancesTransfer; |
17 | | -import ci.bamba.regis.models.RemittancesTransferBodyRequest; |
| 13 | +import ci.bamba.regis.models.RequestToPay; |
| 14 | +import ci.bamba.regis.models.RequestToPayBodyRequest; |
18 | 15 | import ci.bamba.regis.models.Token; |
| 16 | +import ci.bamba.regis.models.Transfer; |
| 17 | +import ci.bamba.regis.models.TransferBodyRequest; |
19 | 18 | import io.reactivex.Observable; |
20 | | -import ci.bamba.regis.models.CollectionsRequestToPayBodyRequest; |
21 | 19 | import okhttp3.OkHttpClient; |
22 | 20 | import okhttp3.Request; |
23 | 21 | import okhttp3.logging.HttpLoggingInterceptor; |
@@ -96,51 +94,38 @@ Observable<Response<Token>> createToken( |
96 | 94 | @Path("type") String type |
97 | 95 | ); |
98 | 96 |
|
99 | | - @POST("collection/v1_0/requesttopay") |
100 | | - Observable<Response<Void>> collectionsCreateRequestToPay( |
101 | | - @Header("Authorization") String authorization, |
102 | | - @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
103 | | - @Header("X-Reference-Id") String referenceId, |
104 | | - @Header("X-Target-Environment") String targetEnvironment, |
105 | | - @Body CollectionsRequestToPayBodyRequest body |
106 | | - ); |
107 | | - |
108 | | - @POST("disbursement/v1_0/transfer") |
109 | | - Observable<Response<Void>> disbursementsCreateTransfer( |
| 97 | + @POST("{type}/v1_0/requesttopay") |
| 98 | + Observable<Response<Void>> createRequestToPay( |
| 99 | + @Path("type") String type, |
110 | 100 | @Header("Authorization") String authorization, |
111 | 101 | @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
112 | 102 | @Header("X-Reference-Id") String referenceId, |
113 | 103 | @Header("X-Target-Environment") String targetEnvironment, |
114 | | - @Body DisbursementsTransferBodyRequest body |
| 104 | + @Body RequestToPayBodyRequest body |
115 | 105 | ); |
116 | 106 |
|
117 | | - @POST("remittance/v1_0/transfer") |
118 | | - Observable<Response<Void>> remittancesCreateTransfer( |
| 107 | + @POST("{type}/v1_0/transfer") |
| 108 | + Observable<Response<Void>> createTransfer( |
| 109 | + @Path("type") String type, |
119 | 110 | @Header("Authorization") String authorization, |
120 | 111 | @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
121 | 112 | @Header("X-Reference-Id") String referenceId, |
122 | 113 | @Header("X-Target-Environment") String targetEnvironment, |
123 | | - @Body RemittancesTransferBodyRequest body |
| 114 | + @Body TransferBodyRequest body |
124 | 115 | ); |
125 | 116 |
|
126 | | - @GET("collection/v1_0/requesttopay/{referenceId}") |
127 | | - Observable<Response<CollectionsRequestToPay>> collectionsGetRequestToPay( |
128 | | - @Header("Authorization") String authorization, |
129 | | - @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
130 | | - @Header("X-Target-Environment") String targetEnvironment, |
131 | | - @Path("referenceId") String referenceId |
132 | | - ); |
133 | | - |
134 | | - @GET("disbursement/v1_0/transfer/{referenceId}") |
135 | | - Observable<Response<DisbursementsTransfer>> disbursementsGetTransfer( |
| 117 | + @GET("{type}/v1_0/requesttopay/{referenceId}") |
| 118 | + Observable<Response<RequestToPay>> getRequestToPay( |
| 119 | + @Path("type") String type, |
136 | 120 | @Header("Authorization") String authorization, |
137 | 121 | @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
138 | 122 | @Header("X-Target-Environment") String targetEnvironment, |
139 | 123 | @Path("referenceId") String referenceId |
140 | 124 | ); |
141 | 125 |
|
142 | | - @GET("remittance/v1_0/transfer/{referenceId}") |
143 | | - Observable<Response<RemittancesTransfer>> remittancesGetTransfer( |
| 126 | + @GET("{type}/v1_0/transfer/{referenceId}") |
| 127 | + Observable<Response<Transfer>> getTransfer( |
| 128 | + @Path("type") String type, |
144 | 129 | @Header("Authorization") String authorization, |
145 | 130 | @Header("Ocp-Apim-Subscription-Key") String subscriptionKey, |
146 | 131 | @Header("X-Target-Environment") String targetEnvironment, |
|
0 commit comments