The CCAvenue Source Details object requires the following field.
Step 2: Create a CCAvenue source using DigitalRiver.js
Use the DigitalRiver.js library to create and mount elements to the HTML container.
CCAvenue's risk policy requires the shopper's phone number (a ten-digit numeric value) in the address object, which cannot be empty. However, Digital River does not validate the phone number.
let ccavenueSourceData = {"type":"ccavenue","sessionId":"3c9473b0-630d-4f20-af61-63d3aa8acb35","owner": {"firstName":"John","lastName":"Doe","email":"john.doe@digitalriver.com","phoneNumber":"1306372509","address":{"line1":"34th Floor, Promod Industrial Estate, Western X-highway, B/h Kohinoor Ind Est, Goregaon (e)","line2":"","city":"Mumbai","state":"Maharashtra","postalCode":"400063","country":"IN" } },"ccavenue": {"returnUrl":"https://example.com/return","cancelUrl":"https://example.com/cancel" }}digitalriver.createSource(ccavenueSourceData).then(function(result) {if (result.error) {//handle errors as something went wrong } else {var source =result.source;//do something with the created source }});
When you create a CCAvenue source, the customer must authorize the charge through their payment provider. You can accomplish this by redirecting the customer to their payment provider.
Redirecting the customer for CCAvenue authorization
Use the redirectUrl parameter in your createSource response to redirect your customer to the payment provider for authorization.
The payment provider will present the customer with the transaction details, and the customer can authorize or cancel the transaction. A successful authorization redirects the customer to the CCAvenue Return URL parameter specified when you created the source.
Once authorized, the source state will change to chargeable.