SDKs para Unity / Compre via carrinho de compras
  Voltar aos Documentos

SDKs para Unity

Compre via carrinho de compras

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

Observação
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

Observação
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.
Observação
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étodos para encher e editar o carrinho

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étodos para obter os conteúdos do carrinho

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étodos para obter um token de pagamento

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.
Este artigo foi útil?
Obrigado!
Podemos melhorar alguma coisa? Mensagem
Que pena ouvir isso
Explique porque este artigo não foi útil para você. Mensagem
Obrigado pelo seu feedback!
Avaliaremos sua mensagem e a usaremos para melhorar sua experiência.
Avalie esta página
Avalie esta página
Podemos melhorar alguma coisa?

Não quero responder

Obrigado pelo seu feedback!

Links úteis

Última atualização: 22 de Janeiro de 2024

Encontrou um erro de texto ou digitação? Selecione o texto e pressione Ctrl+Enter.

Relatar um problema
Nós sempre avaliamos nossos conteúdos. Seu feedback nos ajuda a melhorá-los.
Forneça um e-mail para que possamos responder
Obrigado pelo seu feedback!