By default, when a payment method is added to Spreedly it is placed in a "cached" storage state. This state indicates that, unless told otherwise, the card will be purged from Spreedly after a short period of time (a few hours).
If you are performing a one-time transaction where the workflow is -
- Collect payment information
- Immediately charge the card
then you don't need to do anything else.
However, if you want to charge the card again in the future, or have a longer period of time between collecting the payment information and executing a purchase, then you will need to "retain" the card.
In order to "retain" a card, you can:
a) use the retain call after the AddPaymentMethod transaction
b) set retained to true in the AddPaymentMethod transaction (Direct API method only)
c) Pass "retain_on_success" in the Purchase call if you are sending it immediately after creating the payment method.
If you are only using the payment method with "deliver", you will need to use option 'a' or 'b' above. Retain on success does not apply to "deliver" calls.