Table of Contents

Class StripeConnectApiClient

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

The receiving side: an account the platform can pay, and the onboarding that makes it payable.

public class StripeConnectApiClient : IPayeeAccountClient
Inheritance
StripeConnectApiClient
Implements
Inherited Members

Remarks

A marketplace pays people it has not vetted itself. The provider verifies the identity and bank details and decides whether the account may be paid out. The screens that ask are the provider's own — hosted, or embedded in the application — or the application's, which then sends the details as tokens the payee's browser obtained, so they never reach the platform either way.

Constructors

StripeConnectApiClient(IStripeClient, IOptions<StripeApiClientConfig>, ILogger<StripeConnectApiClient>)

The receiving side: an account the platform can pay, and the onboarding that makes it payable.

public StripeConnectApiClient(IStripeClient client, IOptions<StripeApiClientConfig> config, ILogger<StripeConnectApiClient> logger)

Parameters

client IStripeClient
config IOptions<StripeApiClientConfig>
logger ILogger<StripeConnectApiClient>

Remarks

A marketplace pays people it has not vetted itself. The provider verifies the identity and bank details and decides whether the account may be paid out. The screens that ask are the provider's own — hosted, or embedded in the application — or the application's, which then sends the details as tokens the payee's browser obtained, so they never reach the platform either way.

Methods

CreateAccountAsync(PayeeAccountRequest, CancellationToken)

Creates an account able to receive transfers, prefilled with what the application knows about its owner, and returns the provider's identifier for it.

public Task<IResult<string>> CreateAccountAsync(PayeeAccountRequest request, CancellationToken cancellationToken = default)

Parameters

request PayeeAccountRequest

The country, the address, and the optional prefill.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<string>>

CreateAccountAsync(string, string, IDictionary<string, string>?, CancellationToken)

Creates an account able to receive transfers, and returns the provider's identifier for it.

public Task<IResult<string>> CreateAccountAsync(string countryCode, string email, IDictionary<string, string>? metadata = null, CancellationToken cancellationToken = default)

Parameters

countryCode string

ISO 3166-1 alpha-2, the country the payee is paid in.

email string

Where the provider writes to the payee.

metadata IDictionary<string, string>

Carried on the provider's object; the caller's own identifiers belong here.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<string>>

CreateOnboardingLinkAsync(string, string, string, CancellationToken)

A link to the provider's hosted onboarding. Single-use and short-lived by design, so it is created when the payee asks rather than stored.

public Task<IResult<string>> CreateOnboardingLinkAsync(string accountId, string refreshUrl, string returnUrl, CancellationToken cancellationToken = default)

Parameters

accountId string

The account being onboarded.

refreshUrl string

Where the provider sends the payee when the link has expired.

returnUrl string

Where it returns them when they are done.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<string>>

CreateOnboardingSessionAsync(string, CancellationToken)

A short-lived secret that lets the provider's embeddable onboarding run inside the application's own page, for this account only.

public Task<IResult<string>> CreateOnboardingSessionAsync(string accountId, CancellationToken cancellationToken = default)

Parameters

accountId string

The account being onboarded.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<string>>

Remarks

The alternative to CreateOnboardingLinkAsync(string, string, string, CancellationToken): the payee never leaves the application. The secret is handed to the browser and used at once, never stored.

DeleteAccountAsync(string, CancellationToken)

Closes the account at the provider, for a payee who no longer wants to be paid there. The provider refuses while the account still holds a balance, and keeps what the law requires it to.

public Task<IResult> DeleteAccountAsync(string accountId, CancellationToken cancellationToken = default)

Parameters

accountId string

The account to close.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult>

GetAccountAsync(string, CancellationToken)

What the provider currently says about the account.

public Task<IResult<PayeeAccountDTO>> GetAccountAsync(string accountId, CancellationToken cancellationToken = default)

Parameters

accountId string

The account to read.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<PayeeAccountDTO>>

GetPersonsAsync(string, CancellationToken)

The people registered on a company account.

public Task<IResult<IReadOnlyList<PayeePersonDTO>>> GetPersonsAsync(string accountId, CancellationToken cancellationToken = default)

Parameters

accountId string

The company's account.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<IReadOnlyList<PayeePersonDTO>>>

RemovePersonAsync(string, string, CancellationToken)

Removes a person registered on a company account by mistake.

public Task<IResult> RemovePersonAsync(string accountId, string personId, CancellationToken cancellationToken = default)

Parameters

accountId string

The company's account.

personId string

The person to remove.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult>

SavePersonAsync(string, string, string?, bool?, CancellationToken)

Registers a person on a company account, or changes one already there, from a provider person token the payee's browser obtained. Answers the person's identifier.

public Task<IResult<string>> SavePersonAsync(string accountId, string personToken, string? personId = null, bool? politicallyExposed = null, CancellationToken cancellationToken = default)

Parameters

accountId string

The company's account.

personToken string

The person's details, as a provider person token.

personId string

The person to change; null registers a new one.

politicallyExposed bool?

Whether the person holds, or held, a senior public office, or is close to someone who does; null leaves it as it is. A provider whose browser library drops this answer from the token receives it here and records it right after the token.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<string>>

UpdateAccountAsync(string, PayeeAccountUpdateRequest, CancellationToken)

Changes the account: its legal entity, terms acceptance and bank account as tokens the payee's browser obtained from the provider, and what it does. Answers the account as it then stands.

public Task<IResult<PayeeAccountDTO>> UpdateAccountAsync(string accountId, PayeeAccountUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

accountId string

The account to change.

request PayeeAccountUpdateRequest

The tokens and the business profile; anything left out stays as it was.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<IResult<PayeeAccountDTO>>