A simple package to integrate CCAvenue.
pip install pay_ccavenue
from pay_ccavenue import CCAvenue
We can either setup via the environment or by passing the credentials directly to the plugin.
Set the credentials in the environment variables
- Set
CCAVENUE_WORKING_KEY
for theWORKING_KEY
- Set
CCAVENUE_ACCESS_CODE
for theACCESS_CODE
- Set
CCAVENUE_MERCHANT_CODE
for theMERCHANT_CODE
And then instantiate the CCAvenue
object as shown below
ccavenue = CCAvenue()
ccavenue = CCAvenue(WORKING_KEY, ACCESS_CODE, MERCHANT_CODE)
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.
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)
- 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.
- More detailed documentation.
- Currently supports only Iframe method.