You need to sign in to do that
Don't have an account?
Dnyanesh Gawali
Hi All, Can any one help me in CCAvenue integration with Salesforce
I want to integrate CCAvenue (online payment gateway solution provider) with Salesforce CRM.
Please share some steps or sample code of integration.
Thansk!
Please share some steps or sample code of integration.
Thansk!
First and foremost sincerely regret the delayed reply.
Below information might be helpful for you to accelerate with above requirement.
Description:CCAvenue does not provide integration kit for Salesforce Apex language. They provide Asp.net, Java, NodeJS, iOS, Android, Windows.
How do we encrypt and decrypt data and make request for CCAvenue payment gateway.
Resolution:
Here is Encryption:
/* This PLAIN_TEXT is your data collected from your apex form. Few values are required and lots of values are optional. Please read document provided by ccavenue. */
String PLAIN_TEXT = 'tid=XXXX&merchant_id=XXXX&order_id=XXXX&amount=XX¤cy=INR&redirect_url=XXXX&cancel_url=XXXX&language=EN&billing_name=XXXX&billing_address=XXXX&billing_city=XXXX&billing_state=XX&billing_zip=XXXX&billing_country=XXXX&billing_tel=XXXX&billing_email=XXXX&delivery_name=XXXX&delivery_address=XXXX&delivery_city=XXXX&delivery_state=XXXX&delivery_zip=XXXX&delivery_country=XXXX&delivery_tel=XXXX&merchant_param1=XXXX&merchant_param2=XXXX&merchant_param3=XXXX&merchant_param4=XXXX&merchant_param5=XXXX&promo_code=&customer_identifier=&';
//WORKING_KEY is key provided by CCAvenue when you register as Merchant.
Blob cryptoKey = Blob.valueOf('WORKING_KEY');
Blob hash = Crypto.generateDigest('MD5', cryptoKey );
Blob data = Blob.valueOf(PLAIN_TEXT);
Blob encryptedData = Crypto.encryptWithManagedIV('AES128', hash , data);
String encRequest = EncodingUtil.convertToHex(encryptedData );
/*Pass this encRequest with access_code to the https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction using visual force FORM */
Here is Decryption:
Blob cryptoKey = Blob.valueOf('WORKING_KEY');
Blob hash = Crypto.generateDigest('MD5', cryptoKey);
Blob data = EncodingUtil.convertFromHex('ENC_RESPONSE'); //Received from ccAvenue response
Blob decryptedText = Crypto.decryptWithManagedIV('AES128', hash, data);
String PLAIN_TEXT = decryptedText.toString();
Kindly mark this post as solved if the information help's so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.
Best Regards,
Nagendra.P
Could you please share the details of how you are capturing the ccAvenue response.?
As per the above code by Nagendra, how we get the "ENC_RESPONSE" in the controller.?
What script do I need to write in redirect URL page?
Thanks in Advance,
Amritesh
Nagendra ,
Did you integrated this CCAvenue? Could u please share VF Page and Apex Class tht you have Build?
Hi Dnyanesh Gawali & Amul Baranwal 9,
Here is original post about CCAvenue integration & solution which was updated in April 2016.
https://stackoverflow.com/questions/36565886/payment-gateway-ccavanue-with-salesforce-apex
https://salesforce.stackexchange.com/questions/117578/ccavanue-payment-gateway-integration-with-salesforce-apex
I can help you to fix issues if you have any.
Regards,
Mukund
I am posting UTIL Class that i have Created with help of your Blog.
And I am calling this class from my VF Page and Controller class
controller class
could you please help I am getting Error Code: 10002 Merchant Authentication failed.
We need to whitelist URL for transaction call. You need to add your VF page in Ccavenue merchant account. Please find document here http://cp.thinkcept.com/kb/answer/2417 OR from latest document from CCavenue.
Also I would suggest to use different URL's for redirect URL Cancel URL because your response decription should process on RedirectURL.
Please try whitelisting URL once.
Thanks,
Mukund
I was trying to use a similar logic that you have shared with encryption and decryption. But When I decrypt I was getting decrypted string of this format vivek|INR| but ideally it should be of vivek|INR|.Can you help out or did you face a similar issue?
One more thing, when I was sending the encrypted string to CCAvenue, they told me that when they decrypt they were getting some additional characters in front of the original string(vivek|INR), they were getting something like hdkdjdvivek|INR. can you please tell me if you faced this issue and how did u solve this.
When I send my request it's getting decrypted as below, does anyone have any solution for this.
C�[��6� �� ]{��vivek|INR|2|days|1.00|SMS|123456987|terms and condition|9874563215|Pls call 022-2121212121 to pay your LegalEntity_Name bill # Invoice_ID for Invoice_Currency Invoice_Amount or pay online at Pay_Link.|xxxxx.xxxx@xxxx.com|test invoice mail|this invoice generate for testing|invoice.doc$77u/SGVsbG8gaW5kaWEK|