Configuring Credit Cards
Learn how to configure Credit Cards for DigitalRiver.js with Elements.
If you're using DigitalRiver.js with Elements, you can create a Credit Card payment method for your app or website in three easy steps:
Step 1: Build a Credit Card source request object
Build a Credit Card Source Request object. The Credit Card Source Request object requires the following fields.
type
creditCard
sessionId
The payment session identifier.
owner
Step 2: Create a Credit Card source using DigitalRiver.js
Create the elements
Use the DigitalRiver.js library to create and mount elements to the HTML container.
Create the source
To create a credit card payment source, you must reference the created element and the supplemental data in your createSource request. DigitalRiver.js will retrieve and assemble the request on your behalf.
The address
object must contain postal code and state/province data that adheres to a standardized format using the state
attribute. Note that the state
attribute listed below corresponds to the countrySubdivision
attribute used when providing address information. The payment session manages the correct field name on the backend.
Credit Card source example
Step 3: Use the authorized source
Once authorized, you can use the source by attaching it to a cart or a shopper.
Option 1: Attach the source to a cart
Option 2: Attach the source to a shopper
Testing Credit Cards
See Testing standard payment methods for testing instructions.
Last updated