{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Response Message for 'duplicate'",
  "description": "Provide duplicate information about the last processed transaction on the terminal. Only a Duplicate Customer receipt will be provided.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "jsonrpc",
    "id",
    "result"
  ],
  "properties": {
    "jsonrpc": {
      "title": "JSON-RPC Version Number",
      "description": "Identifies the JSON Remote Protocol version that this message uses.",
      "type": "string",
      "enum": [
        "2.0"
      ],
      "default": "2.0"
    },
    "id": {
      "title": "JSON-RPC2 Message ID",
      "description": "The same message id as the request JSON message this is a reply to, so that this response can be matched to the correct request.",
      "type": "integer",
      "maximum": 999999,
      "minimum": 0
    },
    "result": {
      "title": "Payment",
      "description": "Information about a payment.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "amountBase",
        "amountCashback",
        "amountGratuity",
        "amountTotal",
        "applicationId",
        "applicationLabel",
        "authCode",
        "cardSchemeName",
        "cardholderVerificationMethod",
        "currency",
        "dateOfExpiry",
        "dateOfStart",
        "paymentMethod",
        "primaryAccountNumber",
        "primaryAccountNumberSequence",
        "receiptLines",
        "tid",
        "transactionId",
        "transactionNumber",
        "transactionResult",
        "transactionTime",
        "transactionType"
      ],
      "properties": {
        "amountBase": {
          "description": "Base amount of the transaction (in pence), without cashback or gratuity.",
          "type": "integer",
          "default": 0,
          "minimum": 0,
          "maximum": 99999999
        },
        "amountCashback": {
          "description": "Amount of cashback (in pence) added to the transaction.",
          "type": "integer",
          "default": 0
        },
        "amountGratuity": {
          "description": "Amount of gratuity (in pence) added to the transaction.",
          "type": "integer",
          "default": 0
        },
        "amountTotal": {
          "description": "Sum of amountBase, amountCashback and amountGratuity (in pence).",
          "type": "integer",
          "default": 0,
          "minimum": 0
        },
        "applicationId": {
          "description": "Identifier of the application in the card used in the transaction.",
          "type": "string",
          "default": ""
        },
        "applicationLabel": {
          "description": "Name of the application in the card used in the transaction.",
          "type": "string",
          "default": ""
        },
        "authCode": {
          "description": "Authorisation code provided by the bank to approve the transaction.",
          "type": "string",
          "default": ""
        },
        "cardSchemeName": {
          "description": "Scheme of the card used in the transaction. The scheme controls the operation of payment transactions.",
          "type": "string",
          "default": ""
        },
        "cardholderVerificationMethod": {
          "title": "cardholderVerificationMethod",
          "description": "Method used to verify that the person presenting the card is the legitimate cardholder.",
          "type": "string",
          "default": "NONE",
          "enum": [
            "UNKNOWN",
            "NONE",
            "PIN",
            "SIGNATURE",
            "DEVICE"
          ]
        },
        "currency": {
          "title": "Currency Code",
          "description": "The currency this terminal or request is using. If being used to set the currency code of a response message then it must be the same currency as the associated request message. The textual representation from ISO 4217 is used.",
          "type": "string",
          "enum": [
            "GBP",
            "EUR"
          ]
        },
        "dateOfExpiry": {
          "description": "If available, the expiry date of the card. Of the format 'MM/YY'.",
          "type": "string",
          "default": ""
        },
        "dateOfStart": {
          "description": "If available, the start date of the card. Of the format 'MM/YY'.",
          "type": "string",
          "default": ""
        },
        "paymentMethod": {
          "title": "paymentMethod",
          "description": "Method by which the card details have been read from the payment medium.",
          "type": "string",
          "default": "UNKNOWN",
          "enum": [
            "UNKNOWN",
            "KEYED",
            "SWIPED",
            "ICC_CHIP",
            "CONTACTLESS"
          ]
        },
        "primaryAccountNumber": {
          "description": "PAN (Primary Account Number) of the card used in the transaction. Only the last 4 digits of the number are provided.",
          "type": "string",
          "default": ""
        },
        "primaryAccountNumberSequence": {
          "description": "Sequence number of the PAN of the card used in the transaction. Used to differentiate cards with the same PAN.",
          "type": "string",
          "default": ""
        },
        "receiptLines": {
          "title": "Transaction Receipt(s)",
          "description": "The receipt(s) from the transaction. The receipts can come in the form of a 'MERCHANT' receipt and/or a 'CUSTOMER' receipt. The combination of receipts provided depends on the request taking place.",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "MERCHANT": {
              "title": "Receipt Lines",
              "description": "A receipt from the terminal defined by an ordered array of Receipt Line objects.",
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "title": "Text Receipt Line",
                    "description": "A receipt line containing text that has optional formatting.",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "value",
                      "type"
                    ],
                    "properties": {
                      "value": {
                        "title": "Value of Receipt Line",
                        "description": "This is the text to be printed for this line. The string can only contain ASCII characters 0x20-0x7E (inclusive), 0x80 (Euro Symbol) and 0xA3 (Pound Symbol). The maxLength of this string depends on the formatting options used.",
                        "type": "string",
                        "default": "",
                        "maxLength": 24
                      },
                      "type": {
                        "title": "Type of Receipt Line",
                        "description": "Defines the type of the receipt line to be text.",
                        "type": "string",
                        "enum": [
                          "TEXT"
                        ]
                      },
                      "format": {
                        "title": "Formatting of Receipt Line",
                        "description": "Optional formatting for the printed text. If using DOUBLE_WIDTH the maximum length of the text reduces to 12 characters.",
                        "type": "array",
                        "maxItems": 3,
                        "items": {
                          "type": "string",
                          "enum": [
                            "BOLD",
                            "DOUBLE_HEIGHT",
                            "DOUBLE_WIDTH"
                          ]
                        }
                      }
                    }
                  },
                  {
                    "title": "Graphic Receipt Line",
                    "description": "A receipt line containing a graphic.",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "value",
                      "type"
                    ],
                    "properties": {
                      "value": {
                        "title": "Value of Receipt Line",
                        "description": "If this is a receipt from a terminal, this will contain the text equivalent of the printed graphic object. If this is a receipt to be printed on a terminal, then this property must be an empty string.",
                        "type": "string",
                        "default": ""
                      },
                      "type": {
                        "title": "Type of Graphic",
                        "description": "Defines the type of graphic to be printed.",
                        "type": "string",
                        "enum": [
                          "CARRIAGE_RETURN",
                          "LINE_SEPARATOR_DOUBLE",
                          "LINE_SEPARATOR_SINGLE",
                          "TICKET_FEED"
                        ]
                      },
                      "format": {
                        "title": "Formatting of Receipt Line",
                        "description": "This property has no effect on this type of receipt line, which is why it is an optional parameter and when it is defined it is an empty list.",
                        "type": "array",
                        "maxItems": 0,
                        "items": {}
                      }
                    }
                  }
                ]
              }
            },
            "CUSTOMER": {
              "title": "Receipt Lines",
              "description": "A receipt from the terminal defined by an ordered array of Receipt Line objects.",
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "title": "Text Receipt Line",
                    "description": "A receipt line containing text that has optional formatting.",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "value",
                      "type"
                    ],
                    "properties": {
                      "value": {
                        "title": "Value of Receipt Line",
                        "description": "This is the text to be printed for this line. The string can only contain ASCII characters 0x20-0x7E (inclusive), 0x80 (Euro Symbol) and 0xA3 (Pound Symbol). The maxLength of this string depends on the formatting options used.",
                        "type": "string",
                        "default": "",
                        "maxLength": 24
                      },
                      "type": {
                        "title": "Type of Receipt Line",
                        "description": "Defines the type of the receipt line to be text.",
                        "type": "string",
                        "enum": [
                          "TEXT"
                        ]
                      },
                      "format": {
                        "title": "Formatting of Receipt Line",
                        "description": "Optional formatting for the printed text. If using DOUBLE_WIDTH the maximum length of the text reduces to 12 characters.",
                        "type": "array",
                        "maxItems": 3,
                        "items": {
                          "type": "string",
                          "enum": [
                            "BOLD",
                            "DOUBLE_HEIGHT",
                            "DOUBLE_WIDTH"
                          ]
                        }
                      }
                    }
                  },
                  {
                    "title": "Graphic Receipt Line",
                    "description": "A receipt line containing a graphic.",
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "value",
                      "type"
                    ],
                    "properties": {
                      "value": {
                        "title": "Value of Receipt Line",
                        "description": "If this is a receipt from a terminal, this will contain the text equivalent of the printed graphic object. If this is a receipt to be printed on a terminal, then this property must be an empty string.",
                        "type": "string",
                        "default": ""
                      },
                      "type": {
                        "title": "Type of Graphic",
                        "description": "Defines the type of graphic to be printed.",
                        "type": "string",
                        "enum": [
                          "CARRIAGE_RETURN",
                          "LINE_SEPARATOR_DOUBLE",
                          "LINE_SEPARATOR_SINGLE",
                          "TICKET_FEED"
                        ]
                      },
                      "format": {
                        "title": "Formatting of Receipt Line",
                        "description": "This property has no effect on this type of receipt line, which is why it is an optional parameter and when it is defined it is an empty list.",
                        "type": "array",
                        "maxItems": 0,
                        "items": {}
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "tid": {
          "title": "Terminal Public Identifier (TPI)",
          "description": "The identifier for a terminal.",
          "type": "string",
          "default": "N/A"
        },
        "transactionId": {
          "description": "Used by the terminal to identify this transaction.",
          "type": "string",
          "default": ""
        },
        "transactionNumber": {
          "description": "Number of the transaction within the current terminal session.",
          "type": "string",
          "default": ""
        },
        "transactionResult": {
          "description": "Outcome of the transaction.",
          "type": "string",
          "enum": [
            "SUCCESSFUL",
            "DECLINED",
            "VOID",
            "UNSUCCESSFUL",
            "CANCELLED",
            "TIMED_OUT"
          ]
        },
        "transactionTime": {
          "description": "Time at which the transaction took place.",
          "type": "string",
          "default": ""
        },
        "transactionType": {
          "title": "transactionType",
          "description": "Type of the transaction.",
          "type": "string",
          "enum": [
            "LOGON",
            "REFUND",
            "REFUND_REVERSAL",
            "SALE",
            "SALE_REVERSAL",
            "PRE_AUTH",
            "COMPLETION",
            "ACCOUNT_VERIFICATION"
          ]
        }
      }
    }
  }
}