简体   繁体   English

如何在ASP.NET MVC中使用Coinpayments.net nuget包?

[英]How to use Coinpayments.net nuget package with ASP.NET MVC?

I am working on ASP.NET MVC website where users pays some amount of bitcoins and after payment he can download specific digital art file. 我正在ASP.NET MVC网站上工作,用户在该网站上支付一定数量的比特币,付款后他可以下载特定的数字艺术文件。 Instant payment and download. 即时付款和下载。

I have found nuget package Coinpayments.NET. 我找到了nuget包Coinpayments.NET。

https://www.nuget.org/packages/Coinpayments.NET/ https://www.nuget.org/packages/Coinpayments.NET/

I can't find any example how to use this nuget package with ASP.NET MVC. 我找不到任何示例如何在ASP.NET MVC中使用此nuget包。

Reading documentation on official website which is for PHP doesn't help. 在PHP官方网站上阅读文档无济于事。

Please help me and if You can provide some example how to make transaction and after successfull payment redirect user to specified action. 请帮助我,如果您可以提供一些示例,说明如何进行交易,并且在成功付款后将用户重定向到指定的操作。

Edit: I have sample source code: 编辑:我有示例源代码:

using System;

namespace CoinpaymentsTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var cp = new Coinpayments.Coinpayments("PRIVATEKEY", "PUBLICKEY");

            var payment = cp.CreateTransactionSimple(2, "USD", "BTC", "ADDRESS", "IPN");
            Console.WriteLine(payment.error);

            Console.WriteLine(payment.result.qrcode_url);

            var check = cp.GetTransactionInfo(payment.result.txn_id);

            Console.WriteLine(check.result.payment_address);

            Console.Read();
        }
    }
}

But the question is how to get information that user has successfully paid? 但是问题是如何获取用户已成功付款的信息?

I need explanation on this source code. 我需要对此源代码进行解释。

Like you said, there is little information on the Internet about this library. 就像您说的那样,Internet上关于此库的信息很少。 On Nuget there is no information or documentation available about how to use it, but we have information about the owner of the project, Lode Kennes and his nickname linh721990 . 在Nuget上,没有有关如何使用它的信息或文档,但是我们拥有有关项目所有者Lode Kennes及其昵称linh721990 So the following google search linh721990 github provide no result or clues, but linh721990 bitbucket provides a link for the source code on the library, together with a little test application: 因此,以下Google搜索linh721990 github没有提供结果或线索,但是linh721990 bitbucket提供了库中源代码的链接以及一些测试应用程序:

https://bitbucket.org/linh721990/coinpayments.net-c https://bitbucket.org/linh721990/coinpayments.net-c

If you take a look at the file on https://bitbucket.org/linh721990/coinpayments.net-c/src/316088af0432ec3409d70c13f7fe510d27b47445/CoinpaymentsTest/Program.cs?at=master&fileviewer=file-view-default you can check some basic functionality: 如果您查看https://bitbucket.org/linh721990/coinpayments.net-c/src/316088af0432ec3409d70c13f7fe510d27b47445/CoinpaymentsTest/Program.cs?at=master&fileviewer=file-view-default上的文件,则可以检查一些基本功能:

using System;

namespace CoinpaymentsTest
{
  class Program
  {
    static void Main(string[] args)
    {
        var cp = new Coinpayments.Coinpayments("PRIVATEKEY", "PUBLICKEY");

        var payment = cp.CreateTransactionSimple(2, "USD", "BTC");
        Console.WriteLine(payment.error);

        Console.WriteLine(payment.result.qrcode_url);

        var check = cp.GetTransactionInfo(payment.result.txn_id);

        Console.WriteLine(check.result.payment_address);

        Console.Read();
    }
  }
}

But the relevant code about the functionality of the Nuget package is in the file https://bitbucket.org/linh721990/coinpayments.net-c/src/316088af0432ec3409d70c13f7fe510d27b47445/Coinpayments/Coinpayments.cs?at=master&fileviewer=file-view-default explained in 145 lines. 但是有关Nuget软件包功能的相关代码位于文件https://bitbucket.org/linh721990/coinpayments.net-c/src/316088af0432ec3409d70c13f7fe510d27b47445/Coinpayments/Coinpayments.cs?at=master&fileviewer=file-view-default 145行中有解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM