Bitcoin Forum
September 18, 2018, 08:30:48 PM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: NBitcoin : Payment Protocol Implementation  (Read 537 times)
Nicolas Dorier
Hero Member
*****
Offline Offline

Activity: 700
Merit: 501


View Profile
May 31, 2014, 03:33:01 PM
 #1

Hello all,
I'm happy to announce the release of NBitcoin v1.0.4.1, which include the payment protocol (BIP 70, 21, 72).
How to use can be found in the tests here : https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin.Tests/PaymentTests.cs

Example
Quote
public void CanTalkToPaymentServer()
{
   using(var server = new PaymentServerTester())
   {
      var uri = server.GetPaymentRequestUri(2);
      BitcoinUrlBuilder btcUri = new BitcoinUrlBuilder(uri);
      var request = btcUri.GetPaymentRequest();
      Assert.True(request.VerifySignature());
      Assert.Equal(2, BitConverter.ToInt32(request.Details.MerchantData, 0));
      var ack = request.CreatePayment().SubmitPayment();
      Assert.NotNull(ack);
   }
}

Have fun ! Wink

Github : https://github.com/NicolasDorier/NBitcoin
Nuget : https://www.nuget.org/packages/NBitcoin/

Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!