Django Azerbaycan getewaylari ucun modullar
Project description
odeme sistemleri ucun modul
Hazirda Azericard , NestPay, GoldenPay destekleyir
Modulda async odeme neticesini gonderen function var . Callback a gelen data ya gore 'success' emaili gonderir .
default olarag False di
aktiv etmek ucun :
callbackda data_result a gonderdiyimiz request.POST da send_email = True ve:
send_email = True
sender = ''
to = ''
content = ''
hostname='',
port='',
username='',
password='',
gondermeyiniz bes edir
# Azericard ucun example
@csrf_exempt
def callback(request):
........
if request.method == 'POST':
data = request.POST
# email gondermek isdediyiniz teqdirde
###################
data['send_email'] = True
data['sender'] = '' # gonderen
data['to'] = '' # kime
data['content'] = '' # mail terkibi ```html``` qebul edir
data['hostname']='', # email server
data['port']= 465, # port integer olmalidi
data['username']='', # email login
data['password']='', # email password
####################### eger email gondermek isdemirsinizse commente aldigim hisseni gondermeye ehtiyac yoxdur
result = AzeriCard.data_result(**data)
return HttpResponse(result)
else:
return HttpResponse("Not found")
Example NestPay
from payment.nestpay import NestPay
from payment.utils import microtime
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
def payment(request):
......
temp = NestPay(
clientId = '', # bank terefinden verilir
amount = '', # mebleg : 1.00 azn (float)
oid = '', # order id unique - di
okUrl = '', # callback url. Success den sonra bura post gonderilir
failUrl = '', # error url
rnd = microtime(),
storekey = '2', # bank terefinden verilir
storetype = '', # bank terefinden verilir
lang = 'en', # hansi dilde odeme sehvesine redirect edecek
islemtipi = 'Auth', # default
hash = '', # hash edirik default bosh stringdi
refreshtime = '5', # sehifeler arasinda redirect timeout
instalment='', # taksid
currency = '944', # Azerbaycan manatinin kodu
post_url = 'https://entegrasyon.asseco-see.com.tr/fim/est3Dgate' # odeme sehifesi
).bank_data()
return HttpResponse(temp)
# callback yuxarda paymentde qeyd edeceyimiz okUrl di ve o url e bank post gonderir
@csrf_exempt
def callback(request):
........
if request.method == 'POST':
data = request.POST
data['storekey'] = '' #bank terefinden verilir
result = NestPay.data_result(**data)
return HttpResponse(result)
else:
return HttpResponse("Not found")
Example Azericard
from payment.azericard import AzeriCard
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
def payment(request):
......
temp = AzeriCard(
AMOUNT = '1',
CURRENCY = "AZN",
ORDER = '100001', # order id si mininim 6 reqem olmalidi misal : 100001 : Order id olmadan script run olmur
TERMINAL = "", # bank terefinden verilir
TRTYPE = "1", # Auth
key_for_sign = "", #bank terefden onceden verilir
DESC = "",# description
MERCH_NAME = "", #magaza adi
MERCH_URL = "", # callback sehifesi
EMAIL = "", # emailiniz
COUNTRY = "AZ",
BACKREF = "",# geri donus sehifesi
).bank_data()
return HttpResponse(temp)
# callback yuxarda paymentde qeyd edeceyimiz MERCH_URL di ve o url e bank post gonderir
@csrf_exempt
def callback(request):
........
if request.method == 'POST':
data = request.POST
data['key_for_sign'] = '' # bank terefden onceden verilir
result = AzeriCard.data_result(**data)
# eger odenisin reversal nezerde tutmusunuzsa data['RRN'] ve data['INT_REF'] ni order.models de save edin
# Example
if result['action'] == '0':
try:
order = Order.models.get(id=data['ORDER'])
order.rrn == data['RRN']
order.int_ref = data['INT_REF']
except:
pass
return HttpResponse(result)
else:
return HttpResponse("Not found")
# ordenisin geri qaytarilmasi lazim oldugu halda (reversal)
def payment_reversal(request):
data = {}
data['key_for_sign'] = '' # bank terefden onceden verilir
data['AMOUNT'] = '1';
data['CURRENCY'] = 'AZN';
data['ORDER'] = '000001';
data['RRN'] = ''; #Bank reference number
data['INT_REF'] = ''; # Internal reference number
data['TERMINAL'] = '77777777';
reversal = AzeriCard.reversal(**data)
return HttpResponse(result)
Example GoldenPay
from payment.goldenpay import GoldenPay
from django.http import HttpResponseRedirect
def payment(request):
temp = GoldenPay(
amount = 1, # qiymet
merchantName = "", # goldenpay terefden verilir
authKey = "", # goldenpay terefden verilir
cardType = "", # (Visa=v, Mastercard=m)
description = "", #
).bank_data()
######## Eger odenisin neticesini oyrenmek isdeyirsinizse remp['paymentKey'] database save edin
# Example Order.objects.create(key = remp['paymentKey'])
########
return HttpResponseRedirect(temp['url'])
def get_payment_result(request):
temp = GoldenPay(
authKey = "", # goldenpay terefden verilir
paymentKey = ""
).getPaymentResult()
# temp returnda xml qaytaracaq
return HttpResponse(temp)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
payment-az-1.1.0.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file payment-az-1.1.0.tar.gz
.
File metadata
- Download URL: payment-az-1.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf48012b4bdb970313a20ad636ac87a10868f091f881930c0eea051c42ade6c |
|
MD5 | 14e61f6d8d5eea9498e543ff05463e83 |
|
BLAKE2b-256 | 0cd6cbb6a7c2cc6610a23e9d1d1ca6d14aa2704cdca7ee34cb02626660aa354b |
File details
Details for the file payment_az-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: payment_az-1.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d50d456fac78ae81ed9d747a0fc3341cd38a4e0ffafd585ffad3aa4633c96c39 |
|
MD5 | 437df75f640844dd9ad2a8d8e9a7343d |
|
BLAKE2b-256 | de06c4b6eac2213d7c9004f7b48dcd774de7f94058c0f0c11d8de25b76d546bc |