code: def refund(self, **kwargs):
          
          # Find the URL and method to refund the transaction.
          try:
              selfnode = self._elem
          except AttributeError:
              raise AttributeError('refund')
          url, method = None, None
          for anchor_elem in selfnode.findall('a'):
              if anchor_elem.attrib.get('name') == 'refund':
                  url = anchor_elem.attrib['href']
                  method = anchor_elem.attrib['method'].upper()
          if url is None or method is None:
              raise AttributeError("refund")  # should do something more specific probably
  
          actionator = self._make_actionator(url, method, extra_handler=self._handle_refund_accepted)
          return actionator(**kwargs)
docs: Refund this transaction.
  
          Calling this method returns the refunded transaction (that is,
          ``self``) if the refund was successful, or raises a `ResponseError` if
          an error occurred requesting the refund. After a successful call to
          `refund()`, to retrieve the new transaction representing the refund,
          use the `get_refund_transaction()` method.