Skip to content

Latest commit

 

History

History
65 lines (55 loc) · 2.24 KB

README.md

File metadata and controls

65 lines (55 loc) · 2.24 KB

Rest.GetChangeio

This is an unofficial .NET (standard) library for GetChangeio REST APIs.

.NET

Description

All APIs are grouped in services:

  • Donation service
  • Nonprofits service
  • ...

All concrete classes respect a contract (ex. DonationService -> IDonationService) making things easier for testing/mocking and people that wants to use dependency injection. All services need at least the IGetChangeioConfig which exposes the following properties:

  • GetChangeioPublicKey
  • GetChangeioPrivateKey

Because this config is strictly dependant on your project, you are supposed to inherit from this contract and provide an implementation upon service construction.

Examples

Create donation

var config = MyConfig(); // inherits from `IGetChangeioConfig`
var donationService = new DonationService(config);
var result = await donationService.CreateAsync(new("n_IfEoPCaPqVsFAUI5xl0CBUOx", 1000));
...

Search non-profits

var config = MyConfig(); // inherits from `IGetChangeioConfig`
var nonprofitsService = new NonprofitsService(config);
var result = await nonprofitsService.SearchAsync("fcancer"); // supports pagination via the `page` property
...

Supported APIs

  • Donation
    • Create a donation
    • List your donations
    • Retrieve a donation
    • Retrieve carbon offset stats
  • Nonprofits
    • Show a nonprofit
    • Search a nonprofit
    • Create non-profit
    • Trigger instant payout
    • Get social media content
  • Climate
    • Draft a shipping carbon offset
    • Crate a shipping carbon offset
    • Draft a crypto carbon offset
    • Create a crypto carbon offset
    • Retrieve carbon offset stats
  • Marketplace
    • Create a managed account
    • Create a link bank token
    • Attach a bank to a managed account
  • Reports
    • Fetch impact report
  • Prebuilt pages
    • Create a checkout link
    • Create a crypto checkout link

Feel free to contribute! Support for missing APIs and tests are underway.