# Payments

Connect Mercado Pago, AbacatePay or Stripe, choose who processes Pix and card, and make a test payment before selling.

Source: https://fivedash.fivex.gg/docs/en/store/payments

In **Store → Payments** you connect where the store gets paid and choose who processes each payment method. The money from each purchase goes straight to the city's account with the provider, never through FiveDash. This page is for whoever handles the store's finances.

## Before you start

* **Plan:** Payments is on every plan with the Store (Plus, Pro and Ultra). FiveDash charges a fee on the store's paid sales: 3% on Plus, 1.5% on Pro and none on Ultra. The provider's own fee is separate and charged by the provider.
* **Provider account:** an account with Mercado Pago, AbacatePay or Stripe, cleared to receive payments. The Mercado Pago account must be from Brazil, because the store receives in reais.

| Action                                      | Level         |
| ------------------------------------------- | ------------- |
| Providers and charges                       | **View**      |
| Connect providers, keys and payment methods | **Configure** |

The **Test payment** needs **Configure** on **Payments** or on **Overview**. The **Check connections** button works with **View**. The **Finance** preset sees this page without being able to change the keys.

## Supported providers

| Provider         | Payment methods    | Credential         | Starts with                                                     |
| ---------------- | ------------------ | ------------------ | --------------------------------------------------------------- |
| **Mercado Pago** | Pix and card       | **Access Token**   | `APP_USR-` (production) or `TEST-` (test)                       |
| **AbacatePay**   | Pix                | **API key**        | `abc_prod_` (production) or `abc_dev_` (test)                   |
| **Stripe**       | Card, Pix and more | **Restricted key** | `rk_live_` (or `sk_live_`); `rk_test_` / `sk_test_` for testing |

| Provider         | How the buyer pays                                                                                                                                                       |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Mercado Pago** | Pix and card in a single account. Card opens Mercado Pago's page.                                                                                                        |
| **AbacatePay**   | Pix with a QR code right in the store, without leaving checkout.                                                                                                         |
| **Stripe**       | Cards from all over the world, plus Pix when it's turned on in your Stripe account. Checkout shows the methods turned on in Stripe under **Settings → Payment methods**. |

> Never paste your credential in chats, tickets or on Discord. FiveDash stores the key encrypted and it never shows up in the dashboard again.

## Get the credential from the provider

### Mercado Pago

### Create an application

In **Mercado Pago Developers**, create an application of the **Online payments** type. The **Open Mercado Pago Developers** button in the form takes you there.

### Copy the Access Token

Under **Production credentials**, copy the **Access Token** (starts with `APP_USR-`).

### Check the Pix key

To get paid by Pix, the account needs a registered **Pix key**.

### AbacatePay

### Create a key

In the **AbacatePay** dashboard, open **Integrate** → **API keys** and create a key. The **Open the AbacatePay dashboard** button in the form takes you there.

### Give it permissions

Give it access to the **store**, **charges** and **webhooks**, and copy the key (starts with `abc_prod_`).

### Test in Dev mode (optional)

The `abc_dev_` key works for testing: payments are simulated.

### Stripe

### Create a restricted key

In the **Stripe** Dashboard, open **Developers** → **API keys** and create a **restricted key**. The **Open Stripe API keys** button in the form takes you there.

### Give it permissions

Give it **write** access to **Checkout Sessions** and **Webhook Endpoints**, and copy the key (starts with `rk_live_`).

### Turn on payment methods

Checkout shows the payment methods turned on in Stripe, under **Settings** → **Payment methods** (card, Pix and others).

## Connect a provider

In this page's messages, the provider name shows as Mercado Pago; on screen, you see the provider you're using.

### Open Payments

Go to **Store → Payments**. Under **Providers**, click **Connect** on the provider's card. (In the store's initial setup, this is the **Get paid** step.)

### Paste the credential

Under **Where do you want to get paid?**, check the provider and paste the credential in the field (**Access Token**, **API key** or **Restricted key**). Use **Show key** to check what you pasted.

### Choose the payment methods

Under **Use Mercado Pago for**, turn on **Pix**, **Credit card** or both (only the methods the provider takes show up). Keep at least one on.

### Connect

Click **Connect Mercado Pago**. FiveDash checks the key with the provider (**Checking key…**) and shows **Account connected**.

