2017 © Pedro Peláez
 

library payubiz

payubiz

image

lakshmaji/payubiz

payubiz

  • Sunday, June 4, 2017
  • by lakshmaji
  • Repository
  • 1 Watchers
  • 2 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 10 % Grown

The README.md

PayUbiz

What it is

  • Integrates the PayUbiz services with Laravel application.

Version

1.0.1, (*1)


Installation

  • This package is available on packagist and we can simply download it by issuing the following command on terminal within the project root directory.
    composer require lakshmaji/payubiz
  • Add the Service Provider to providers array
        Lakshmaji\PayUbiz\PayUbizServiceProvider::class,
  • Add the Facade to aliases array
        'PayUbiz' => Lakshmaji\PayUbiz\Facade\PayUbiz::class,
  • Try updating the application with composer (dependencies) bash composer update
  • Publish configuration files
   php artisan vendor:publish
  • Populate config/payubiz.php with credentials and enable production mode.
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, (*2)

<?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 
 */
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

MIT, (*3)

The Versions

04/06 2017

dev-master

9999999-dev

payubiz

  Sources   Download

MIT

The Requires

 

by Avatar lakshmaji

laravel composer payment gateway integrations payubiz

04/06 2017

1.0.3

1.0.3.0

payubiz

  Sources   Download

MIT

The Requires

 

by Avatar lakshmaji

laravel composer payment gateway integrations payubiz

04/06 2017

1.0.2

1.0.2.0

payubiz

  Sources   Download

MIT

The Requires

 

by Avatar lakshmaji

laravel composer payment gateway integrations payubiz

05/12 2016

1.0.1

1.0.1.0

payubiz

  Sources   Download

MIT

The Requires

 

by Avatar lakshmajim

laravel composer payment gateway integrations payubiz

05/12 2016

1.0.0

1.0.0.0

payubiz

  Sources   Download

MIT

The Requires

 

by Avatar lakshmajim

laravel composer payubiz