blinkpay/laravel is a Laravel package for blinkpay payment gateway integration for laravel.
It currently has 0 GitHub stars and 2 downloads on Packagist (latest version v1.2.1).
Install it with composer require blinkpay/laravel.
Discover more Laravel packages by blinkpay
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package for integrating BlinkPay payment gateway into your Laravel applications.
You can install the package via composer:
composer require blinkpay/laravel
Publish the configuration file:
php artisan vendor:publish --provider="BlinkPay\Laravel\BlinkPayServiceProvider"
Add the following to your .env file:
BLINK_PAYMENTS_USERNAME=your_username
BLINK_PAYMENTS_PASSWORD=your_password
BLINK_PAYMENTS_MERCHANT_ID=your_merchant_id
BLINK_PAYMENTS_MERCHANT_PASSWORD=your_merchant_password
BLINK_PAYMENTS_API_URL=your_api_url
BLINK_PAYMENTS_BANKING_API_URL=your_banking_api_url
BLINK_PAYMENTS_DEFAULT_EXCHANGE_RATE=3700
BLINK_PAYMENTS_EXCHANGE_RATE_KEY=your_exchange_rate_key
BLINK_PAYMENTS_CONVERT_TO_UGX=false
use BlinkPay\Laravel\Facades\BlinkPay;
class PaymentController extends Controller
{
public function processMobileMoneyPayment(Request $request)
{
try {
$result = BlinkPay::mobileMoney([
'order_id' => $request->order_id,
'amount' => $request->amount,
'currency' => $request->currency,
'phone_number' => $request->phone_number
]);
return response()->json($result);
} catch (\Exception $e) {
return response()->json(['error' => $e->getMessage()], 400);
}
}
}
use BlinkPay\Laravel\Facades\BlinkPay;
class PaymentController extends Controller
{
public function processCreditCardPayment(Request $request)
{
try {
$result = BlinkPay::processCreditCardPayment([
'order_id' => $request->order_id,
'amount' => $request->amount,
'currency' => $request->currency,
'card_number' => $request->card_number,
'expiry_month' => $request->expiry_month,
'expiry_year' => $request->expiry_year,
'cvv' => $request->cvv,
'card_holder_name' => $request->card_holder_name,
'billing_address' => $request->billing_address,
'billing_city' => $request->billing_city,
'billing_country' => $request->billing_country,
'billing_postal_code' => $request->billing_postal_code
]);
return response()->json($result);
} catch (\Exception $e) {
return response()->json(['error' => $e->getMessage()], 400);
}
}
}
The package supports automatic currency conversion to UGX. This can be enabled by setting BLINK_PAYMENTS_CONVERT_TO_UGX=true in your .env file.
When enabled:
BLINK_PAYMENTS_DEFAULT_EXCHANGE_RATEBLINK_PAYMENTS_EXCHANGE_RATE_KEYAll payment methods return a response in the following format:
{
"status": "SUCCESS|FAILED|PENDING",
"message": {
"reference_code": "transaction_reference",
"status": "transaction_status",
"details": "Additional transaction details"
}
}
The package throws exceptions for various error conditions:
All exceptions include detailed error messages to help identify the issue.
./vendor/bin/phpunit
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.