The CCAvenue Source Details object requires the following field.
Field
Required/Optional
Description
returnUrl
Required
Where you will redirect your customer after the customer authorizes within the CCAvenue experience.
cancelUrl
Required
Where you will redirect your customer after the customer cancels within the CCAvenue experience.
Step 2: Create a CCAvenue source using DigitalRiver.js
Use the DigitalRiver.js library to create and mount elements to the HTML container.
Note the following requirements when configuring CCAvenue:
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
}
});
The bank reference nubmer for the shopper's account.
accountToken
Required
The shopper's account token.
trackingId
Required
The tracking identifier for the order.
Step 3: Authorize the CCAvenue 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.