Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
15
vendor/anandsiddharth/laravel-paytm-wallet/src/Contracts/Factory.php
vendored
Normal file
15
vendor/anandsiddharth/laravel-paytm-wallet/src/Contracts/Factory.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Contracts;
|
||||
|
||||
interface Factory
|
||||
{
|
||||
/**
|
||||
* Get Paytm Wallet Provider
|
||||
*
|
||||
* @param string $driver
|
||||
* @return \Anand\LaravelPaytmWallet\Contracts\Provider
|
||||
*/
|
||||
|
||||
public function driver($do = null);
|
||||
}
|
||||
14
vendor/anandsiddharth/laravel-paytm-wallet/src/Contracts/Provider.php
vendored
Normal file
14
vendor/anandsiddharth/laravel-paytm-wallet/src/Contracts/Provider.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Contracts;
|
||||
|
||||
interface Provider
|
||||
{
|
||||
/**
|
||||
* Return raw response.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function response();
|
||||
|
||||
}
|
||||
34
vendor/anandsiddharth/laravel-paytm-wallet/src/Facades/PaytmWallet.php
vendored
Normal file
34
vendor/anandsiddharth/laravel-paytm-wallet/src/Facades/PaytmWallet.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Facades;
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
/**
|
||||
* @see \Laravel\Socialite\SocialiteManager
|
||||
*/
|
||||
class PaytmWallet extends Facade
|
||||
{
|
||||
/**
|
||||
* Get the registered name of the component.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
const STATUS_SUCCESSFUL = 'TXN_SUCCESS';
|
||||
const STATUS_FAILURE = 'TXN_FAILURE';
|
||||
const STATUS_OPEN = 'OPEN';
|
||||
const STATUS_PENDING = 'PENDING';
|
||||
|
||||
const RESPONSE_SUCCESSFUL="01";
|
||||
const RESPONSE_CANCELLED = "141";
|
||||
const RESPONSE_FAILED = "227";
|
||||
const RESPONSE_PAGE_CLOSED = "810";
|
||||
const REPSONSE_REFUND_ALREADY_RAISED = "617";
|
||||
const RESPONSE_CANCELLED_CUSTOMER = "8102";
|
||||
const RESPONSE_CANCELLED_CUSTOMER_INSUFFICIENT_BALANCE = "8103";
|
||||
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'Anand\LaravelPaytmWallet\Contracts\Factory';
|
||||
}
|
||||
}
|
||||
76
vendor/anandsiddharth/laravel-paytm-wallet/src/PaytmWalletManager.php
vendored
Normal file
76
vendor/anandsiddharth/laravel-paytm-wallet/src/PaytmWalletManager.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet;
|
||||
use Illuminate\Support\Manager;
|
||||
use Illuminate\Http\Request;
|
||||
class PaytmWalletManager extends Manager implements Contracts\Factory{
|
||||
|
||||
|
||||
protected $config;
|
||||
|
||||
|
||||
|
||||
public function with($driver){
|
||||
return $this->driver($driver);
|
||||
}
|
||||
|
||||
protected function createReceiveDriver(){
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\ReceivePaymentProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
protected function createStatusDriver(){
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\StatusCheckProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
protected function createBalanceDriver(){
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\BalanceCheckProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
protected function createAppDriver(){
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\PaytmAppProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
protected function createRefundDriver() {
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\RefundPaymentProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
protected function createRefundStatusDriver(){
|
||||
$this->config = $this->container['config']['services.paytm-wallet'];
|
||||
return $this->buildProvider(
|
||||
'Anand\LaravelPaytmWallet\Providers\RefundStatusCheckProvider',
|
||||
$this->config
|
||||
);
|
||||
}
|
||||
|
||||
public function getDefaultDriver(){
|
||||
throw new \Exception('No driver was specified. - Laravel Paytm Wallet');
|
||||
}
|
||||
|
||||
public function buildProvider($provider, $config){
|
||||
return new $provider(
|
||||
$this->container['request'],
|
||||
$config
|
||||
);
|
||||
}
|
||||
}
|
||||
42
vendor/anandsiddharth/laravel-paytm-wallet/src/PaytmWalletServiceProvider.php
vendored
Normal file
42
vendor/anandsiddharth/laravel-paytm-wallet/src/PaytmWalletServiceProvider.php
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet;
|
||||
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
|
||||
class PaytmWalletServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
||||
/**
|
||||
* Indicates if loading of the provider is deferred.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $defer = false;
|
||||
|
||||
/**
|
||||
* Register bindings in the container.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('Anand\LaravelPaytmWallet\Contracts\Factory', function ($app) {
|
||||
// $this->app->singleton('PaytmWallet', function ($app) {
|
||||
return new PaytmWalletManager($app);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function boot(){
|
||||
$this->loadViewsFrom(__DIR__.'/resources/views', 'paytmwallet');
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function provides(){
|
||||
return ['Anand\LaravelPaytmWallet\Contracts\Factory'];
|
||||
}
|
||||
}
|
||||
49
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/BalanceCheckProvider.php
vendored
Normal file
49
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/BalanceCheckProvider.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Illuminate\Http\Request;
|
||||
// require __DIR__.'/../../lib/encdec_paytm.php';
|
||||
|
||||
class BalanceCheckProvider extends PaytmWalletProvider{
|
||||
|
||||
|
||||
private $parameters = null;
|
||||
|
||||
|
||||
|
||||
public function prepare($params = array()){
|
||||
$defaults = [
|
||||
'token' => NULL,
|
||||
];
|
||||
|
||||
$_p = array_merge($defaults, $params);
|
||||
foreach ($_p as $key => $value) {
|
||||
|
||||
if ($value == NULL) {
|
||||
|
||||
throw new \Exception(' \''.$key.'\' parameter not specified in array passed in prepare() method');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->parameters = $_p;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function check(){
|
||||
if ($this->parameters == null) {
|
||||
throw new \Exception("prepare() method not called");
|
||||
}
|
||||
return $this->beginTransaction();
|
||||
}
|
||||
|
||||
private function beginTransaction(){
|
||||
|
||||
$params = [
|
||||
'MID' => $this->merchant_id,
|
||||
'TOKEN' => $this->parameters['token']
|
||||
];
|
||||
return $this->api_call($this->paytm_balance_check_url, $params);
|
||||
}
|
||||
|
||||
}
|
||||
38
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/PaytmAppProvider.php
vendored
Normal file
38
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/PaytmAppProvider.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PaytmAppProvider extends PaytmWalletProvider{
|
||||
|
||||
public function generate(Request $request){
|
||||
$checksum = getChecksumFromArray($request->all(), $this->merchant_key);
|
||||
return response()->json([ 'CHECKSUMHASH' => $checksum, 'ORDER_ID' => $request->get('ORDER_ID'), 'payt_STATUS' => '1' ]);
|
||||
}
|
||||
|
||||
public function verify(Request $request, $success = null, $error = null){
|
||||
$paramList = $request->all();
|
||||
$return_array = $request->all();
|
||||
$paytmChecksum = $request->get('CHECKSUMHASH');
|
||||
|
||||
$isValidChecksum = verifychecksum_e($paramList, $this->merchant_key, $paytmChecksum);
|
||||
|
||||
if ($isValidChecksum) {
|
||||
if ($success != null && is_callable($success)) {
|
||||
$success();
|
||||
}
|
||||
}else{
|
||||
if ($error != null && is_callable($error)) {
|
||||
$error();
|
||||
}
|
||||
}
|
||||
|
||||
$return_array["IS_CHECKSUM_VALID"] = $isValidChecksum ? "Y" : "N";
|
||||
unset($return_array["CHECKSUMHASH"]);
|
||||
$encoded_json = htmlentities(json_encode($return_array));
|
||||
|
||||
return view('paytmwallet::app_redirect')->with('json', $encoded_json);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
65
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/PaytmWalletProvider.php
vendored
Normal file
65
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/PaytmWalletProvider.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Anand\LaravelPaytmWallet\Contracts\Provider as ProviderContract;
|
||||
use Illuminate\Http\Request;
|
||||
require __DIR__.'/../../lib/encdec_paytm.php';
|
||||
|
||||
class PaytmWalletProvider implements ProviderContract {
|
||||
|
||||
protected $request;
|
||||
protected $response;
|
||||
protected $paytm_txn_url;
|
||||
protected $paytm_txn_status_url;
|
||||
protected $paytm_refund_url;
|
||||
protected $paytm_refund_status_url;
|
||||
protected $paytm_balance_check_url;
|
||||
|
||||
protected $merchant_key;
|
||||
protected $merchant_id;
|
||||
protected $merchant_website;
|
||||
protected $industry_type;
|
||||
protected $channel;
|
||||
|
||||
|
||||
public function __construct(Request $request, $config){
|
||||
$this->request = $request;
|
||||
|
||||
if ($config['env'] == 'production') {
|
||||
$domain = 'securegw.paytm.in';
|
||||
}else{
|
||||
$domain = 'securegw-stage.paytm.in';
|
||||
}
|
||||
$this->paytm_txn_url = 'https://'.$domain.'/theia/processTransaction';
|
||||
$this->paytm_txn_status_url = 'https://'.$domain.'/merchant-status/getTxnStatus';
|
||||
$this->paytm_refund_url = 'https://'.$domain.'/refund/HANDLER_INTERNAL/REFUND';
|
||||
$this->paytm_refund_status_url = 'https://'.$domain.'/refund/HANDLER_INTERNAL/getRefundStatus';
|
||||
$this->paytm_balance_check_url = 'https://'.$domain.'/refund/HANDLER_INTERNAL/getRefundStatus';
|
||||
|
||||
$this->merchant_key = $config['merchant_key'];
|
||||
$this->merchant_id = $config['merchant_id'];
|
||||
$this->merchant_website = $config['merchant_website'];
|
||||
$this->industry_type = $config['industry_type'];
|
||||
$this->channel = $config['channel'];
|
||||
}
|
||||
|
||||
public function response(){
|
||||
$checksum = $this->request->get('CHECKSUMHASH');
|
||||
if(verifychecksum_e($this->request->post(), $this->merchant_key, $checksum) == "TRUE"){
|
||||
return $this->response = $this->request->post();
|
||||
}
|
||||
throw new \Exception('Invalid checksum');
|
||||
}
|
||||
|
||||
public function getResponseMessage() {
|
||||
return $this->response()['RESPMSG'];
|
||||
}
|
||||
|
||||
public function api_call($url, $params){
|
||||
return callAPI($url, $params);
|
||||
}
|
||||
|
||||
public function api_call_new($url, $params){
|
||||
return callAPI($url, $params);
|
||||
}
|
||||
}
|
||||
76
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/ReceivePaymentProvider.php
vendored
Normal file
76
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/ReceivePaymentProvider.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Anand\LaravelPaytmWallet\Facades\PaytmWallet;
|
||||
use Anand\LaravelPaytmWallet\Traits\HasTransactionStatus;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ReceivePaymentProvider extends PaytmWalletProvider{
|
||||
use HasTransactionStatus;
|
||||
|
||||
private $parameters = null;
|
||||
private $view = 'paytmwallet::transact';
|
||||
|
||||
public function prepare($params = array()){
|
||||
$defaults = [
|
||||
'order' => NULL,
|
||||
'user' => NULL,
|
||||
'amount' => NULL,
|
||||
'callback_url' => NULL,
|
||||
'email' => NULL,
|
||||
'mobile_number' => NULL,
|
||||
];
|
||||
|
||||
$_p = array_merge($defaults, $params);
|
||||
foreach ($_p as $key => $value) {
|
||||
|
||||
if ($value == NULL) {
|
||||
|
||||
throw new \Exception(' \''.$key.'\' parameter not specified in array passed in prepare() method');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->parameters = $_p;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function receive(){
|
||||
if ($this->parameters == null) {
|
||||
throw new \Exception("prepare() method not called");
|
||||
}
|
||||
return $this->beginTransaction();
|
||||
}
|
||||
|
||||
public function view($view) {
|
||||
if($view) {
|
||||
$this->view = $view;
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function beginTransaction(){
|
||||
$params = [
|
||||
'REQUEST_TYPE' => 'DEFAULT',
|
||||
'MID' => $this->merchant_id,
|
||||
'ORDER_ID' => $this->parameters['order'],
|
||||
'CUST_ID' => $this->parameters['user'],
|
||||
'INDUSTRY_TYPE_ID' => $this->industry_type,
|
||||
'CHANNEL_ID' => $this->channel,
|
||||
'TXN_AMOUNT' => $this->parameters['amount'],
|
||||
'WEBSITE' => $this->merchant_website,
|
||||
'CALLBACK_URL' => $this->parameters['callback_url'],
|
||||
'MOBILE_NO' => $this->parameters['mobile_number'],
|
||||
'EMAIL' => $this->parameters['email'],
|
||||
];
|
||||
return view('paytmwallet::form')->with('view', $this->view)->with('params', $params)->with('txn_url', $this->paytm_txn_url)->with('checkSum', getChecksumFromArray($params, $this->merchant_key));
|
||||
}
|
||||
|
||||
public function getOrderId(){
|
||||
return $this->response()['ORDERID'];
|
||||
}
|
||||
public function getTransactionId(){
|
||||
return $this->response()['TXNID'];
|
||||
}
|
||||
|
||||
}
|
||||
70
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/RefundPaymentProvider.php
vendored
Normal file
70
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/RefundPaymentProvider.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Anand\LaravelPaytmWallet\Facades\PaytmWallet;
|
||||
use Anand\LaravelPaytmWallet\Traits\HasTransactionStatus;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class RefundPaymentProvider extends PaytmWalletProvider{
|
||||
use HasTransactionStatus;
|
||||
|
||||
private $parameters = null;
|
||||
protected $response;
|
||||
|
||||
public function prepare($params = array()){
|
||||
$defaults = [
|
||||
'order' => NULL,
|
||||
'reference' => NULL,
|
||||
'amount' => NULL,
|
||||
'transaction' => NULL
|
||||
];
|
||||
|
||||
$_p = array_merge($defaults, $params);
|
||||
foreach ($_p as $key => $value) {
|
||||
|
||||
if ($value == NULL) {
|
||||
|
||||
throw new \Exception(' \''.$key.'\' parameter not specified in array passed in prepare() method');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->parameters = $_p;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function beginTransaction(){
|
||||
$params = array();
|
||||
$params["MID"] = $this->merchant_id;
|
||||
$params["ORDERID"] = $this->parameters['order'];
|
||||
$params["REFID"] = $this->parameters['reference'];
|
||||
$params["TXNTYPE"] = 'REFUND';
|
||||
$params["REFUNDAMOUNT"] = $this->parameters['amount'];
|
||||
$params["TXNID"] = $this->parameters['transaction'];
|
||||
$chk = getChecksumFromArray($params, $this->merchant_key);
|
||||
$params['CHECKSUM'] = $chk;
|
||||
$this->response = $this->api_call_new($this->paytm_refund_url, $params);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function initiate(){
|
||||
if ($this->parameters == null) {
|
||||
throw new \Exception("prepare() method not called");
|
||||
}
|
||||
$this->beginTransaction();
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function response(){
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function isRefundAlreadyRaised() {
|
||||
if ($this->isFailed() && $this->response()['RESPCODE'] == PaytmWallet::REPSONSE_REFUND_ALREADY_RAISED) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
66
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/RefundStatusCheckProvider.php
vendored
Normal file
66
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/RefundStatusCheckProvider.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Anand\LaravelPaytmWallet\Traits\HasTransactionStatus;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
|
||||
class RefundStatusCheckProvider extends PaytmWalletProvider{
|
||||
use HasTransactionStatus;
|
||||
|
||||
private $parameters = null;
|
||||
protected $response;
|
||||
|
||||
public function prepare($params = array()){
|
||||
$defaults = [
|
||||
'order' => NULL,
|
||||
'reference' => NULL,
|
||||
];
|
||||
|
||||
$_p = array_merge($defaults, $params);
|
||||
foreach ($_p as $key => $value) {
|
||||
|
||||
if ($value == NULL) {
|
||||
|
||||
throw new \Exception(' \''.$key.'\' parameter not specified in array passed in prepare() method');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->parameters = $_p;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function check(){
|
||||
if ($this->parameters == null) {
|
||||
throw new \Exception("prepare() method not called");
|
||||
}
|
||||
return $this->beginTransaction();
|
||||
}
|
||||
|
||||
|
||||
private function beginTransaction(){
|
||||
$params = array(
|
||||
'MID' => $this->merchant_id,
|
||||
'ORDERID' => $this->parameters['order'],
|
||||
'REFID' => $this->parameters['reference']
|
||||
);
|
||||
$chk = getChecksumFromArray($params, $this->merchant_key);
|
||||
$params['CHECKSUM'] = $chk;
|
||||
$this->response = $this->api_call_new($this->paytm_txn_status_url, $params);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function response(){
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function getOrderId(){
|
||||
return $this->response()['ORDERID'];
|
||||
}
|
||||
public function getTransactionId(){
|
||||
return $this->response()['TXNID'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
63
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/StatusCheckProvider.php
vendored
Normal file
63
vendor/anandsiddharth/laravel-paytm-wallet/src/Providers/StatusCheckProvider.php
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
namespace Anand\LaravelPaytmWallet\Providers;
|
||||
use Anand\LaravelPaytmWallet\Traits\HasTransactionStatus;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class StatusCheckProvider extends PaytmWalletProvider{
|
||||
use HasTransactionStatus;
|
||||
|
||||
private $parameters = null;
|
||||
protected $response;
|
||||
|
||||
public function prepare($params = array()){
|
||||
$defaults = [
|
||||
'order' => NULL,
|
||||
];
|
||||
|
||||
$_p = array_merge($defaults, $params);
|
||||
foreach ($_p as $key => $value) {
|
||||
|
||||
if ($value == NULL) {
|
||||
|
||||
throw new \Exception(' \''.$key.'\' parameter not specified in array passed in prepare() method');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->parameters = $_p;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function check(){
|
||||
if ($this->parameters == null) {
|
||||
throw new \Exception("prepare() method not called");
|
||||
}
|
||||
return $this->beginTransaction();
|
||||
}
|
||||
|
||||
|
||||
private function beginTransaction(){
|
||||
$params = array(
|
||||
'MID' => $this->merchant_id,
|
||||
'ORDERID' => $this->parameters['order']
|
||||
);
|
||||
$chk = getChecksumFromArray($params, $this->merchant_key);
|
||||
$params['CHECKSUMHASH'] = $chk;
|
||||
$this->response = $this->api_call_new($this->paytm_txn_status_url, $params);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function response(){
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function getOrderId(){
|
||||
return $this->response()['ORDERID'];
|
||||
}
|
||||
public function getTransactionId(){
|
||||
return $this->response()['TXNID'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
35
vendor/anandsiddharth/laravel-paytm-wallet/src/Traits/HasTransactionStatus.php
vendored
Normal file
35
vendor/anandsiddharth/laravel-paytm-wallet/src/Traits/HasTransactionStatus.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Anand\LaravelPaytmWallet\Traits;
|
||||
use Anand\LaravelPaytmWallet\Facades\PaytmWallet;
|
||||
|
||||
trait HasTransactionStatus {
|
||||
|
||||
public function isOpen(){
|
||||
if ($this->response['STATUS'] == PaytmWallet::STATUS_OPEN){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isFailed(){
|
||||
if ($this->response['STATUS'] == PaytmWallet::STATUS_FAILURE) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isSuccessful(){
|
||||
if($this->response['STATUS'] == PaytmWallet::STATUS_SUCCESSFUL){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isPending(){
|
||||
if($this->response['STATUS'] == PaytmWallet::STATUS_PENDING){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
18
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/app_redirect.blade.php
vendored
Normal file
18
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/app_redirect.blade.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-I">
|
||||
<title>Paytm</title>
|
||||
<script type="text/javascript">
|
||||
function response(){
|
||||
return document.getElementById('response').value;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
Redirect back to the app<br>
|
||||
|
||||
<form name="frm" method="post">
|
||||
<input type="hidden" id="response" name="responseField" value='{{$json}}'>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
16
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/form.blade.php
vendored
Normal file
16
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/form.blade.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
@extends($view)
|
||||
@section('payment_redirect')
|
||||
<form method="post" action="{{$txn_url}}" name="f1" style="visibility: hidden;">
|
||||
<table border="1">
|
||||
<tbody>
|
||||
@foreach ($params as $key => $value)
|
||||
<input type="hidden" name="{{$key}}" value="{{$value}}" />
|
||||
@endforeach
|
||||
<input type="hidden" name="CHECKSUMHASH" value="{{$checkSum}}">
|
||||
</tbody>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
document.f1.submit();
|
||||
</script>
|
||||
</form>
|
||||
@stop
|
||||
12
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/transact.blade.php
vendored
Normal file
12
vendor/anandsiddharth/laravel-paytm-wallet/src/resources/views/transact.blade.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Merchant Check Out Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<br>
|
||||
<br>
|
||||
<center><h1>Your transaction is being processed!!!</h1></center>
|
||||
<center><h2>Please do not refresh this page...</h2></center>
|
||||
@yield('payment_redirect')
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user