C# API wrapper for CryptoPay https://telegra.ph/Crypto-Pay-API-11-25
How to use this CryptoPay API connector?
Install-Package CryptoPay.Conector -Version 1.0.0
1.1 Add CryptoPay to your dependency container
services.AddCryptopay(new CryptopayCredentials(
apiUrl: "https://testnet-pay.crypt.bot/",
apiToken: "9999:ABpPkivT2jiuVywaJbSGjfXFozOjQZfO3ZL"
));
2.1 Inject CryptoPay conector into you service & call the required method
public class CryptopayService
{
private readonly ICryptopay _cryptopay;
public ConectorService(ICryptopay cryptopay)
{
_cryptopay = cryptopay;
}
}
...
var answer = await _cryptopay.GetMeAsync();
2.1 Initialize CryptopayCredentials
var creds = new CryptopayCredentials(
apiUrl: "https://testnet-pay.crypt.bot/",
apiToken: "9999:ABpPkivT2jiuVywaJbSGjfXFozOjQZfO3ZL"
);
2.2 Create connector instance & call the required method
using var cryptopay = Connector.GetIstance(new HttpClient(), creds);
var answer = await cryptopay.GetMeAsync();