GithubHelp home page GithubHelp logo

connectum's Introduction

Platron Connectum SDK

Install

composer require platron/connectum-sdk

To use SDK you need to generate pem certificate and private key. You could use this command

openssl pkcs12 -in login.p12 -out private.key -nocerts -nodes
openssl pkcs12 -in login.p12 -out certificate.cer -nokeys

Start tests

composer install

To use tests copy tests/integration/MerchantSettingsSample.php and delete Sample substring. Than use

vendor/bin/phpunit tests/integration

Samples

  1. Set connection settings in object
$connectionSettings = new Platron\Connectum\data_objects\ConnectionSettingsData();
$connectionSettings->login = 'login';
$connectionSettings->password = 'password';
$connectionSettings->certificatePath = 'path_to_cert.pem';
$connectionSettings->certificatePassword = 'certificate_password;
  1. Auth
$client = new Platron\Connectum\clients\PostClient($connectionSettings);
        
$card = new Platron\Connectum\data_objects\CardData();
$card->holder = 'test test';
$card->cvv = '123';
$card->expiration_month = '06';
$card->expiration_year = '2022';

$location = new Platron\Connectum\data_objects\LocationData();
$location->ip = '8.8.8.8';

$request = new Platron\Connectum\services\order_authorize\OrderAuthorizeRequest(10, 'RUB', '4111111111111111', $card, $location);
$response = new Platron\Connectum\services\order_authorize\OrderAuthorizeResponse($client->sendRequest($request));
  1. Capture
$client = new Platron\Connectum\clients\PutClient($connectionSettings);
$request = new Platron\Connectum\services\order_charge\OrderChargeRequest(111, 10.00);
$response = new Platron\Connectum\services\order_charge\OrderChargeResponse($client->sendRequest($request));
  1. Order list
$client = new Platron\Connectum\clients\GetClient($this->connectionSettings);
$request = new Platron\Connectum\services\order_list\OrderListRequest();

$card = new Platron\Connectum\data_objects\CardData();
$card->type = Platron\Connectum\handbooks\OrderStatus::PREPARED;
$request->setCard($card);

$response = new Platron\Connectum\services\order_list\OrderListResponse($client->sendRequest($request));

connectum's People

Contributors

lashnag avatar schursin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.