The response returns a Source object if a valid identifier and API key are provided. This sample response returns a Source with a type of creditCard and a state of chargeable.
Only the last four digits of credit card numbers are returned by a GET Source request.
You can retrieve the Sources associated with a Shopper by making a get shopper by ID request and parsing the sources array contained in the response if the payment source is attached to the shopper's payment option. All payment sources will be listed when the shopper gets their payment options.
Step 1: Create your first payment source and option
Create your first payment source using the following:
POST https://api.digitalriver.com/payments/sources/
Create your first payment option using the following:
POST https://api.digitalriver.cm/v1/shoppers/me/payment-options/
You can use the data contained in the sources array to display a customer's saved payment methods on your website or app. To do this, parse the response and extract the values in the creditCard, owner, and address hash tables. You can then use these values to present the card's brand name, last four digits, expiration date, and the customer's billing information.