InitializePaymentRequest:
  description: |
    A representation of the initialization details provided by the consumer to initialize the payment of a payment transaction through an upstream 3rd party provider such as Apple Pay, Google Pay or MobilePay Online.
  type: object
  required:
    - initialization_details
  properties:
    initialization_details:
      $ref: './initialization-details_v1.yaml#/InitializationDetails'

InitializePaymentDocumentationRequest:
  description: |
    A representation of the initialization details provided by the consumer to initialize the payment of a payment transaction through an upstream 3rd party provider such as Apple Pay, Google Pay or MobilePay Online.  
    This version of the `InitializePaymentRequest` is used to work around a bug in the Swagger UI.
  type: object
  properties:
    initialization_details:
      oneOf:
        - $ref: './initialization-details_v1.yaml#/InitializationDetails'
        - $ref: './mobilepay-online_v1.yaml#/MobilePayOnlineInitialization'
        - $ref: './google-pay_v1.yaml#/GooglePayInitialization'
        - $ref: './apple-pay_v1.yaml#/ApplePayInitialization'
        - $ref: './pix_v1.yaml#/PIXInitialization'
      discriminator:
        propertyName: payment_method_id
        mapping:
          101: './initialization-details_v1.yaml#/InitializationDetails'    # AMEX
          102: './initialization-details_v1.yaml#/InitializationDetails'    # DANKORT
          103: './initialization-details_v1.yaml#/InitializationDetails'    # VISA_DANKORT
          104: './initialization-details_v1.yaml#/InitializationDetails'    # DINERS_CLUB
          105: './initialization-details_v1.yaml#/InitializationDetails'    # DISCOVER
          106: './initialization-details_v1.yaml#/InitializationDetails'    # JCB
          107: './initialization-details_v1.yaml#/InitializationDetails'    # MAESTRO
          108: './initialization-details_v1.yaml#/InitializationDetails'    # MASTERCARD
          109: './initialization-details_v1.yaml#/InitializationDetails'    # VISA
          110: './initialization-details_v1.yaml#/InitializationDetails'    # VISA_ELECTRON
          111: './initialization-details_v1.yaml#/InitializationDetails'    # ELO
          112: './initialization-details_v1.yaml#/InitializationDetails'    # HIPERCARD
          200: './initialization-details_v1.yaml#/InitializationDetails'    # SAVED_CARD
          201: './initialization-details_v1.yaml#/InitializationDetails'    # CONSUMER_WALLET
          202: './mobilepay-online_v1.yaml#/MobilePayOnlineInitialization'  # MOBILEPAY_ONLINE
          203: './google-pay_v1.yaml#/GooglePayInitialization'              # GOOGLE_PAY
          204: './apple-pay_v1.yaml#/ApplePayInitialization'                # APPLE_PAY
          301: './pix_v1.yaml#/PIXInitialization'                           # PIX

InitializePaymentResponse:
  description: |
    A representation of the details for the successful initialization of the payment for a payment transaction through an upstream 3rd party provider such as Apple Pay, Google Pay or MobilePay Online.
  type: object
  required:
    - transaction_id
    - status_code
    - payment_method_id
  properties:
    transaction_id:
      description: The payment gateway's unique ID for the payment transaction for which the payment was successfully initialized
      $ref: '../../common/record-entity-id/record-entity-id_v1.yaml#/RecordEntityId'
      example: 123456
    status_code:
      description: The payment status code for the authorization of the payment transaction
      $ref: '../../common/status-message/status-code_v1.yaml#/STATUS_CODE'
      example: 620021
    payment_method_id:
      description: The unique id for the payment method that the consumer selected to create the payment transaction
      $ref: '../../payment-gateway/payment-method/payment-method-id_v1.yaml#/PAYMENT_METHOD_ID'
      example: 202
    connection:
      description: The details for establishing a connection to the upstream 3rd party provider to authorize the payment for the payment transaction
      $ref: './payment-connection_v1.yaml#/PaymentConnection'