Interface IPaymentChargeClient
Moving money: charging a customer, and paying a payee.
public interface IPaymentChargeClient
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.
Task<IResult<PaymentDTO>> ChargeAsync(PaymentChargeRequest request, CancellationToken cancellationToken = default)
Parameters
requestPaymentChargeRequestWho is charged, how much, and the key that makes a retry safe.
cancellationTokenCancellationTokenCancels the call.
Returns
TransferAsync(PaymentTransferRequest, CancellationToken)
Sends part of what was charged to a payee's account.
Task<IResult<PaymentTransferDTO>> TransferAsync(PaymentTransferRequest request, CancellationToken cancellationToken = default)
Parameters
requestPaymentTransferRequestWho is paid, how much, and the key that makes a retry safe.
cancellationTokenCancellationTokenCancels the call.