Download the PHP package 3x1io/laravel-paytm-wallet without Composer
On this page you can find all versions of the php package 3x1io/laravel-paytm-wallet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3x1io/laravel-paytm-wallet
More information about 3x1io/laravel-paytm-wallet
Files in 3x1io/laravel-paytm-wallet
Package laravel-paytm-wallet
Short Description Integrate paytm wallet easily with this package. This package uses official Paytm PHP SDK's
License MIT
Informations about the package laravel-paytm-wallet
Laravel Paytm Wallet
For Laravel 5.0 use version ^1.0.0
For Laravel 6.0 use version ^1.0.0
For Laravel 7.0 use version ^1.0.0
For Laravel 8.0 use version ^2.0.0
Introduction
Integrate paytm wallet in your laravel application easily with this package. This package uses official Paytm PHP SDK's.
License
Laravel Paytm Wallet open-sourced software licensed under the MIT license
Getting Started
To get started add the following package to your composer.json
file using this command.
composer require anandsiddharth/laravel-paytm-wallet
Configuring
Note: For Laravel 5.5 and above auto-discovery takes care of below configuration.
When composer installs Laravel Paytm Wallet library successfully, register the Anand\LaravelPaytmWallet\PaytmWalletServiceProvider
in your config/app.php
configuration file.
Also, add the PaytmWallet
facade to the aliases
array in your app
configuration file:
Add the paytm credentials to the .env
file
One more step to go....
On your config/services.php
add the following configuration
Note : All the credentials mentioned are provided by Paytm after signing up as merchant.
Laravel 7 Changes
Our package is comptible with Laravel 7 but same_site setting is changed in default Laravel installation, make sure you change same_site
to null
in config/session.php
or callback won't include cookies and you will be logged out when a payment is completed
Usage
Making a transaction
Make sure the callback_url
you have mentioned while receiving payment is post
on your routes.php
file, Example see below:
Important: The callback_url
must not be csrf protected Check out here to how to do that
Get transaction status/information using order id
Initiating Refunds
Check Refund Status
Customizing transaction being processed page
Considering the modern app user interfaces, default "transaction being processed page" is too dull which comes with this package. If you would like to modify this, you have the option to do so. Here's how:
You just need to change 1 line in you OrderController
's code.
Here $payment->receive()
is replaced with $payment->view('your_custom_view')->receive()
. Replace your_custom_view
with your view name which resides in your resources/views/your_custom_view.blade.php
.
And in your view file make sure you have added this line of code before </body>
(i.e. before closing body tag), which redirects to payment gateway.
@yield('payment_redirect')
Here's a sample custom view:
That's all folks!
Wait you still here?
I am working on this cool project called yoheim. It's an all in one collaboration platform to manage and share ssh servers. Download now and start using it for free www.yoheim.com