I have this information from the Binance page, and I need to integrate the SDK into a B4A application. On the other hand, they provide a library called: binance_pay_sdk_v1.0.0.aar. Is it possible to integrate an .aar library into B4A? This is the information provided on the page.
Integrate SDK for Android
Requirements
- Android 4.1+
- Support AndroidX
Import SDK
- Download binance_pay_sdk_v1.0.0.aar
- Add binance_pay_sdk_v1.0.0.aar into libs directory
- Add dependence for app module, just like this:
android{
repositories {
flatDir {
dirs 'libs'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation (name: 'binance_pay_sdk_v1.0.0', ext: 'aar')
Create BinancePayListener
class PayListener : BinancePayListener {
override fun onSuccess() {
// When the payment is successful, this will be called
}
override fun onCancel() {
// When the payment is canceled, this will be called
}
override fun onError(exception: BinancePayException) {
// When there is an error in the payment process,this will be called
}
}
val listener = PayListener()
2. To Pay
2.1 Crypto payments(C2B)
val param = BinancePayParam(merchantId, prepayId, timeStamp, nonceStr, certSn, sign)
val binancePay = BinancePayFactory.getBinancePay(context)
binancePay.pay(param, listener)