type
represents the payment method used to create that object. On the Sources API reference page, you can find a complete list of these type
values.type
. This data object holds detailed information specific to that type
. For example, a source with a type
of credit card
has a creditCard
hash table that lists the card's brand
, expirationMonth
, expirationYear
, and lastFourDigits
.state
of the source is returned immediately as either chargeable
or failed
. A credit card is an example of this type of payment method.state
of pending_funds
, pending_redirect
, or requires_action
before it transitions to chargeable
. PayPal is an example of an asynchronous payment method because the customer is redirected to the PayPal site and must take additional action to authorize the transaction.source.chargeable
event. This will allow you to determine when you should attach the source to a checkout or save the source to a customer's account.reusable
value of true
before they can be used to make multiple charges. Reusable sources however can't be created using a public API key. So both Drop-in payments and DigitalRiver.js with elements only generate single-use sources. To make them reusable once they're created (assuming the source type
supports re-usability), you must save the source to a customer. This flips reusable
to true
and prevents the source's state
from becoming consumed
once it's associated with a transaction.flow
attribute represents how your customers experience the payment process and what actions they must take to authenticate a payment method. The enumerated values of the attribute are standard
, redirect
, and receiver
.standard
: In this flow, which mainly applies to credit cards, you obtain a customer's payment details on your storefront and submit this information to Digital River. The customer is never required to leave your website during the checkout process. No additional action is required by the customer after they submit their information and a charge can be created immediatelyredirect
: With this authentication flow type, you obtain a customer's payment data on your storefront. You then redirect them to the website of the payment method where they are asked to authorize the transaction. Once the authorization is confirmed, a charge can be created. We recommend you adhere to these guidelines when using redirect payment methods.receiver
: This flow type requires that a customer push funds to an account before a charge can be created. Bank and wire transfers are two common payment methods that use this authentication flow.state
attribute, which provides information about what can be done with it. The state
of a source is enumerated by the following values: cancelled
, chargeable
, consumed
, failed
, requires_action
, pending_funds
, and pending_redirect
.chargeable
. To be notified of when the source transitions to this state
, you can listen for source.chargeable
events.consumed
and no additional charges can be created from the source. Reusable sources however can maintain a chargeable
state.pending_redirect
because the customer must leave your website to confirm the payment.pending_funds
to chargeable
.state
value.amount
value contained within the source, taking into account any cancellations you create or refunds you issue.amount
can change. For example, if customers add or subtract items from their carts late in the checkout process, and you then submit a new checkout request with the same sourceId
, the source is returned with an updated amount
.