-
Notifications
You must be signed in to change notification settings - Fork 2
WibmoPay Payment Gateway
This is the documentation for integrating the WibmoPay payment gateway on your Android app.
- UPI
- Cards
- Wallets
- Paytm
- Mobikwik
Add this to your project level build.gradle
file in your studio project
buildscript { repositories { mavenCentral() } }
Add this to your module level build.gradle
file in your studio project
compile 'com.mypoolin:sdk-pg-lite:0.0.7'
Or
<dependency> <groupId>com.mypoolin</groupId> <artifactId>sdk-pg-lite</artifactId> <version>0.0.7</version> </dependency>
Request Parameters | Type | Mandatory |
---|---|---|
"merchantName" |
String | Yes |
"merchantAmount" |
String | Yes |
"merchantTxnId" |
String | Yes |
"merchantKey" |
String | Yes |
"payerName" |
String | No |
"payerMobileNo" |
String | No |
"merchantMessage" |
String | No |
"payerEmailId" |
String | No |
"merchantPaymentOption" |
String | No |
"callbackurl" |
String | Yes |
"checksum" |
String | Yes |
Bundle pgBundle = new Bundle();
pgBundle.putString("merchantName", <YOUR-MERCHANT-ID>); //req
pgBundle.putString("merchantAmount", "1.00"); //req
pgBundle.putString("merchantTxnId", <UNIQUE-TRANSACTION-ID>);//req
pgBundle.putString("merchantKey", <YOUR-MERCHANT-KEY>); //req
pgBundle.putString("payerName", ""); // optional
pgBundle.putString("payerMobileNo", ""); // optional
pgBundle.putString("merchantMessage", "");// optional
pgBundle.putString("payerEmailId", ""); // optional
pgBundle.putString("merchantPaymentOption", "paytm,mobikwik,upi,cards"); // optional
// comma seprated values to enable mode of payments
//ALLOWED options are
/*paytm,
mobikwik,
upi,nb
cards*/
pgBundle.putString("checksum", sha1(<YOUR-MERCHANT-ID>|<UNIQUE-TRANSACTION-ID>|<AMOUNT>|<YOUR-MERCHANT-KEY>)); //req
pgBundle.putString(SDKConstants.KEY_REQUEST_PARAM_MERCHANT_CALLBACK_URL, ""); //req //dummy url
// PRODUCTION https://pgupi.wibmopay.com/callback
// TEST https://testpgupi.wibmopay.com/callback
// CUSTOM https://<YOUR-DOMAIN-CALLBACK-URL> (NOTE: if setting then it Should be notified to the integration/Business team [help@wibmopay.com] )
pgBundle.putBoolean(SDKConstants.KEY_TEST, false); // for switching test& production
Intent pgIntent = new Intent(MainActivity.this, PgMerchantOrderActivity.class);
pgIntent.putExtras(pgBundle);
startActivityForResult(pgIntent, <YOUR-REQUEST-CODE>);
The checksum is a field used to validate the parameters of the transaction. To create the checksum we will require the following fields:
- Username (your merchant username)
- Merchant Transaction ID (merchant_txn_id)
- Amount to be requested (amount)
- Secret/API Key (your merchant secret)
We create a verifying string in the following manner:
username|merchant_txn_id|amount|secret
Here we are using | (pipe) as a separator. Now we will hash this verifying string with sha512 algorithm and pass it in the calls
static String sha1(String input) throws NoSuchAlgorithmException {
MessageDigest mDigest = MessageDigest.getInstance("SHA-512");
byte[] result = mDigest.digest(input.getBytes());
StringBuffer sb = new StringBuffer();
for (int i = 0; i < result.length; i++) {
sb.append(Integer.toString((result[i] & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
}
For testing of java checksum code please visit URL - http://tpcg.io/kc0v6z
The merchants are required to submit a redirection URL to report the completion of the order. You can share your desired redirection URL with our team on email - admin@wibmopay.com
or help@wibmopay.com
and we will configure it for you.
The returning checksum is calculated by using username|order_id|merchant_txn_id|status|secret
and then creating a hash with sha512
algorithm.
Response Parameters | Type | Mandatory |
---|---|---|
"merchant_name" |
String | yes |
"order_id" |
String | yes |
"merchant_txn_id" |
String | yes |
"status" |
String | yes |
"payment_mode" |
String | yes |
"checksum" |
String | yes |
"amount" |
String | yes |
"commission" |
String | yes |
"channel" |
String | yes |
Response parms will be received in the onActivityResult
Intent
Bundle
onActivityResult(int requestCode, int resultCode, Intent data){}
RESULT CODES | Status |
---|---|
RESULT_CANCELED | failed |
RESULT_OK | success |
STATUS CODES | Status | Description |
---|---|---|
COMPLETED | Success | Success |
PENDING | Same as ABORTED but when no response received (user closes the app/browser) | |
ABORTED | Transactions aborted by users midway (user cancels the transaction) | |
FAILED | for cases where there is an error in creation | |
RETRIED | for cases where the same merchant_txn_id is passed | |
DECLINED | In UPI when the collect request is declined by the user | |
SETTLED | COMPLETED transactions settled to your bank/distribution account in T+2 |
Status Codes | Status | Description |
---|---|---|
MC05 | Cancelled By User | If txn Cancelled by User or backpressed |
MC07 | Technical Error | Some Request param issue either in validation or not passed. check Studio Logs |
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case <your - request - code >:
if (resultCode == RESULT_CANCELED) {
Toast.makeText(MainActivity.this, "App: Failed", Toast.LENGTH_SHORT).show();
} else if (resultCode == RESULT_OK) {
if (data != null) {
Bundle bundle = data.getExtras();
String statusCode = bundle.getString("status");
//… other values in bundle mentioned in table in Documentation
}
}
break;
}
}
if you are getting Manifest merger failed
issue then please add
Please add following line to AndroidManifest.xml
<Application ..
..
..
tools:replace="android:theme,android:label">...</Application>
- Home
- Payment Gateway(Wibmo Pay) SDK
- Integration WibmoPay UPI SDK
- Documentaion
- Registration
- Payments
- Splitting
- Important Links
- Sample APP