CustomerSession

Represents a logged-in session of a single Customer.

See Creating ephemeral keys

Properties

Link copied to clipboard

A cached Customer, or null if the current customer has expired.

Functions

Link copied to clipboard

Add the Source to the current customer.

Link copied to clipboard

Attaches a PaymentMethod to a customer.

Link copied to clipboard

Delete the Source from the current customer.

Link copied to clipboard

Detaches a PaymentMethod from a customer.

Link copied to clipboard

fun getPaymentMethods(paymentMethodType: PaymentMethod.Type, @IntRange(from = 1, to = 100) limit: Int?, endingBefore: String? = null, startingAfter: String? = null, listener: CustomerSession.PaymentMethodsRetrievalListener)

Retrieves all of the customer's PaymentMethod objects, filtered by a PaymentMethod.Type.

Link copied to clipboard

Retrieve the current Customer. If customer is not stale, this returns immediately with the cache. If not, it fetches a new value and returns that to the listener.

Link copied to clipboard

Set the default Source of the current customer.

Link copied to clipboard

Set the shipping information on the current customer.

Link copied to clipboard

Force an update of the current customer, regardless of how much time has passed.