Skip to content
C# client for cloudpayments cash api
C# PowerShell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
CloudPayments.Cash.Tests
CloudPayments.Cash
scripts
.gitattributes
.gitignore
CloudPayments.Cash.sln
LICENSE
README.md
appveyor.yml

README.md

cloudpayments-cash

C# client for cloudpayments cash api

Build status NuGet GitHub license

Usage

Get CashApi object with default implementation

using Microsoft.Extensions.Logging;

...

CashApi.GetDefault(new CashSettings { ... }, loggerFactory)

Use Test = true param in development enviroment

CashApi.GetDefault(new CashSettings { ..., Test = true }, loggerFactory)

If project use dependency injection, CashApi can register it services in container.

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    services.AddCloudPaymentCash(new CashSettings { ... })
    ...
}

Create cash vaucher

var api = CashApi.GetDefault(new CashSettings { ... }, loggerFactory)
await api.Receipt(new ReceiptContract { ... }, 123, token)

Second argument (123) is optional and it is used to make requests idempotent.

See cloudpayments api docs for more details about ReceiptContract.

CashSettings description

Name Description Default
PublicId Public ID from CloudPaynets site settings
ApiSecret ApiSecret from CloudPaynets site settings
Endpoint Api endpoint https://api.cloudpayments.ru
Inn Organization INN number. Optional. INN can be set in ReceiptContract
Test Test mode false
You can’t perform that action at this time.