P
P
Pekky2018-10-07 16:49:46
API
Pekky, 2018-10-07 16:49:46

api privat encoding error?

I connect to the site Payment by installments from a private bank. Here is the documentation: link

$url = 'https://payparts2.privatbank.ua/ipp/v2/payment/create';
$params = array(
        'storeId' => '36E137A157014AC297DD',
        'orderId' => '123456789',
        'amount' => '1000',
        'partsCount' => '1',
        'merchantType' => 'pp',
        'scheme' => 'pp',
        'products' => array(
                'name' => 'televizor',
                'count' => 1,
                'price' => 1000
                    ),
        'signature' => 'b47f80a7fbb34db084bb35527f84ed4a'
    );
$result = file_get_contents($url, false, stream_context_create(array(
    'http' => array(
        'method'  => 'POST',
        'header'  => 'Accept:application/json;Accept-Encoding:UTF-8;Content-Type:application/json',
        'content' => json_encode($params)
    )
)));

Here is the error: {"state":"FAIL","errorMessage":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported","locale":"ru_RU"}
So As I understand it, this is an encoding error, maybe I sent the encoding incorrectly?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question