Skip to content

PHP SDK for developing merchant applications which accept 18app vouchers

License

Notifications You must be signed in to change notification settings

ste80pa/18app-php-sdk

 
 

Repository files navigation

Minimum PHP Version

Synopsis

This project i part of Developers Italia initiative.

Converting the certificate

This library uses client certificate in pem format. To generate a pem format certificate from an existing pkcs12 archive use the following command

openssl pkcs12 -in key.p12 -out key.pem -clcerts

Code Example

Invoking the activation procedure

<?php
require_once 'autoload.php';
use Italia\SDK18App\Client;
use Italia\SDK18App\Base\ResponseException;
$certificatePath = implode(DIRECTORY_SEPARATOR, array(
    __DIR__,
    '..',
    'key.pem'
));
$wsdlPath = implode(DIRECTORY_SEPARATOR, array(
    __DIR__,
    '..',
    'VerificaVoucher.wsdl'
));
// create a new instance of the client
$client = new Client($certificatePath, $wsdlPath);
try {
    print_r($client->activate());
} catch (ResponseException $e) {
    // Protocol Exception
    echo $e->getMessage();
} catch (Exception $e) {
    // Other problems occurred
    echo $e->getMessage();
}

Motivation

Installation

Tests

To run all tests

phpunit

Contributors

License

About

PHP SDK for developing merchant applications which accept 18app vouchers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%