Package Data | |
---|---|
Maintainer Username: | lakshmaji |
Package Create Date: | 2016-12-05 |
Package Last Update: | 2021-05-08 |
Home Page: | https://lakshmajim.github.io/payubiz/ |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 03:03:19 |
Package Statistics | |
---|---|
Total Downloads: | 92 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
What it is
Version
1.0.1
Installation
composer require lakshmaji/payubiz
Lakshmaji\PayUbiz\PayUbizServiceProvider::class,
'PayUbiz' => Lakshmaji\PayUbiz\Facade\PayUbiz::class,
composer update
php artisan vendor:publish
return [
/*
|--------------------------------------------------------------------------
| PayUbiz Authentication Secret
|--------------------------------------------------------------------------
|
| Don't forget to set this.
|
*/
'merchant_id' => 'gtSsEw',
'secret_key' => 'eRyshYFb',
'test_mode' => true
];
Integrating PayUbiz services with the application
The following example illustrates the usage of PayUbiz package
<?php
namespace Trending\Http\Controllers\File;
use Carbon;
use PayUbiz;
use Illuminate\Http\Request;
use Trending\Http\Controllers\Controller;
/**
* -----------------------------------------------------------------------------
* PayUbizTest - a class illustarting the usage of PayUbiz package
* -----------------------------------------------------------------------------
* This class having the functionality to do payment using
* PayUbiz services
*
* @since 1.0.0
* @version 1.0.0
* @author lakshmaji <lakshmajee88@gmail.com>
*/
class PayUbizTest extends AnotherClass
{
public function doPayment()
{
// get input data
$data = $this->request->all();
// All of these parameters are mandatory!
$params = array(
'txnid' => $data['transaction_id'],
'amount' => $data['amount'],
'productinfo' => $data['product_info']',
'firstname' => $data['user_name'],
'email' => $data['user_email']',
'phone' => $data['mobile_number'],
'surl' => 'http://localhost/payubiz_app_development/public/back',
'furl' => 'http://localhost/payubiz_app_development/public/back',
);
// Call to PayUbiz method
$result = PayUbiz::initializePurchase($params);
// Redirect to PayUbiz Payment Gateway services
return $result;
}
/**
* A method to process the results returned from the PayUbiz services
*
*/
public function processResultFromPayUbiz()
{
$result = PayUbiz::completePurchase($_POST);
$params = $result->getParams();
echo $result->getStatus()."\n";
echo $result->getTransactionId()."\n";
echo $result->getTransactionStatus()."\n";
echo $result->getStatus()."\n";
}
}
// end of class PayUbizTest
// end of file PayUbizTest.php
METHOD
PayUbiz::initializePurchase(<PARAMETERS_REQUIRED_BY_PAYUBIZ>);
PayUbiz::completePurchase($_POST);
LICENSE