Link a collection module to a product module

Update a product module configuration so policies can use a collection module for payment collection.

Update a product module configuration so policies can use a collection module for payment collection.

Prerequisites

  • Create the collection module in the same organisation as the product module.
  • Publish a live version of the collection module.

Link the collection module

  1. Open .root-config.json in the product module.
  2. Go to settings.billing.paymentMethodTypes. If any of these sections do not exist, add them.
  3. Add the relevant collection module key to collectionModules:
{
  "settings": {
    "billing": {
      "paymentMethodTypes": {
        "collectionModules": [
          {
            "key": "cm_acme_payments"
          }
        ]
      }
    }
  }
}

Legacy product modules may use paymentMethodTypes.collectionModule.collectionModuleKeys. That form is still accepted but deprecated. Migrate to collectionModules when you next update the file.

  1. From the product module directory, push your changes:
rp push

rp push uploads the changed .root-config.json to Workbench as a new draft. Publish the product module before using the collection module link in production.

Related guides