Configuring Credit Cards
Learn how to configure Credit Cards for DigitalRiver.js with Elements.
Step 1: Build a Credit Card source request object
Field
Value
Step 2: Create a Credit Card source using DigitalRiver.js
Create the elements
var options = {
style: {
base: {
color: "#fff",
fontFamily: "Arial, Helvetica, sans-serif",
fontSize: "16px",
}
}
}
//Create your elements
var cardNumber = digitalriver.createElement('cardnumber', options);
var cardExpiration = digitalriver.createElement("cardexpiration", options);
var cardCVV = digitalriver.createElement("cardcvv", options);
//Place the created elements on the page.
cardNumber.mount('card-number');
cardExpiration.mount('card-expiration');
cardCVV.mount('card-cvv');Create the source
Credit Card source example
Step 3: Use the authorized source
Option 1: Attach the source to a cart
Option 2: Attach the source to a shopper
Testing Credit Cards
Last updated