SslCommerze payment Gateway integration in Laravel


Instructions:

  • Step 1: Download and extract the library files.
  • Step 2: Copy the Library folder and put it in the laravel project's app/ directory. If needed, then run composer dump -o.
  • Step 3: Copy the config/sslcommerz.php file into your project's config/ folder.
Now, we have already copied the core library files. Let's do copy some other helpers files that is provided to understand the integration process. The other files are not related to core library.
  • Step 4: Add STORE_ID and STORE_PASSWORD values on your project's .env file. You can register for a store at https://developer.sslcommerz.com/registration/
  • Step 5: Copy the SslCommerzPaymentController into your project's Controllers folder.
  • Step 6: Copy the defined routes from routes/web.php into your project's route file.
  • Step 7: Add the below routes into the $excepts array of VerifyCsrfToken middleware.
protected $except = [
    '/pay-via-ajax', '/success','/cancel','/fail','/ipn'
];
  • Step 8: Copy the resources/views/*.blade.php files into your project's resources/views/ folder.
Now, let's go to the main integration part.
  • Step 9: To integrate popup checkout, use the below script before the end of body tag.
For Sandbox
<script>
    (function (window, document) {
        var loader = function () {
            var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
            script.src = "https://sandbox.sslcommerz.com/embed.min.js?" + Math.random().toString(36).substring(7);
            tag.parentNode.insertBefore(script, tag);
        };

        window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
    })(window, document);
</script> 
 
 
For Live
<script> (function (window, document) { var loader = function () { var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0]; script.src = "https://seamless-epay.sslcommerz.com/embed.min.js?" + Math.random().toString(36).substring(7); tag.parentNode.insertBefore(script, tag); }; window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader); })(window, document);
 </script> 

বাসা ভাড়ার সহজ মাধ্যম বাসা বাড়ি বিডি ডট কম  https://basabaribd.com


সংবাদ   https://jiboneralo.com


চাকরির পরীক্ষার প্রস্তুতি নেওয়ার জন্য  https://schoolportalbd.com



 

No comments

Powered by Blogger.