Skip to main content

A simple library to setup payment integration with CCAvenue

Project description

pay_ccavenue

A simple package to integrate CCAvenue.

How to install

pip install pay_ccavenue

Import

from pay_ccavenue import CCAvenue

Initialize the Package

We can either setup via the environment or by passing the credentials directly to the plugin.

Via the environment variables

Set the credentials in the environment variables

  • Set CCAVENUE_WORKING_KEY for the WORKING_KEY
  • Set CCAVENUE_ACCESS_CODE for the ACCESS_CODE
  • Set CCAVENUE_MERCHANT_CODE for the MERCHANT_CODE

And then instantiate the CCAvenue object as shown below

ccavenue = CCAvenue()

Pasing the credentials directly

ccavenue = CCAvenue(WORKING_KEY, ACCESS_CODE, MERCHANT_CODE)

To encrypt the data

form_data is the post request body which is a dictionary of the related data for the payment. You don't need to pass the Merchant ID though. Since we have already intiated the package with the correct MERCHANT_CODE. encrypt() method return the encrypted string that can be ussed directly in the Iframe rendering.

encrypt_data = ccavenue.encrypt(form_data)

Pass the encrypt_data from the above to the view to render the IFrame.

Decrypt the data received from the CCAvenue

form_data is the post request body which is a dictionary of the related data received from the CCAvenue. The decrypt() method returns the dictionary of the data received from the CCAvenue.

decrypted_data = ccavenue.decrypt(form_data)

Limitations

  1. I have not added any tests as of now in the package, but I have tested this out for my project after debugging their given examples and Stackoverflow to simplify it.
  2. More detailed documentation.
  3. Currently supports only Iframe method.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pay_ccavenue-0.1.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pay_ccavenue-0.1.3-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pay_ccavenue-0.1.3.tar.gz.

File metadata

  • Download URL: pay_ccavenue-0.1.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/21.2.0

File hashes

Hashes for pay_ccavenue-0.1.3.tar.gz
Algorithm Hash digest
SHA256 821007f7bce6b69746ad2ba20b80130731147b767d2c96a38754324ac30b866d
MD5 3dffe76406a15ba46542b905fd23d1aa
BLAKE2b-256 10be6d5deacce8d12bb8e3e7a23b885227eb684e6b43c7784e8e6752cb5fca68

See more details on using hashes here.

File details

Details for the file pay_ccavenue-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pay_ccavenue-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.9.7 Darwin/21.2.0

File hashes

Hashes for pay_ccavenue-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e799a1a2457f1c8754fd440f29bb8c9d4e732c1b4127fdedd9739fa18cb00f75
MD5 571448722ca9e1deb927df998d9f9925
BLAKE2b-256 41694caa0c8929e0dfbf4d605253e0d429b8aa211367c8ad8efb63f991cf9aed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page