The format of a payment gateway extension is described in the Create a Credit Card Payment Gateway Integration chapter. For a gift card gateway, the gateway.json
file should be similar to the following:
{ "provider": "Custom Gift Card", "paymentMethodTypes": ["physicalGiftCard"], "transactionTypes": { "physicalGiftCard": ["balanceInquiry", "authorize", "void", "refund"] }, "processors" : { "physicalGiftCard": "genericGiftCard" } }
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": "physicalGiftCard", "displayAsCheckboxes": true, "public": true, "options": [ { "id": "physicalGiftCard", "value": "physicalGiftCard", "labelResourceId": "physicalGiftCardPayLabel" } ] }, { "id": "giftCardMaxLength", "type": "stringType", "name": "giftCardMaxLength", "helpTextResourceId": "giftCardMaxLengthHelpText", "labelResourceId": "giftCardMaxLengthLabel", "required": true, "defaultValue": "19", "public": true }, { "id": "giftCardPinRequired", "type": "booleanType", "name": "giftCardPinRequired", "helpTextResourceId": "giftCardPinRequiredHelpText", "labelResourceId": "giftCardPinRequiredLabel", "defaultValue": true, "public": true }, { "id": "giftCardPinMaxLength", "type": "stringType", "name": "giftCardPinMaxLength", "required": false, "helpTextResourceId": "giftCardPinMaxLengthHelpText", "labelResourceId": "giftCardPinMaxLengthLabel", "defaultValue": "4", "public": true } ] }
The properties in the config.json
file shown above create controls that appear in the Payment Processing settings in the administration interface. These controls allow the merchant to specify whether a shopper using a gift card is required to supply a PIN, as well as the maximum length of the gift card number and the PIN.