Comprar mediante la cesta de la compra
This method is suitable for selling items of any type and in any quantity for real currency.
Nota
When purchasing via the shopping cart, the opportunity to use promotional codes is provided.
To implement the logic of purchasing via the shopping cart:
- 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
Nota
In the application UI, it should not be available to add to the cart items that are sold only for virtual currency.
- Implement the logic of filling and editing the cart.
Nota
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.
- Implement the display of the cart contents.
- Implement receiving of a payment token.
- Implement payment UI opening. To do this, call the
OpenPurchaseUi
SDK method and pass the payment token and order ID to it.
Métodos para rellenar y editar la cesta
SDK method name | Description |
---|---|
FillCart | Fills the cart with the specified ID or the cart of the current user 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. |
ClearCart | Removes all items from the cart with the specified ID or from the cart of the current user. |
UpdateItemInCart | Updates the quantity of a previously added item in the cart with the specified ID or in the current user cart. If there is no item with the specified SKU in the cart, it will be added. |
RemoveItemFromCart | Removes the item from the cart with the specified ID or from the cart of the current user. |
Métodos para obtener el contenido de la cesta
SDK method name | Description |
---|---|
GetCartItems | Returns a list of items from the cart with the specified ID or from the cart of the current user. For each item, complete data is returned. |
Métodos para obtener un token de pago
SDK method name | Description |
---|---|
PurchaseCart | Creates an order with items from the cart with the specified ID or from the cart of the current user. Returns the payment token and order ID. |
¿Te ha resultado útil este artículo?
¡Gracias por tu mensaje!
Nos ayudará a mejorar tu experiencia.Enlaces útiles
Última actualización: 22 de Enero de 2024¿Has encontrado una errata u otro error de texto? Selecciona el texto y pulsa Ctrl+Intro.