<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
  targetNamespace="http://www.siteminder.com.au/pmsxchange"
  xmlns:tns="http://www.siteminder.com.au/pmsxchange"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:ws="http://www.siteminder.com.au/pmsxchange"
  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:ota="http://www.opentravel.org/OTA/2003/05">
  <wsdl:types>
    <xs:schema targetNamespace="http://www.siteminder.com.au/pmsxchange">
      <xs:element name="SM_HotelResPaymentReadRQ">
        <xs:annotation>
          <xs:documentation xml:lang="en">The SM_HotelResPaymentReadRQ message is used to request current unsynced payment transactions for a specific hotel.</xs:documentation>
        </xs:annotation>

        <xs:complexType>
          <xs:sequence>
            <xs:element name="POS">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Source">
                    <xs:complexType>
                      <xs:sequence>
                        <xs:element name="RequestorID">
                          <xs:complexType>
                            <xs:attribute name="Type" type="xs:integer" use="required" />
                            <xs:attribute name="ID" type="xs:string" use="required" />
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
            <xs:element name="SelectionCriteria">
              <xs:annotation>
                <xs:documentation xml:lang="en">SelectionType will always be 'Undelivered'</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                <xs:attribute name="HotelCode" type="xs:string" use="required" />
                <xs:attribute name="SelectionType" type="xs:string" use="required" />
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="EchoToken" type="xs:string" />
          <xs:attribute name="TimeStamp" type="xs:dateTime"  />
          <xs:attribute name="Version" type="xs:string"  />
        </xs:complexType>
      </xs:element>

      <xs:element name="SM_HotelResPaymentReadRS">
        <xs:annotation>
          <xs:documentation xml:lang="en">The SM_HotelResPaymentReadRS message contains current unsynced payment transactions for the requested hotel.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="HotelResPaymentList">
              <xs:complexType>
                <xs:sequence>
                  <xs:element maxOccurs="unbounded" name="HotelResPayment">
                    <xs:complexType>
                      <xs:sequence minOccurs="0">
                        <xs:element maxOccurs="unbounded" name="UniqueID">
                          <xs:complexType>
                            <xs:attribute name="ID" type="xs:string" use="required" />
                            <xs:attribute name="Type" type="xs:integer" use="required" />
                          </xs:complexType>
                        </xs:element>
                        <xs:element name="PaymentInfo">
                          <xs:annotation>
                            <xs:documentation xml:lang="en">Please be aware that the details provided in the PaymentInfo Element is a best effort. We may not get all details from the external payment systems</xs:documentation>
                          </xs:annotation>
                          <xs:complexType>
                            <xs:sequence>
                              <xs:element name="PaymentCard">
                                <xs:complexType>
                                  <xs:attribute name="CardCode" type="xs:string" use="required" />
                                  <xs:attribute name="CardType" type="xs:string" use="required" />
                                  <xs:attribute name="ExpireDate" type="xs:integer" use="required" />
                                  <xs:attribute name="Mask" type="xs:string" use="required" />
                                  <xs:attribute name="CardHolderName" type="xs:string" use="required" />
                                </xs:complexType>
                              </xs:element>
                              <xs:element name="PaymentAmount">
                                <xs:complexType>
                                  <xs:attribute name="Amount" type="xs:decimal" use="required" />
                                  <xs:attribute name="CurrencyCode" type="xs:string" use="required" />
                                </xs:complexType>
                              </xs:element>
                            </xs:sequence>
                            <xs:attribute name="PaymentTransactionTypeCode" use="required">
                              <xs:simpleType>
                                <xs:restriction base="xs:NMTOKEN">
                                  <xs:enumeration value="charge"/>
                                  <xs:enumeration value="refund"/>
                                </xs:restriction>
                              </xs:simpleType>
                            </xs:attribute>
                            <xs:attribute name="PaymentType" use="required" >
                              <xs:annotation>
                                <xs:documentation xml:lang="en">A value of '5' represents a credit card payment, '6' a debit card payment, '46' an online payment</xs:documentation>
                              </xs:annotation>
                              <xs:simpleType>
                                <xs:restriction base="xs:NMTOKEN">
                                  <xs:enumeration value="5"/>
                                  <xs:enumeration value="6"/>
                                  <xs:enumeration value="46"/>
                                </xs:restriction>
                              </xs:simpleType>
                            </xs:attribute>
                            <xs:attribute name="Remark" type="xs:string" use="required" />
                            <xs:attribute name="ChargeTypeCode"  use="required">
                              <xs:simpleType>
                                <xs:restriction base="xs:NMTOKEN">
                                  <xs:enumeration value="RM"/>
                                  <xs:enumeration value="FD"/>
                                  <xs:enumeration value="OT"/>
                                  <xs:enumeration value="EX"/>
                                </xs:restriction>
                              </xs:simpleType>
                            </xs:attribute>
                          </xs:complexType>
                        </xs:element>
                      </xs:sequence>
                      <xs:attribute name="TransactionID" type="xs:string" use="required" />
                      <xs:attribute name="HotelCode" type="xs:string" use="required" />
                      <xs:attribute name="CreateDateTime" type="xs:string" use="optional" />
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="EchoToken" type="xs:string"  />
          <xs:attribute name="TimeStamp" type="xs:dateTime"  />
          <xs:attribute name="Version" type="xs:string"  />
        </xs:complexType>
      </xs:element>

      <xs:element name="SM_HotelResPaymentResultRQ">
        <xs:annotation>
          <xs:documentation xml:lang="en">The SM_HotelResPaymentResultRQ message is used to mark that a payment transaction has been processed by the pms</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="HotelResPaymentResult">
              <xs:complexType>
                <xs:sequence>
                  <xs:element maxOccurs="unbounded" name="UniqueID">
                    <xs:complexType>
                      <xs:attribute name="ID" type="xs:string" use="required" />
                      <xs:attribute name="Type" type="xs:integer" use="required" />
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
                <xs:attribute name="TransactionID" type="xs:string" use="required" />
                <xs:attribute name="HotelCode" type="xs:string" use="required" />
              </xs:complexType>
            </xs:element>
            <xs:element name="Success" type="xs:string" />
            <xs:element name="Errors" minOccurs="0">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="Error">
                    <xs:complexType>
                      <xs:simpleContent>
                        <xs:extension base="xs:string">
                          <xs:attribute name="Type" type="xs:integer" use="required" />
                          <xs:attribute name="Code" type="xs:integer" use="required" />
                        </xs:extension>
                      </xs:simpleContent>
                    </xs:complexType>
                  </xs:element>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="EchoToken" type="xs:string"  />
          <xs:attribute name="TimeStamp" type="xs:dateTime"  />
          <xs:attribute name="Version" type="xs:string"  />
        </xs:complexType>
      </xs:element>

      <xs:element name="SM_HotelResPaymentResultRS">
        <xs:annotation>
          <xs:documentation xml:lang="en">The SM_HotelResPaymentResultRS message is used to show SM_HotelResPaymentResultRQ has been processed by SM and it has marked the payment transaction as synchronized</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:sequence>
            <xs:element name="Success" />
          </xs:sequence>
          <xs:attribute name="EchoToken" type="xs:string"  />
          <xs:attribute name="TimeStamp" type="xs:dateTime"  />
          <xs:attribute name="Version" type="xs:string"  />
        </xs:complexType>
      </xs:element>
    </xs:schema>

    <xs:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <xs:include schemaLocation="../schema/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
    </xs:schema>

    <xs:schema targetNamespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <xs:include schemaLocation="../schema/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
    </xs:schema>
  </wsdl:types>

  <wsdl:message name="SM_HotelResPaymentReadRQMessage">
    <wsdl:part name="Security" element="wsse:Security"/>
    <wsdl:part name="SM_HotelResPaymentReadRQ" element="ws:SM_HotelResPaymentReadRQ"/>
  </wsdl:message>

  <wsdl:message name="SM_HotelResPaymentReadRSMessage">
    <wsdl:part name="Security" element="wsse:Security"/>
    <wsdl:part name="SM_HotelResPaymentReadRS" element="ws:SM_HotelResPaymentReadRS"/>
  </wsdl:message>

  <wsdl:message name="SM_HotelResPaymentResultRQMessage">
    <wsdl:part name="Security" element="wsse:Security"/>
    <wsdl:part name="SM_HotelResPaymentResultRQ" element="ws:SM_HotelResPaymentResultRQ"/>
  </wsdl:message>

  <wsdl:message name="SM_HotelResPaymentResultRSMessage">
    <wsdl:part name="Security" element="wsse:Security"/>
    <wsdl:part name="SM_HotelResPaymentResultRS" element="ws:SM_HotelResPaymentResultRS"/>
  </wsdl:message>

  <wsdl:portType name="PmsXchangeService">
    <wsdl:operation name="SMHotelResPaymentReadRQ">
      <wsdl:input message="tns:SM_HotelResPaymentReadRQMessage"/>
      <wsdl:output message="tns:SM_HotelResPaymentReadRSMessage"/>
    </wsdl:operation>

    <wsdl:operation name="SMHotelResPaymentResultRQ">
      <wsdl:input message="tns:SM_HotelResPaymentResultRQMessage"/>
      <wsdl:output message="tns:SM_HotelResPaymentResultRSMessage"/>
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="PmsXchangeServiceSoap11" type="tns:PmsXchangeService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="SMHotelResPaymentReadRQ">
      <soap:operation soapAction="http://www.siteminder.com.au/pmsxchange/SMHotelResPaymentReadRQ"/>
      <wsdl:input>
        <soap:header message="tns:SM_HotelResPaymentReadRQMessage" part="Security" use="literal"/>
        <soap:body use="literal" parts="SM_HotelResPaymentReadRQ"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" parts="SM_HotelResPaymentReadRS"/>
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="SMHotelResPaymentResultRQ">
      <soap:operation soapAction="http://www.siteminder.com.au/pmsxchange/SMHotelResPaymentResultRQ"/>
      <wsdl:input>
        <soap:header message="tns:SM_HotelResPaymentResultRQMessage" part="Security" use="literal"/>
        <soap:body use="literal" parts="SM_HotelResPaymentResultRQ"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" parts="SM_HotelResPaymentResultRS"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="PmsXchangeService">
    <wsdl:port name="PmsXchangeServicePort" binding="tns:PmsXchangeServiceSoap11">
      <soap:address location="https://tpi-pmsx.preprod.siteminderlabs.com/webservices/{RequestorID}"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
