payutc/php-client

PHP client for the payutc servers

dev-master 2023-03-07 18:58 UTC

This package is not auto-updated.

Last update: 2024-04-27 12:48:52 UTC


README

A PHP client for the payutc server.

Install

If you are not using the Composer dependency manager in your project, download it :

$ curl -sS https://getcomposer.org/installer | php

Then, create (or edit) the composer.json file :

{
    "require": {
        "payutc/php-client": "*"
    }
}

Now, run Composer to download the dependency :

$ php composer.phar install

Usage

Here is an example of using the AutoJsonClient, which allows you to call any method dynamically.

<?php

require_once "vendor/autoload.php";

use \Payutc\Client\AutoJsonClient;
use \Payutc\Client\JsonException;

$c = new AutoJsonClient("http://localhost/payutc/server/", "MYACCOUNT");

$result = $c->getCasUrl();
var_dump($result);

try {
	$result = $c->loginCas(array(
        "ticket" => "CAS-TICKET-42",
        "service" => "http://localhost/payutc/casper/"
    ));
    var_dump($result);
}
catch (JsonException $e) {
	echo $e.PHP_EOL;
}