Download the PHP package yandex-money/yandex-money-sdk-php without Composer
On this page you can find all versions of the php package yandex-money/yandex-money-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yandex-money/yandex-money-sdk-php
More information about yandex-money/yandex-money-sdk-php
Files in yandex-money/yandex-money-sdk-php
Package yandex-money-sdk-php
Short Description Yandex.Money API SDK for PHP
License MIT
Informations about the package yandex-money-sdk-php
PHP Yandex.Money API SDK
Requirements
PHP 5.3 or above
Links
- Yandex.Money API page: Ru, En
- sample app
Getting started
Installation
- Add
"yandex-money/yandex-money-sdk-php": "3.0.*"
tocomposer.json
of your application. Or clone repo to your project. - If you are using composer - simply use
require_once 'vendor/autoload.php';
otherwise paste following code
Payments from the Yandex.Money wallet
Using Yandex.Money API requires following steps
-
Obtain token URL and redirect user's browser to Yandex.Money service. Note:
client_id
,redirect_uri
,client_secret
are constants that you get, when register app in Yandex.Money API. -
After that, user fills Yandex.Money HTML form and user is redirected back to
REDIRECT_URI?code=CODE
. -
You should immediately exchange
CODE
withACCESS_TOKEN
. - Now you can use Yandex.Money API.
Payments from bank cards without authorization
-
Fetch instantce-id(ussually only once for every client. You can store result in DB).
-
Make request payment
- Process the request with process-payment.
Side notes
- Library throws exceptions in case of
- response status isn't equal 2**
- I/O error(see requests)
- If you register app and fill
CLIENT_SECRET
entry then you should provide$client_secret
explicitly where$client_secret=NULL
- You should wrap all passed boolean values in quotes(because php converts them to numbers otherwise). For example:
Running tests
- Clone this repo.
- Install composer
- Run
composer install
- Make sure
phpunit
executable is present in your$PATH
- Create
tests/constants.php
withCLIENT_ID
,CLIENT_SECRET
andACCESS_TOKEN
constants. - Run tests
phpunit --bootstrap vendor/autoload.php tests/