When you connect, FiveDash also registers the **payment notice** (the webhook) in your provider account by itself. You don't need to create anything there.

> A test key shows **Test key** on the card: payments are simulated. Switch to the production key before selling.

### Connection errors

| Message                                                                               | What to do                                                                  |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **That doesn't look like an Access Token. It starts with APP_USR- or TEST-.**         | Copy the whole Access Token again.                                          |
| **That doesn't look like an AbacatePay key. It starts with abc_prod\_ or abc_dev\_.** | Copy the AbacatePay key again.                                              |
| **That doesn't look like a Stripe key. It starts with rk_live\_ (or sk_live\_).**     | Copy the restricted key again.                                              |
| **This restricted key lacks the permissions the store uses…**                         | In Stripe, give write access to Checkout Sessions and Webhook Endpoints.    |
| **This key lacks the permissions the store uses…**                                    | In AbacatePay, create a key with access to the store, charges and webhooks. |
| **This credential has no access to the account…**                                     | In Mercado Pago, copy the production Access Token again.                    |
| **This Mercado Pago account isn't from Brazil. The store receives in reais.**         | Use a Brazilian Mercado Pago account.                                       |
| **Mercado Pago rejected this credential. Copy it again and paste it here.**           | The key is wrong or was deleted. Create another one.                        |
| **We couldn't reach Mercado Pago right now…**                                         | The provider didn't answer. Try again in a moment.                          |

## Choose who processes each method

Under **Payment methods** there is a card for **Pix** and one for **Credit card**. On each, turn on the providers that will process that method.

| Method          | How it works                                                       | Providers at once                                  |
| --------------- | ------------------------------------------------------------------ | -------------------------------------------------- |
| **Pix**         | QR code right in the store, approved instantly.                    | 1                                                  |
| **Credit card** | The buyer pays on the provider's page and comes back to the store. | Up to 3 (today, Mercado Pago and Stripe take card) |

With more than one card provider, the buyer chooses at checkout. The first one comes selected: it shows as **Default**, and **Make default** changes it. When you change something, the **You have unsaved changes** bar shows up; click **Save** (or **Discard**).

If you turn Pix on for a new provider, Pix moves from the previous provider to the new one, because Pix takes only one.

| Rule                                                                     | Message                                                                  |
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
| At least one method must stay on.                                        | **Keep at least one payment method on.**                                 |
| The provider must be connected before it's used.                         | **Connect Mercado Pago before using it.**                                |
| A provider whose key was refused can't be used until the key is changed. | **Mercado Pago rejected the saved key. Change the key before using it.** |

## Provider card

Under **Providers**, each card shows the connection state:

| State             | What it means                                                                     |
| ----------------- | --------------------------------------------------------------------------------- |
| **Not connected** | No key yet. Button **Connect**.                                                   |
| **Connected**     | The key works. Shows since when, and **· not used** if no method goes through it. |
| **Test key**      | Payments are simulated.                                                           |
| **Key refused**   | The provider refused the saved key. Change the key to get paid through it again.  |

| Button                                  | What it does                                                                                                                                                                       |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connect**                             | Shows when the provider has no key yet.                                                                                                                                            |
| **Test**                                | Opens the **Test payment** with that provider (only while the key works).                                                                                                          |
| **Change key**                          | Shows when the provider refused the saved key. Paste a new key; open charges keep being checked.                                                                                   |
| **⋯** menu → **Change key and methods** | Changes the key and the payment methods together.                                                                                                                                  |
| **⋯** menu → provider link              | Opens the provider's dashboard where the key is made (for example, **Open Mercado Pago Developers**).                                                                              |
| **⋯** menu → **Disconnect**             | Deletes the key from FiveDash and removes the payment notice from your provider account. The methods it processed leave checkout right away, and open charges expire on their own. |

> You can't disconnect the only provider that takes payments for the store. Connect another provider for Pix or card first.

### Notices on the card

| Notice                                                               | What to do                                                                  |
| -------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| **Mercado Pago notifies FiveDash the moment a payment is approved.** | All good.                                                                   |
| **We couldn't register the Mercado Pago payment notice…**            | Check the key's permissions. Meanwhile, FiveDash checks payments by itself. |
| **The key lost the permissions the store uses…**                     | Create another key with the same permissions and click **Change key**.      |
| **Mercado Pago didn't respond just now…**                            | Click **Check connections** in a moment.                                    |
| **Connected, but no payment method goes through here.**              | Turn a method on for it under **Payment methods**, or disconnect it.        |

