Package: payment-az
odeme sistemleri ucun modulHazirda Azericard , NestPay, GoldenPay destekleyirModulda async odeme neticesini gonderen function var . Callback a gelen data ya gore 'success' emaili gonderir .default olarag False diaktiv etmek ucun :callbackda data_result a gonderdiyimiz request.POST da send_email = True ve:send_email=Truesender=''to=''content=''hostname='',port='',username='',password='',gondermeyiniz bes edir# Azericard ucun example@csrf_exemptdefcallback(request):........ifrequest.method=='POST':data=request.POST# email gondermek isdediyiniz teqdirde###################data['send_email']=Truedata['sender']=''# gonderendata['to']=''# kimedata['content']=''# mail terkibi ```html``` qebul edirdata['hostname']='',# email serverdata['port']=465,# port integer olmalididata['username']='',# email logindata['password']='',# email password####################### eger email gondermek isdemirsinizse commente aldigim hisseni gondermeye ehtiyac yoxdurresult=AzeriCard.data_result(**data)returnHttpResponse(result)else:returnHttpResponse("Not found")Example NestPayfrompayment.nestpayimportNestPayfrompayment.utilsimportmicrotimefromdjango.httpimportHttpResponsefromdjango.views.decorators.csrfimportcsrf_exemptdefpayment(request):......temp=NestPay(clientId='',# bank terefinden veriliramount='',# mebleg : 1.00 azn (float)oid='',# order id unique - diokUrl='',# callback url. Success den sonra bura post gonderilirfailUrl='',# error urlrnd=microtime(),storekey='2',# bank terefinden verilirstoretype='',# bank terefinden verilirlang='en',# hansi dilde odeme sehvesine redirect edecekislemtipi='Auth',# defaulthash='',# hash edirik default bosh stringdirefreshtime='5',# sehifeler arasinda redirect timeoutinstalment='',# taksidcurrency='944',# Azerbaycan manatinin kodupost_url='https://entegrasyon.asseco-see.com.tr/fim/est3Dgate'# odeme sehifesi).bank_data()returnHttpResponse(temp)# callback yuxarda paymentde qeyd edeceyimiz okUrl di ve o url e bank post gonderir@csrf_exemptdefcallback(request):........ifrequest.method=='POST':data=request.POSTdata['storekey']=''#bank terefinden verilirresult=NestPay.data_result(**data)returnHttpResponse(result)else:returnHttpResponse("Not found")Example Azericardfrompayment.azericardimportAzeriCardfromdjango.httpimportHttpResponsefromdjango.views.decorators.csrfimportcsrf_exemptdefpayment(request):......temp=AzeriCard(AMOUNT='1',CURRENCY="AZN",ORDER='100001',# order id si mininim 6 reqem olmalidi misal : 100001 : Order id olmadan script run olmurTERMINAL="",# bank terefinden verilirTRTYPE="1",# Authkey_for_sign="",#bank terefden onceden verilirDESC="",# descriptionMERCH_NAME="",#magaza adiMERCH_URL="",# callback sehifesiEMAIL="",# emailinizCOUNTRY="AZ",BACKREF="",# geri donus sehifesi).bank_data()returnHttpResponse(temp)# callback yuxarda paymentde qeyd edeceyimiz MERCH_URL di ve o url e bank post gonderir@csrf_exemptdefcallback(request):........ifrequest.method=='POST':data=request.POSTdata['key_for_sign']=''# bank terefden onceden verilirresult=AzeriCard.data_result(**data)# eger odenisin reversal nezerde tutmusunuzsa data['RRN'] ve data['INT_REF'] ni order.models de save edin# Exampleifresult['action']=='0':try:order=Order.models.get(id=data['ORDER'])order.rrn==data['RRN']order.int_ref=data['INT_REF']except:passreturnHttpResponse(result)else:returnHttpResponse("Not found")# ordenisin geri qaytarilmasi lazim oldugu halda (reversal)defpayment_reversal(request):data={}data['key_for_sign']=''# bank terefden onceden verilirdata['AMOUNT']='1';data['CURRENCY']='AZN';data['ORDER']='000001';data['RRN']='';#Bank reference numberdata['INT_REF']='';# Internal reference numberdata['TERMINAL']='77777777';reversal=AzeriCard.reversal(**data)returnHttpResponse(result)Example GoldenPayfrompayment.goldenpayimportGoldenPayfromdjango.httpimportHttpResponseRedirectdefpayment(request):temp=GoldenPay(amount=1,# qiymetmerchantName="",# goldenpay terefden verilirauthKey="",# goldenpay terefden verilircardType="",# (Visa=v, Mastercard=m)description="",#).bank_data()######## Eger odenisin neticesini oyrenmek isdeyirsinizse remp['paymentKey'] database save edin# Example    Order.objects.create(key = remp['paymentKey'])########returnHttpResponseRedirect(temp['url'])defget_payment_result(request):temp=GoldenPay(authKey="",# goldenpay terefden verilirpaymentKey="").getPaymentResult()# temp returnda xml qaytaracaqreturnHttpResponse(temp)