Overview

Updated: 13 September, 2023

Introduction

Bohudur In-built payment gateway is a free gateway feature which helps you to create your own payment gateway which you can intrigate in your website or application. No need to handle payments manually anymore.

Setup Bohudur Payment Gateway

All Resources:

App Inventors Intrigation

If you want to intrigate Bohudur In-built Payment Gateway in App Inventors then you need to use CustomWebView Extension. Because the default WebView component we get in builders isn't enough to intrigate Bohudur Gateway. You can download the extension from here: https://community.kodular.io/t/customwebview-an-extended-form-of-web-viewer/63037

Intrigation Video

Intrigation Blocks Images

Normal Intrigation

Image

Full Intrigation

Image

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/uc?export=download&id=1LZU4zfb0GhgZ6Nd3CqfU1eH3nCYyI6q1

Intrigation Video

Intrigation Blocks Images

Normal Intrigation

Image

Android Studio Intrigation

If you want to intrigate Bohudur In-built 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.

Java Code


public class MainActivity extends AppCompatActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		WebView webView = findViewById(R.id.webView);
		
		WebSettings webSettings = webView.getSettings();
		webSettings.setJavaScriptEnabled(true);
		webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
		webView.setWebChromeClient(new WebChromeClient() {
			@Override
			public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
				String message = consoleMessage.message();

				if (!message.equals("cancelled")) {
					try {
						JSONObject jSONObject = new JSONObject(consoleMessage.message());
						String _pay_id = jSONObject.getString("ID");
						String _banking = jSONObject.getString("Gateway");
						String _method = jSONObject.getString("Method");
						String _sender = jSONObject.getString("Sender");
						String _amount = jSONObject.getString("Amount");
						String _trx = jSONObject.getString("Trx");
						String _time = jSONObject.getString("Time");

						if (jSONObject.getString("message").equals("পেমেন্ট সফল হয়েছে।")) {
							Toast.makeText(MainActivity.this,"Payment Successful",Toast.LENGTH_LONG).show();
						}
					} catch (JSONException e) {
					}
				} else {
				}
				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:resolve?")) {
					Intent telegramIntent = new Intent(Intent.ACTION_VIEW);
					telegramIntent.setData(Uri.parse("tg:resolve?domain=bohudur"));
					startActivity(telegramIntent);
					return true;
				}
				view.loadUrl(url);
				return false;
			}
		});

		try {
			webView.postUrl("https://pay.example.com/", "amount=10".getBytes("UTF-8"));
		} catch (UnsupportedEncodingException e) {
		}
	}
}
                                 

Returned Parameters After Payment

Param Name Data Type Description
ID 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.
Status string it's status of payment.
Message string it's a message which is automatically provided by Bohudur In-built Payment Gateway

Response After Payment

Response:

{"ID":"1","Gateway":"upay","Method":"Cash In","Sender":"01700000000","Amount":"10","Trx":"01GY9PY31N","Time":"18/04/2023 14:15","status":"success","message":"পেমেন্ট সফল হয়েছে।"}