reversal open
This commit is contained in:
parent
1b68220c9d
commit
b7830491d5
@ -30,11 +30,14 @@ import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||
import com.utsmyanmar.baselib.util.URLValidator;
|
||||
import com.utsmyanmar.paylibs.model.PayDetail;
|
||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation;
|
||||
import com.utsmyanmar.paylibs.utils.enums.TransMenu;
|
||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType;
|
||||
import com.utsmm.kbz.BR;
|
||||
import com.utsmm.kbz.MainViewModel;
|
||||
import com.utsmm.kbz.R;
|
||||
import com.utsmm.kbz.config.data.model.TMSUpdate;
|
||||
import com.utsmm.kbz.databinding.FragmentSettingsModernBinding;
|
||||
import com.utsmm.kbz.ui.core_viewmodel.SharedViewModel;
|
||||
import com.utsmm.kbz.ui.settlement.SettlementViewModel;
|
||||
import com.utsmm.kbz.util.tms.TMSUtil;
|
||||
|
||||
@ -55,6 +58,7 @@ public class SettingsFragment extends DataBindingFragment {
|
||||
|
||||
private SettlementViewModel settlementViewModel;
|
||||
private MainViewModel mainViewModel;
|
||||
private SharedViewModel sharedViewModel;
|
||||
private int count = 0;
|
||||
|
||||
|
||||
@ -67,6 +71,7 @@ public class SettingsFragment extends DataBindingFragment {
|
||||
protected void initViewModel() {
|
||||
settlementViewModel = getFragmentScopeViewModel(SettlementViewModel.class);
|
||||
mainViewModel = getFragmentScopeViewModel(MainViewModel.class);
|
||||
sharedViewModel = getFragmentScopeViewModel(SharedViewModel.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -158,10 +163,10 @@ public class SettingsFragment extends DataBindingFragment {
|
||||
|
||||
private void updateReversalSettings() {
|
||||
boolean isEnabled = SystemParamsOperation.getInstance().isReversalOn();
|
||||
// binding.reversalSwitch.setChecked(isEnabled);
|
||||
// binding.reversalSummary.setText(isEnabled ?
|
||||
// "Automatic reversal enabled for failed transactions" :
|
||||
// "Automatic reversal disabled - Manual reversal only");
|
||||
binding.reversalSwitch.setChecked(isEnabled);
|
||||
binding.reversalSummary.setText(isEnabled ?
|
||||
"Automatic reversal enabled for failed transactions" :
|
||||
"Automatic reversal disabled - Manual reversal only");
|
||||
}
|
||||
|
||||
private void updateMultiHostSettings() {
|
||||
@ -311,6 +316,17 @@ public class SettingsFragment extends DataBindingFragment {
|
||||
}
|
||||
}
|
||||
|
||||
public void onClearBatchClick() {
|
||||
try {
|
||||
sharedViewModel.transactionsType.postValue(TransactionsType.CLEAR_BATCH);
|
||||
sharedViewModel.setTransMenu(TransMenu.CLEAR_BATCH);
|
||||
Navigation.findNavController(requireActivity(), R.id.nav_host_fragment)
|
||||
.navigate(R.id.inputPasswordFragment);
|
||||
} catch (Exception e) {
|
||||
LogUtil.e(TAG, "Error in clear batch click: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void onTmsConfigClick() {
|
||||
try {
|
||||
LogUtil.d(TAG, "TMS Config clicked");
|
||||
@ -446,4 +462,4 @@ public class SettingsFragment extends DataBindingFragment {
|
||||
showDeclineDialog(getResourceString(R.string.txt_error_occurred));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -542,15 +542,16 @@ public class InputRRNFragment extends DataBindingFragment {
|
||||
// }
|
||||
|
||||
} else {
|
||||
terminatedTransRefund(isECR);
|
||||
|
||||
PayDetail newPay = transProcessViewModel.getPayDetail();
|
||||
newPay.setReferNo(rrnNo);
|
||||
|
||||
transProcessViewModel.setPayDetail(newPay);
|
||||
|
||||
sharedViewModel.rrNNo.setValue(rrnNo);
|
||||
|
||||
callNextScreen();
|
||||
// PayDetail newPay = transProcessViewModel.getPayDetail();
|
||||
// newPay.setReferNo(rrnNo);
|
||||
//
|
||||
// transProcessViewModel.setPayDetail(newPay);
|
||||
//
|
||||
// sharedViewModel.rrNNo.setValue(rrnNo);
|
||||
//
|
||||
// callNextScreen();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,83 +718,83 @@
|
||||
|
||||
<!--<!– </androidx.cardview.widget.CardView>–>-->
|
||||
|
||||
<!-- <!– Automatic Reversal Card –>-->
|
||||
<!-- <androidx.cardview.widget.CardView-->
|
||||
<!-- android:id="@+id/reversalCard"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginBottom="12dp"-->
|
||||
<!-- android:clickable="true"-->
|
||||
<!-- android:foreground="?android:attr/selectableItemBackground"-->
|
||||
<!-- android:onClick="@{()->click.onReversalClick()}"-->
|
||||
<!-- app:cardBackgroundColor="@color/white"-->
|
||||
<!-- app:cardCornerRadius="16dp"-->
|
||||
<!-- app:cardElevation="2dp">-->
|
||||
<!-- Automatic Reversal Card -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/reversalCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:onClick="@{()->click.onReversalClick()}"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp">
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:gravity="center_vertical"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:padding="20dp">-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="20dp">
|
||||
|
||||
<!-- <androidx.cardview.widget.CardView-->
|
||||
<!-- android:layout_width="48dp"-->
|
||||
<!-- android:layout_height="48dp"-->
|
||||
<!-- android:layout_marginEnd="16dp"-->
|
||||
<!-- app:cardBackgroundColor="@color/colorPrimary"-->
|
||||
<!-- app:cardCornerRadius="24dp"-->
|
||||
<!-- app:cardElevation="0dp">-->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
app:cardBackgroundColor="@color/colorPrimary"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="24dp"-->
|
||||
<!-- android:layout_height="24dp"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:src="@drawable/ic_swap"-->
|
||||
<!-- app:tint="@color/white" />-->
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_swap"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<!-- </androidx.cardview.widget.CardView>-->
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:fontFamily="@font/rubik_medium"-->
|
||||
<!-- android:text="Automatic Reversal"-->
|
||||
<!-- android:textColor="@color/colorTextTitle"-->
|
||||
<!-- android:textSize="18sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- tools:fontFamily="sans-serif-medium" />-->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/rubik_medium"
|
||||
android:text="Automatic Reversal"
|
||||
android:textColor="@color/colorTextTitle"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:fontFamily="sans-serif-medium" />
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/reversalSummary"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="2dp"-->
|
||||
<!-- android:fontFamily="@font/rubik_regular"-->
|
||||
<!-- android:text="Automatic reversal enabled for failed transactions"-->
|
||||
<!-- android:textColor="@color/colorTextContent"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- tools:fontFamily="sans-serif" />-->
|
||||
<TextView
|
||||
android:id="@+id/reversalSummary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:fontFamily="@font/rubik_regular"
|
||||
android:text="Automatic reversal enabled for failed transactions"
|
||||
android:textColor="@color/colorTextContent"
|
||||
android:textSize="14sp"
|
||||
tools:fontFamily="sans-serif" />
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <Switch-->
|
||||
<!-- android:id="@+id/reversalSwitch"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="8dp"-->
|
||||
<!-- android:clickable="false"-->
|
||||
<!-- android:focusable="false" />-->
|
||||
<Switch
|
||||
android:id="@+id/reversalSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false" />
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
</LinearLayout>
|
||||
|
||||
<!-- </androidx.cardview.widget.CardView>-->
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- <!– Multi-Host Support Card –>-->
|
||||
<!-- <androidx.cardview.widget.CardView-->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user