Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

При попытке отменить платеж - 415 Unsupported Media Type #28

Open
glowfisch8lan opened this issue Apr 24, 2022 · 1 comment

Comments

@glowfisch8lan
Copy link

glowfisch8lan commented Apr 24, 2022

При вызове метода cancelBill() получаю
'{ "servlet":"dispatcherServlet", "message":"Unsupported Media Type", "url":"/v1/bills/fe155d50-d30e-4c85-bf96-6c9fa2ad990a-68/reject", "status":"415" }'

Если отправить Postman запрос - то все окей

@shipulina
Copy link

В requestBuilder в $headers добавить Content-Type

$headers = [
    'Accept: application/json',
    'Authorization: Bearer '.$this->secretKey,
    'Content-Type: application/json;charset=UTF-8', // <---  
];
if (true !== empty($body) && self::GET !== $method) {
    $body    = json_encode($body, JSON_UNESCAPED_UNICODE);
    $headers = array_merge(
        $headers,
        [
            // 'Content-Type: application/json;charset=UTF-8',
            'Content-Length: '.strlen($body),
        ]
    );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants