import hashlib
import json
import requests

from django.conf import settings


class RemitaService:

    @staticmethod
    def generate_hash(payment):

        pass

    @staticmethod
    def generate_rrr(payment):

        pass

    @staticmethod
    def verify(payment):

        pass

    @staticmethod
    def requery(payment):

        pass

    @staticmethod
    def generate_hash(payment):

        hash_string = (
            settings.REMITA_MERCHANT_ID +
            settings.REMITA_SERVICE_TYPE_ID +
            payment.txn_ref +
            str(payment.amount) +
            settings.REMITA_API_KEY
        )

        return hashlib.sha512(
            hash_string.encode()
        ).hexdigest()