Integrate Halkbank's online payment gateway seamlessly into your Laravel application with this dedicated package. Designed specifically for Macedonian businesses, this package provides an easy-to-use interface for integrating Halkbank payment services.
This package was created by KalimeroMK.
This package is open-sourced software licensed under the MIT license.
Before you begin, ensure you have the following:
- PHP >= 7.4
Follow these steps to install the package:
Install via Composer Run the following command to install the package:
composer require kalimeromk/halkbank-payment
php artisan vendor:publish --provider="Kalimeromk\HalkbankPayment\HalkBankPaymentServiceProvider"
Pls register CsrfExemptMiddleware in the Kernel of laravel app
Edit the published config/payment.php with your Halkbank credentials and settings. Usage
Route::prefix('payment')->group(function () {
Route::get('/{amount}', [PaymentController::class, 'showPaymentForm'])->name('payment.form');
Route::post('/', [PaymentController::class, 'showPaymentForm'])->name('payment.post');
Route::get('success', [PaymentController::class, 'paymentSuccess'])->name('payment.success')->middleware('csrf_exempt');
Route::get('fail', [PaymentController::class, 'paymentFail'])->name('payment.fail')->middleware('csrf_exempt');
});
Customize the payment form in resources/views/vendor/payment.
Extend PaymentController to modify or add new payment processing logic.
Add new routes in your Laravel application as needed.
PAYMENT_CLIENT_ID=
PAYMENT_STORE_KEY=
PAYMENT_STORE_TYPE=
PAYMENT_CURRENCY=807
PAYMENT_TRANSACTION_TYPE=Auth
PAYMENT_OK_URL=http:https://localhost:87/payment-success
PAYMENT_FAIL_URL=http:https://localhost:87/payment-fail
PAYMENT_LANG=en
PAYMENT_LAYOUT=
Fail url returns post form with this array
[
'ReturnOid' => '',
'TRANID' => '',
'PAResSyntaxOK' => '',
'islemtipi' => '',
'refreshtime' => '',
'lang' => '',
'merchantID' => '',
'maskedCreditCard' => '',
'amount' => '',
'sID' => '',
'RECEIVERPAN' => '',
'ACQBIN' => '',
'Ecom_Payment_Card_ExpDate_Year' => '',
'MaskedPan' => '',
'merchantName' => '',
'clientIp' => '',
'_token' => '',
'iReqDetail' => '',
'okUrl' => '',
'md' => '',
'ProcReturnCode' => '',
'payResults_dsId' => '',
'taksit' => '',
'vendorCode' => '',
'TransId' => '',
'EXTRA_TRXDATE' => '',
'Ecom_Payment_Card_ExpDate_Month' => '',
'storetype' => '',
'iReqCode' => '',
'Response' => '',
'SettleId' => '',
'mdErrorMsg' => '',
'ErrMsg' => '',
'PAResVerified' => '',
'cavv' => '',
'digest' => '',
'HostRefNum' => '',
'callbackCall' => '',
'AuthCode' => '',
'failUrl' => '',
'terms' => '',
'cavvAlgorithm' => '',
'xid' => '',
'encoding' => '',
'currency' => '',
'oid' => '',
'AcquirerAllowedFallback' => '',
'mdStatus' => '',
'dsId' => '',
'eci' => '',
'version' => '',
'clientid' => '',
'txstatus' => '',
'HASH' => '',
'rnd' => '',
'HASHPARAMS' => '',
'HASHPARAMSVAL' => '',
'countdown' => ''
]