Overview
Updated: 10 February, 2024
Introduction
Bohudur Firebase payment gateway is a free gateway feature which helps you to create your own payment gateway which you can intrigate in your application. No need to handle payments manually anymore. No hosting is required for it. It's totally free provided by Bohudur Firebase.
Resources
- Bohudur Firebase payment gateway link https://bohudurfirebasepayment.pages.dev/
- Download gateway from here https://drive.google.com/uc?export=download&id=1M48UnTuu33cAzGCzPsLtkiill7CrTr0r
App Inventors Intrigation
If you want to intrigate Bohudur Firebase Payment Gateway in App Inventors then you need to use two WebView. One for payment request and another one for deleting payment data after payment successful. It's necessary. Here is a demo aia file: https://drive.google.com/uc?export=download&id=1M8xS3QleTFR_uqtC3U5c3a-nQ_V8syH_
Intrigation Video
Intrigation Blocks Images
Normal Intrigation
Sketchware Pro Intrigation
Normal Intrigation
Sketchware Pro Intrigation
If you want to intrigate Bohudur In-built Payment Gateway in Sketchware Pro then you can use our gateway blocks which is made for Sketchware Pro. You can download it from here: https://drive.google.com/file/d/12ucHPj336hVtJCPmkvS9FImkJ5EIEyzC/view?usp=drivesdk .
You can also download a demo SWB file from here: https://drive.google.com/file/d/12EOGudBhnvhyBXlbm-uUlpG6hzRzBbxe/view?usp=drivesdk
Intrigation Video
Blocks Images
Full Intrigation
Android Studio Intrigation
Full Intrigation
Android Studio Intrigation
If you want to intrigate Bohudur Firebase Payment Gateway in Android Studio and similar platforms then you can use WebView. Here is full code of Mainactivity where WebView is intrigated with Bohudur In-built Payment Gateway. Definately you need to use two WebView.
Java Code
public class MainActivity extends AppCompatActivity {
private RequestQueue requestQueue;
private String baseUrl = "http://your-server-address.com";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
private void paymentRequest() {
String _mainURL = "https://paymentgatewaylink/index.html?";
String _bKashEnabled = "";
String _nagadEnabled = "";
String _rocketEnabled = "";
String _upayEnabled = "";
String _bKashNumher = "";
String _nagadNumber = "";
String _rocketNumber = "";
String _upayNumber = "";
String _to = "";
String _from = "";
String _amount = "";
String _bohudurID = "";
String _apiKey = "";
String _databseURL = "";
String _authDomain = "";
String _email = "";
String _password = "";
String _telegramUsername = "";
String _supportEmail = "";
WebView webView = findViewById(R.id.webView);
webView.loadUrl(_mainURL + "bkash=" + _bKashEnabled + "&nagad=" + _nagadEnabled + "&rocket=" + _rocketEnabled
+ "&upay=" + _upayEnabled + "&bkash_number=" + _bKashNumher + "&nagad_number=" + _nagadNumber
+ "&rocket_number=" + _rocketNumber + "&upay_number=" + _upayNumber + "&paymentFrom=" + _from
+ "&paymentTo=" + _to + "&amount=" + _amount + "&bohudur_id=" + _bohudurID + "&api=" + _apiKey
+ "&base_url=" + _databseURL + "&auth_domain=" + _authDomain + "&email=" + _email + "&password="
+ _password + "&telegramUsername=" + _telegramUsername + "&supportEmail=" + _supportEmail);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
if (!message.equals("{}")) {
try {
JSONObject jSONObject = new JSONObject(message);
String _retrievePaymentKey = jSONObject.getString("paymentKey");
String _retrieveBanking = jSONObject.getString("Gateway");
String _retrieveMethod = jSONObject.getString("Method");
String _retrieveSender = jSONObject.getString("Sender");
String _retrieveAmount = jSONObject.getString("Amount");
String _retrieveTrx = jSONObject.getString("Trx");
String _retrievetime = jSONObject.getString("Time");
} catch (JSONException e) {
}
}
return super.onConsoleMessage(consoleMessage);
}
});
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
String url = request.getUrl().toString();
if (url.startsWith("tg:")) {
Intent telegramIntent = new Intent(Intent.ACTION_VIEW);
telegramIntent.setData(Uri.parse("https://t.me/" + _telegramUsername));
startActivity(telegramIntent);
return true;
} else if (url.startsWith("mailto:")) {
String emailAddressURL = "mailto:" + _supportEmail;
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse(emailAddressURL));
startActivity(emailIntent);
return true;
}
return false;
}
});
}
private void deletePayment() {
WebView webView = findViewById(R.id.webViewD);
String mainURLD = "https://paymentgatewaylink/delete.html?api=";
String apiD = "";
String databse_urlD = "";
String authDomainD = "";
String project_idD = "";
String bohudur_idD = "";
String unique_idD = "";
String trxD = "";
String emailD = "";
String passwordD = "";
WebView webViewD = webView;
WebSettings webSettingsD = webViewD.getSettings();
webSettingsD.setJavaScriptEnabled(true);
webSettingsD.setCacheMode(WebSettings.LOAD_NO_CACHE);
webViewD.setWebViewClient(new WebViewClient());
webViewD.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
if (message.equals("successful")) {
//payment deleted successfully. You can do any action after it.
}else {
//failed to delete payment. Do any action you want to do after failed.
}
return super.onConsoleMessage(consoleMessage);
}
});
webViewD.loadUrl(mainURLD + apiD + "&authDomain=" + authDomainD
+ "&database_url=" + databse_urlD + "&project_id=" + project_idD + "&bohudur_id=" + bohudur_idD
+ "&uniqueId=" + unique_idD + "&trx=" + trxD + "&email=" + emailD + "&password=" + passwordD);
}
}
Returned Parameters After Payment
Param Name | Data Type | Description |
---|---|---|
PaymentID |
string | It's an unique id which is generatd when payment stores on database |
Gateway |
string | It's name of payment service that user used like bKash |
Method |
string | Method means It's cash in or send money |
Sender |
string | it's the number of payment sender account |
Amount |
string | Amount is how much money user paid |
Trx |
string | it's transaction id of payment |
Time |
string | it's time of payment. |
Response After Payment
{"Amount":"10", "Gateway":"bKash", "Method":"Send Money", "Sender":"01900000000","Time":"01/01/2024 23:16", "Trx": "BKOG7UFK50", "paymentKey":"-NqO_39NACCZh78XLhCN"}