BBMSL Limited Online Payment Gateway provides an easy-to-implement payment platform for e-commerce merchants, supporting Visa, Master, Alipay, Wechat Pay, Apple Pay and Google Pay.
This demo is a mock e-commerce application to demonstrate how to implement the BBMSL PayAPI.
- Build SDK verison: 30
- SDK version: 26+
- Android Studio version: 4.0+
- Gradle Version: 6.1.1+
The demo app can then be set up by the following step:
- Get a test merchant account from BBMSL. Contact your account integration manager for details.
- Generate a key pair.
- Upload public key in merchant portal.
- Update
res/xml/merchant.xml
. - Build and run the application.
Note: private key stored in merchant.xml
is for demonstration purpose only. In production, the private key should be stored securely in server.
The demo app demonstrates 3 sample integration modes supported by the BBMSL PayAPI. Main sample logics are included in the package com.bbmsl.payapidemo.ui
.
- Hosted Checkout - class
FragmentHostedCheckout
- Direct API integration - class
FragmentDirectSale
- Tokenization - class
FragmentTokenization
The above modes simulates shopping cart page of an e-commerce app. The checkout process calls the checkout API and receives a checkout URL. The checkout URL will then be pass to FragmentWebview to show the checkout pages.
The class FragmentWebView
is a sample implementation to show the BBMSL checkout web pages. It receives and load the URL passed from fragment argument.
When the transaction ended, either success, failed or cancelled, BBMSL checkout page would call the CallbackURL. The merchant should implement their own callback handling action.
The class FragmentSettings
demonstrates how to clear local cookies to logout user for GooglePay and WechatPay.
The package com.bbmsl.payapidemo.network
contains the methods and dataobjects for API calls using Retrofit.
Documentation about BBMSL Online Payment Gateway: https://docs.bbmsl.com/
Retrofit: https://square.github.io/retrofit/