Creating a gateway integration using the Generic Payment webhook is similar to creating an integration using the Credit Card Payment webhook. However, the Generic Payment webhook supports a wider range of options in order to handle the various payment types.
The following table summarizes the available payment methods and the transaction types they support:
Payment Method | Supported Transaction Types |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The payment and transaction types are specified in the gateway.json
file. For example:
{ "provider": "Sample Payment Gateway", "paymentMethodTypes": ["physicalGiftCard", "cash"], "transactionTypes": { "physicalGiftCard": ["balanceInquiry", "authorize", "void", "refund"], "cash": ["initiate", "cancel"] } }
User interface configuration controls that appear in the Payment Processing page of the administration interface are specified in the config.json
file. For example:
{ "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": "physicalGiftCard", "displayAsCheckboxes": true, "public": true, "options": [ { "id": "cash", "value": "cash", "labelResourceId": "cashPayLabel" }, { "id": "physicalGiftCard", "value": "physicalGiftCard", "labelResourceId": "physicalGiftCardPayLabel" } ] } ] }
Notice that the type
property in this example is set to multiSelectOptionType
, which means that multiple methods can be selected (for example, physicalGiftCard
and cash
). By default the control created for selecting the methods is a drop-down list, but setting the displayAsCheckboxes
property to true
specifies that a set of checkboxes should be used instead.