Download the PHP package openpayu/openpayu_php_sdk without Composer

On this page you can find all versions of the php package openpayu/openpayu_php_sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openpayu_php_sdk

Official OpenPayU PHP Library

The OpenPayU PHP library provides integration access to the REST API 2.1

Dependencies

PHP >= 5.3 with extensions cURL and hash

Documentation

Full implementation guide: English, Polish.

To process operations such as:

You will need to provide a parameter called orderId. The value of orderId is your order identifier that is set by PayU Payment system, and it's used to invoke remote methods.

There are two ways to get orderId:

  1. It is present inside the received notification message from PayU Payment System as a result of payment.
  2. In the response from method OpenPayU_Order::create.

In both cases you will find orderId using this statement: $response->getResponse()->orderId.

Installation

Composer

To install with Composer, simply add the requirement to your composer.json file:

Then install by running

Manual installation

Obtain the latest version of openpayu_php SDK with:

Getting started

If you are using Composer use autoload functionality:

Or simply add this lines anywhere in your application:

Configure

Important: SDK works only with 'REST API' (Checkout) points of sales (POS). If you do not already have PayU merchant account, please register in Production or please register in Sandbox

Example "Configuration keys" from Merchant Panel

To configure OpenPayU environment you must provide a set of mandatory data in config.php file.

For production environment:

For sandbox environment:

If you want to use sandbox environment, register at this link https://secure.snd.payu.com/cp/register?lang=en

OAuth configuration

SDK supports two PayU OAuth grant types: client_credentials and trusted_merchant. Default is client_credentials.

If you want to change grant type use:

grant_type can be one of the following OauthGrantType::CLIENT_CREDENTIAL or OauthGrantType::TRUSTED_MERCHANT

Parameters needed for client_credentials

Parameters needed for trusted_merchant

Connection over Proxy

Cache

OpenPayU library automatically stores OAuth authentication data in the Cache.

OpenPayU library has two classes implemented to manage the Cache:

It is possible to implement another method to manage cache. In such a case it needs to implement OauthCacheInterface

Usage

Remember: All keys in "order array" must be in lowercase.

Creating order using REST API

File with working example: examples/v2/order/OrderCreate.php

To create an order using REST API in back-end you must provide an Array with order data:

in your controller

Retrieving order from OpenPayU

File with working example: examples/v2/order/OrderRetrieve.php

You can retrieve order by its PayU order_id

Retrieving transactions for order from OpenPayU

File with working example: examples/v2/order/OrderTransactionRetrieve.php

You can retrieve transactions for order by its PayU order_id

Cancelling order

File with working example: examples/v2/order/OrderCancel.php

You can cancel order by its PayU order_id

Updating order status

File with working example: examples/v2/order/OrderStatusUpdate.php

You can update order status to accept order.

Handling notifications from PayU

File with working example: examples/v2/order/OrderNotify.php

PayU sends requests to your application when order status changes

Refund money

File with working example: examples/v2/refund/RefundCreate.php

You can create refund to refund money on buyer account

Retrieving pay methods from POS

File with working example: examples/v2/retrieve/RetrievePaymethods.php

You can retrieve pay methods from POS

You can add optional parameter lang to payMethods()

Delete card token

File with working example: examples/v2/token/TokenDelete.php

You can delete user's card token.

Token deletion is possible only for trusted_merchant grant type.

Get Shop

File with working example: examples/v2/shops/Get.php

You can retrieve shop data.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

All versions of openpayu_php_sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.19 | >=5.6.3
ext-curl Version *
ext-hash Version *
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package openpayu/openpayu_php_sdk contains the following files

Loading the files please wait ....