public interface CustomerCardManager
The card information is stored on Square servers, not on the specific device running Reader SDK. This means cards cannot be saved on file when offline, and that saved cards for a customer are available from any device, keyed by customer ID.
Modifier and Type | Method and Description |
---|---|
CallbackReference |
addStoreCardActivityCallback(StoreCardActivityCallback callback)
Adds a callback to handle results from calls to
startStoreCardActivity(Context,
String) . |
void |
startStoreCardActivity(android.content.Context context,
java.lang.String customerId)
Starts an activity to store a card for a customer.
|
void startStoreCardActivity(@NonNull android.content.Context context, @NonNull java.lang.String customerId)
The Reader SDK must be authorized to start the store card activity.
Add a StoreCardActivityCallback
object using
addStoreCardActivityCallback(StoreCardActivityCallback)
to be notified of the result. For a success result, this will contain information about the
card that was stored.
This method must be called from the main thread.
Reader SDK does not currently support paying with a card on file. To process a card on file payment use Connect APIs. See the cards-on-file cookbook for an example using the Transactions API Charge endpoint.
context
- an Android context under which to start the card-storing activitycustomerId
- The Square generated ID for the customer profile under which the card is
stored. Typically fetched using the
Customers API.@NonNull CallbackReference addStoreCardActivityCallback(@NonNull StoreCardActivityCallback callback)
startStoreCardActivity(Context,
String)
.
The callback is executed on the main thread.
callback
- a callback to be called when results from startStoreCardActivity
are
available.CallbackReference
for the added callback. To avoid memory leaks, clear the
callback reference with CallbackReference.clear()
any time a lifecycle destroy event
occurs (e.g. android.app.Activity.onDestroy()
).