uzdevid/yii2-apelsin

Integration with the "Apelsin" payment system

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Type:yii2-extension

1.0 2022-10-20 05:27 UTC

This package is auto-updated.

Last update: 2024-04-20 08:40:20 UTC


README

Integration with the "Apelsin" payment system

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist uzdevid/yii2-apelsin "dev-main"

or add

"uzdevid/yii2-apelsin": "dev-main"

to the require section of your composer.json file.

Usage

Note: You can use this extension after creating a contract between the Apelsin service and your company. And you can use most of the methods only when you create your company as a payment system through the Central Bank of the Republic of Uzbekistan.

Login and password can be obtained from the technical specialists of the Apelsin service

    $config = [
        'login' => '<login>',
        'password' => '<password>'
    ];

Creating an instance of a class

    $apelsin = new uzdevid\apelsin\Apelsin($config);

Working with cards

Getting p2p information about the card (cards.get_p2p_info)

params:

  1. card number is string
    $card = $apelsin->card->info('<card number>');

Getting card data by card number and expiry date (cards.get)

params:

  1. card number is string or array
  2. expiry date is string
    $card = $apelsin->card->data('<card number>', '<expiry date>');

or (cards.get_some)

    $cards = [
        ['token' => '<token_1>', 'expire' => '<expire_1>'],
        ['token' => '<token_2>', 'expire' => '<expire_2>'],
        ['token' => '<token_3>', 'expire' => '<expire_3>'],
    ];
    $card = $apelsin->card->data($cards);

Getting card data by token (cards.get)

params:

  1. token is string or array
    $card = $apelsin->card->dataByToken('<token>');

or (cards.get_some)

    $tokens = ['<token_1>', '<token_2>', '<token_3>'];
    $card = $apelsin->card->dataByToken($tokens);

Getting a phone number linked to a card by card number and expiry date (cards.get_phone)

params:

  1. card number is string
  2. expiry date is string
    $card = $apelsin->card->phone('<card number>', '<expiry date>');

Getting a phone number linked to a card by token (cards.get_phone)

params:

  1. token is string
    $card = $apelsin->card->phoneByToken('<token>');

Method that will block the card (cards.block)

params:

  1. token is string
    $card = $apelsin->card->block('<token>');