How to use get and post callbacks together

I have both post and get callbacks from an external api
from the post one i need a variable to send to the get one
how can i do it?

class parspostget(View):
    def __init__(self,):
        self.post_hmac = ''
    def get(self, request, *args, **kwargs):
        print("GET DEF START")

        print("GET DEF END")
        return render(request, "store/card_payment.html")
        # return JsonResponse("get", safe=False)
    def post(self, request, *args, **kwargs):
        print("POST DEF START")
        self.post_hmac = paymentProcCallback(request)
        request.session['hmac'] = self.post_hmac
        print("POST DEF END")
        return render(request, "store/card_payment.html")
        # return JsonResponse("post", safe=False)

That depends strictly upon the external service. There should be documentation somewhere that specifies the details of what data is sent and received.

I have assigned
request.session[‘hmac’] = self.post_hmac
in the post function

but i can not get it in the get function
print(request.session.get(“hmac”)) => None

I doubt seriously that the external service uses session-based connections. You’re going to want to save this data in the database and find what data the service uses to associate requests. But again, that’s something that you’re only going to be able to determine for sure by researching this through their documentation.