Commerce SDK - Android

Step 1: Obtain your API Key

To get set up with an API Key please email us at support@bidali.com with your request.

Step 2: Install with gradle

  1. Add the JitPack repository to your build file

    allprojects {
      repositories {
        ...
        maven { url 'https://jitpack.io' }
      }
    }
    
  2. Add the dependency to your build.gradle file

    dependencies {
      implementation 'com.github.bidalihq:commerce-sdk-android:0.0.2@aar'
    }
    
  3. Add the appropriate imports

     import com.bidali.commerce.BidaliSDK;
     import com.bidali.commerce.BidaliSDKOptions;
     import com.bidali.commerce.PaymentRequest;
    

Usage

Default options

Java
// This should go inside a click handler
BidaliSDKOptions options = new BidaliSDKOptions("YOUR API KEY");
options.listener = new BidaliSDK.BidaliSDKListener() {
    @Override
    public void onPaymentRequest(PaymentRequest paymentRequest) {

    }
};
BidaliSDK bidaliSDK = new BidaliSDK(context);
bidaliSDK.show(context, options);
Kotlin
// This should go inside a click handler
val options = BidaliSDKOptions("YOUR API KEY")
options.listener = object : BidaliSDK.BidaliSDKListener {
  override fun onPaymentRequest(paymentRequest: PaymentRequest) {

  }
}
val bidaliSDK = BidaliSDK(context)
bidaliSDK.show(this, options)

Pay with Dai only

Java
// This should go inside a click handler
options.paymentCurrencies = new ArrayList<String>() {
  {
    add("DAI");
  }
};
Kotlin
options.paymentCurrencies = object : ArrayList<String>() {
  init {
      add("DAI")
  }
}

Prefilling a customers email address

This will pre-populate the users email address and they will be prompted to confirm it in the checkout flow

Java
// This should go inside a click handler
options.email = "user@email.com";

A PaymentRequest has the following properties:

Property Type Description
address String The address to send to
amount String The amount of currency to send to address
currency String The symbol of the currency the user has chosen to pay with, ex: BTC
chargeDescription String Description of the order, can be used on your payment approval screen so the user sees what they are approving payment for. Ex: 1 x Gift Card - Amazon $20 CAD
chargeId String The users order reference, helpful to reference the order in the future or if there are any issues. Ex: vIQ807gvR
extraId String The extraId that must be passed for the payment to be credited appropriately to the order. Currently only applicable to XLM, XRP, EOS, XEM, BNB, and ARDR
extraIdName String The name of the extraId that must be sent with the transaction. Currently only applicable to XLM, XRP, EOS, XEM, BNB, and ARDR

Note for Stellar Lumens (XLM), XRP, EOS, NEM (XEM), Binance BEP2 (BNB), and Ardor (ARDR)

Below are the additional fields that will be populated on the BidaliPaymentRequest and MUST be passed with the transaction for it to be successful.

Name currency extraIdName
Stellar Lumens XLM Memo.id
Binance BEP2 BNB memo
EOS EOS Memo
XRP XRP Destination Tag
Ardor ARDR Message
NEM XEM Message

results matching ""

    No results matching ""