{
  "openapi": "3.0.1",
  "info": {
    "title": "MockIpg",
    "version": "1.0"
  },
  "paths": {
    "/api/payments": {
      "post": {
        "tags": [
          "MockIpg"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/payments/{id}": {
      "get": {
        "tags": [
          "MockIpg"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/payments/{id}/pay": {
      "post": {
        "tags": [
          "MockIpg"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardDetails"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/payments/{id}/cancel": {
      "post": {
        "tags": [
          "MockIpg"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/charge": {
      "post": {
        "tags": [
          "MockIpg"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/admin/payments": {
      "get": {
        "tags": [
          "MockIpg"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CardDetails": {
        "type": "object",
        "properties": {
          "cardNumber": {
            "type": "string",
            "nullable": true
          },
          "cardHolder": {
            "type": "string",
            "nullable": true
          },
          "expiryMonth": {
            "type": "integer",
            "format": "int32"
          },
          "expiryYear": {
            "type": "integer",
            "format": "int32"
          },
          "cvv": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ChargeRequest": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "card": {
            "$ref": "#/components/schemas/CardDetails"
          }
        },
        "additionalProperties": false
      },
      "CreatePaymentRequest": {
        "type": "object",
        "properties": {
          "merchantId": {
            "type": "string",
            "nullable": true
          },
          "orderId": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "returnUrl": {
            "type": "string",
            "nullable": true
          },
          "notifyUrl": {
            "type": "string",
            "nullable": true
          },
          "customerEmail": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}