Download the PHP package techtailor/laravel-paytm without Composer
On this page you can find all versions of the php package techtailor/laravel-paytm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download techtailor/laravel-paytm
More information about techtailor/laravel-paytm
Files in techtailor/laravel-paytm
Package laravel-paytm
Short Description A Laravel wrapper for the Paytm Payment Gateway (PG). Now quickly setup and accept UPI, Credit/Debit Card, Net Banking & EMI payments via Paytm PG starting today.
License MIT
Homepage https://github.com/TechTailor/Laravel-Paytm
Informations about the package laravel-paytm
This package provides a simple Laravel wrapper for the Paytm PG (Payment Gateway) to allow you to easily spin up a new laravel app and start accepting UPI, Wallet, Credit/Debit, Net Banking & EMI payments without any hassle. Before getting started, be sure to go through the Paytm documentation to have a better understanding.
Note: You also need to have a valid Paytm Business Merchant Account to start using the Paytm PG (Payment Gatteway)
Installation
You can install the package via composer:
You can publish the config file with:
You must publish the assets file using:
Usage
Before you can start using this package, you must familiarize yourself with the payment workflow for the Paytm PG. Read official documentation here
To give a basic gist, you generate a unique payment token by providing the amount and customer details, then use the txnId and orderId received in the response to initiate the Checkout JS in your front-end.
Setup Environment
Add the following variables to your .env file, or alternatively, you can publish the config file and update it accordingly.
A bit of explainantion -
Step # 1 - Generate a Token
The $response will return an array containing:
Step # 2 - Invoking Payment Page & Collecting Payment
You can read detailed documentation for Paytm Checkout JS here.
Setup Frontend
Start by adding the @paytmScripts
tag into the <head>
tag of your page. For ex:
Next, to initiate the Checkout Payment Page, you have 2 available methods -
Method # 1
This method will invoke the payment gateway and upon completion, will redirect the user to the callback url set earlier (or in the config file).
To achieve that, you need to call the openJsCheckoutPopup(orderId, txnToken, amount)
function and pass it the orderId
, txntoken
and the amount
received in Step # 1.
Upon clicking the Pay Now
button, a pop-up for the Paytm PG will open with all the options to make the payment. Once the payment is complete, you will be redirected to the callback_url
set in the .env file as PAYTM_CALLBACK_URL
.
Method # 2
This method will allow you to handle the response on the same page (and ignore any callback urls set for this transaction). Useful when you want to process transaction without a redirect.
Once you set the redirect flag as false, you can use the paymentCompleted
function to excute further queries using the returned data.
Step # 3 - Receiving Response
The response from the Paytm PG (via callback or same page) will provide an array containing the following (for a successful transaction) -
Using the above data, you can update the order details in your database and add the transaction and order id to it and process it accordingly.
Verify Transaction
You can check and verify the status of any transaction using just the OrderId.
The $response will return an array containing:
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Moinuddin S. Khaja
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Patym, Paytm PG, Paytm for Business and all related logos are registered trademarks of and belongs to One97 Communications Limited.
All versions of laravel-paytm with dependencies
illuminate/contracts Version ^9.0
paytm/paytmchecksum Version ^1.1
spatie/laravel-package-tools Version ^1.9.2