Please note this package is no longer working.
Please check the demo for new integration: Demo
Please contact me at: contact@bikramlama.com.np or call me at 9808134818 for new integration.
Himalayan Bank Payment Integration - Laravel Package
HBL Laravel Package can be used to generate himalayan bank payment requests.
This package can be installed through Composer.
composer require thebikramlama/hbl
Publish hbl.php
config file for configuration
php artisan vendor:publish --provider="Thebikramlama\Hbl\HblServiceProvider"
Edit the configuration file in config/hbl.php
"merchantId" => "987654321", // Merchant ID provided by Himalayan Bank
"secretKey" => "abcdef0987654321", // Secrect Key associated with the Merchant ID
"currencyCode" => "NPR", // Currency type: USD, NPR
"nonSecure" => "Y", // Option for OTP authentication Y/N, Y means disable authentication
"methodUrl" => "https://hblpgw.2c2p.com/HBLPGW/Payment/Payment/Payment", // Only update URL if needed
"clickContinue" => false, // Click to continue for Payment Page redirection true/false
"redirectWait" => 1500, // Redirect wait time in miliseconds, set 0 for no wait time
After the installation is complete, Hbl
alias is generated by default.
// Using Default Alias
use Hbl;
Syntax for creating a payment request
Hbl::payment($amount, $identifier, $description, $userDefinedValuesArr, $merchantID, $merchantSecret, $currencyCode, $nonSecure);
$amount
(integer, required): Amount to be paid$identifier
(integer, optional): Unique identifier used for invoicing. (Can be order ID)$description
(text, optional): Description text to display on payment page/invoice.$userDefinedValuesArr
(array, optional): Custom values to be sent and receive as postback. (Eg: verification data)$merchantID
(optional): Custom merchant other than config file, use this argument if you intend to use multiple accounts for payment.$merchantSecret
(optional): Use the secret key related to the custom merchantID$currencyCode
(optional): Use this argument if you intend to use multiple Currency payments. Available options: "NPR", "USD"$nonSecure
(optional): Use this argument to enable/disable OTP authentication. Available options: "Y", "N" (Y means disable)
Example with just amount
$amount = 250;
Hbl::payment($amount); // This will create and redirect to the payment page of Rs/$ 250
Example with more arguments
// $booking is a dynamic collection
$amount = $booking->amount;
$identifier = $booking->id;
$description = "Booking Payment.";
$userDefinedValues = [
"bookingUser" => $booking->user,
"paymentHash" => md5($amount.'MySecretSalt') // To use the hash to verify pament later
];
// Make a payment request
Hbl::payment($amount, $identifier, $description, $userDefinedValues);
Example with full arguments
// $booking is a dynamic collection
$amount = $booking->amount;
$identifier = $booking->id;
$description = "Booking Payment.";
$userDefinedValues = [
"bookingUser" => $booking->user,
"paymentHash" => md5($amount.'MySecretSalt') // To use the hash to verify pament later
];
// Custom Merchant
$merchantID = "123456789";
$merchantSecret = "abcdef1234567890";
$currencyCode = "USD";
$nonSecure = "N";
// Make a payment request
Hbl::payment($amount, $identifier, $description, $userDefinedValues, $merchantID, $merchantSecret, $currencyCode, $nonSecure);
// This code will generate a payment page with custom merchant, Currency in US Dollars and Enable OTP authentication
- Route names:
hbl.index
,hbl.error
are created by the package, please do not override. - Custom Views: Create custom views folder under
resources/views/vendor/hbl/
, copy the original view files from:vendor/thebikramlama/hbl/src/views/
The MIT License (MIT). Please see License File for more information.