<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_payment_request(self, tid, currency=None, amount=None, action=None, ledger=None, callback_uri=None, display_message_uri=None, capture_id=None, additional_amount=None, text=None, refund_id=None, required_scope=None, required_scope_text=None, line_items=None):
 """Update payment request, reauthorize, capture, release or abort It is possible to update ledger and the callback URIs for a payment request. Changes are always appended to the open report of a ledger, and notifications are sent to the callback registered at the time of notification. Capturing an authorized payment or reauthorizing is done with the action field. The call is idempotent; that is, if one posts the same amount, additional_amount and capture_id twice with action CAPTURE, only one capture is performed. Similarly, if one posts twice with action CAPTURE without any amount stated, to capture the full amount, only one full capture is performed. Arguments: ledger: Log entries will be added to the open report on the specified ledger display_message_uri: Messages that can be used to inform the POS operator about the progress of the payment request will be POSTed to this URI if provided callback_uri: If provided, mCASH will POST to this URI when the status of the payment request changes, using the message mechanism described in the introduction. The data in the "object" part of the message is the same as what can be retrieved by calling GET on the "/payment_request/<tid>/outcome/" resource URI. currency: 3 chars https://en.wikipedia.org/wiki/ISO_4217 amount: The base amount of the payment additional_amount: Typically cash withdrawal or gratuity capture_id: Local id for capture. Must be set if amount is set, otherwise capture_id must be unset. tid: Transaction id assigned by mCASH refund_id: Refund id needed when doing partial refund text: For example reason for refund. action: Action to perform. required_scope: Scopes required to fulfill payment line_items: An updated line_items. Will fail if line_items already set in the payment request or if the sum of the totals is different from the original amount. required_scope_text: Text that is shown to user when asked for permission. """

        arguments = {'ledger': ledger,
                     'display_message_uri': display_message_uri,
                     'callback_uri': callback_uri,
                     'currency': currency,
                     'amount': amount,
                     'additional_amount': additional_amount,
                     'capture_id': capture_id,
                     'action': action,
                     'text': text,
                     'refund_id': refund_id}

        if required_scope:
            arguments['required_scope'] = required_scope
            arguments['required_scope_text'] = required_scope_text

        if line_items:
            arguments['line_items'] = line_items


        arguments = {k: v for k, v in arguments.items() if v is not None}
        return self.do_req('PUT',
                           self.merchant_api_base_url + '/payment_request/' +
                           tid + '/', arguments)