Checkout

class Checkout @JvmOverloads constructor(project: Project, shoppingCart: ShoppingCart, checkoutApi: CheckoutApi = DefaultCheckoutApi( project, shoppingCart ))

Constructors

Link copied to clipboard
constructor(project: Project, shoppingCart: ShoppingCart, checkoutApi: CheckoutApi = DefaultCheckoutApi( project, shoppingCart ))

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Gets all available payment methods, callable after CheckoutState.REQUEST_PAYMENT_METHOD.

Link copied to clipboard

The current checkout process response from the backend

Link copied to clipboard

List of codes that can be added to offline qr codes

Link copied to clipboard

The current fulfillment state as a live data

Link copied to clipboard
val id: String?

Gets the unique identifier of the checkout.

Link copied to clipboard

List of invalid products that were contained in a checkout request, available after entering state CheckoutState.INVALID_PRODUCTS

Link copied to clipboard

Returns true of the checkout is currently available, or false if checkout is disabled for this project

Link copied to clipboard

The price to pay in cents (or equivalent integer based currency type), or 0 if no price is available

Link copied to clipboard

Gets the content of the qrcode that needs to be displayed, or null if no qrcode needs to be displayed

Link copied to clipboard

List of coupons that were redeemed during this checkout

Link copied to clipboard

Gets the currently selected payment method, or null if currently none is selected

Link copied to clipboard

ShopId associated with this Checkout

Link copied to clipboard

The current state of the checkout as a live data

Link copied to clipboard

The final price of the checkout, calculated by the backend.

Functions

Link copied to clipboard
fun abort()

Aborts outstanding http calls and notifies the backend that the checkout process was cancelled

Link copied to clipboard

Aborts outstanding http calls and notifies the backend that the checkout process was cancelled, but does not notify listeners and ignores the backend response

Link copied to clipboard
fun addCode(code: String)

Add code to append to offline qr codes

Link copied to clipboard

Approve offline processed payment methods. E.g. on clicking the "finish" button or leaving the qr code view.

Link copied to clipboard
fun authorizePayment(encryptedOrigin: String?)

Authorize a for one-time use payment requests, e.g. sending tokenized payment data of google pay.

Link copied to clipboard
fun checkout(timeout: Long = -1, allowFallbackAfterTimeout: Boolean = false)

Starts the checkout process.

Link copied to clipboard

Clear all codes that are appended to offline qr codes

Link copied to clipboard
fun pay(paymentMethod: PaymentMethod, paymentCredentials: PaymentCredentials?)

Needs to be called when the checkout is state CheckoutState.REQUEST_PAYMENT_METHOD.

Link copied to clipboard
fun removeCode(code: String)

Remove code to append to offline qr codes

Link copied to clipboard
fun reset()

Cancels outstanding http calls and sets the checkout to its initial state.