60262186
Lok Sze Decoration Engineering Limited
Flat C7, 5/F, Tung Lee Factory Building, 9 Lai Yip Street, Kwun Tong, Kowloon

  • 中文 (香港)
  • English
  • Ethereum: How to integrate bitcoin payment in ASP.Net?

    Integration Payan Bitcoin with ASP.NET: Blood Processing

    Insurance

    ————-

    Hundreds of bitcoins are expanding spraying, all the predictals of the fever. One of the popular options is Ethereum, which outputs its own dentalized settings (DAPP) and intestate of the functionality of the plate in its own projects. In this condition, we will hold you on how to interact a Bitcoin poster with ASP.NET, the updated structure for the creation of the network.

    Suppliers

    We will take the fact that you have the following:

    • The main ponimania asp.net and its function.

    • Koshelek Ethereum (eg Metamask) for Ethereum.

    • Lower records of cryptocurrency (eg Coinbase) for Bitcoin (BTC).

    • Wednesday testing (Sandy) set to your Ethereum Mainnet.

    Shag 1: Test Ethereum Test Setting

    Ethereum: How to integrate bitcoin payment in ASP.Net?

    To check Bitkinsky Platures in ASP.NET, you need to develop an Ethereum test using the final point http: // localhost: 8000. This is allowed to allow you to make a place with a place Blockchain Ethereum, not in real transaction gatherings.

    Shag 2: Install the non -wearing libraries and packages

    To integrate the Bitcoin Payan feature into your ASP.NET project, you must install the following libraries:

    • System.net.http for http communication.

    2.

    • Ethereum.net (library.

    You can install these packages from Nuget:

    `Bash

    Installation- package System.net.http

    Installation- Microsoft.entityframeworkCore.SQLServer package

    Installation- Ethereum.net package

    Shag 3: Set the Bitcoin Platage Class

    Send a new class C#that will obey the bitcoin transaction. This class will be inadvertent for the creation, website and bite.

    csharp

    Use of System.net.http;

    Using Ethereum.net.client;

    Microsoft.entframeworkcore;

    Bitcoaning of the open class

    {

    Part HTTPCLIENT _HttpClient;

    Social Bitcoin (String Secretkey)

    {

    Var Client = New Client (new httpcclientandler ());

    Client.Timeout = Timespan.Froseconds (100);

    _httpclient = client;

    _Secretkey = Secretkey;

    }

    Public Asynchronization Task SenbitcoIntransctionaSync (Bitcoinaddress, Biginteger Summ)

    {

    var Payload = $ "tx_hash = {Sensraddress}";

    VAR RESPONSE = AWAIT _httpClient.postasync ("http: // Localhost: 8000/Bitcoinpayment", New StringConTent (Power-Loading, System.enCoding.utwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww.

    If (Respose.Sissuccessstatuscode)

    {

    Console.Writeline ($ "transaction is healthy: {response.content.Readassstringasync (). Result}");

    }

    }

    Public Asynchronization Task Atebitcoointransactionsync (Biginteger sum)

    {

    var Payload = $ "tx_hash = {reratedress}";

    VAR RESPONSE = AWAIT _httpClient.postasync ("http: // Localhost: 8000/Cretbitcoin", New StringConTent (Power-Loading, Systext.ext.UTFwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww w-

    If (Respose.Sissuccessstatuscode)

    {

    Console.Writeline ($ "transaction is successfully attached: {resport.content.Readassstringasync (). Result}");

    Returned the gift;

    }

    }

    Apply Strenge Sendraddress

    {

    Cap {return "0x ..." + cryptoaddress; }

    }

    A specific string discount

    {

    Cap {return "0x ..." + cryptoaddress; }

    }

    }

    Shag 4: Integrate Bitcoin Pay with ASP.NET CORE

    Send the new main project ASP.NET and add the following code to your file Startup.cs:

    `csharp

    Microsoft.aspnetcore.builder;

    Microsoft.aspnetcore.hosting;

    Using System.net.