sylapi/omnipay-paylane

Paylane gateway for Omnipay payment processing library

v1.0.1 2020-06-29 10:52 UTC

This package is auto-updated.

Last update: 2024-04-15 23:31:11 UTC


README

Paylane driver for the Omnipay PHP payment processing library

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

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "sylapi/paylane": "~1.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic purchase example

$gateway = Omnipay\Omnipay::create('Paylane');
$gateway->setApiKey('--API Login--');
$gateway->setApiPassword('--API Password--');
$gateway->setIp('--IP--');

$response = $gateway->purchase(
    [
        "amount" => "100.00",
        "currency" => "PLN",
        "description" => "My Payment",
        "transactionId" => "12345",
        "email" => "name@example.com",
        "name" => "Fisrtname Lastname",
        "payMethod" => "m",
        "items" => [
            [
                "name" => "Product name",
                "price" => "100.00",
                "quantity" => 1
            ]
        ],
         "card" => [
            "firstName" => "Fisrtname",
            "lastName" => "Lastname",
            "number" => "4111111111111111",
            "cvv" => "123",
            "expiryMonth" => "12",
            "expiryYear" => "2025",
            "email" => "name@example.com"
        ],
        "returnUrl" => "https://example.org/paylane-success.php",
        "cancelUrl" => "https://example.org/paylane-error.php",
        "notifyUrl" => "https://example.org/paylane-callback.php",
    ]
)->send();

// Process response
if ($response->isSuccessful()) {

    $result = $response->getData();
    
    if ($response->isRedirect()) {
        $response->redirect();
    }
} 
else {

    // Payment failed
    echo $response->getMessage();
    echo $response->getCode();
}

Basic purchase success example

$response = $gateway->completePurchase($_POST);

if ($response->isSuccessful()) {

    $message = $response->getMessage();
    $status = $response->getStatus();
}
else {
    $error = $response->getMessage();
    $code = $response->getCode();
}

Basic Usage

The following gateways are provided by this package:

  • Paylane

This is a dummy gateway driver intended for testing purposes. If you provide a card number ending in an even number, the driver will return a success response. If it ends in an odd number, the driver will return a generic failure response. For example:

  • 4111111111111111 - Visa - Sale successful
  • 5500000000000004 - MasterCard - Sale successful
  • 370000000000002 - American Express - Sale successful
  • 4000000000000069 - Visa - 3-D Secure authentication is required.(sale error 700)
  • 4012001036275556 - Visa - Unable to verify card enrollment (enrollment check error 720)
  • 4012001038488884 - Visa - Unable to verify card enrollment (enrollment check error 720)
  • 4012001036298889 - Visa - Unable to verify card enrollment (enrollment check error 720)
  • 4012001038443335 - Visa - 3-D Secure Enrollment testing – card not enrolled in 3-D Secure
  • 4012001036853337 - Visa - Card enrolled, verification failed (sale error 703)
  • 4012001036983332 - Visa - Card enrolled, verification failed (sale error 703)
  • 4012001037490006 - Visa - Card enrolled, verification failed (sale error 703)
  • 4012001037461114 - Visa - Card enrolled, authentication failure (sale error 704)
  • 4012001037484447 - Visa -Card enrolled, authentication not available (sale error 725)

All errors Paylane system

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

Support

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 anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.