Credit Cards

The Credit Cards payment method is a fast and secure shopping experience where the consumer can purchase goods or services on credit.

Credit cards supported: American Express, Diners, Discover, JCB, Maestro, MasterCard, Union Pay, and Visa

You can find an example of integration here.

Create a Credit Card payment method for your app or website in three easy steps:

Step 1. Build a Credit Card source request object

The Credit Card Source Request object requires the following fields.

Field

Value

type

creditCard

owner

An Owner object.

Step 2. Create a Credit Card source using DigitalRiver.js

Create the elements

To create a credit card payment source, you must use the createSource method exposed via DigitalRiver.js.

var payload = {
"sessionId": "ea03bf6f-84ef-4993-b1e7-b7d5ecf71d1f",
"type": "creditCard",
"owner": {
firstName: "John",
lastName: "Doe",
email: "john.doe@digitalriver.com",
phoneNumber: "000-000-0000",
address: {
line1: "10380 Bren Road West",
line2: "Suite 123",
city: "Minnetonka",
state: "MN",
postalCode: "55343",
country: "US"
}
}
}
digitalriver.createSource(cardCVV, payload).then(function(result) {
if (result.error) {
//handle errors
} else {
var source = result.source;
//send source to back end
sendToBackend(source);
}
});

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.

var payload = {
"sessionId": "ea03bf6f-84ef-4993-b1e7-b7d5ecf71d1f",
"type": "creditCard",
"owner": {
firstName: "John",
lastName: "Doe",
email: "john.doe@digitalriver.com",
phoneNumber: "000-000-0000",
address: {
line1: "10380 Bren Road West",
line2: "Suite 123",
city: "Minnetonka",
state: "MN",
postalCode: "55343",
country: "US"
}
}
}
digitalriver.createSource(cardCVV,payload).then(function(result) {
if(result.error) {
//handle errors
} else {
var source = result.source;
//send source to back end
sendToBackend(source);
}
});

Credit Card source example

{
"clientId": "gc",
"channelId": "drdod15",
"liveMode": false,
"id": "b9914aea-d045-4160-8bd9-12277ee333b1",
"clientSecret": "b9914aea-d045-4160-8bd9-12277ee333b1_a2214aea-d045-4160-8bd9-12277ee333b1",
"type": "creditCard",
"reusable": false,
"owner": {
"firstName": "Destany",
"lastName": "Hackett",
"email": "Jimmy.Trantow63@gmail.com",
"phoneNumber": "000-000-0000",
"address": {
"line1": "1283 Cummings Squares",
"line2": "Suite 917",
"city": "Russelview",
"state": "CO",
"country": "US",
"postalCode": "85501-4084"
}
},
"state": "chargeable",
"creationIp": "209.87.178.4",
"createdTime": "2019-05-22T01:41:59.241Z",
"updatedTime": "2019-05-22T01:41:59.241Z",
"flow": "standard",
"creditCard": {
"brand": "Visa",
"expirationMonth": 2,
"expirationYear": 2022,
"lastFourDigits": "1111",
"paymentIdentifier": "13159976250000000000000500658101"
}
}

Step 3. Use the authorized source

Once authorized, you can use the source by either attaching it to a checkout or attaching it to a customer for multiple uses.

Option 1. Attach the source to a checkout

POST /checkouts/{id}
POST /checkouts/{id}
{
"customerId": "5774321008",
"sourceId": "src_a78cfeae-f7ae-4719-8e1c-d05ec04e4d37"
}

Option 2. Attach the source to a customer

POST /customers/{id}/sources/{sourcesId}
POST /customers/{id}/sources/{sourcesId}
{
"id": "5774321008",
"sourceId": "src_a78cfeae-f7ae-4719-8e1c-d05ec04e4d37"
}

Supported geographies

Supported geographies

American Samoa (AS), Andorra (AD), Argentina (AR), Austria (AT), Australia (AU), Bahrain (BH), Bangladesh (BD), Belgium (BE), Bouvet Islands (BV), Brazil (BR), British Indian Ocean Territory (IO), Bulgaria (BG), Canada (CA), Cocos Islands (CC), Cook Islands (CK), Chile (CL), China (CN), Christmas Island (CX), Colombia (CO), Croatia (Hrvatska) (HR), Cyprus (CY), Czech Republic (CZ), Denmark (DK), East Malaysia (MY), Ecuador (EC), Egypt (EG), El Salvador (SV), Estonia (EE), Ethiopia (ET), Faroe Islands (FO), Finland (FI), France (FR), French Guiana (GF), Germany (DE), Greece (GR), Greenland (GL), Guam (GU), Heard Island & McDonald Islands (HM), Hong Kong (HK), India (IN), Indonesia (ID), Ireland (IE), Israel (IL), Italy (IT), Japan (JP), Jordan (JO), Kiribati (KI), Kuwait (KW), Latvia (LV), Lebanon (LB), Liechtenstein (LI), Lithuania (LT), Luxembourg (LU), Marshall Islands (MH), Mexico (MX), Micronesia (FM), Monaco (MC), Niue (NU), Norfolk Island (NF), Northern Mariana Islands Malta (MP), Netherlands (NL), New Zealand (NZ), Norway (NO), Oman (OM), Panama (PA), Peru (PE), Philippines (PH), Pitcairn Islands (PN), Poland (PL), Portugal (PT), Puerto Rico (PR), Qatar (QA), Reunion (RE), Romania (RO), Russia (RU), Saint Pierre & Miquelon (PM), San Marino (SM), Saudi Arabia (SA), Singapore (SG), Slovakia (SK), Slovenia (SI), South Africa (ZA), South Georgia & South Sandwich Islands (GS), South Korea (KR), Spain (ES), Svalbard & Jan Mayen Islands (SJ), Sweden (SE), Switzerland (CH), Tristan da Cunha (SH), Thailand (TH), Tokelau (TK), Turkey (TR), Turks & Caicos Islands (TC), Tuvalu (TV), Ukraine (UA), United Arab Emirates (AE), United Kingdom (GB), United States (US), United States Minor Outlying Islands (UM), Vatican (VA), Venezuela (VE)

Supported currencies

AED, ARS, AUD, BHD, BRL, CAD, CHF, CLP, CNY, COP, CZK, DKK, EGP, ETB, EUR, GBP, HKD, IDR, ILS, INR, JOD, JPY, KRW, KWD, LBP, MXN, MYR, NOK, NZD, OMR, PHP, PLN, QAR, RUB, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, ZAR