Mukesh Dhungana
2 years ago
16 changed files with 404 additions and 22 deletions
-
2.idea/compiler.xml
-
48app/build.gradle
-
33app/src/main/AndroidManifest.xml
-
2app/src/main/java/com/remit/jmecustomer/features/home/HomeParentViewContractV2.java
-
12app/src/main/java/com/remit/jmecustomer/features/home/view/HomeActivityV2.java
-
5app/src/main/java/com/remit/jmecustomer/features/home/view/HomeFragmentV2.java
-
12app/src/main/java/com/remit/jmecustomer/features/sendmoney/model/RewardsPointDTO.java
-
2app/src/main/java/com/remit/jmecustomer/features/sendmoney/view/amountdetail/AmountDetailSendMoneyFragment.java
-
177app/src/main/java/com/remit/jmecustomer/features/trustdock/view/TrustDockActivity.java
-
2app/src/main/java/com/remit/jmecustomer/utils/https/HttpClientV2.java
-
6app/src/main/res/drawable/circular_blue_border.xml
-
6app/src/main/res/drawable/circular_red_border.xml
-
9app/src/main/res/layout/activity_home_v2.xml
-
107app/src/main/res/layout/activity_trustdock.xml
-
1app/src/main/res/values/colors.xml
-
2build.gradle
@ -1,6 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<project version="4"> |
|||
<component name="CompilerConfiguration"> |
|||
<bytecodeTargetLevel target="1.8" /> |
|||
<bytecodeTargetLevel target="11" /> |
|||
</component> |
|||
</project> |
@ -0,0 +1,177 @@ |
|||
package com.remit.jmecustomer.features.trustdock.view; |
|||
|
|||
import android.content.Context; |
|||
import android.os.Bundle; |
|||
import android.util.Log; |
|||
import android.view.View; |
|||
import android.widget.Button; |
|||
|
|||
import com.android.volley.AuthFailureError; |
|||
import com.android.volley.RequestQueue; |
|||
import com.android.volley.Request; |
|||
import com.android.volley.Response; |
|||
import com.android.volley.VolleyError; |
|||
import com.android.volley.toolbox.JsonObjectRequest; |
|||
import com.android.volley.toolbox.StringRequest; |
|||
import com.android.volley.toolbox.Volley; |
|||
import com.remit.jmecustomer.R; |
|||
import com.remit.jmecustomer.base.BaseActivity; |
|||
|
|||
import org.jetbrains.annotations.NotNull; |
|||
import org.jetbrains.annotations.Nullable; |
|||
import org.json.JSONArray; |
|||
import org.json.JSONObject; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
import io.trustdock.sdk.TrustdockPlan; |
|||
import io.trustdock.sdk.TrustdockVerificationException; |
|||
import io.trustdock.sdk.TrustdockVerificationParams; |
|||
import io.trustdock.sdk.TrustdockVerificationSDK; |
|||
import kotlin.collections.CollectionsKt; |
|||
import kotlin.jvm.internal.DefaultConstructorMarker; |
|||
import kotlin.jvm.internal.Intrinsics; |
|||
|
|||
public class TrustDockActivity extends BaseActivity { |
|||
|
|||
protected void onCreate(@Nullable Bundle savedInstanceState) { |
|||
super.onCreate(savedInstanceState); |
|||
this.setContentView(R.layout.activity_trustdock); |
|||
TrustdockVerificationSDK.Companion.init(); |
|||
TrustdockVerificationSDK.Listener listener = new TrustdockVerificationSDK.Listener() { |
|||
public void onDocumentSubmitted() { |
|||
} |
|||
|
|||
public void onCompleted() { |
|||
} |
|||
|
|||
public void onCanceled(@NotNull TrustdockVerificationException e) { |
|||
Intrinsics.checkNotNullParameter(e, "e"); |
|||
} |
|||
}; |
|||
TrustdockVerificationSDK.Companion.registerListener((TrustdockVerificationSDK.Listener) listener); |
|||
String publicId = "c471d877-c4e4-4805-9332-7f6c3a1881d8"; |
|||
String nativeAppSdkToken = "rbTme8F4whfAZBuSQcN5gUXr"; |
|||
|
|||
// List planPPA = CollectionsKt.listOf(new TrustdockPlan("5ba5a065-dac1-4509-a574-0d4deef19720", null, null)); |
|||
// final TrustdockVerificationParams paramsPPA = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planPPA); |
|||
// |
|||
// Button startButtonPPA = (Button) this.findViewById(R.id.startButtonPPA); |
|||
// startButtonPPA.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
// public final void onClick(View it) { |
|||
// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsPPA); |
|||
// } |
|||
// })); |
|||
// List planRC = CollectionsKt.listOf(new TrustdockPlan("b1da18ee-bean-42f0-b7f6-0d375e1f505d", (String) null, (List) null)); |
|||
// final TrustdockVerificationParams paramsRC = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planRC); |
|||
// |
|||
// Button startButtonRC = (Button) this.findViewById(R.id.startButtonRC); |
|||
// ; |
|||
// startButtonRC.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
// public final void onClick(View it) { |
|||
// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsRC); |
|||
// } |
|||
// })); |
|||
// List planDL = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (List) null)}); |
|||
// final TrustdockVerificationParams paramsDL = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planDL); |
|||
// |
|||
// Button startButtonDL = (Button) this.findViewById(R.id.startButtonDL); |
|||
// startButtonDL.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
// public final void onClick(View it) { |
|||
// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsDL); |
|||
// } |
|||
// })); |
|||
// List planeKYC = CollectionsKt.listOf(new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", (String) null, (List) null)); |
|||
// final TrustdockVerificationParams paramsKYC = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planeKYC); |
|||
// |
|||
// Button startButtonEKYC = (Button) this.findViewById(R.id.startButtonEKYC); |
|||
// startButtonEKYC.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
// public final void onClick(View it) { |
|||
// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsKYC); |
|||
// } |
|||
// })); |
|||
// List planSelfie = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "e103a0db-ae3c-4eda-8dcb-6fff06cdfcc9", (List) null)}); |
|||
// final TrustdockVerificationParams paramsSelfie = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planSelfie); |
|||
// |
|||
// Button startButtonSelfie = (Button) this.findViewById(R.id.startButtonSelfie); |
|||
// startButtonSelfie.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
// public final void onClick(View it) { |
|||
// TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsSelfie); |
|||
// } |
|||
// })); |
|||
List planSelfie2 = CollectionsKt.listOf(new TrustdockPlan[]{new TrustdockPlan("b1da18ee-fabe-42f0-b7f6-0d375e1f505d", (String) null, (List) null), new TrustdockPlan("ee46f7fd-3988-49cd-a972-1056e498302f", "b1da18ee-fabe-42f0-b7f6-0d375e1f505d", (List) null)}); |
|||
final TrustdockVerificationParams paramsSelfie2 = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planSelfie2); |
|||
|
|||
Button startButtonSelfie2 = (Button) this.findViewById(R.id.startButtonSelfie2); |
|||
startButtonSelfie2.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
public final void onClick(View it) { |
|||
//TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsSelfie2); |
|||
requestWithSomeHttpHeaders(planSelfie2); |
|||
} |
|||
})); |
|||
List planE = CollectionsKt.listOf(new TrustdockPlan("f8d1f271-7c95-43bf-bdf8-f84ebe96671d", (String) null, (List) null)); |
|||
final TrustdockVerificationParams paramsE = new TrustdockVerificationParams(publicId, nativeAppSdkToken, planE); |
|||
|
|||
Button startButtonE = (Button) this.findViewById(R.id.startButtonE); |
|||
startButtonE.setOnClickListener((View.OnClickListener) (new View.OnClickListener() { |
|||
public final void onClick(View it) { |
|||
//TrustdockVerificationSDK.Companion.start((Context) getContext(), paramsE); |
|||
requestWithSomeHttpHeaders(planE); |
|||
} |
|||
})); |
|||
} |
|||
|
|||
|
|||
protected void onDestroy() { |
|||
TrustdockVerificationSDK.Companion.unregisterListener(); |
|||
super.onDestroy(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
public void requestWithSomeHttpHeaders(List<TrustdockPlan> plan) { |
|||
RequestQueue queue = Volley.newRequestQueue(this); |
|||
String url = "https://api.test.trustdock.io/v2/verifications?Authorization=rbTme8F4whfAZBuSQcN5gUXr"; |
|||
JsonObjectRequest getRequest = new JsonObjectRequest(Request.Method.POST, url,null, |
|||
new Response.Listener<JSONObject>() |
|||
{ |
|||
@Override |
|||
public void onResponse(JSONObject response) { |
|||
try { |
|||
String publicKey = response.getString("public_id"); |
|||
//setupPlans() |
|||
String nativeAppSdkToken = "rbTme8F4whfAZBuSQcN5gUXr"; |
|||
TrustdockVerificationParams param = new TrustdockVerificationParams( |
|||
publicKey, |
|||
nativeAppSdkToken, |
|||
plan |
|||
); |
|||
TrustdockVerificationSDK.Companion.start((Context) getContext(), param); |
|||
} catch (Exception ex) { |
|||
Log.d("ERROR","error => "+ex.toString()); |
|||
} |
|||
} |
|||
}, |
|||
new Response.ErrorListener() |
|||
{ |
|||
@Override |
|||
public void onErrorResponse(VolleyError error) { |
|||
// TODO Auto-generated method stub |
|||
Log.d("ERROR","error => "+error.toString()); |
|||
} |
|||
} |
|||
) { |
|||
@Override |
|||
public Map<String, String> getHeaders() throws AuthFailureError { |
|||
Map<String, String> params = new HashMap<String, String>(); |
|||
params.put("Authorization", "Bearer SC5ra2f1GDqMaAVZX289bpuH"); |
|||
return params; |
|||
} |
|||
}; |
|||
queue.add(getRequest); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="oval"> |
|||
<size android:width="40dp" android:height="40dp"/> |
|||
<stroke android:width="1dp" android:color="#0C2169" /> |
|||
</shape> |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:shape="oval"> |
|||
<size android:width="40dp" android:height="40dp"/> |
|||
<stroke android:width="1dp" android:color="@color/colorAccent" /> |
|||
</shape> |
@ -0,0 +1,107 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
|||
xmlns:app="http://schemas.android.com/apk/res-auto" |
|||
xmlns:tools="http://schemas.android.com/tools" |
|||
android:layout_width="match_parent" |
|||
android:layout_height="match_parent"> |
|||
|
|||
<!-- <Button--> |
|||
<!-- android:id="@+id/startButtonPPA"--> |
|||
<!-- android:layout_width="145dp"--> |
|||
<!-- android:layout_height="50dp"--> |
|||
<!-- android:layout_marginStart="132dp"--> |
|||
<!-- android:layout_marginTop="4dp"--> |
|||
<!-- android:layout_marginEnd="8dp"--> |
|||
<!-- android:text="Start PPA"--> |
|||
<!-- app:layout_constraintStart_toStartOf="parent"--> |
|||
<!-- app:layout_constraintTop_toTopOf="parent" />--> |
|||
|
|||
<!-- <Button--> |
|||
<!-- android:id="@+id/startButtonRC"--> |
|||
<!-- android:layout_width="279dp"--> |
|||
<!-- android:layout_height="59dp"--> |
|||
<!-- android:text="Start Residence Card Auth"--> |
|||
<!-- app:layout_constraintBottom_toTopOf="@+id/startButtonSelfie"--> |
|||
<!-- app:layout_constraintEnd_toEndOf="parent"--> |
|||
<!-- app:layout_constraintHorizontal_bias="0.449"--> |
|||
<!-- app:layout_constraintStart_toStartOf="parent"--> |
|||
<!-- app:layout_constraintTop_toBottomOf="@+id/startButtonDL"--> |
|||
<!-- app:layout_constraintVertical_bias="0.444" />--> |
|||
|
|||
<!-- <Button--> |
|||
<!-- android:id="@+id/startButtonEKYC"--> |
|||
<!-- android:layout_width="248dp"--> |
|||
<!-- android:layout_height="56dp"--> |
|||
<!-- android:layout_marginStart="8dp"--> |
|||
<!-- android:layout_marginTop="68dp"--> |
|||
<!-- android:layout_marginEnd="8dp"--> |
|||
<!-- android:text="Start eKYC"--> |
|||
<!-- app:layout_constraintBottom_toTopOf="@+id/startButtonSelfie2"--> |
|||
<!-- app:layout_constraintEnd_toEndOf="parent"--> |
|||
<!-- app:layout_constraintHorizontal_bias="0.555"--> |
|||
<!-- app:layout_constraintStart_toStartOf="parent"--> |
|||
<!-- app:layout_constraintTop_toBottomOf="@+id/startButtonSelfie"--> |
|||
<!-- app:layout_constraintVertical_bias="0.357" />--> |
|||
|
|||
<!-- <Button--> |
|||
<!-- android:id="@+id/startButtonDL"--> |
|||
<!-- android:layout_width="372dp"--> |
|||
<!-- android:layout_height="91dp"--> |
|||
<!-- android:layout_marginStart="8dp"--> |
|||
<!-- android:layout_marginTop="32dp"--> |
|||
<!-- android:layout_marginEnd="8dp"--> |
|||
<!-- android:text="Criminal Proceeds Transfer Prevention Law: To_SDK (driver's license)"--> |
|||
<!-- app:layout_constraintBottom_toTopOf="@+id/startButtonSelfie"--> |
|||
<!-- app:layout_constraintEnd_toEndOf="parent"--> |
|||
<!-- app:layout_constraintHorizontal_bias="0.482"--> |
|||
<!-- app:layout_constraintStart_toStartOf="parent"--> |
|||
<!-- app:layout_constraintTop_toTopOf="parent"--> |
|||
<!-- app:layout_constraintVertical_bias="0.261" />--> |
|||
|
|||
<!-- <Button--> |
|||
<!-- android:id="@+id/startButtonSelfie"--> |
|||
<!-- android:layout_width="248dp"--> |
|||
<!-- android:layout_height="56dp"--> |
|||
<!-- android:layout_marginStart="8dp"--> |
|||
<!-- android:layout_marginEnd="8dp"--> |
|||
<!-- android:layout_marginBottom="180dp"--> |
|||
<!-- android:text="Start Selfie Auth"--> |
|||
<!-- app:layout_constraintBottom_toTopOf="@+id/startButtonSelfie2"--> |
|||
|
|||
<!-- app:layout_constraintEnd_toEndOf="parent"--> |
|||
<!-- app:layout_constraintHorizontal_bias="0.496"--> |
|||
<!-- app:layout_constraintStart_toStartOf="parent"--> |
|||
<!-- app:layout_constraintTop_toBottomOf="@+id/startButtonPPA"--> |
|||
<!-- app:layout_constraintVertical_bias="1.0" />--> |
|||
|
|||
<Button |
|||
android:id="@+id/startButtonSelfie2" |
|||
android:layout_width="371dp" |
|||
android:layout_height="96dp" |
|||
android:layout_marginStart="8dp" |
|||
android:layout_marginEnd="8dp" |
|||
android:text="Residence Card / Special Permanent Resident Certificate)" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.0" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toTopOf="parent" /> |
|||
|
|||
<Button |
|||
android:id="@+id/startButtonE" |
|||
android:layout_width="293dp" |
|||
android:layout_height="49dp" |
|||
android:layout_marginStart="8dp" |
|||
android:layout_marginTop="95dp" |
|||
android:layout_marginEnd="8dp" |
|||
android:layout_marginBottom="8dp" |
|||
android:text="Start Criminal Law E Auth" |
|||
app:layout_constraintBottom_toBottomOf="parent" |
|||
app:layout_constraintEnd_toEndOf="parent" |
|||
app:layout_constraintHorizontal_bias="0.401" |
|||
app:layout_constraintStart_toStartOf="parent" |
|||
app:layout_constraintTop_toBottomOf="@+id/startButtonSelfie2" |
|||
app:layout_constraintVertical_bias="0.132" /> |
|||
|
|||
|
|||
</androidx.constraintlayout.widget.ConstraintLayout> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue