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 

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.