Migrating from 1.x.x to 2.x.x
This migration is fairly simple. The changes for each SDK are highlighted.
- Java
- Kotlin
- React Native
- Flutter
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 } }); } }); // ... }}
Your Android App
class PaymentActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { // ... bharatxPaymentOption.setOnClickListener { BharatXCommonUtilManager.confirmTransactionWithUser( this@PaymentActivity, amountInPaise, phoneNumber, object : BharatXCommonUtilManager.TransactionConfirmationListener() { override fun onUserConfirmedTransaction() { // user confirmed that they want to proceed with the transaction! }
override fun onUserAcceptedPrivacyPolicy() { // user accepted privacy policy. // register our Alternate Data manager. AlternateDataManager.register(this@MainActivity) }
override fun onUserCancelledTransaction() { // user cancelled transaction. // allow user to choose other payment options. }
// optional override fun onFailure( transactionFailureReason: BharatXCommonUtilManager.TransactionFailureReason ) { // could not get transaction confirmation // from the user due to a failure } }) } // ... }}
Uh-oh! We don't have this version rolled out for React Native just yet. Stay tuned 😉
Uh-oh! We don't have this version rolled out for Flutter just yet. Stay tuned 😉