PHPackages                             riazxrazor/payumoney - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. riazxrazor/payumoney

ActiveLibrary[Payment Processing](/categories/payments)

riazxrazor/payumoney
====================

PayUMoney library for Laravel and core PHP

1.0.4(6y ago)02.4k6[2 issues](https://github.com/riazXrazor/payumoey/issues)MITPHPPHP &gt;=5.6.0CI failing

Since May 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/riazXrazor/payumoey)[ Packagist](https://packagist.org/packages/riazxrazor/payumoney)[ Docs](http://github.com/riazxrazor/payumoney)[ RSS](/packages/riazxrazor-payumoney/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

PayUMoney API for Laravel and core PHP
======================================

[](#payumoney-api-for-laravel-and-core-php)

Simple Library/Package for accepting payments via [PayUMoney](https://www.payumoney.com/).

### demo project example

[](#demo-project-example)

Installation
------------

[](#installation)

To add this library to your project, simply add a dependency on `riazxrazor/payumoney` to your project's `composer.json` file. Here is a minimal example of a composer.json file:

```
{
    "require": {
        "riazxrazor/payumoney": "1.*"
    }
}

```

Or you can run this command from your project directory.

```
composer require riazxrazor/payumoney
```

Usage Laravel `(for non laravel usage see below)`
-------------------------------------------------

[](#usage-laravel-for-non-laravel-usage-see-below)

### Configuration

[](#configuration)

Open the `config/app.php` and add this line in `providers` section.

```
Riazxrazor\Payumoney\PayumoneyServiceProvider::class,
```

add this line in the `aliases` section.

```
'Payumoney' => Riazxrazor\Payumoney\PayumoneyFacade::class
```

get the `config` by running this command.

```
php artisan vendor:publish --tag=config
```

config option can be found `config/payumoney.php`

```

    'KEY' => '',

    'SALT' => '',

    'TEST_MODE' => TRUE,

    'DEBUG' => FALSE

```

### Basic Usage

[](#basic-usage)

You can use the function like this.

```
// All of these parameters are required!
// Redirects to PayUMoney
\Payumoney::pay([
                       'txnid'       => 'A_UNIQUE_TRANSACTION_ID',
                       'amount'      => 10.50,
                       'productinfo' => 'A book',
                       'firstname'   => 'Peter',
                       'email'       => 'abc@example.com',
                       'phone'       => '1234567890',
                       'surl'        => url('payumoney-test/return'),
                       'furl'        => url('payumoney-test/return'),
                   ])->send();

// In the return method of controller
$result = \Payumoney::completePay($_POST);

if ($result->checksumIsValid() AND isSuccess()) {
  print 'Payment was successful.';
} else {
  print 'Payment was not successful.';
}

The `PayumoneyResponse` has a few more methods that might be useful:

$result = \Payumoney::completePay($_POST);

// Returns Complete, Pending, Failed or Tampered
$result->getStatus();

// Returns an array of all the parameters of the transaction
$result->getParams();

// Returns the ID of the transaction
$result->getTransactionId();

// Returns true if the checksum is correct
$result->checksumIsValid();
```

Usage Non Laravel
-----------------

[](#usage-non-laravel)

For non laravel usage

### Completing Payment

[](#completing-payment)

```
