2017 © Pedro Peláez
 

library payment-ws-api

SOAP WS API to call Lyra payment services in PHP based websites.

image

jrodella/payment-ws-api

SOAP WS API to call Lyra payment services in PHP based websites.

  • Tuesday, March 6, 2018
  • by jrodella
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Lyra payment WS API

Lyra payment WS API is an open source PHP API that allows making SOAP WS calls to secured payment services developped by Lyra Network inside e-commerce websites., (*1)

Requirements

PHP 5.3.0 and later., (*2)

Installation

Composer

You can install the API via Composer. Run the following command:, (*3)

composer require lyranetwork/payment-ws-api

To use the API, use Composer's autoload:, (*4)

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the API, include the init.php file., (*5)

require_once('/path/to/payment-ws-api/init.php');

Usage

try {
    $ctxMode = 'TEST';
    $keyTest = '1111111111111111';
    $keyProd = '2222222222222222';
    $shopId = '12345678';

    // proxy options if any
    $options = array(
        'proxy_host' => 'host',
        'proxy_port' => '3128',
        'proxy_login' => 'login',
        'proxy_password' => 'password'
    );

    $wsApi = new \Lyranetwork\WsApi($options, $url);
    $wsApi->init($shopId, $ctxMode, $keyTest, $keyProd);

    // example of getPaymentDetails call
    $queryRequest = new \Lyranetwork\QueryRequest();
    $queryRequest->setUuid($uuid); // a known transaction UUID

    $getPaymentDetails = new \Lyranetwork\GetPaymentDetails($queryRequest);
    $getPaymentDetails->setQueryRequest($queryRequest);

    $requestId = $wsApi->setHeaders();

    $getPaymentDetailsResponse = $wsApi->getPaymentDetails($getPaymentDetails);

    $wsApi->checkAuthenticity();
    $wsApi->checkResult(
        $getPaymentDetailsResponse->getGetPaymentDetailsResult()->getCommonResponse(),
        array(
            'INITIAL', 'WAITING_AUTHORISATION', 'WAITING_AUTHORISATION_TO_VALIDATE',
            'UNDER_VERIFICATION', 'AUTHORISED', 'AUTHORISED_TO_VALIDATE', 'CAPTURED', 'CAPTURE_FAILED'
        ) // pending or accepted payment
    );

} catch(\SoapFault $f) {
    log("[$requestId] SoapFault with code {$f->faultcode}: {$f->faultstring}.", Zend_Log::WARN);

    // friendly message here 
} catch(\UnexpectedValueException $e) {
    log("[$requestId] getPaymentDetails error with code {$e->getCode()}: {$e->getMessage()}.", Zend_Log::ERR);

    if ($e->getCode() === -1) {
        // manage authentication error here
    } elseif ($e->getCode() === 1) {
        // merchant does not subscribe to WS option
    } else {
        // manage other unexpected response here
    }
} catch (Exception $e) {
    log("[$requestId] Exception with code {$e->getCode()}: {$e->getMessage()}", Zend_Log::ERR);

    // friendly message here 
}

License

Each Lyra payment WS API source file included in this distribution is licensed under GNU GENERAL PUBLIC LICENSE (GPL 3.0)., (*6)

Please see LICENSE.txt for the full text of the GPL 3.0 license. It is also available through the world-wide-web at this URL: http://www.gnu.org/licenses/., (*7)

The Versions

06/03 2018

dev-master

9999999-dev

SOAP WS API to call Lyra payment services in PHP based websites.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0
  • ext-curl *

 

api php payment sdk soap e-commerce ws wsdl lyra

06/03 2018

v1.0.1

1.0.1.0

SOAP WS API to call Lyra payment services in PHP based websites.

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.0
  • ext-curl *

 

api php payment sdk soap e-commerce ws wsdl lyra

06/03 2018

dev-develop

dev-develop

SOAP WS API to call Lyra payment services in PHP based websites.

  Sources   Download

GPL-3.0+

The Requires

 

api php payment sdk soap e-commerce ws wsdl lyra

06/03 2018

1.0.0

1.0.0.0

SOAP WS API to call Lyra payment services in PHP based websites.

  Sources   Download

GPL-3.0+

The Requires

 

api php payment sdk soap e-commerce ws wsdl lyra