{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "version": { "type": "string", "const": "saleor.app.square.v1" },
        "method": { "type": "string", "const": "card" },
        "sourceId": { "type": "string", "minLength": 1 },
        "verificationToken": { "type": "string", "minLength": 1 },
        "giftCardRemainder": { "type": "boolean", "const": true }
      },
      "required": ["version", "method", "sourceId"],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "version": { "type": "string", "const": "saleor.app.square.v1" },
        "method": { "type": "string", "enum": ["apple-pay", "cash-app-pay", "afterpay-clearpay"] },
        "sourceId": { "type": "string", "minLength": 1 },
        "verificationToken": { "type": "string", "minLength": 1 },
        "giftCardRemainder": { "type": "boolean", "const": true }
      },
      "required": ["version", "method", "sourceId"],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "version": { "type": "string", "const": "saleor.app.square.v1" },
        "method": { "type": "string", "const": "saved-card" },
        "paymentMethodId": { "type": "string", "minLength": 1 },
        "giftCardRemainder": { "type": "boolean", "const": true }
      },
      "required": ["version", "method", "paymentMethodId"],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "version": { "type": "string", "const": "saleor.app.square.v1" },
        "method": { "type": "string", "const": "gift-card" },
        "sourceId": { "type": "string", "minLength": 1 }
      },
      "required": ["version", "method", "sourceId"],
      "additionalProperties": false
    }
  ],
  "$schema": "http://json-schema.org/draft-07/schema#"
}
