Table of Contents

Class StripeChargeApiClient

Namespace
NuvTools.Payment.Stripe.ApiClient.Services
Assembly
NuvTools.Payment.Stripe.ApiClient.dll

Moving money: charging a customer, and paying a payee.

public class StripeChargeApiClient : IPaymentChargeClient
Inheritance
StripeChargeApiClient
Implements
Inherited Members

Remarks

The two are separate calls on purpose. One charge can pay several payees, and a payee is paid for what was billed rather than for what each customer happened to pay — a customer who has not paid is a debt the platform carries, while a payee paid twice is a mistake nobody can take back.

Constructors

StripeChargeApiClient(IStripeClient, ILogger<StripeChargeApiClient>)

Moving money: charging a customer, and paying a payee.

public StripeChargeApiClient(IStripeClient client, ILogger<StripeChargeApiClient> logger)

Parameters

client IStripeClient
logger ILogger<StripeChargeApiClient>

Remarks

The two are separate calls on purpose. One charge can pay several payees, and a payee is paid for what was billed rather than for what each customer happened to pay — a customer who has not paid is a debt the platform carries, while a payee paid twice is a mistake nobody can take back.

Methods

ChargeAsync(PaymentChargeRequest, CancellationToken)

Charges a saved payment method off-session — nobody is at a keyboard when a month is billed — and returns what the provider made of it.

public Task<IResult<PaymentDTO>> ChargeAsync(PaymentChargeRequest request, CancellationToken cancellationToken = default)

Parameters

request PaymentChargeRequest

Who is charged, how much, and the key that makes a retry safe.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<PaymentDTO>>

TransferAsync(PaymentTransferRequest, CancellationToken)

Sends part of what was charged to a payee's account.

public Task<IResult<PaymentTransferDTO>> TransferAsync(PaymentTransferRequest request, CancellationToken cancellationToken = default)

Parameters

request PaymentTransferRequest

Who is paid, how much, and the key that makes a retry safe.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<PaymentTransferDTO>>