trocho/laravel-paytm 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trocho/laravel-paytm

Composer 安装命令:

composer require trocho/laravel-paytm

包简介

Payment Integration with Paytm.

README 文档

README

Introduction

It simplifies the payment flow with the defined methods. You can pay through paytm just writing few lines of codes. Before you start installing this service, please complete your Paytem setup at on Paytm.

Installation

First, you'll need to require the package with Composer:

composer require trocho/laravel-paytm

Aftwards, run composer update from your command line.

Then, update config/app.php by adding an entry for the service provider.

'providers' => [
	// ...
	'Trocho\LaravelPaytm\PaytmServiceProvider',
];

Then, register class alias by adding an entry in aliases section

'aliases' => [
	// ...
	'Paytm' => 'Trocho\LaravelPaytm\Facades\Paytm',
];

Finally, from the command line again, run php artisan vendor:publish to publish the default configuration file. This will publish a configuration file named paytm.php which includes your Paytm authorization keys and aditional settings.

Configuration

You need to fill in paytm.php file that is found in your applications config directory.

Usage

Request for Payment

You can easily send a message to all registered users with the command

$request = array('CUST_ID' => 1 ,'TXN_AMOUNT'=> 1 );
Paytm::pay($request);

CUST_ID and TXN_AMOUNT fields value are pass to Paytm and redirect to callback URL.

After redirect to callback URL

Once we redirected to callback URL we need to verify whether transaction Success or Fail.

Example

Suppose, your callback URL is https://your-app.io/payment/callback Paytm POST respone on your URL. we need to get response.

In routes.php add a post method.

Route::post("payment/callback", "PaymentController@callback");

In PaymentController create a method

public function callback(Request $Request)
{
$paymentResponse =  $Request->all();
$paymentData     = Paytm::verifyPayment($paymentResponse);
}

$postData gives transcation details. after, use your business logic to save.

Check Transaction Status

Paytm::transactionStatus($orderID);

$orderID is the Unique ID generated for the transaction by merchant

Initiate Refund Process

Paytm::initiateTransactionRefund($orderID,$amount,$txnType);

$orderID: Transaction Order Id by merchant.

$amount: Amount to refund.

$txnType; Any one of below values: REFUND CANCEL

Please refer to Documentation. for all customizable parameters.

统计信息

  • 总下载量: 63
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固