Download the PHP package subscribo/omnipay-payunity without Composer

On this page you can find all versions of the php package subscribo/omnipay-payunity. 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 omnipay-payunity

Omnipay: PayUnity

PayUnity driver for the Omnipay PHP payment processing library

Build Status

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements PayUnity support for Omnipay.

Versions

Omnipay PayUnity driver version PayUnity COPYandPAY version Post Gateway
0.2.x 4 No
0.3.x 4 purchase() with token billing, refund(), void()
0.4.x 4 also authorize() and capture()

Installation

Omnipay PayUnity driver (beta version) is installed via Composer. To install, add it to your composer.json file:

and run composer to update your dependencies:

Basic Usage

The following gateways are provided by this package:

Gateways in this package have following required options:

To get those please contact your PayUnity representative.

(Note: they are provided usually in the form 'SECURITY.SENDER' etc.)

Additionally these options could be specified:

For meaning and possible values of transactionMode ('TRANSACTION.MODE') see PayUnity documentation.

For meaning of testMode see general Omnipay documentation

Setting registrationMode to true prepends RG. to default transaction mode, thus making the request also registration request. When transactionMode is specified, then registration mode is ignored (so you have to prepend 'RG.' manually, if you want to make the request registration)

Gateway PayUnity\COPYandPAY

Gateway PayUnity\COPYandPAY supports these request-sending methods:

Method purchase()

Method purchase() expects an array with these keys as its argument:

Additionally these keys could be specified:

Option brands could be an array or string with space separated list of (uppercase) brand identifiers, supported by COPYandPAY widget. For supported brands see COPYandPAY documentation.

Option returnUrl should be an absolute url in your site, where user should be redirected after payment.

You need to provide brands and returnUrl either as part of purchase() argument, or when creating a widget later.

Method purchase() returns an instance of CopyAndPayPurchaseRequest having method send(), which in turn is sending the request and returning an instance of CopyAndPayPurchaseResponse having the following methods (additional to standard Omnipay RequestInterface methods and besides other helper and static methods):

Method isSuccessful() always returns false, as the COPYandPAY workflow is as follows:

  1. using purchase() method you acquire transactionToken,
  2. then create or get (using CopyAndPayPurchaseResponse::getWidget()) frontend widget and display it to customer (you can echo it or render it by parts, see CopyAndPayWidget class for more details)
  3. and when customer fills and sends the widget,
  4. he is redirected to returnUrl provided,
  5. where you can finish/check the transaction (see below)

Class CopyAndPayWidget

Class constructor, methods render(), isRenderable(), renderHtmlForm(), renderJavascript() and CopyAndPayPurchaseResponse::getWidget() accepts as first (optional) argument array with following keys:

First two parameters are usually provided to the constructor via CopyAndPayPurchaseResponse::getWidget(), if returnUrl and/or brands had been set on purchase() method, these are provided as well, otherwise they should be provided manually either through setters of CopyAndPayWidget object or via $parameters argument on rendering.

Methods:

Method completePurchase()

Method completePurchase() could be called after customer had been redirected from widget (see above) back to your site. It expects an array with key 'transactionToken' as a parameter, however it could be invoked also with an empty array and you can provide transaction token to returned instance of CopyAndPayCompletePurchaseRequest via setTransactionToken($token) or fill(CopyAndPayPurchaseResponse $response) methods. If transactionToken is not provided manually, an attempt will be made to retrieve it from httpRequest, provided to gateway constructor. (That usually means, that if you do not specify transactionToken, it will be taken from url query of current page automatically.)

After transactionToken is provided to CopyAndPayCompletePurchaseRequest, you can call its send() method and receive CopyAndPayCompletePurchaseResponse.

Method CopyAndPayCompletePurchaseResponse::isWaiting() returns true when customer did not yet sent the widget form. For other methods see Post and CopyAndPayCompletePurchase responses

Gateway PayUnity\Post

Gateway PayUnity\Post contains following methods:

Method purchase() and authorize()

Following parameters are needed (either as argument of purchase() / authorize() method or set via setters on PostPurchaseRequest / PostAuthorizeRequest returned):

In order to use tokens returned by getCardReference() from CopyAndPayCompleteResponse, you need to provide them to PostPurchaseRequest either via parameter during purchase(['cardReference' => '...']); call or using setCardReference() setter.

Method capture()

Required parameters:

You may optionally specify transaction method ('CC', 'DD', ...), either directly via setPaymentMethod() or indirectly, using reference stored in registration token via setCardReference() method.

