Getting started #

This guide covers the starting steps for configuring Pragma to process orders setup with a supported provider.

  1. Set up store with a supported provider.
  2. Configure an Order Provider Plugin.
  3. Define the Order Mappings content catalog.

1. Set up store with a supported provider #

Before integrating with Pragma Engine, you’ll need to set up an account with a supported provider. For more information on setting up stores with a provider’s system, refer to their respective documentation.

You can map an order to ownership of a Steam application or inventory item.

You can map an order to any type of Epic offer.

Setup Twitch drops.

Contact your customer support representative for more information.
Contact your customer support representative for more information.

2. Configure the Order Provider Plugin #

Add the order provider plugins under the social config.

Requirements:

  • Each order provider configured must also be configured as a identity provider.
  • You must allow users to log in with this provider and/or link their account.
  • The credentials configured for both plugins must be the same. Use shared config to avoid miss-configuration.
social:
  shared:
    configs:
      Steam:
        class: "pragma.shared.SteamCredentialsConfig"
        config:
          appId: "[steam-app-id]"
          steamWebAPIKey: "[encrypted-steam-web-api-key]"
      Epic:
        class: "pragma.shared.EpicCredentialsConfig"
        config:
          clientId: "[epic-client-id]"
          clientSecret: "[encrypted-epic-client-secret]"
          deploymentId: "[epic-deployment-id]"
          sandboxId: "[epic-sandbox-id]"
      Twitch:
        class: "pragma.shared.TwitchCredentialsConfig"
        config:
          clientId: "[twitchClientId]"
          clientSecret: "[encrypted-twitch-client-secret]"                    
  pluginConfigs:
    ThirdPartyNodeService.orderProviderPlugins:
      plugins:
        Steam:
          class: "pragma.order.SteamOrderProviderPlugin"
          config:
            sharedConfigKey: "Steam"
        Twitch:
          class: "pragma.order.TwitchOrderProviderPlugin"
          config:
            sharedConfigKey: "Twitch"
            gameId: "{twitchGameId}"
        Epic:
          class: "pragma.order.EpicOrderProviderPlugin"
          config:
            sharedConfigKey: "Epic"
            clawbackPollingEnabled: true # enables refund processing
Encrypting config values

All secrets must be encrypted and decrypted per shard. Shards use different encryption keys.

  1. Connect to the VPN using the *.ovpn file provided to you during onboarding.
  2. Navigate to your Homebase API URL: https://api.homebase.<studioname>.pragmaengine.com/
  3. Choose /secrets/encryptV1
  4. Enter the following values in the request body:
    1. shardId - The name of the shard you are encrypting a value for.
    2. titleId - The working title of your game that uses the secret.
    3. value - The secret you’re encrypting.

Your encrypted secret will appear below in the Responses section.

Any configuration set through the portal will override any values assigned in a config yml file.
  • Do not manually encrypt any secrets. The API automatically encrypts all sensitive values during submission.
  • You only need to enter credential values in one form. Portal will store credentials under shared config.

Order provider configuration #

  1. Navigate to the Order Providers page: select the Commerce Tab → Order Providers in side menu.
  2. Select platform to configure and fill out the form.
  3. Click Confirm to see changes.
  4. Click Deploy to apply changes.

order-providers-config-portal

Id provider configuration #

  1. Navigate to the ID Provider page: select the Accounts Tab → ID Provider in the side menu.
  2. Select a provider and fill out the form.
  3. Click Confirm to see changes.
  4. Click Deploy to apply changes.

id-providers-config-portal
You can implement your own custom Order Provider Plugin. See the Create a Custom Order Provider Plugin guide for details.

3. Define the Order Mappings content catalog #

Once you have setup your store, you can create a orders mapping content catalog. This will map the provider’s identifiers with a unique Pragma identifier. This lets you map orders across providers to the same grant.

Requirements

  • skuId must be unique.
  • a source can only map to one skuId.
  • a skuId can contain multiple sources of the same type. For example you can have three different Steam applications map back to the same sku.

Below is an example with Steam, Epic, and Twitch sources mapped to a single Pragma sku.

The content catalog must be defined in the OrderMappingsSpecs.json file.

[project]/content/src/OrderMappingsSpecs.json

[
    {
        "skuId": "SmallGoldBundle",
        "sources": [
            {
                "provider": "STEAM",
                "steamSource": {
                    "inventory": {
                        "itemDefId": "475"    
                    }
                }
            },
            {
                "provider" : "EPIC",
                "epicSource" : {
                    "entitlement" : {
                      "audienceItemId" : "231f97b3e1a44fb7b496e1832ec6b3d6"
                    }
                }
            },
            { 
                "provider": "TWITCH",
                "twitchSource": {
                    "rewardId": "twitch_item_drop"
                }
            }
        ]
    }
]

Run the content apply command to validate and generate content catalogs.

./pragma content apply

Next steps #

You are now ready to define the fulfillment grants.