2017 © Pedro Peláez
 

library platba-mobilom-php-sdk

SDK for payment gateway PlatbaMobilom.sk for PHP7.0

image

martinvondrak/platba-mobilom-php-sdk

SDK for payment gateway PlatbaMobilom.sk for PHP7.0

  • Thursday, January 11, 2018
  • by VondrakM
  • Repository
  • 0 Watchers
  • 0 Stars
  • 121 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

PlatbaMobilom.sk PHP SDK

This library provides simple interface for making payments through PlatbaMobilom.sk. In general PlatbaMobilom.sk supports online and offline payments. This library currently supports only online payment., (*1)

Requirements

  • PHP >= 7.0

Installation

The easiest way to install the SDK is to use dependency manager called Composer., (*2)

$ composer require martinvondrak/platba-mobilom-php-sdk

Basic usage

Setting up client

use MartinVondrak\PlatbaMobilom\PlatbaMobilomClient;

$pid = 1; // merchant ID
$url = 'https//www.shop.com/callback'; // URL of callback where user will be redirected from PlatbaMobilom.sk
$pwd = 'SecretPass'; // passphrase used for signing requests
$email = 'sales@shop.com'; // merchant email (optional)
$debug = true; // flag whether production or test environment is used
$platbaMobilomClient = new PlatbaMobilomClient($pid, $url, $pwd, $email, $debug);

Creating payment

use MartinVondrak\PlatbaMobilom\Http\Request;

$id = 'aef4622'; // unique ID of payment
$description = 'Payment in www.shop.com'; // description of payment
$price = 6.5; // amount to pay in EUR
$request = new Request($id, $description, $price);
// client from previous step
$redirectUrl = $platbaMobilomClient->getGatewayUrl($request);
// now redirect user to $redirectUrl

Verifying payment

use MartinVondrak\PlatbaMobilom\Exception\InvalidSignatureException;
use MartinVondrak\PlatbaMobilom\Http\Response;

// following attributes are in query string in request on callback url from first step
$id = $_GET['ID']; // unique ID of payment
$result = $_GET['RES']; // status of payment
$responseSignature = $_GET['SIGN']; // signature of received parameters
$phone = $_GET['PHONE']; // phone number used for payment (optional)
$response = new Response($id, $result, $responseSignature, $phone);

try {
    // client from first step
    if ($platbaMobilomClient->checkResponse($response)) {
        // paid
    } else {
        // not paid or error
    }
} catch (InvalidSignatureException $ex) {
    // signature is not valid for received data
}

PlatbaMobilom.sk documentation

For further information there is the official documentation of PlatbaMobilom.sk. Unfortunately the documentation is only in Slovak language., (*3)

The Versions

11/01 2018

dev-master

9999999-dev https://github.com/MartinVondrak/platba-mobilom-php-sdk

SDK for payment gateway PlatbaMobilom.sk for PHP7.0

  Sources   Download

MIT

The Requires

  • php >=7.0

 

payment sms

11/01 2018

dev-devel

dev-devel https://github.com/MartinVondrak/platba-mobilom-php-sdk

SDK for payment gateway PlatbaMobilom.sk for PHP7.0

  Sources   Download

MIT

The Requires

  • php >=7.0

 

payment sms

11/01 2018

0.1

0.1.0.0 https://github.com/MartinVondrak/platba-mobilom-php-sdk

SDK for payment gateway PlatbaMobilom.sk for PHP7.0

  Sources   Download

MIT

The Requires

  • php >=7.0

 

payment sms