Skip to content

Commit

Permalink
Change value return by empty transaction_tracking_id to None instead …
Browse files Browse the repository at this point in the history
…of 0
  • Loading branch information
odero committed Aug 11, 2015
1 parent a61587d commit 6d26d27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django_pesapal/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def get_payment_status(self, **kwargs):


class TransactionCompletedView(TemplateView):

'''
After Pesapal processes the transaction this will save the transaction and then redirect
to whatever redirect URL in your settings as `PESAPAL_TRANSACTION_DEFAULT_REDIRECT_URL`.
Expand Down Expand Up @@ -210,9 +211,10 @@ def get_context_data(self, **kwargs):


class UpdatePaymentStatusMixin(PaymentRequestMixin):

def get_params(self):
self.merchant_reference = self.request.GET.get('pesapal_merchant_reference', 0)
self.transaction_id = self.request.GET.get('pesapal_transaction_tracking_id', 0)
self.transaction_id = self.request.GET.get('pesapal_transaction_tracking_id', None)

params = {
'pesapal_merchant_reference': self.merchant_reference,
Expand Down Expand Up @@ -248,6 +250,7 @@ def process_payment_status(self):


class TransactionStatusView(UpdatePaymentStatusMixin, RedirectView):

permanent = False
url = None

Expand All @@ -263,6 +266,7 @@ def get_redirect_url(self, *args, **kwargs):


class IPNCallbackView(UpdatePaymentStatusMixin, View):

def get(self, request, *args, **kwargs):
self.process_payment_status()
return HttpResponse('OK')

0 comments on commit 6d26d27

Please sign in to comment.