D
D
Dmitry Tarasov2019-04-09 13:27:46
PHP
Dmitry Tarasov, 2019-04-09 13:27:46

How to get balance api unitpay?

In general, I installed sdk unitpay
Further in unitpay it was like this,
5cac71fd6b059561082783.jpeg
according to the code I did it like this

require_once $_SERVER['DOCUMENT_ROOT'].'/class/unitpay/vendor/autoload.php';
    $unitPay = new UnitPay($setup_payment['unitpay-secret-key']);
    $response_w = $unitPay->api("getPartner", [
        'login' => '[email protected]',
        'secretKey' => $setup_payment['unitpay-secret-key']
    ]);

then I got a 500 error on the site, I think it's good.
I think the getPartner method is probably not available.
I go here and add getPartner
5cac728a1157a658386272.jpeg
Then it began to knock out such an error
stdClass Object
(
    [error] => stdClass Object
        (
            [message] => Неверные параметры авторизации
            [code] => -32000
        )

)

on the unitpay website, an authorization error is written, but I just can’t understand where
https://help.unitpay.ru/article/63-get-partner
, if it’s just without calling the getPartner method, then it shows like this
UnitPay Object
(
    [supportedCurrencies:UnitPay:private] => Array
        (
            [0] => EUR
            [1] => UAH
            [2] => BYR
            [3] => USD
            [4] => RUB
        )

    [supportedUnitpayMethods:UnitPay:private] => Array
        (
            [0] => initPayment
            [1] => getPayment
            [2] => getPartner
        )

    [requiredUnitpayMethodsParams:UnitPay:private] => Array
        (
            [initPayment] => Array
                (
                    [0] => desc
                    [1] => account
                    [2] => sum
                )

            [getPayment] => Array
                (
                    [0] => paymentId
                )

            [getPartner] => Array
                (
                    [0] => login
                    [1] => secretKey
                )

        )

    [supportedPartnerMethods:UnitPay:private] => Array
        (
            [0] => check
            [1] => pay
            [2] => error
        )

    [supportedUnitpayIp:UnitPay:private] => Array
        (
            [0] => 31.186.100.49
            [1] => 178.132.203.105
            [2] => 52.29.152.23
            [3] => 52.19.56.234
            [4] => 127.0.0.1
        )

    [secretKey:UnitPay:private] => влфовфлдлдфыловф
    [params:UnitPay:private] => Array
        (
        )

)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
senior65, 2019-04-09
@fast-je

Obviously, you entered incorrect data for authorization, check the data again

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question