PHP code example of parazeet / paymaster_api_php_sdk

1. Go to this page and download the library: Download parazeet/paymaster_api_php_sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

parazeet / paymaster_api_php_sdk example snippets


use parazeet\PayMaster\PayMasterApi;
use parazeet\PayMaster\Config\Config;
use parazeet\PayMaster\Validator\ResponseValidator;

$api = new PayMasterApi(
    new Config('YOUR_API_KEY', $idempotencyKey = null),
    new ResponseValidator()
);

use parazeet\PayMaster\Requests\InvoiceRequest;

$objInvoiceRequest = (new InvoiceRequest())
    ->merchantId('YOUR_SHOP_KEY')
    ->testMode(true)
    ->invoice(['description' => 'test'])
    ->amount(['value' => 11, 'currency' => 'RUB'])
    ->paymentMethod('BankCard')
    ->customer([
        'email' => '[email protected]',
        'phone' => '79081234567',
        'ip' => '192.168.1.1',
        'account' => 'test'
    ]);

$api->post($objInvoiceRequest);

$api->post(Request $objRequest);
$api->getId(Request $objRequest, int|string $id);
$api->getQuery(Request $objRequest, array $queryParameters);
$api->put(Request $objRequest, $id, $type /*complete,confirm,cancel,revoke*/);

InvoiceRequest
PaymentRequest
PaymentTokenRequest
ReceiptRequest
RefundRequest
StickerRequest
TokenizationRequest
bash
composer