For setting transactionReference and cardReference you may use also method fill()

Methods void() and refund()

Methods void() and refund() need parameter transactionReference set either via parameter, i.e. void(['transactionReference' => '...']); or using setTransactionReference() method of PostRefundRequest or PostVoidRequest. Its value may be obtained from transaction-to-be-voided/refunded response object using getTransactionReference() method. (see refund.php for code examples.)

You may optionally specify transaction method ('CC', 'DD', ...), either directly via setPaymentMethod() or indirectly, using reference stored in registration token via setCardReference() method.

Method refund() needs also amount and currency parameters.

Post requests

Post gateway requests - GenericPostRequests and its subclasses (PostPurchaseRequest, PostRefundRequest, PostVoidRequest) have these parameters (and corresponding setter getter methods):

And also other parameters inherited from common Omnipay interface, such as card, cardReference, amount, currency...

Parameters amount and currency are required for PostPurchaseRequest and PostRefundRequest.

Parameter cardReference and/or transactionReference is required for proper processing of all Post gateway requests.

Payment code is computed using values from provided paymentCode, paymentType, paymentMethod, cardReference parameters and default values. Default values and particular payment code computing algorithm is specific to particular request class.

Besides methods inherited from common Omnipay interface (such as send() or initialize()), Post gateway requests provide method fill() to make chaining requests easier.

Method fill()

Method fill() accepts two arguments:

Constants could be combined using bit arithmetic. Available combination constants:

Depending on $fillMode, cardReference, transactionReference, amount, currency and/or description parameters are being set on request, on which this method has been used, using values from provided $response object. If $fillMode is set to true (default), default fill mode for particular request class is used. If the value provided evaluates as empty (or '0.00' for amount), the particular parameter is left intact.

Post and CopyAndPayCompletePurchase responses

Post gateway responses as well as CopyAndPayCompletePurchase response have also following methods:

Method getCode() tries to get 'PROCESSING.STATUS.CODE', either directly or by parsing 'PROCESSING.CODE', if both fails, then it tries to provide error code from 'POST.VALIDATION'.

Method getMessage() tries to concatenate (with colon and spaces if both are provided) 'PROCESSING.REASON' and 'PROCESING.RESULT'.

Method getCardReference() returns tokens, which could be used for subsequent requests, via specifying cardReference option on purchase request. These tokens are base64-encoded json, containing data from 'ACCOUNT.REGISTRATION' and 'PAYMENT.CODE'

Method getPresentationAmount() might return '0.00' instead of an empty / not specified value.

Methods getPresentationAmount(), getPresentationCurrency(), getPresentationUsage() usually returns null for CopyAndPayCompletePurchase.

Example code

For example code see:

To run full workflow of example code you need to set up you routing mechanism to actually reach those examples, provide your valid API credentials as environment variables PAYUNITY_USER_LOGIN, PAYUNITY_USER_PWD, PAYUNITY_SECURITY_SENDER, PAYUNITY_TRANSACTION_CHANNEL and PAYUNITY_DRIVER_FOR_OMNIPAY_EXAMPLES_URL_BASE containing url base to your examples. (or you can provide these data by modifying your copy of example code itself)

General instructions

For general usage instructions, please see the main Omnipay repository.

Testing

For testing you need to install development dependencies:

If you want to run both online and offline tests, run just phpunit.

If you want to run offline (not requiring internet connection) tests only, run:

For some online tests you might need to provide following environment variables, containing your API credentials: PAYUNITY_USER_LOGIN, PAYUNITY_USER_PWD, PAYUNITY_SECURITY_SENDER, PAYUNITY_TRANSACTION_CHANNEL and PAYUNITY_DRIVER_FOR_OMNIPAY_TESTING_ACCOUNT_REGISTRATION_REFERENCE containing registration reference string, which you can create e.g. via using example code for COPYandPAY workflow (with environment variables with the same API credentials). It should be displayed as Card Reference on COPYandPAY Complete purchase page.

Support

General

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

Omnipay PayUnity driver specific

If you believe you have found a bug, please send us an e-mail ([email protected]) or report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

Links


All versions of omnipay-payunity with dependencies

PHP Build Version
Package Version
Requires php Version ^5.4 || 7.0@dev
omnipay/common Version ~2.3.4
psr/http-message Version ~1.0
egeloen/http-adapter Version ~0.8.0
subscribo/omnipay-subscribo-shared Version ~0.3.6
subscribo/psr-http-message-tools Version ~0.4.3
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 subscribo/omnipay-payunity contains the following files

Loading the files please wait ....