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
The provider protocol identifier (e.g. "PayPal").
methodType
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);