If you want your shoppers to be able to pay for orders requiring approval using a deferred payment method such as invoice or cash, you must set up the payment gateway for the method using the instructions provided in the Integrate with an Invoice Payment Gateway or Integrate with a Cash Payment Gateway sections. In addition to these instructions, you must add an enabledForApproval property to the config.json file for the gateway. For example, the following code snippet shows the config.json file for an invoice payment gateway that includes the enabledForApproval property:

{
  "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": "enabledForApproval",
      "type": "booleanType",
      "name": "enabledForApproval",
      "helpTextResourceId": "enabledForApprovalHelpText",
      "labelResourceId": "enabledForApprovalLabel",
      "public": true,
      "defaultValue": true
  },

  {
      "id": "paymentMethodTypes",
      "type": "multiSelectOptionType",
      "name": "paymentMethodTypes",
      "required": true,
      "helpTextResourceId": "paymentMethodsHelpText",
      "labelResourceId": "paymentMethodsLabel",
      "defaultValue": "invoice",
      "displayAsCheckboxes": true,
      "options": [
         {
           "id": "invoice",
           "value": "invoice",
           "labelResourceId": "invoiceLabel"
         },
         {
           "id": "card",
           "value": "card",
           "labelResourceId": "cardLabel"
         }
       ]
    }
  ]
}

You must also add a translation resource that provides the label for the enabledForApproval property in the administration interface. You should add the resource to each <locale>.json file you have for the languages supported in your administration interface. For example, the following code snippet shows the en.json file where the value for the enableForApprovalLabel is Enable for order approvals. This is the label that will appear in the administration interface when you view the gateway’s properties.

{
  "resources" : {
    "paymentMethodsHelpText": "Select the payment methods.",
    "paymentMethodsLabel": "Payment Methods",
    "invoiceLabel": "Invoice",
    "cardLabel": "CCCard",
    "title": "Invoice Payment Gateway Config",
    "description":"Invoice Payment Gateway configuration.",
    "agentInstanceLabel": "Agent Configuration",
    "previewInstanceLabel": "Preview Configuration",
    "storefrontInstanceLabel": "Storefront Configuration",
    "poRequiredHelpText":"Check if PO number is required",
    "poRequiredLabel":"PO number required",
    "enabledForApprovalLabel":"Enable for order approvals",
    }
}

When configuring the deferred payment gateway in the administration interface, be sure that the “Enable for order approvals” option is checked (if you follow the instructions above, it will be checked by default).


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