Create a Custom Order Provider Plugin #

Pragma Engine supports having multiple custom Order Provider Plugins. This guide covers creating a custom plugin to implement the Orders service with a provider of your choice.

  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.

1. 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)
}

2. Add a new enum value #

Add your ext provider:

AccountRpcExt.proto

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

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

3. Configure the Order Provider Plugin #

To enable your custom plugin update your social config:

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