SDK pour Unity / Achat via le panier
  Retour à la documentation

SDK pour Unity

Achat via le panier

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.
  1. Implement receiving of a payment token.
  1. Implement payment UI opening. To do this, call the OpenPurchaseUi SDK method and pass the payment token and order ID to it.

Méthodes de remplissage et de modification du panier

SDK method nameDescription
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éthodes pour obtenir le contenu du panier

SDK method nameDescription
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éthodes d'obtention d'un jeton de paiement

SDK method nameDescription
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.
Cet article vous a été utile ?
Merci !
Que pouvons-nous améliorer ? Message
Nous sommes désolés de l'apprendre
Dites-nous pourquoi vous n'avez pas trouvé cet article utile. Message
Merci pour votre commentaire !
Nous examinerons votre message et l'utiliserons pour améliorer votre expérience.
Évaluer cette page
Évaluer cette page
Que pouvons-nous améliorer ?

Préfère ne pas répondre

Merci pour votre commentaire !

Liens utiles

Dernière mise à jour: 22 Janvier 2024

Faute de frappe ou autre erreur dans le texte ? Sélectionnez le texte concerné et appuyez sur Ctrl+Entée.

Signaler un problème
Nous améliorons continuellement notre contenu grâce à vos commentaires.
Indiquez votre adresse e-mail pour un suivi
Merci pour votre commentaire !