Skip to main content
Version: 1.0.6

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,          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.            }        });      }    });    // ...  }}