BitCoin not signed in when trying to CreateInvoice

0

1

In code bellow I'm trying to create Bitcoin payment:

var privateKey = "f267c05d4552b92825e46cfe056d6e3ff36072538f71d8c5acf3ebc4b09f4c87";       var 
key = new Key(Encoders.Hex.DecodeData(privateKey));
Uri BitPayUri = new Uri("https://test.bitpay.com/");
static Network Network = Network.TestNet;
BitcoinSecret k = new BitcoinSecret(key, Network);
Bitpay BitPay = new Bitpay(k.PrivateKey, BitPayUri);

var invoice = BitPay.CreateInvoice(new NBitpayClient.Invoice()
{
            Price = 50,
            Currency = "USD",
            PosData = "posData",
            OrderId = "123",
            RedirectURL = "redirectURL",
            NotificationURL = "NotificationURL",
            ItemDesc = "description",
            FullNotifications = true
});
return Redirect(invoice.Url);

When I try to call BitPay.CreateInvoice(...), I get an error:

NBitpayClient.BitPayException: 'Error: System.MissingMethodException: Method 
not found: 'NBitcoin.Crypto.ECDSASignature 
NBitcoin.Key.Sign(NBitcoin.uint256)'.

at NBitpayClient.Extensions.BitIdExtensions.GetBitIDSignature(Key key, String uri, String body)

Error says my key is not signed yet if I'm correct, but dont know how to fix it.

P.S. Code example would be useful.

vidara

Posted 2019-01-13T13:34:19.650

Reputation: 1

No answers