F
F
FastOwl6662020-09-20 18:48:56
Python
FastOwl666, 2020-09-20 18:48:56

How to get list of anypay payments using api?

I am writing a telegram bot.
You need to connect the payment system anypay.
Can't get list of transactions using api.
Writes that the wrong project_id, although it is correct.
I get the balance using Api and the list of transactions gives an error.
This is a balance code that works.

import requests
import hashlib
import json
API_ID = '****'
API_KEY = '****'
project_id = '****'
sign = hashlib.sha256(f'balance{API_ID}{API_KEY}'.encode())
responce = requests.get(f"https://anypay.io/api/balance/{API_ID}",params={"sign":sign.hexdigest()})
print(responce.json())

This is a transaction code that does not work.
import requests
import hashlib
import json
API_ID = '****'
API_KEY = '****'
project_id = '****'
sign = hashlib.sha256(f'payments{API_ID}{project_id}{API_KEY}'.encode())
responce = requests.get(f"https://anypay.io/api/payments/{API_ID}",params={"sign":sign.hexdigest()})
print(responce.json())

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Codeine8, 2020-10-29
@Codeine8

You forgot about one more required parameter (see docs ):

requests.get(f"https://anypay.io/api/payments/{API_ID}", params={
    "sign":sign.hexdigest(),
    "project_id": project_id,
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question