DEVICE_CHANNEL_ID:
  description: Indicates the type of channel interface being used to authenticate the consumer
  type: integer
  format: int32
  enum:
    - 1 # APP
    - 2 # BROWSER
    - 3 # RI
  x-enum-varnames:
    - APP       # 1
    - BROWSER   # 2
    - RI        # 3
  x-enum-descriptions:
    - Mobile App
    - Browser
    - 3DS Requestor Initiated (3RI)
  example: 2

AuthenticateConsumerRequest:
  description: |
    A representation of the entered payment and billing details required for strong authentication of a payment transaction using 3D Secure or equivalent
  type: object
  required:
    - device_channel_id
    - payment_details
  properties:
    device_channel_id:
      description: |
        Indicates the type of channel interface being used to authenticate the consumer
      $ref: '#/DEVICE_CHANNEL_ID'
    payment_details:
      description: The payment details provided by the consumer, generally the entered card details but may be a 3rd party wallet such as MobilePay Online
      $ref: '../../common/payment-details/payment-details_v1.yaml#/PaymentDetails'
    billing_address:
      description: The billing address associated with the consumer's payment card
      $ref: '../../common/address/address_v1.yaml#/Address'
    shipping_address:
      description: The shipping address the merchandise ordered by the consumer will be sent to
      $ref: '../../common/address/address_v1.yaml#/Address'
    contact:
      description: The consumer's contact details such as email address, mobile phone etc.
      $ref: '../../common/contact-details/contact-details_v1.yaml#/ContactDetails'
  discriminator:
    propertyName: device_channel_id
    mapping:
      2: '#/AuthenticateConsumerBrowserRequest'

AuthenticateConsumerBrowserRequest:
  description: |
    A representation of the entered payment details and details of the consumer's browser attributes required for strong authentication of a payment transaction using 3D Secure or equivalent
  type: object
  required:
    - browser
  properties:
    browser:
      description: The attributes of the consumer's browser
      $ref: '../../common/browser-details/browser-details_v1.yaml#/Browser'
  allOf:
    - $ref: '#/AuthenticateConsumerRequest'