<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Payment Gateway Archives - GiveTurn</title>
	<atom:link href="https://www.giveturn.com/category/youtube/payment-gateway/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.giveturn.com/category/youtube/payment-gateway/</link>
	<description>A Leading IT Company, Powering Digital Growth for Your Business!</description>
	<lastBuildDate>Sat, 27 Sep 2025 11:56:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.5</generator>

<image>
	<url>https://www.giveturn.com/wp-content/uploads/2022/12/favicon-100x100.png</url>
	<title>Payment Gateway Archives - GiveTurn</title>
	<link>https://www.giveturn.com/category/youtube/payment-gateway/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Integrate or Add bKash Payment Gateway with Any Laravel Website</title>
		<link>https://www.giveturn.com/bkash-payment-gateway-laravel/</link>
					<comments>https://www.giveturn.com/bkash-payment-gateway-laravel/#comments</comments>
		
		<dc:creator><![CDATA[GiveTurn]]></dc:creator>
		<pubDate>Fri, 14 Apr 2023 09:23:03 +0000</pubDate>
				<category><![CDATA[Payment Gateway]]></category>
		<category><![CDATA[YouTube]]></category>
		<category><![CDATA[API integration]]></category>
		<category><![CDATA[Bangladesh payment system]]></category>
		<category><![CDATA[bKash payment gateway]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[Laravel payment gateways]]></category>
		<category><![CDATA[Laravel website]]></category>
		<category><![CDATA[Online payment solutions]]></category>
		<category><![CDATA[Online payments]]></category>
		<category><![CDATA[Payment APIs]]></category>
		<category><![CDATA[Payment gateway customization]]></category>
		<category><![CDATA[Payment gateway plugins]]></category>
		<category><![CDATA[Payment gateway setup]]></category>
		<category><![CDATA[Payment gateways for startups]]></category>
		<category><![CDATA[Payment integration]]></category>
		<category><![CDATA[Payment processing]]></category>
		<category><![CDATA[Payment security]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web development tutorial]]></category>
		<category><![CDATA[website development]]></category>
		<guid isPermaLink="false">https://www.giveturn.com/?p=4849</guid>

					<description><![CDATA[<p>This post is a part of the following video playlist. So, First of all, you should watch the following video otherwise you will not understand properly about this post. Requirements: Installation Command: Vendor publish (config) Command: After publish config file setup your credential. you can see the following code in your config directory bkash.php file [&#8230;]</p>
<p>The post <a href="https://www.giveturn.com/bkash-payment-gateway-laravel/">Integrate or Add bKash Payment Gateway with Any Laravel Website</a> appeared first on <a href="https://www.giveturn.com">GiveTurn</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="has-digeco-button-light-gray-color has-text-color">This post is a part of the following video playlist. So, First of all, you should watch the following video otherwise you will not understand properly about this post.</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Integrate or Add bKash Payment Gateway with Any Laravel Website (Part 1) | Bangladeshi Gateway" width="1200" height="675" src="https://www.youtube.com/embed/SMa2na3FKsM?list=PLD11cPzGpfKT1o2OTydIecmyHII5tZl_F" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div></figure>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Requirements:</strong></p>



<ul class="wp-block-list">
<li>PHP &gt;=7.4</li>



<li>Laravel &gt;= 6</li>
</ul>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Installation Command:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>composer require karim007/laravel-bkash-tokenize</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Vendor publish (config) Command:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>php artisan vendor:publish --provider="Karim007\LaravelBkashTokenize\BkashTokenizeServiceProvider" --tag="config"</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>After publish config file setup your credential. you can see the following code in your config directory bkash.php file</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>"sandbox"         =&gt; env("BKASH_SANDBOX", true),
"bkash_app_key"     =&gt; env("BKASH_APP_KEY", ""),
"bkash_app_secret" =&gt; env("BKASH_APP_SECRET", ""),
"bkash_username"      =&gt; env("BKASH_USERNAME", ""),
"bkash_password"     =&gt; env("BKASH_PASSWORD", ""),
"callbackURL"     =&gt; env("BKASH_CALLBACK_URL", "http://127.0.0.1:8000/bkash/callback"),
'timezone'        =&gt; 'Asia/Dhaka', </code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Now Set .env configuration</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>BKASH_SANDBOX=true  #for production use false
BKASH_APP_KEY=""
BKASH_APP_SECRET=""
BKASH_USERNAME=""
BKASH_PASSWORD=""
BKASH_CALLBACK_URL=""</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Publish a Controller Command:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>php artisan vendor:publish --provider="Karim007\LaravelBkashTokenize\BkashTokenizeServiceProvider" --tag="controllers"
</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>You can override the routes (routes must be in authenticate because bKash prefer it)</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>Route::group(&#91;'middleware' =&gt; &#91;'web']], function () {
    // Payment Routes for bKash
    Route::get('/bkash/payment', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'index']);
    Route::get('/bkash/create-payment', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'createPayment'])-&gt;name('bkash-create-payment');
    Route::get('/bkash/callback', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'callBack'])-&gt;name('bkash-callBack');

    //search payment
    Route::get('/bkash/search/{trxID}', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'searchTnx'])-&gt;name('bkash-serach');

    //refund payment routes
    Route::get('/bkash/refund', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'refund'])-&gt;name('bkash-refund');
    Route::get('/bkash/refund/status', &#91;App\Http\Controllers\BkashTokenizePaymentController::class,'refundStatus'])-&gt;name('bkash-refund-status');

});</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Payment Page (you will find it App\Http\Controllers\BkashTokenizePaymentController)</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function index()
{
    return view('bkashT::bkash-payment');
}</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Create Payment</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function createPayment(Request $request)
    {
        $inv = uniqid();
        $request&#91;'intent'] = 'sale';
        $request&#91;'mode'] = '0011';
        $request&#91;'payerReference'] = $inv;
        $request&#91;'currency'] = 'BDT';
        $request&#91;'amount'] = 100;
        $request&#91;'merchantInvoiceNumber'] = $inv;
        $request&#91;'callbackURL'] = config("bkash.callbackURL");;

        $request_data_json = json_encode($request-&gt;all());

        $response =  BkashPaymentTokenize::cPayment($request_data_json);
        if (isset($response&#91;'bkashURL'])) return redirect()-&gt;away($response&#91;'bkashURL']);
        else return redirect()-&gt;back()-&gt;with('error-alert2', $response&#91;'statusMessage']);
    }
</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Now create payment response looks like below:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>array&#91;
  "statusCode" =&gt; "0000"
  "statusMessage" =&gt; "Successful"
  "paymentID" =&gt; "TR0011WQ1674418613025"
  "bkashURL" =&gt; "https://sandbox.payment.bkash.com/redirect/tokenized/?paymentID=TR0011WQ1674418613025&amp;hash=t1-54Dtkmi*wr1KeWV55Z8fl5_DqsaW2q.zQWAQrPtpMsg*5zhuy3w17ZbXEvQ)qU7IT_ ▶"
  "callbackURL" =&gt; "base_url/bkash/callback"
  "successCallbackURL" =&gt; "base_url/bkash/callback?paymentID=TR0011WQ1674418613025&amp;status=success"
  "failureCallbackURL" =&gt; "base_url/bkash/callback?paymentID=TR0011WQ1674418613025&amp;status=failure"
  "cancelledCallbackURL" =&gt; "base_url/bkash/callback?paymentID=TR0011WQ1674418613025&amp;status=cancel"
  "amount" =&gt; "100"
  "intent" =&gt; "sale"
  "currency" =&gt; "BDT"
  "paymentCreateTime" =&gt; "2023-01-23T02:16:57:784 GMT+0600"
  "transactionStatus" =&gt; "Initiated"
  "merchantInvoiceNumber" =&gt; "63cd99abe6bae"
]</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Callback Function:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function callBack(Request $request)
    {
        //paymentID=TR00117B1674409647770&amp;status=success&amp;apiVersion=1.2.0-beta
        if ($request-&gt;status == 'success'){
            $response = BkashPaymentTokenize::executePayment($request-&gt;paymentID);
            if (!$response){
                $response =  BkashPaymentTokenize::queryPayment($request-&gt;paymentID);
            }
            if (isset($response&#91;'statusCode']) &amp;&amp; $response&#91;'statusCode'] == "0000") return $this-&gt;success('Thank you for your payment',$response&#91;'trxID']);
            return BkashPaymentTokenize::failure($response&#91;'statusMessage']);
        }else if ($request-&gt;status == 'cancel'){
            return BkashPaymentTokenize::cancel('Your payment is canceled');
        }else{
            return BkashPaymentTokenize::failure('Your transaction is failed');
        }
    }</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Execute payment response looks like below:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>{
   "statusCode":"0000",
   "statusMessage":"Successful",
   "paymentID":"TR0011FN1674417661851",
   "payerReference":"485605798",
   "customerMsisdn":"01877722345",
   "trxID":"AAN20A8HOI",
   "amount":"100",
   "transactionStatus":"Completed",
   "paymentExecuteTime":"2023-01-23T02:04:05:736 GMT+0600",
   "currency":"BDT",
   "intent":"sale"
}</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Query payment response looks like below:</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>{
    "paymentID":"TR0011FN1674417661851",
   "mode":"0011",
   "paymentCreateTime":"2023-01-23T02:01:06:713 GMT+0600",
   "paymentExecuteTime":"2023-01-23T02:04:05:736 GMT+0600",
   "amount":"100",
   "currency":"BDT",
   "intent":"sale",
   "merchantInvoice":"485605798",
   "trxID":"AAN20A8HOI",
   "transactionStatus":"Completed",
   "verificationStatus":"Complete",
   "statusCode":"0000",
   "statusMessage":"Successful",
   "payerReference":"485605798"
}
</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Search Transaction</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function searchTnx($trxID)
{
    //response
    /*{
        "trxID":"AAN60A8IOQ",
       "initiationTime":"2023-01-23T12:06:05:000 GMT+0600",
       "completedTime":"2023-01-23T12:06:05:000 GMT+0600",
       "transactionType":"bKash Tokenized Checkout via API",
       "customerMsisdn":"01877722345",
       "transactionStatus":"Completed",
       "amount":"20",
       "currency":"BDT",
       "organizationShortCode":"50022",
       "statusCode":"0000",
       "statusMessage":"Successful"
    }*/
    return BkashPaymentTokenize::searchTransaction($trxID);
}</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Refund Transaction</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function refund(Request $request)
    {
        $paymentID='paymentID';
        $trxID='trxID';
        $amount=5;
        $reason='this is test reason';
        $sku='abc';
        //response
        /*{
            "statusCode":"0000",
           "statusMessage":"Successful",
           "originalTrxID":"AAN30A8M4T",
           "refundTrxID":"AAN30A8M5N",
           "transactionStatus":"Completed",
           "amount":"5",
           "currency":"BDT",
           "charge":"0.00",
           "completedTime":"2023-01-23T15:53:29:120 GMT+0600"
        }*/
        return BkashRefundTokenize::refund($paymentID,$trxID,$amount,$reason,$sku);
    }</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Refund Status Check</strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>public function refundStatus(Request $request)
    {
        $paymentID='paymentID';
        $trxID='trxID';
        /*{
            "statusCode":"0000",
           "statusMessage":"Successful",
           "originalTrxID":"AAN30A8M4T",
           "refundTrxID":"AAN30A8M5N",
           "transactionStatus":"Completed",
           "amount":"5",
           "currency":"BDT",
           "charge":"0.00",
           "completedTime":"2023-01-23T15:53:29:120 GMT+0600"
        }*/
        return BkashRefundTokenize::refundStatus($paymentID,$trxID);
    }</code></pre>



<p class="has-digeco-button-light-gray-color has-text-color"><strong>Now, You Can Check by Using the Following Checkout Demo</strong>:<strong> </strong></p>



<pre class="wp-block-code has-digeco-button-light-gray-color has-text-color"><code>Go to: <a href="https://merchantdemo.sandbox.bka.sh/frontend/checkout/version/1.2.0-beta" target="_blank" rel="noreferrer noopener">https://merchantdemo.sandbox.bka.sh/frontend/checkout/version/1.2.0-b</a><a href="https://merchantdemo.sandbox.bka.sh/frontend/checkout/version/1.2.0-beta" target="_blank" rel="noreferrer noopener nofollow">eta</a>
Wallet : 01770618575
OTP : 123456
PIN : 12121</code></pre>
<p>The post <a href="https://www.giveturn.com/bkash-payment-gateway-laravel/">Integrate or Add bKash Payment Gateway with Any Laravel Website</a> appeared first on <a href="https://www.giveturn.com">GiveTurn</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.giveturn.com/bkash-payment-gateway-laravel/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