The **Check connections** button at the top tests every key again. If all of them respond, you see **All good**.

## Make a test payment

The test payment creates a **R$ 1,00** charge on your provider account, to see the payment reach FiveDash.

### Open the test

In **Store → Payments**, click **Test** on the provider's card. (On **Overview**, the same test is on the **Test payment** card, under **Store setup**.)

### Create the charge

Click **Create charge**. For Pix, the **Pix QR code** shows up with the code to **Copy**. Otherwise, click **Open payment on Mercado Pago**.

### Pay

Pay the charge. The screen shows **Waiting for Mercado Pago to confirm the R$ 1,00 payment…** and updates by itself.

### See the confirmation

When the provider confirms, you see **Payment confirmed!**. The integration is working.

| Connected key       | What happens                                                                     |
| ------------------- | -------------------------------------------------------------------------------- |
| Production          | It's a real charge, and the money goes to your provider account (minus the fee). |
| Test (Mercado Pago) | Pay with a Mercado Pago test user, not your own account.                         |
| Test (AbacatePay)   | Use **Simulate payment** to pay the Pix without a bank.                          |
| Test (Stripe)       | Pay with card `4242 4242 4242 4242`, any future expiry date and any CVC.         |

If the last test charge expired, was refunded or wasn't completed, the dialog says so and shows **Create another charge**. An open test charge made less than 10 minutes ago is shown again instead of creating another one.

## Charge statuses

A charge's status always comes from asking the provider. The payment notice only makes FiveDash ask right away; without it, FiveDash checks open charges on its own.

| Status            | What it means                                         | On the order                                                 |
| ----------------- | ----------------------------------------------------- | ------------------------------------------------------------ |
| **Pending**       | The charge was created and the buyer hasn't paid yet. | Awaiting payment                                             |
| **Paid**          | The provider confirmed the payment.                   | Paid, goes to delivery                                       |
| **Expired**       | Time to pay ran out (a charge lasts 1 hour).          | Expired                                                      |
| **Not completed** | The payment wasn't completed at the provider.         | Canceled                                                     |
| **Refunded**      | The money went back to the buyer.                     | Refunded; whatever the city hasn't delivered yet is canceled |

## Recent charges and numbers

**Recent charges** lists the 12 newest charges, from tests and orders. Each row shows the provider, amount, status and whether it's a **Test payment** or **Order #number** (click the number to open the order in **Store → Orders**). **Refresh** reloads the list.

| Card                   | What it shows                                                                                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Received · 30 days** | Approved payments per day, compared with the 30 days before, with the average order.                                                                                                            |
| **Approval**           | How many charges turned into payments and what happened to the rest (**Paid**, **Pending**, **Expired**, **Not completed**, **Refunded**), per payment method and with the average time to pay. |
| **By provider**        | Charges and paid rate for each provider, and how many charges are waiting for the buyer.                                                                                                        |

## FAQ

**Do I need to register the webhook with the provider?**
No. FiveDash registers the payment notice by itself when you connect. If registering fails, the provider's card says so, and FiveDash keeps checking payments on its own.

**Can I use two providers at once?**
Yes. For example, Pix through AbacatePay and card through Mercado Pago and Stripe. Pix takes one provider at a time; card takes more than one, and the buyer chooses.

**How do I refund someone?**
The dashboard has no refund button. Refund the payment in the provider's dashboard; once the provider reports the refund, the charge becomes **Refunded** and the order **Refunded**.

**I changed the key. Are old charges lost?**
No. Open charges keep being checked with the new key.

## Next steps

[Store overview](https://fivedash.fivex.gg/docs/en/store/overview)Store setup and sales numbers.
[Orders](https://fivedash.fivex.gg/docs/en/store/orders)See what happens after payment.
[In-game delivery](https://fivedash.fivex.gg/docs/en/store/in-game-delivery)How a paid purchase reaches the character.
[Plans and billing](https://fivedash.fivex.gg/docs/en/getting-started/plans-and-billing)The fee on sales for each plan.
