Create a loyalty point extension and configure the webhook

To create a custom integration with a loyalty point payment gateway, you must create a loyalty point extension and configure the Custom Currency webhook.

To create the integration, you perform the following steps:

  1. Create the gateway extension, as described below.
  2. Upload the extension to the administration interface.
  3. Enable the gateway for the sites that require it.
  4. Add a loyalty point payment option to the checkout page.
  5. Configure the Custom Currency webhook by specifying the gateway URL and the username and password. Note that webhook settings are not site-specific. The configuration you supply applies to all sites that use this webhook.

Loyalty point extension details

The format of a payment gateway extension is described in the Create a Credit Card Payment Gateway Integration chapter. For a loyalty point gateway, the gateway.json file should be similar to the following:

{
  "provider": "Loyalty Points Payment Gateway",
  "paymentMethodTypes": ["loyaltyPoints"],
  "transactionTypes": {
    "loyaltyPoints": ["balanceInquiry", "authorize", "void", "refund"]
  },
  "processors" : {
    "loyaltyPoints": "loyaltyPoints"
  }
}

The config.json file should be similar to the following:

{
  "configType": "payment",
  "titleResourceId": "title",
  "descriptionResourceId": "description",
  "instances" : [
    {
      "id": "agent",
      "instanceName": "agent",
      "labelResourceId": "agentInstanceLabel"
    },
    {
      "id": "preview",
      "instanceName": "preview",
      "labelResourceId": "previewInstanceLabel"
    },
    {
      "id": "storefront",
      "instanceName": "storefront",
      "labelResourceId": "storefrontInstanceLabel"
    }
  ],
  "properties": [
    {
      "id": "paymentMethodTypes",
      "type": "multiSelectOptionType",
      "name": "paymentMethodTypes",
      "required": false,
      "helpTextResourceId": "paymentMethodsHelpText",
      "labelResourceId": "paymentMethodsLabel",
      "defaultValue": "loyaltyPoints",
      "displayAsCheckboxes": true,
      "public": true,
      "options": [
         {
           "id": "loyaltyPoints",
           "value": "loyaltyPoints",
           "labelResourceId": "loyaltyPointsLabel"
         }
       ]
    },
    {
      "id": "includeOrderInWebhookPayload",
      "type": "booleanType",
      "name": "includeOrderInWebhookPayload",
      "helpTextResourceId": "includeOrderHelpText",
      "labelResourceId": "includeOrderLabel",
      "defaultValue": true,
      "public": true
    }
  ]
}