Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

خطا در هنگام انصراف از خرید در زرین پال #134

Open
ParhamMz opened this issue Nov 27, 2024 · 1 comment
Open

Comments

@ParhamMz
Copy link

هنگامی که کاربر تو درگاه پرداخت، انصراف رو میزنه و میخواد به سایت بگرده خطای زیر رو دریافت میکنه:

Session is not valid, session is not active paid try.
چجوری به صفحه پرداخت ناموفق منتقلش کنم؟

@ahmadrezanavaie
Copy link
Contributor

برای حل این مشکل من در فایل zarinpal.py متد verify رو به شکل زیر تغییر دادم اگر دوستان راه بهتری دارند بفرمایند:

def verify(self, transaction_code):
   super(Zarinpal, self).verify(transaction_code)
   data = self.get_verify_data()
   client = self._get_client(timeout=10)
   try:
       result = client.service.PaymentVerification(**data)
       if result.Status in [100, 101]:
           self._set_payment_status(PaymentStatus.COMPLETE)
       else:
           self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
           logging.debug("Zarinpal gateway unapprove payment")
   except:
       self._set_payment_status(PaymentStatus.CANCEL_BY_USER)
       logging.debug("Zarinpal gateway unapprove payment")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants