CustomerSession
Represents a logged-in session of a single Customer.
Types
Link copied to clipboard
Link copied to clipboard
interface PaymentMethodRetrievalListener : CustomerSession.RetrievalListener
Content copied to clipboard
Link copied to clipboard
interface PaymentMethodsRetrievalListener : CustomerSession.RetrievalListener
Content copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
fun addCustomerSource( sourceId: String, sourceType: String, listener: CustomerSession.SourceRetrievalListener)
Content copied to clipboard
Add the Source to the current customer.
Link copied to clipboard
fun attachPaymentMethod(paymentMethodId: String, listener: CustomerSession.PaymentMethodRetrievalListener)
Content copied to clipboard
Attaches a PaymentMethod to a customer.
Link copied to clipboard
fun deleteCustomerSource(sourceId: String, listener: CustomerSession.SourceRetrievalListener)
Content copied to clipboard
Delete the Source from the current customer.
Link copied to clipboard
fun detachPaymentMethod(paymentMethodId: String, listener: CustomerSession.PaymentMethodRetrievalListener)
Content copied to clipboard
Detaches a PaymentMethod from a customer.
Link copied to clipboard
fun getPaymentMethods(paymentMethodType: PaymentMethod.Type, listener: CustomerSession.PaymentMethodsRetrievalListener)
Content copied to clipboard
fun getPaymentMethods( paymentMethodType: PaymentMethod.Type, @IntRange(from = 1, to = 100) limit: Int?, endingBefore: String? = null, startingAfter: String? = null, listener: CustomerSession.PaymentMethodsRetrievalListener)
Content copied to clipboard
Retrieves all of the customer's PaymentMethod objects, filtered by a PaymentMethod.Type.
Link copied to clipboard
fun retrieveCurrentCustomer(listener: CustomerSession.CustomerRetrievalListener)
Content copied to clipboard
Link copied to clipboard
fun setCustomerDefaultSource( sourceId: String, sourceType: String, listener: CustomerSession.CustomerRetrievalListener)
Content copied to clipboard
Set the default Source of the current customer.
Link copied to clipboard
fun setCustomerShippingInformation(shippingInformation: ShippingInformation, listener: CustomerSession.CustomerRetrievalListener)
Content copied to clipboard
Set the shipping information on the current customer.
Link copied to clipboard
fun updateCurrentCustomer(listener: CustomerSession.CustomerRetrievalListener)
Content copied to clipboard
Force an update of the current customer, regardless of how much time has passed.
Properties
Link copied to clipboard
A cached Customer, or null
if the current customer has expired.