2017 © Pedro Peláez
 

library qiwi-service-provider-sdk

QIWI service provider connection interface

image

fruitware/qiwi-service-provider-sdk

QIWI service provider connection interface

  • Sunday, December 14, 2014
  • by fruitware.ru
  • Repository
  • 3 Watchers
  • 4 Stars
  • 185 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 20 % Grown

The README.md

QIWI service provider connection interface

Requirements

  • php >= 5.3
  • ext-SimpleXML

Install

Composer

{
    "require": {
        "fruitware/qiwi-service-provider-sdk": "dev-master"
    },
}

Create custom command classes

Create your CheckCommand class


<?php namespace Acme\QiwiServiceProvider\Command; use Fruitware\QiwiServiceProvider\Model\Method\Check\CheckRequest; use Fruitware\QiwiServiceProvider\Model\Method\Check\CheckResponse; class CheckCommand extends CheckRequest { /** * Internal logic processing * * @return CheckResponse */ public function process() { // some your logic here /** * @var CheckResponse $response */ $response = $this->getResponse(); return $response ->setOsmpTxnId($this->getTxnId()) // required ->setResult(0) // required ->setComment('some Check comment') // not required ; } }

Create your PayCommand class


<?php namespace Acme\QiwiServiceProvider\Command; use Fruitware\QiwiServiceProvider\Model\Method\Pay\PayRequest; use Fruitware\QiwiServiceProvider\Model\Method\Pay\PayResponse; class PayCommand extends PayRequest { /** * Internal logic processing * * @return PayResponse */ public function process() { // some your logic here /** * @var PayResponse $response */ $response = $this->getResponse(); return $response ->setOsmpTxnId($this->getTxnId()) // required ->setPrvTxn(123) // required ->setSum($this->getSum()) // required ->setResult(0) // required ->setComment('some pay comment') // not required ; } }

Usage

In your controller, (*1)


<?php /** * Get ips from the contract! */ $validIps = array( '127.0.0.1', // for the test gate interface // '127.0.0.2', // for the production gate interface ); $service = new \Fruitware\QiwiServiceProvider\Service($validIps, [ 'check' => 'Acme\QiwiServiceProvider\Command\CheckCommand', 'pay' => 'Acme\QiwiServiceProvider\Command\PayCommand', ]); /** * @var \Fruitware\QiwiServiceProvider\Model\Request\RequestInterface $method */ $method = $service->handleRequest($_GET); $xmlResponseString = $method->process()->xml()->asXML(); echo $xmlResponseString;

The Versions

14/12 2014

dev-master

9999999-dev https://github.com/Fruitware/qiwi-service-provider-sdk

QIWI service provider connection interface

  Sources   Download

MIT

The Requires

  • php >= 5.3
  • ext-simplexml *

 

sdk provider qiwi

08/12 2014

0.1

0.1.0.0 https://github.com/Fruitware/qiwi-service-provider-sdk

QIWI service provider connection interface

  Sources   Download

MIT

The Requires

  • php >= 5.3
  • ext-simplexml *

 

sdk provider qiwi