> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/how-the-apps-work/screens/staff/card-payment.md).

# Credit card payment

{% hint style="info" %}
Draft, written by an agent and not yet checked by a person ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). Platforms: web. [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/screens/staff/card-payment.md).
{% endhint %}

Staff create a payment package for one site: a title, a description, an amount, an interval and a currency. The server links the package to the site, inactive, for the customer to subscribe to.

* **Where:** admin app `/credit-card-payment`; menu "Credit Card Payment", shown only to the staff on the built-in list
* **Who:** staff whose username is on the app's built-in `adminUsers` list and whose token names their own user (webadmin\_angular @ db972390b8, `src/app/services/payment/payment.service.ts:180-193`, `src/app/shared/config.ts:21-28`). The route sends anyone else to Home, and the menu hides the item. Both checks run in the browser; the server checks neither the list nor the staff flag.
* **Feature:** [Billing setup](https://docs.snapfix.com/product/features/staff/staff-billing.md)

## Layout

1. **Title.** "Credit Card Payment".
2. **Tabs.** "Details", with the form, and "History", which is disabled and empty.
3. **Left column.** "\* Select Account" with the [account picker](https://docs.snapfix.com/how-the-apps-work/screens/staff.md#account-picker), then "Title" and "Description".
4. **Right column.** "Total Amount", "Interval" and "Currency". Once a site is picked and the amount is 0 or more, a sentence follows: " will pay per ", with the interval value title-cased, so "per Month" or "per Annual". The sentence reads the amount as whole currency units, but the server sends it to Stripe as minor units.
5. **Save.** A divider, then "Save".

## Inputs

| Field          | Type                      | Required | Default                           | Rules and messages                                                                                                                                                                                                                                                                                                                                                   |
| -------------- | ------------------------- | -------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Select Account | Single select with search | Yes      | Nothing selected                  | No message: "Save" stays disabled until a site is picked. Deleted sites are listed and can be picked \[[ASK-223](https://github.com/snapfix/docs/blob/main/ASK.md#ask-223-should-deleted-accounts-be-selectable-for-card-payments-and-support-logs)]; the server then refuses the save with "invalid parent".                                                        |
| Title          | Text                      | Yes      | Empty                             | "Please input title"                                                                                                                                                                                                                                                                                                                                                 |
| Description    | Text, 4 to 8 rows         | Yes      | Empty                             | "Please input description"                                                                                                                                                                                                                                                                                                                                           |
| Total Amount   | Number                    | Yes      | 0                                 | "Total Amount is incorrect" when empty or negative. Zero passes the form \[[ASK-218](https://github.com/snapfix/docs/blob/main/ASK.md#ask-218-should-a-zero-amount-be-accepted-for-card-payments-and-paywall-prices)], and the server refuses it with "invalid amount". The value goes to Stripe unchanged, as the currency's minor unit: 120 makes a price of 1.20. |
| Interval       | Select                    | Yes      | "MRR - Monthly Recurring Revenue" | "ARR - Annual Recurring Revenue", sent as `annual`, or "MRR - Monthly Recurring Revenue", sent as `month`. The server takes only `month`, `year` and `day`, so "ARR" always fails with "invalid interval".                                                                                                                                                           |
| Currency       | Select                    | Yes      | USD                               | The currencies the list marks as supported, each shown as "CODE (symbol)" and sent in lower case. The server takes only USD, EUR, GBP and INR, so any other listed currency fails with "invalid currency" \[[ASK-201](https://github.com/snapfix/docs/blob/main/ASK.md#ask-201-which-currencies-should-the-stripe-package-form-offer)].                              |

## Actions

| Action         | Who          | What happens                                                                                                                                                                                                                                                                                                                                                            | API                                                                                                                                                                                              |
| -------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Open the page  | Listed staff | Loads the currency list and the first page of sites.                                                                                                                                                                                                                                                                                                                    | [`GET ?action=currencies_list`](https://docs.snapfix.com/engineering-reference/api/reference.md), [`GET /v4/parents`](https://docs.snapfix.com/engineering-reference/api/staff.md#get-v4parents) |
| Pick a site    | Listed staff | Sets the site of the package and of the sentence.                                                                                                                                                                                                                                                                                                                       | None                                                                                                                                                                                             |
| Clear the site | Listed staff | Empties the picker and reloads the site list. The form keeps the previous site, the sentence still names it, and "Save" still sends it.                                                                                                                                                                                                                                 | [`GET /v4/parents`](https://docs.snapfix.com/engineering-reference/api/staff.md#get-v4parents)                                                                                                   |
| Save           | Listed staff | Sends the form, with the signed-in user as creator and as sales person. On success it shows the server's message, or "Success", and resets the form: every field, Interval and Currency included, becomes empty, so they must be chosen again. The picker still shows the site, but the form no longer holds it, so "Save" stays disabled until a site is picked again. | [`POST ?action=admin_create_package`](https://docs.snapfix.com/engineering-reference/api/staff.md#post-actionadmin_create_package)                                                               |

## States

* **Loading:** the Currency list shows its loading state until the currencies arrive; the picker shows "Loading Data..." while sites load; "Save" shows a spinner while the request runs.
* **Empty:** the Currency list has no options until it loads, and the picker none when no site matches the search.
* **Error:** a failed currency or site load shows no message and leaves the list empty. A failed save shows the server's message, and the form keeps its values.
* **No permission:** staff not on the list are sent to Home and never see the page; the menu item is hidden.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/how-the-apps-work/screens/staff/card-payment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
