Updated 31 March 2021
In this blog, we will learn about “Razer Merchant Payment Gateway” SDK Integration in android. It will help the merchant to sell products online to reach out to the regionals customers.
Razer Merchant Services (RMS) collecting the payment from the customer and distribute it to the merchant. It will provide you online secure transactions with various payment channels (methods). If you want to manage multiple payment methods in a single payment Gateway, Razer Merchant Services is one of them.
RMS will provide you with multiple payment methods similarly – AmOnline, RazerPay, GrabPay, Boost, KFH Online, and many others. Currently, its mainly used in the South-East Asian market.
Razer Merchant Payment Gateway SDK Integration is very simple, parsing some parameters from the Razer merchant dashboard. Like merchant_id, verify Key, secret_key (private key), and some Payment details product_amount, order_id, currency, etc…
Customers will start the transaction process on the internet banking or any payment channel with transaction details. Then RMS will verify the transaction details and send transaction details to the bank. Meanwhile, Bank will process the transaction and return the transaction as a result to RMS, If the payment completed after that RMS will redirect the customers to the merchant application.
We are showing an example of how to integrate this payment gateway in the Android app with the help of the source so you can understand it easily.
Add SDK dependency in your build.gradle file-
1 |
implementation 'com.molpay:molpay-mobile-xdk-android:3.29.1' |
Prepare the Payment details in HashMap-
1 |
HashMap<String, Object> paymentData = new HashMap<>(); |
1 2 3 4 5 6 |
// Mandatory String params from RMS Dashboard. paymentData.put(MOLPayActivity.mp_username, "api_test"); paymentData.put(MOLPayActivity.mp_password, "api_test12"); paymentData.put(MOLPayActivity.mp_merchant_ID, "test_merchant"); paymentData.put(MOLPayActivity.mp_app_name, "appname"); paymentData.put(MOLPayActivity.mp_verification_key, "verify_key"); |
1 2 3 4 5 |
// Mandatory String params Payment details. paymentData.put(MOLPayActivity.mp_amount, "1.10"); paymentData.put(MOLPayActivity.mp_order_ID, "123456"); paymentData.put(MOLPayActivity.mp_currency, "MYR"); paymentData.put(MOLPayActivity.mp_country, "MY"); |
1 2 |
//Optional, You can Use 'multi' for all available channels option. paymentData.put(MOLPayActivity.mp_channel, "multi"); |
1 2 3 |
// Optional, show individual channels. String[] channelLis = {"credit","hlb"}; paymentData.put(MOLPayActivity.mp_allowed_channels, channelLis); |
Now, you can start Razer Merchant SDK using startActivityForResult-
1 2 3 4 |
//Start the payment SDK module Intent intent = new Intent(this, MOLPayActivity.class); intent.putExtra(MOLPayActivity.MOLPayPaymentDetails, paymentData); startActivityForResult(intent, MOLPayActivity.MOLPayXDK); |
Handle the RMS SDK callback is very simple as a result you will get payment status in onActivityResult as JSON string:
1 2 3 4 5 6 7 8 9 |
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == MOLPayActivity.MOLPayXDK && resultCode == RESULT_OK) { Log.d(TAG, "RMSResult = " + data.getStringExtra(MOLPayActivity.MOLPayTransactionResult)); } } |
If the customer will complete online transactions through RMS, RMS will return as a result of transactions like:-
“status_code” – “00” for Success, “11” for Failed, “22” for Pending.
“amount” – Transaction amount
“paydate” – Transaction date
“order_id” – Transaction order id
“channel” – Transaction channel name
“txn_ID” – Transaction id
In conclusion, we have learned about “Razer Merchant Services” and Razer Merchant Payment Gateway SDK Integration In Android.
To learn more about Razer Merchant Services, please check the following link: Razer Merchant Services
I hope, this blog will be helpful to you.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.