C# client for cloudpayments cash api
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 { ... })
...
}
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
.
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 |