Skip to content

interledger/open-payments-dotnet

Open Payments .NET SDK

Open Payments

Status GitHub Issues GitHub Pull Requests

What is Open Payments?

Open Payments is an open API standard that can be implemented by account servicing entities (e.g. banks, digital wallet providers, and mobile money providers) to facilitate interoperability in the setup and completion of payments for different use cases including:

  • Web Monetization
  • Tipping/Donations (low value/low friction)
  • eCommerce checkout
  • P2P transfers
  • Subscriptions
  • Invoice Payments

The Open Payments APIs are a collection of three sub-systems:

  • A wallet address server which exposes public information about Open Payments-enabled accounts called "wallet addresses"
  • A resource server which exposes APIs for performing functions against the underlying accounts
  • A authorisation server which exposes APIs compliant with the GNAP standard for getting grants to access the resource server APIs

This repository contains contains a .NET Open Payments SDK to make requests via the Open Payments API.

New to Interledger?

Never heard of Interledger before? Or would you like to learn more? Here are some excellent places to start:

Contributing

Please read the contribution guidelines before submitting contributions. All contributions must adhere to our code of conduct.

Open Payments Catchup Call

Our catchup calls are open to our community. We have them every other Wednesday at 13:00 GMT, via Google Meet.

Video call link: https://meet.google.com/htd-eefo-ovn

Or dial: (DE) +49 30 300195061 and enter this PIN: 105 520 503#

More phone numbers: https://tel.meet/htd-eefo-ovn?hs=5

Add to Google Calendar

Local Development Environment

This repository contains a Git submodule, which contains the Open Payments OpenAPI specifications. After cloning, make sure to initialize and update it:

git submodule update --init

Alternatively, clone the repository with submodules in one step:

git clone --recurse-submodules git@github.com:interledger/open-payments-node.git

Prerequisites

Environment Setup

npm install -g swagger-cli && \
dotnet tool install --global NSwag.ConsoleCore

Now generate models from the OpenAPI specs. You can generate all of them by running the command below:

make models

However, you can generate them one by one (please check the Makefile for all supported commands).

🔧 Running the tests

dotnet test

🎈 Usage

To use in your project, just add the package using the command line

dotnet add package Interledger.OpenPayments

Then add it to your project code

// Import dependencies
using Microsoft.Extensions.DependencyInjection;
using OpenPayments.Sdk.Clients;
using OpenPayments.Sdk.Extensions;
using OpenPayments.Sdk.HttpSignatureUtils;

// Initialize client
var client = new ServiceCollection()
    .UseOpenPayments(opts =>
    {
        opts.UseAuthenticatedClient = true;
        opts.KeyId = CLIENT_ID;
        opts.PrivateKey = KeyUtils.LoadPem(CLIENT_SECRET);
        opts.ClientUrl = new Uri(CLIENT_WALLET_ADDRESS);
    })
    .BuildServiceProvider()
    .GetRequiredService<IAuthenticatedClient>();

Please visit OpenPayments Docs for a detailed guide.

✍️ Authors

See also the list of contributors who participated in this project.

About

Open Payments .NET SDK

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors