Custom Order Provider Plugin #

Pragma Engine supports having multiple custom Order Provider Plugins. To create a custom plugin, there are several steps that need to be taken:

  1. Create an Order Provider Plugin class.
  2. Add a new enum value.
  3. Configure the Order Provider Plugin.
For an example of how to create a custom plugin, see Custom Identity Providers.

Create an Order Provider Plugin class #

Below is a plugin interface to implement a custom Order Provider Plugin:

interface OrderProviderPlugin : PragmaServicePlugin {
    fun getType(): OrderProviderType

    fun getName(): String

    suspend fun syncOrders(accountId: String, orders: Orders)
}

Add a new enum value #

In your AccountRpcExt.proto you’ll need to add your ext provider:

enum ExtIdProvider {
  EXT_UNUSED = 0; 
  reserved 1 to 100; // Pragma supported Id Providers

  //  === EXTENSIONS (101+) ===
  EXAMPLE_PROVIDER = 101;
}

Configure the Order Provider Plugin #

To enable your custom plugin update your social config:

social: 
  pluginConfigs:
    ThirdPartyNodeService.orderProviderPlugins:
      plugins:
        Example:
          class: "ext.order.ExampleOrderProviderPlugin"