killgt/sermepa

There is no license information available for the latest version (1.2.0) of this package.

1.2.0 2017-10-16 10:37 UTC

This package is auto-updated.

Last update: 2024-11-29 04:19:48 UTC


README

PHP Sermepa payments utility

Usage

use Killgt\Sermepa\Request;

$fuc = "999008881";
$key = "Mk9m98IfEblmPfrpsawt7BmxObt98Jev";
$useProductionEnviroment = false;
$terminal = "871";
$businessName = "Massive Dynamic";

$request = new Killgt\Sermepa\Request($fuc, $key, $useProductionEnviroment, $terminal, $businessName);

$request->setAmount(45.54);
$request->setOrder('2014abcd1234');
$request->setTransactionType(0);
$request->setCallbackURL('http://example.com/callback');
$request->setSuccessURL('http://example.com/ok');
$request->setErrorURL('http://example.com/error');
$request->setPayer('Peter Bishop');
$request->setProductDescription('The machine');

echo $request->render(); //outputs the form and auto-submit

Checking the callback

$request = new Killgt\Sermepa\Request;
$request->setKey($key);

if ($response = $request->checkCallback($_POST)) {
	// Get $response['Ds_Order'] and update your order
} else {
	// Something went wrong
}