Download the PHP package parazeet/paymaster_api_php_sdk without Composer

On this page you can find all versions of the php package parazeet/paymaster_api_php_sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package paymaster_api_php_sdk

paymaster_api_php_sdk

PHP SDK для PayMaster API v2.

Latest Version on Packagist PHP Version

Requirements

Installation

Setup

Создайте клиент с API-ключом (токены в кабинете). Для POST-запросов рекомендуется передавать Idempotency-Key (например через ramsey/uuid).

Базовый URL: https://paymaster.ru/api/v2/.

Available methods

Method HTTP Returns
$api->post($request) POST /{resource}/ Response
$api->getId($request, $id) GET /{resource}/{id} Response
$api->getQuery($request, $query) GET /{resource}/?... Response (list items)
$api->put($request, $id, $type?) PUT /{resource}/{id}[/{type}] Response или true

Поведение put()

Вызов Endpoint Успешный ответ
put($payment, $id, 'complete') PUT /payments/{id}/complete PaymentResponse (JSON body)
put($payment, $id, 'confirm') PUT /payments/{id}/confirm true (пустой HTTP 200)
put($payment, $id, 'cancel') PUT /payments/{id}/cancel true
put($token, $id, 'complete') PUT /paymenttokens/{id}/complete PaymentTokenResponse
put($token, $id, 'revoke') PUT /paymenttokens/{id}/revoke true
put($sticker->active(false), $id) PUT /stickers/{id} true

$type опциональный: если null, вызывается PUT /{resource}/{id} без суффикса (для активации стикеров).

Request classes

Class Resource Typical operations
InvoiceRequest invoices создание ссылки на оплату
PaymentRequest payments create / get / list / complete / confirm / cancel
RefundRequest refunds create / get / list
TokenizationRequest tokenization ссылка на привязку карты
PaymentTokenRequest paymenttokens create / get / complete / revoke
ReceiptRequest receipts create / get / list
StickerRequest stickers create / get / list / activate

Examples

Invoice (ссылка на оплату)

Payment — создание

Payment — get / list

Payment — complete (3DS) / confirm (capture) / cancel

Для complete / confirm в toArray() попадает только соответствующий action-payload (completeData / confirmData), не create-тело платежа.

Tokenization (ссылка на привязку)

Payment token — создание / get / complete / revoke

Receipt (чеки)

Resource: receipts (POST/GET /api/v2/receipts).

Sticker — создание / активация

Не передавайте третьим аргументом 'active' — согласно API путь без суффикса: PUT /stickers/{id}.

Свойство ответа: $response->sticker (раньше ошибочно называлось $receipt).

Refund

Error handling

При ошибке API SDK выбрасывает исключения из parazeet\PayMaster\Exceptions\* (например ErrorContentFormatException, ErrorUnauthorizedException, UnknownCodeException, EmptyResponseException, PayMasterHttpException, ErrorSyntaxException).

Валидация ошибок срабатывает только для error-envelope {code, message, errors?} — успешный платёж/refund с полем resultCode (без верхнего code) исключения не бросает.

Известные коды ошибок API (validation_error, not_authorized, idempotency_key_violation, invalid_operation, payment_token_revoked, payment_token_blocked) и коды авторизации — мапятся в ResponseValidator.

HTTP-статус вне 2xx → PayMasterHttpException (доступны statusCode(), responseBody()).

Пустой body на GET/POST или невалидный JSON → PayMasterHttpException / ErrorSyntaxException.

Notes


All versions of paymaster_api_php_sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package parazeet/paymaster_api_php_sdk contains the following files

Loading the files please wait ...