SDKs for Android / Purchase via shopping cart
  Back to Docs

SDKs for Android

Purchase via shopping cart

This method is suitable for selling items of any type and in any quantity for real currency.

Note
When purchasing via the shopping cart, the opportunity to use promotional codes is provided.
To implement the logic of purchasing via the shopping cart:
  1. In the application UI, add the following elements:
    • buttons for adding items to the cart
    • form for viewing and editing the contents of the cart
    • button to buy items in the cart
Note
In the application UI, it should not be available to add to the cart items that are sold only for virtual currency.
  1. Implement the logic of filling and editing the cart.
Note
Before calling the method for filling the cart, you won’t have information about promotions applied to the purchase. This means that the total cost and details of the added bonus items will be unknown.

  1. Implement the display of the cart contents in one of the following ways:

  1. Implement receiving of a payment token in one of the following ways:

  1. Implement payment UI opening. To do this, call the createIntentBuilder method of the Payments library and pass the payment token.
  2. Implement payment result handling.
SDK reference documentation
Learn more about SDK methods and its parameters.

Methods for filling and editing the cart

SDK method nameDescription
fillCartByIdWithItems
Fills the cart with the specified ID with items. If there is already an item with the same SKU in the cart, the existing item position will be replaced by the passed value.
fillCurrentCartWithItems
Fills the current user cart with items. If there is already an item with the same SKU in the cart, the existing item position will be replaced by the passed value.
clearCartById
Removes all items from the cart with the specified ID.
clearCurrentCart
Updates the quantity of a previously added item in the cart with the specified ID. If there is no item with the specified SKU in the cart, it will be added.
updateItemFromCartByCartId
Updates the quantity of a previously added item in the cart with the specified ID. If there is no item with the specified SKU in the cart, it will be added.
updateItemFromCurrentCart
Updates the quantity of a previously added item in the current user cart. If there is no item with the specified SKU in the cart, it will be added.
deleteItemFromCartByCartId
Removes the item from the cart with the specified ID.
deleteItemFromCurrentCart
Removes the item from the current user cart.

Methods for getting the contents of the cart

SDK method nameDescription
getCartById
Returns a list of items from the cart with the specified ID. For each item, complete data is returned.
getCurrentCart
Returns a list of items from the cart of the current user. For each item, complete data is returned.

Methods for obtaining a payment token

SDK method nameDescription
createOrderFromCartById
Creates an order with items from the cart with the specified ID. Returns the payment token and order ID.
createOrderFromCurrentCart
Creates an order with items from the cart of the current user. Returns the payment token and order ID.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.

Useful links

Last updated: October 3, 2024

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!