Elements integration guide
Create a payment form using DigitalRiver.js.
Use DigitalRiver.js to create a payment form that securely collects sensitive payment details.
To see a custom payment form example, go to Payment form example.
To populate the fields in this example, click Populate Sample Data In Form. Then enter 4444222233331111
in the Credit Card field, 10/23
in the Expiration field, and 123
in the CVV field, and click Create Credit Card Source.
Integrate the DigitalRiver.js into your app or website in four easy steps:
Step 1. Include DigitalRiver.js on your page
To use DigitalRiver.js as part of your experience, you must include the library and your API key. The key shown in the following example is your public API key. The DigitalRiver.js digitalriver.createSource()
or digitalriver.createElement()
methods use the var
that you assigned.
Step 2. Create your payment form
DigitalRiver.js provides and hosts HTML elements that you can place in your payments form to collect credit card details securely. You can seamlessly integrate these elements into an outside-hosted experience.
Step 3. Create and embed elements
Use the DigitalRiver.js library to create and mount an element to the container created in step 2.
Follow the same pattern for additional credit card fields.
Step 4. Use DigitalRiver.js to create a payment source
Digital River securely transmits credit card details captured by DigitalRiver.js for tokenization. You can use these payment sources in downstream API calls to place orders or save credit cards for later purchases.
Create an event handler to interact with the DigitalRiver.js library on submit and then create a payment source. Use the createSource()
method to tokenize the customer's details and payment information.
Prerequisite: To create a Payment Source for a credit card, you must either know or capture the billing address information for the entered credit card. The createSource()
method submits this information and uses it to create a payment source.
Last updated