Emberstore logoEmberstore

Checkout dialogs

The dialog players pay from, the fields it shows, and the chest menu used when a client cannot show dialogs.

When a player clicks an item, Emberstore opens a checkout dialog: a real Minecraft dialog window with the item, the price, optional fields for a code, a gift and a quantity, and one button per payment method. After they choose, a second dialog gives them the payment link.

The checkout picker dialog with each part labelled with the dialogs/checkout.yml key that controls it.

The four dialogs

DialogWhen it showsBuilt from
PickerTwo or more gateways can bill the itempicker in dialogs/checkout.yml
ConfirmExactly one gateway can bill the itemconfirm in dialogs/checkout.yml
PayThe order and its payment link were createddialogs/pay.yml
ErrorThe gateway refused to create the checkoutdialogs/error.yml
The Secure Checkout dialog in game: item, total, description lines and the promo code and gift fields. The same dialog scrolled down: one button per payment method, the Apply button and Cancel.

Only gateways that are turned on, have all their keys filled in, and can bill the item's price are listed. With most setups that is two to four buttons, not eleven.

What the player can type

Each field only appears when its feature applies.

FieldShows whenRules
Promo or referral codepromotions.yml has at least one code, or referrals are onLetters, digits, _ and -, up to 32 characters. Five wrong codes in a minute and the player has to wait. See Sales, codes and referrals.
Gift togifts.enabled: trueA player name that has joined this server before. Empty means the buyer. See Stock, limits and gifts.
QuantityThe item's max-quantity is above 1A slider from 1 to max-quantity.

The Apply button checks what was typed, works out the new price and shows the dialog again with it. A gateway button does the same checks and then goes on to pay. Anything that is not allowed shows a red line at the top of the dialog with the reason, and nothing is created.

After a gateway is chosen

  • Emberstore works out the price again from your files (never from anything the client sent), holds the stock, the per-player limit and the code use, and asks the gateway for a payment link.
  • The pay dialog opens with Pay now (opens the link), Copy link and Close. The same link is sent in chat as well, with how many minutes it stays valid (checkout.expire-minutes).
  • If the price came to zero after discounts, no gateway is called and the item is given straight away.
  • If the gateway refused, the error dialog opens and the player gets the purchase.invoice-failed message. The order is marked failed and nothing is held.
The Complete Your Payment dialog for PayPal with the item, how long the link is valid, and Pay now and Copy link buttons. The same dialog for Stripe billing in rupees, showing the converted price.

A checkout is only good for five minutes and one use. Buttons from an old or already used checkout do nothing except close the dialog and tell the player to open the store again.

The chest menu fallback

Some players cannot see dialogs. They get a chest menu titled "Choose how to pay" instead, with one icon per gateway (the gateway's icon material from config.yml) and a barrier to close. With only one gateway the menu is skipped and the link is sent straight away.

The chest menu checkout used when dialogs are off: one item per payment method with the total in its currency.

A player gets the menu when:

  • checkout.use-dialogs is false in config.yml, or
  • they play on Bedrock through Geyser or Floodgate, or
  • ViaVersion reports a client older than 1.21.6.

The menu has no fields, so these players buy one of the item for themselves. They can still use a code: /store code <code> saves it for their next checkout.

Changing how the dialogs look

Every word is in the language file and every layout choice is in the dialog files. See Dialog files and Messages and language. To check a change, run /store admin reload and then /store admin preview picker (or confirm, pay, error). Preview uses sample data and its buttons only close the dialog.

On this page