Version: 2.1.3

Confirm Transaction with User

In the payments screen, when the user clicks on BharatX for payment, we need to confirm the transaction first. To do that, add the following:

Your Android App
public class PaymentActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// ...
bharatxPaymentOption.setOnClickListener(new View.OnClickListener() {
@Override
void onClick(View view) {
BharatXCommonUtilManager.confirmTransactionWithUser(
PaymentActivity.this,
amountInPaise,
phoneNumber,
new BharatXCommonUtilManager.TransactionConfirmationListener() {
@Override
public void onUserConfirmedTransaction() {
// user confirmed that they want to proceed with the transaction!
}
@Override
public void onUserAcceptedPrivacyPolicy() {
// user accepted privacy policy.
// register our Alternate Data manager.
AlternateDataManager.register(MainActivity.this);
}
@Override
public void onUserCancelledTransaction() {
// user cancelled transaction.
// allow user to choose other payment options.
}
// optional
@Override
public void onFailure(
@NotNull BharatXCommonUtilManager.TransactionFailureReason transactionFailureReason
) {
// could not get transaction confirmation
// from the user due to a failure
}
});
}
});
// ...
}
}