<Orders>
    <UpdateOrder>
        <Function>2</Function>
        <ErrorLevel>2</ErrorLevel>
        <CheckNumber>{{ ticket_number }}</CheckNumber>
        {%- if sub_ticket_number %}
        <SubCheckNumber>{{ sub_ticket_number }}</SubCheckNumber>
        {%- endif %}
        <ReferenceNumber>{{ request_number }}</ReferenceNumber>
        <Check>
            <CheckHeader>
            </CheckHeader>
        </Check>
        <CreditCardAuth>
            <CardNumber>{{ account_number }}</CardNumber>
            <ExpirationDate>{{ expiration_date }}</ExpirationDate>
            <ReferenceNumber>{{ reference_number }}</ReferenceNumber>
            <ApprovalCode>{{ approval_code }}</ApprovalCode>
            <Amount>{{ amount }}</Amount>
            {%- if gift_card_balance %}
            <GCRemainingBalance>{{ gift_card_balance }}</GCRemainingBalance>
            {%- endif %}
            {%- if third_party_payment %}
            <DebitProcessing>Y</DebitProcessing>
            {%- endif %}
            <Gratuity>{{ tip_amount }}</Gratuity>
            <SlipCopies>0</SlipCopies>
            <Debit>N</Debit>
            {%- if cardholder_name %}
            <CardholderName>{{ cardholder_name }}</CardholderName>
            {%- endif %}
        </CreditCardAuth>
        {%- if loyalty_card_number %}
        <CreditCardAuth>
            <CardNumber>{{ loyalty_card_number }}</CardNumber>
            <ExpirationDate>XXXX</ExpirationDate>
            <LoyaltyCard>Y</LoyaltyCard>
            <Amount>0.00</Amount>
        </CreditCardAuth>
        {%- endif %}
    </UpdateOrder>
</Orders>
