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

card

authorization – approve payment for an order

void -- cancel an order or a payment

refund -- issue a credit to the shopper after a return

cash

initiate -- create an order to be completed later

cancel -- cancel an order or a payment

paypalCheckout

initiate -- create an order to be completed later

retrieve – return an initiated order to complete it

authorization -- approve payment for an order

void -- cancel an order or a payment

refund – issue a credit to the shopper after a return

generic

initiate -- create an order to be completed later

retrieve -- return an initiated order to complete it

authorization -- approve payment for an order

void -- cancel an order or a payment

refund -- issue a credit to the shopper after a return

physicalGiftCard

balanceInquiry -- return current available balance

authorize -- approve payment for an order

void -- cancel an order or a payment

refund -- issue a credit to the shopper after a return

invoice

authorization -- approve payment for an order

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.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices