Update NetworkModule.java
This commit is contained in:
parent
67fc55800a
commit
40c4ba2d25
@ -254,7 +254,7 @@ public class NetworkModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (baseUrl.isEmpty()) {
|
if (baseUrl.isEmpty()) {
|
||||||
baseUrl = "http://api.kbzpay.com/payment/gateway/uat/";
|
baseUrl = "http://api-uat.kbzpay.com/payment/gateway/uat/";
|
||||||
}
|
}
|
||||||
return new Retrofit.Builder()
|
return new Retrofit.Builder()
|
||||||
.baseUrl(baseUrl)
|
.baseUrl(baseUrl)
|
||||||
@ -302,88 +302,6 @@ public class NetworkModule {
|
|||||||
.create(SiriusApiService.class);
|
.create(SiriusApiService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Provides
|
|
||||||
// @Singleton
|
|
||||||
// @KPayRefundRetrofit
|
|
||||||
// public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
|
||||||
// char[] password = "test123".toCharArray();
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// if (Security.getProvider(BouncyCastleProvider.PROVIDER_NAME) == null) {
|
|
||||||
// Security.addProvider(new BouncyCastleProvider());
|
|
||||||
// }
|
|
||||||
// // Client keystore
|
|
||||||
// KeyStore clientKeyStore = KeyStore.getInstance("PKCS12",new BouncyCastleProvider());
|
|
||||||
// InputStream clientStream = context.getResources().openRawResource(R.raw.client);
|
|
||||||
// clientKeyStore.load(clientStream, password);
|
|
||||||
// clientStream.close();
|
|
||||||
//
|
|
||||||
// KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
|
|
||||||
// kmf.init(clientKeyStore, password);
|
|
||||||
// KeyManager[] keyManagers = kmf.getKeyManagers();
|
|
||||||
//
|
|
||||||
// InputStream caInput = context.getResources().openRawResource(R.raw.certi);
|
|
||||||
// CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
|
||||||
// Certificate ca = cf.generateCertificate(caInput);
|
|
||||||
//
|
|
||||||
// KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
|
||||||
// keyStore.load(null, null);
|
|
||||||
// keyStore.setCertificateEntry("ca", ca);
|
|
||||||
//
|
|
||||||
// TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
|
||||||
// tmf.init(keyStore);
|
|
||||||
// TrustManager[] trustManagers = tmf.getTrustManagers();
|
|
||||||
//
|
|
||||||
// X509TrustManager x509TrustManager = null;
|
|
||||||
// for (TrustManager tm : trustManagers) {
|
|
||||||
// if (tm instanceof X509TrustManager) {
|
|
||||||
// x509TrustManager = (X509TrustManager) tm;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// SSLContext sslContext = SSLContext.getInstance("TLS");
|
|
||||||
// sslContext.init(kmf.getKeyManagers(), new TrustManager[]{x509TrustManager}, null);
|
|
||||||
//
|
|
||||||
// HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
|
|
||||||
// loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
|
||||||
//
|
|
||||||
// OkHttpClient okHttp = new OkHttpClient.Builder()
|
|
||||||
// .sslSocketFactory(sslContext.getSocketFactory(), x509TrustManager)
|
|
||||||
// .addInterceptor(loggingInterceptor)
|
|
||||||
// .hostnameVerifier(new HostnameVerifier() {
|
|
||||||
// @Override
|
|
||||||
// public boolean verify(String hostname, SSLSession session) {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .build();
|
|
||||||
//
|
|
||||||
// return new Retrofit.Builder()
|
|
||||||
// .baseUrl(Refund_Base_Url)
|
|
||||||
// .client(okHttp)
|
|
||||||
// .addCallAdapterFactory(RxJava3CallAdapterFactory.create())
|
|
||||||
// .addConverterFactory(GsonConverterFactory.create())
|
|
||||||
// .build();
|
|
||||||
//
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// e.printStackTrace();
|
|
||||||
//
|
|
||||||
// OkHttpClient okHttp = new OkHttpClient();
|
|
||||||
// return new Retrofit.Builder()
|
|
||||||
// .baseUrl(Refund_Base_Url)
|
|
||||||
// .client(okHttp)
|
|
||||||
// .addConverterFactory(GsonConverterFactory.create())
|
|
||||||
// .build();
|
|
||||||
//
|
|
||||||
//// throw new RuntimeException("Failed to create Retrofit instance", e);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//@Reusable
|
//@Reusable
|
||||||
//@KPayRefundRetrofit
|
//@KPayRefundRetrofit
|
||||||
@Provides
|
@Provides
|
||||||
@ -392,10 +310,8 @@ public Retrofit provideKPayRefundRetrofit(@ApplicationContext Context context) {
|
|||||||
|
|
||||||
// char[] password = "test123".toCharArray();
|
// char[] password = "test123".toCharArray();
|
||||||
|
|
||||||
// public static String Refund_Base_Url = "https://api.kbzpay.com:18008/payment/gateway/uat/";
|
// String refundBaseUrl = "https://api.kbzpay.com:8008/payment/gateway/";
|
||||||
|
String refundBaseUrl = "https://api-uat.kbzpay.com:18008/payment/gateway/uat/";
|
||||||
|
|
||||||
String refundBaseUrl = "https://api.kbzpay.com:8008/payment/gateway/";
|
|
||||||
// String IpAddress = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
// String IpAddress = SystemParamsOperation.getInstance().getSecHostIpAddress();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user