diff --git a/app/src/main/java/com/nivesh/production/niveshfd/api/ApiCallback.kt b/app/src/main/java/com/nivesh/production/niveshfd/api/ApiCallback.kt index 51e83d9..60cb275 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/api/ApiCallback.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/api/ApiCallback.kt @@ -14,15 +14,12 @@ abstract class ApiCallback : Callback> { override fun onResponse(call: Call>, response: Response>) { if (response.isSuccessful && response.body() != null && response.code() == 200) { onSuccess(response.body()!!) - } else { + } else if (response.code() == 650){ // handle 4xx & 5xx error codes here // val resp = Resource() // resp.status = false // resp.message = response.message() // onFailure(resp) - - - } } diff --git a/app/src/main/java/com/nivesh/production/niveshfd/interfaces/ApiInterface.kt b/app/src/main/java/com/nivesh/production/niveshfd/interfaces/ApiInterface.kt index a7f3f7a..ab99e49 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/interfaces/ApiInterface.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/interfaces/ApiInterface.kt @@ -44,12 +44,6 @@ interface ApiInterface { @Header("token") token: String ): Response - @POST("UpdateFDPaymentStatus") - suspend fun updateFDPaymentStatus( - @Body requestBody: RequestBody, - @Header("token") token: String - ): Response - @POST("FinaliseFD") suspend fun finaliseFD( @Body requestBody: FinalizeFDRequest, diff --git a/app/src/main/java/com/nivesh/production/niveshfd/ui/activity/NiveshFdMainActivity.kt b/app/src/main/java/com/nivesh/production/niveshfd/ui/activity/NiveshFdMainActivity.kt index f8f03e9..6583c1f 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/ui/activity/NiveshFdMainActivity.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/ui/activity/NiveshFdMainActivity.kt @@ -2,6 +2,7 @@ package com.nivesh.production.niveshfd.ui.activity import android.annotation.SuppressLint import android.app.Dialog +import android.content.Intent import android.graphics.Bitmap import android.graphics.drawable.Drawable import android.os.Bundle @@ -485,4 +486,10 @@ class NiveshFdMainActivity : BaseActivity() { } } + fun retryMethod() { + val intent: Intent = getIntent() + finish() + startActivity(intent) + } + } \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFiveNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFiveNiveshFDFragment.kt index 92adfac..7aa9f5f 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFiveNiveshFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFiveNiveshFDFragment.kt @@ -33,11 +33,13 @@ class StepFiveNiveshFDFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding.tvCongrats.text = "" - binding.tvSuccessMessage.text = "" binding.btnViewOrder.setOnClickListener { } + + binding.tvRetry.setOnClickListener{ + (activity as NiveshFdMainActivity).retryMethod() + } } fun getData(paymentReQueryResponse: PaymentReQueryResponse) { @@ -55,16 +57,21 @@ class StepFiveNiveshFDFragment : Fragment() { } }else{ if (paymentReQueryResponse.Response.Message.isNotEmpty()) { - val arrOfStr: List = paymentReQueryResponse.Response.Message.split(" ", limit = 2) - binding.tvCongrats.text = arrOfStr[0] - binding.tvCongrats.setTextColor( - ContextCompat.getColor( - activity as NiveshFdMainActivity, - R.color.red + if (paymentReQueryResponse.Response.Message.isNotEmpty()) { + val arrOfStr: List = + paymentReQueryResponse.Response.Message.split(" ", limit = 2) + binding.tvCongrats.text = arrOfStr[0] + binding.tvCongrats.setTextColor( + ContextCompat.getColor( + activity as NiveshFdMainActivity, + R.color.red + ) ) - ) - binding.tvSuccessMessage.text = arrOfStr[1] + binding.tvSuccessMessage.text = arrOfStr[1] + } } + binding.tvRetry.visibility = View.VISIBLE + binding.btnViewOrder.visibility = View.GONE } finalizeFDApi() finalizeKYCApi() @@ -164,8 +171,6 @@ class StepFiveNiveshFDFragment : Fragment() { } - - override fun onDestroyView() { super.onDestroyView() _binding = null