Response field not in FROM_API_FIELDS: csrfmiddlewaretoken

I am trying to integrate Helcim Payment Method in django, i have written all the logic to make the payment, when i open up the page page, fill in my cards detail and amount to be paid and hit the submit button, it shows processing then refresh the page, then in the terminal i got this error that says Response field not in FROM_API_FIELDS: csrfmiddlewaretoken.

I know this error is related to a csrf issue, i have added csrf_token to my form and even added csrf_exempt to the View but the error keeps showing up, i would really appreciate it if i can get some guide on what to look for or do concerning this issue.

This is the view to process the payment


@method_decorator(csrf_exempt, name='dispatch')
class HelcimJSPaymentView(HelcimJSMixin, FormView):
    form_class = HelcimjsPaymentForm
    success_url = 'example:complete'
    template_name = 'core/example_app/helcimjs_payment_details.html'

    def get_success_url(self, **kwargs): # pylint: disable=arguments-differ
        """Returns the success URL."""
        return reverse_lazy(self.success_url, kwargs=kwargs)

    def post(self, request, *args, **kwargs):
        """Handles remaining processing after Helcim.js processing."""
        response = HelcimJSResponse(
            response=request.POST, save_token=True, django_user=request.user
        )

        if response.is_valid():
            # NOTE: the type of transaction made by Helcim.js is determined by
            # the Helcim.js configuration. You will need to decide on the
            # proper "record" method to use for your situation.
            transaction, token = response.record_purchase()

            # NOTE: you generally wouldn't want to transmit these
            # details as query parameters; this is just done to
            # simplify this sandbox example
            url = '{}?transaction_type={}&transaction={}&token={}'.format(
                self.get_success_url(),
                'helcimjs',
                transaction.id,
                token.id,
            )
            return HttpResponseRedirect(url)

        # Invalid form submission/payment - render payment details again
        # TODO: add some basic initial data to the form
        form = self.get_form()

        return self.form_invalid(form)

I don’t really know the exact code to share, i would provide more info if needed