# How money moves (/get-started/how-money-moves)

A payer pays with one Solana transaction that their own wallet signs. The price goes straight to
the merchant's wallet and any service fee to Fianto, in the same transaction. Nothing is held in
between.

## A one-time payment [#a-one-time-payment]

**How money moves in a one-time payment**

1. The payer's wallet signs one transaction. The payer is the only signer.
2. That transaction sends the price in USDC straight to the merchant's wallet.
3. In the same transaction, the service fee goes to Fianto's treasury — only when the service fee is above zero.
4. Fianto broadcasts the signed transaction and watches the chain. The price goes straight to the merchant's wallet and any service fee to Fianto, in the same transaction. Nothing is held in between.
5. Subscriptions work differently: Fianto's charging key co-signs the subscribe transaction and signs each renewal, within the limits the on-chain program enforces.

The transaction the payer signs holds:

1. Two compute-budget instructions.
2. A USDC transfer of the price to the merchant's wallet. This transfer carries the session's
   reference, so Fianto can match it to the checkout.
3. A USDC transfer of the service fee to Fianto's treasury, only when the fee is above zero.

The payer is the only signer and pays the network fee. The wallet only signs: **Fianto
broadcasts** the transaction, and rebroadcasts it when needed.

To pay, the payer needs:

* a USDC token account that already exists and is not frozen,
* the price plus the service fee in USDC,
* at least 0.00001 SOL.

A one-time payment costs the payer no rent. Fianto never creates token accounts, for the payer or
for the merchant. The merchant's receiving wallet must already have a USDC token account, or
creating a checkout fails with `merchant_token_account_missing`. Send that wallet any amount of
USDC once to create it.

## Confirmed, then finalized [#confirmed-then-finalized]

A Solana transaction is first **confirmed**, then **finalized**. Fianto acts on each step
differently:

| Step      | What happens                                                                                                                                |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Confirmed | The checkout page shows the payer success.                                                                                                  |
| Finalized | The order becomes `PAID`, the payment `SUCCEEDED`, and Fianto sends `order.paid` and `checkout.session.completed` to your webhook endpoint. |

> **The payer's success screen is not proof of payment:**
>
> The payer sees success at confirmed, before the order is paid. Fulfil an order only from the
> `order.paid` webhook or from the order you read back from the API.

## The service fee [#the-service-fee]

> **The payer pays the service fee:**
>
> Fianto's service fee is capped at 10 % of the price. It is added on top of the price and the
> payer pays it. It is rounded down in the payer's favour. It goes to Fianto's treasury in the same
> transaction, and only when it is above zero. The checkout page always shows a "Service fee" line.

The fee is fixed on the session when you create it, so a later change never alters a checkout that
is already open.

## Subscriptions work differently [#subscriptions-work-differently]

**What the subscribe transaction contains**

1. Set the compute budget.
2. Create the payer's USDC authority, only when the wallet has none.
3. Subscribe, bound to the plan's terms.
4. Pull the price to the merchant's wallet; this pull carries the session reference.
5. Pull the service fee to Fianto's treasury, only when the fee is above zero.
6. The first period is charged inside this transaction.
7. The payer's wallet signs and is the fee payer: the payer pays the network fee and both rents (the subscription's and, when it is created, the USDC authority's).
8. Fianto's charging key co-signs and pays nothing.
9. The rent is read from Solana at subscribe time.

To subscribe, the payer signs one subscribe transaction. It creates the payer's USDC authority
when the wallet has none, subscribes to the plan, pulls the price to the merchant's wallet and
pulls the service fee to Fianto's treasury when the fee is above zero. The first period is
charged inside this transaction.

> **What the payer pays to subscribe:**
>
> The payer pays the network fee and two rents: the subscription account's, and the USDC
> authority's when this transaction creates it. The rent is read from Solana when the payer
> subscribes and shown on the checkout page. Fianto's charging key
> co-signs and pays nothing.

After that, **Fianto's charging key** takes each renewal, every 30 days or every 365 days as the
price sets, and pays the network fee for it. It can only take what the subscription's own
on-chain terms allow: at most the plan amount per period, only to the plan's destinations, and
nothing after the subscription is cancelled or expired.

A subscription keeps the wallet and the fee it started with. If the merchant's wallet or the fee
changes, only new subscribers get the new ones.

## See also [#see-also]

- [What is Fianto](/get-started/what-is-fianto): What Fianto does and what it does not.

- [Quickstart](/get-started/quickstart): Take your first one-time payment.

- [Subscriptions quickstart](/get-started/subscriptions-quickstart): Sell a recurring price.

- [Concepts](/concepts): Payments, subscriptions and the on-chain program in depth.