📖 Documentation

Overview

The bKash Blogger integration provides a simple JavaScript-based solution for accepting bKash payments on your Blogger/Blogspot website. This solution works entirely on the client-side, making it perfect for static sites.

Core Components

1. bkash-payment.js

The main payment processing script that handles bKash API integration.

<script src="bkash-payment.js"></script>

2. blogger.js

Helper functions specifically designed for Blogger integration.

<script src="blogger.js"></script>

API Reference

bkashBlogger.initButton()

Initializes a payment button with bKash integration.

bkashBlogger.initButton(buttonId, amountInputId);

Parameters:

Example Usage

<!-- Add input field for amount -->
<input id="amount" type="number" placeholder="Enter amount" />

<!-- Add payment button -->
<button id="payBtn">Pay with bKash</button>

<!-- Include scripts -->
<script src="bkash-payment.js"></script>
<script src="blogger.js"></script>

<!-- Initialize button -->
<script>
  bkashBlogger.initButton('payBtn', 'amount');
</script>

Configuration

Setting Up Credentials

Before going live, you need to configure your bKash merchant credentials in bkash-payment.js:

window.bkashCreds = {
  merchantNumber: 'YOUR_MERCHANT_ID',
  username: 'YOUR_USERNAME',
  password: 'YOUR_PASSWORD',
  appKey: 'YOUR_APP_KEY',
  appSecret: 'YOUR_APP_SECRET'
};

Environment

For testing, use sandbox credentials from bKash Developer Portal. For production, replace with live credentials.

Payment Flow

  1. User enters amount and clicks payment button
  2. Script generates a unique invoice ID
  3. Opens bKash payment popup window
  4. User completes payment on bKash platform
  5. Popup closes and returns to your site

Security Notes

Browser Support

This solution works on all modern browsers including: