Skip to content

درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون

License

Notifications You must be signed in to change notification settings

mahyar-amiri/az-iranian-bank-gateways

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AZ Iranian Bank Gateway (v1.6.15 Forked)

Changes

added payer filed to Bank model.


File models.banks.py Line 7-10

from django.contrib.auth import get_user_model


User = get_user_model()

File models.banks.py Line 74-79

payer = models.ForeignKey(
    User,
    null=True,
    on_delete=models.CASCADE,
    related_name='payments',
    verbose_name='پرداخت کننده')

File models.banks.py Line 126

return '{}-{}-{}'.format(self.pk, self.payer.username, self.tracking_code)

File banks.banks.py Line 25

_payer = None

File banks.banks.py Line 80-87

def get_payer(self):
    """get the payer"""
    return self._payer

def set_payer(self, payer):
    """set payer"""
    self._payer = payer

File banks.banks.py Line 126

payer=self.get_payer(),

File banks.banks.py Line 209

self.set_payer(self._bank.payer)

File views/samples.py Line 19

if form.is_valid() and request.user.is_authenticated:

File views/samples.py Line 27

bank.set_payer(request.user)

File views/samples.py Line 30-31

if mobile_number:
    bank.set_mobile_number(mobile_number)  # اختیاری

File admin.py Line 11,26,46,63

'payer',

Usage

bank_record = bank_models.Bank.objects.get(tracking_code=tracking_code)
print(bank_record.payer.username)  # prints the payer's username
payer = User.objects.get(pk=request.pk)
print(payer.payments.all())  #  prints all user's payments
print(payer.payments.filter(status='Complete'))  #  prints Completed user's payments

About

درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.6%
  • HTML 4.4%