PaymentMethodsAPI

Provides suspend and callback overloads for all payment method API operations.

Every function returns a Pair whose first element is the parsed response on success and whose second element is a NetworkingError on failure; exactly one of the two is non-null at a time.

Functions

Link copied to clipboard

Attaches a payment method to a customer or merchant account.

Attaches a payment method to a customer or merchant account and delivers the result to a callback.

Link copied to clipboard

Blocks a payment method, preventing it from being used for new transactions.

fun blockPaymentMethodWith(paymentMethodId: String, completionHandler: (FrameObjects.PaymentMethod?, NetworkingError?) -> Unit)

Blocks a payment method and delivers the result to a callback.

Link copied to clipboard

Creates a new ACH payment method by connecting a bank account via Plaid.

Creates a new ACH payment method by connecting a bank account via Plaid and delivers the result to a callback.

Link copied to clipboard

Creates a new ACH bank-account payment method.

Creates a new ACH payment method and delivers the result to a callback.

Link copied to clipboard

Creates a new card payment method, optionally encrypting sensitive fields via Evervault.

fun createCardPaymentMethod(request: PaymentMethodRequests.CreateCardPaymentMethodRequest, encryptData: Boolean = true, scope: CoroutineScope, completionHandler: (FrameObjects.PaymentMethod?, NetworkingError?) -> Unit)

Creates a new card payment method on the provided coroutine scope and delivers the result to a callback on the main thread.

Link copied to clipboard

Creates a new payment method from a Google Pay wallet token.

Creates a new payment method from a Google Pay wallet token and delivers the result to a callback.

Link copied to clipboard

Detaches a payment method from its associated customer or account.

fun detachPaymentMethodWith(paymentMethodId: String, completionHandler: (FrameObjects.PaymentMethod?, NetworkingError?) -> Unit)

Detaches a payment method from its associated customer or account and delivers the result to a callback.

Link copied to clipboard

Fetches a paginated list of payment methods.

fun getPaymentMethods(page: Int? = null, perPage: Int? = null, completionHandler: (PaymentMethodResponses.ListPaymentMethodsResponse?, NetworkingError?) -> Unit)

Fetches a paginated list of payment methods and delivers the result to a callback.

Link copied to clipboard

Fetches all payment methods associated with a specific merchant account.

Fetches all payment methods for a merchant account and delivers the result to a callback.

Link copied to clipboard

Fetches all payment methods associated with a specific customer.

Fetches all payment methods for a customer and delivers the result to a callback.

Link copied to clipboard

Fetches a single payment method by its unique identifier.

fun getPaymentMethodWith(paymentMethodId: String, completionHandler: (FrameObjects.PaymentMethod?, NetworkingError?) -> Unit)

Fetches a single payment method by its unique identifier and delivers the result to a callback.

Link copied to clipboard

Unblocks a previously blocked payment method, restoring its ability to be used for transactions.

fun unblockPaymentMethodWith(paymentMethodId: String, completionHandler: (FrameObjects.PaymentMethod?, NetworkingError?) -> Unit)

Unblocks a previously blocked payment method and delivers the result to a callback.

Link copied to clipboard

Updates mutable fields on an existing payment method.

Updates mutable fields on an existing payment method and delivers the result to a callback.