Payment Hub — Providers & Flows

Implementing payment providers, the mock reference provider, Nuvei production setup, order-to-cash flow, Quick Pay, credit memos, and error handling.

Core Architecture Providers & Flows Advanced Topics
add_circle

Adding a Payment Provider

2
Extend BasePaymentsProviderPlugin

Create a plugin class that inherits from BasePaymentsProviderPlugin and set the Key property to a unique provider identifier.

3
Create Settings Model

Define a settings class for provider-specific configuration (API keys, endpoints, merchant IDs, secret keys).

4
Register in Client/Startup.cs

Register the plugin, settings, and DI bindings for the provider implementation in the client startup configuration.

5
Add Frontend Wallet Form Extension

Create a frontend extension component for the provider's payment form (card input, ACH fields, etc.) using the wallet extension point.

science

Mock Provider (Reference)

file_copy
Partial Classes

Implementation split across partial classes: CreditCard, Method, and ACH for clear separation of payment type logic.

// Mock token format
Token = "MOCK:Token-{Guid}"

// Mock transaction format
TransactionId = "MOCK:Transaction-{Guid}"
cloud

Nuvei Provider (Production)

person
User Token Strategy

UserTokenId derived from UserId/CustomerId for wallet association. Enables multi-card wallet management per customer.

credit_card
Full Capability Support

Credit cards, ACH, and subscriptions fully supported. Secret key used for request signing and authentication.

receipt_long

Order-to-Cash Flow

End-to-end flow from sales collection through payment capture and ERP synchronization.

SalesCollection
Invoicing
Payments
PaymentTargets
Connector Sync
to ERP

Key Pipelines

PayOnAccountPipeline PayInvoicePipeline CalculateBalanceDuePipeline
bolt

Quick Pay

Token-based payment flow for invoice links. Allows customers to pay invoices directly via a secure link without logging in.

GenerateQuickPayTokenInput/Output

Creates a secure, time-limited token that identifies the invoice and customer for payment.

ValidateQuickPayTokenInput

Validates the token is not expired, not already used, and resolves to a valid invoice.

DoQuickPayInput

Executes the quick pay transaction using the validated token and provided payment method details.

GenerateInvoiceAndQuickPayInput

Combined operation that generates the invoice and quick pay token in a single pipeline execution.

note_alt

Credit Memos

payments
Apply Credits to Payments

Credits can be applied as a payment source alongside card or ACH payments, reducing the amount charged to external payment methods.

account_balance_wallet
Credit Payment Method

Credit-type payment methods track CurrentBalance and OriginalBalance for balance management.

error

Error Handling

block
Decline Handling

UpdateSurchargeForDeclinedPaymentPipeline adjusts surcharge records when a payment is declined by the provider.

undo
Refunds

RefundPaymentPipeline processes full or partial refunds through the original payment provider.

sync_problem
Connector / ERP Errors

Errors during ERP synchronization are logged and counted but do not roll back the payment transaction. Sync retries are handled by the connector layer.