Skip to content

collana pay JS Docs v0.1.0


collana pay JS Docs / registerProvider

Function: registerProvider()

registerProvider(protocolType, methodType, factory): void

Defined in: core/CollanaPay.ts:51

Registers a provider factory in the global provider registry.

Built-in providers (e.g. PayPal) are registered automatically when src/index.ts is imported. Integrators only need to call this function to register custom or third-party providers.

Parameters

protocolType

ProviderProtocolType

The provider protocol identifier (e.g. "PayPal").

methodType

PaymentMethodType

The payment method identifier (e.g. "PayPalExpress").

factory

ProviderFactory

The provider class constructor to associate with the given protocol/method combination.

Returns

void

Nothing.

Example

ts
import { registerProvider } from './core/CollanaPay';
import { MyCustomProvider } from './providers/MyCustomProvider';

registerProvider('CustomProtocol', 'CustomMethod', MyCustomProvider);

CollanaPay SDK Documentation