G
G
Greg VanBuren2021-11-04 02:42:39
PHP
Greg VanBuren, 2021-11-04 02:42:39

How to connect btcpay-server? And what do they eat it with?

Good day, colleagues.

I want to implement BTC payment in my project. Neither blockchain.info, nor coinbase commerce, nor bitaps suited me for various reasons.

Here I came across a worthwhile project: https://btcpayserver.org/
I know many of you use it for your projects.

But it’s not clear to me whether it is necessary to raise your VPS, if so, can you advise some instructions? Or did I just misunderstand?

At first I thought that it works as an API (maybe it is and I just made the request wrong). Here's some code from which I get a "405:Not Allowed" response.

$url = 'https://docs.btcpayserver.org/api/v1/stores/A37xb9AbYHkvpPpMrehtUmPxQRVqdQGj58bGWd451vfk/invoices'; // url, на который отправляется запрос
$post_data = array(
    "speedPolicy" => 'HighSpeed'
);
$headers = array('Content-Type: application/json',"Authorization: token: kKA3niG"); // заголовки запроса
$post_data=json_encode($post_data);
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true); // true - означает, что отправляется POST запрос
$result = curl_exec($curl);


var_dump($result);


I must say right away that in the header, in addition to token, I tried to enter the following keys:
Authorization: Basic NzdSR0cxUkdkbGtucmRXV29EV0UwVlpERE03cFpZaUlra3lZRFo3TEx2MQ== 77RGG1RGdlknrdWWoDWE0VZDDM7pZYiIkkyYDZ7LLv1


All good.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Uno, 2021-11-04
@Noizefan

apirone.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question