Giter VIP home page Giter VIP logo

paywitheasebuzz-django-lib-python2.7's Introduction

paywitheasebuzz-python-django-lib-python2.7

Python-Django integration kit for pay with easebuzz pay.easebuzz.in

Software Requirement

setup python-django kits on test/development/production environment install below software

  1. pip
  2. python 2.7
  3. Django 1.11
  4. requests 2.18.4

Note:

We strongly recommend to set up this kits inside virtual environment to avoid any conflict with your's existing projects.

  1. virtualenv

easebuzz documentation for kit integration

https://docs.easebuzz.in/

paywitheasebuzz-python-django-lib kit, try it your self

Once set up python environment then follow below steps

  1. clone paywitheasebuzz-python-django-lib on your's system.

  2. unzip paywitheasebuzz-python-django-lib.

  3. using virtual environment

    1. go to your's python environment folder using terminal or command prompt.

      1. active environment using below command.
            source bin/activate
        
      2. goto paywitheasebuzz-python-django-lib kit folder and run command like
            python manage.py runserver
        
      3. type URL: http://127.0.0.1:8000/
  4. without virtual environment

    1. goto paywitheasebuzz-python-django-lib kit folder.
      1. run the below command.
          python manage.py runserver
      
      1. type URL: http://127.0.0.1:8000/

Process for integrating paywitheasebuzz-python-django-lib kit in "Project"

  1. copy and paste easebuzz_lib folder in your's project directory.
  2. include easebuzz_payment_gateway.py file in your's views.py file.
        from easebuzz_lib.easebuzz_payment_gateway import Easebuzz
    
  3. set MERCHANT_KEY, SALT, and ENV.
        MERCHANT_KEY = "10PBP71ABZ2";
        SALT = "ABC55E8IBW";         
        ENV = "test";   // "test for test enviroment or "prod" for production enviroment
    
  4. create Easebuzz class object and pass MERCHANT_KEY, SALT and ENV.
        easebuzzObj = Easebuzz(MERCHANT_KEY, SALT, ENV)
    
  5. call Easebuzz class methods or function based on your's requirements.
    1. Initiate Payment API POST Format and call initiatePaymentAPI

      postDict = {
          'txnid': 'T3SAT0B5OL',
          'firstname': 'jitendra',
          'phone': '1231231235',
          'email': '[email protected]'
          'amount': '1.03',
          'productinfo': 'Apple Mobile',
          'surl': 'http://localhost:8000/response/',
          'furl': 'http://localhost:8000/response/',
          'city': 'aaaa',
          'zipcode': '123123',
          'address2': 'aaaa',
          'state': 'aaaa',
          'address1': 'aaaa',
          'country': 'aaaa',
          'udf1': 'aaaa',
          'udf2': 'aaaa',
          'udf3': 'aaaa',
          'udf4': 'aaaa',
          'udf5': 'aaaa'
      }
      
      final_response = easebuzzObj.initiatePaymentAPI(postDict)
      result = json.loads(final_response)
      if result['status'] == 1:
      
          # note: result['data'] - contain payment link. 
          return redirect(result['data'])
      else:
          return render(request, 'response.html', {'response_data': final_response})
      
    2. Transaction API POST Format and call transactionAPI

      postDict = {
          'txnid':'T300',
          'amount':'1.03',
          'phone':'1231231235',
          'email':'[email protected]'
      }
      
      final_response = easebuzzObj.transactionAPI(postDict)
      return render(request, 'response.html', {'response_data': final_response})
      
    3. Transaction API (by date) POST Format and call transactionDateAPI

      postDict = {
          'merchant_email':'[email protected]',
          'transaction_date':'06-06-2018'
      }
      
      final_response = easebuzzObj.transactionDateAPI(postDict)
      return render(request, 'response.html', {'response_data': final_response})
      
    4. Refund API POST Format and call refundAPI

      postDict = {
          'txnid':'T300',
          'refund_amount':'0.9',
          'phone':'1231231235',
          'amount':'1.03',
          'email':'[email protected]'
      }
      
      final_response = easebuzzObj.refundAPI(postDict)
      return render(request, 'response.html', {'response_data': final_response})    
      
    5. Payout API POST Format and call payoutAPI

      postDict = {
          'merchant_email':'[email protected]',
          'payout_date':'06-06-2018'
      }
      
      final_response = easebuzzObj.payoutAPI(postDict)
      return render(request, 'response.html', {'response_data': final_response})
      
    6. Response of Inititate Payment API

      Initiate Payment API response will be sent on success URL or failure URL using HTTP form post.

          final_response = easebuzzObj.easebuzzResponse(request.POST)
          return render(request, 'response.html', {'response_data': final_response})
      

paywitheasebuzz-django-lib-python2.7's People

Contributors

easebuzz avatar jitendraeasebuzz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.