code: def online(cls, payload, ip, req_sig):
          
  
          from getpaid.models import Payment
  
          params = json.loads(payload)
          order_data = params.get('order', {})
          pos_id = order_data.get('merchantPosId')
          payment_id = order_data.get('extOrderId')
  
          key2 = cls.get_backend_setting('key2')
  
          if pos_id != cls.get_backend_setting('pos_id'):
              logger.warning('Received message for different pos: {}'.format(pos_id))
              return 'ERROR'
  
          req_sig_dict = cls.parse_payu_sig(req_sig)
          sig = cls.compute_sig(payload, key2, algorithm=req_sig_dict.get('algorithm', 'md5'))
  
          if sig != req_sig_dict['signature']:
              logger.warning('Received message with malformed signature. Payload: {}'.format(payload))
              return 'ERROR'
  
          try:
              payment = Payment.objects.get(id=payment_id)
          except Payment.DoesNotExist:
              logger.warning('Received message for nonexistent payment: {}.\nPayload: {}'.format(payment_id, payload))
              return 'ERROR'
          status = order_data['status']
          if payment.status != 'paid':
              if status == 'COMPLETED':
                  payment.external_id = order_data['orderId']
                  payment.amount = Decimal(order_data['totalAmount']) / Decimal(100)
                  payment.amount_paid = payment.amount
                  payment.currenct = order_data['currencyCode']
                  payment.paid_on = pendulum.parse(params['localReceiptDateTime']).in_tz('utc')
                  payment.description = order_data['description']
                  payment.change_status('paid')
  
              elif status == 'PENDING':
                  payment.change_status('in_progress')
              elif status in ['CANCELED', 'REJECTED']:
                  payment.change_status('cancelled')
          return 'OK'
docs: Receive and analyze request from payment service with information on payment status change.