> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compago.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment Methods

> Save customer cards securely and charge them on demand.

A **payment method** allows you to securely save a customer's credit or debit card and charge it on demand, without the customer needing to re-enter their card details each time. This is ideal for recurring billing, subscriptions, memberships, and any scenario where you need to charge a customer repeatedly.

## What You Can Do

With payment methods, you can:

* **Save Cards Securely**: Customers complete a one-time checkout to save their card through Compago's PCI-compliant infrastructure
* **Charge on Demand**: Initiate charges against saved cards at any time via API
* **Process Refunds**: Issue full refunds for charges made against saved cards
* **Manage Cards**: List, retrieve, and revoke saved payment methods
* **Track Payments**: View the full payment history for each saved card
* **Customize Checkout**: Choose between a full-page redirect or embedded iframe for the card-saving flow

## Use Cases

Payment methods are perfect for:

* **Subscriptions**: Charge customers monthly or annually for SaaS products, streaming services, or memberships
* **Memberships**: Automatically bill members for gym access, clubs, or professional organizations
* **On-demand Services**: Charge customers after service delivery (ride-sharing, food delivery, freelance work)
* **Pay-later Flows**: Collect card details upfront and charge later when an order ships or a service is rendered
* **Installment Billing**: Split large payments into multiple charges over time

## How It Works

1. **Create**: Your backend calls the Compago API to create a payment method, providing customer billing details and optional customization
2. **Checkout**: The customer is directed to the checkout URL to securely enter their card details
3. **Verification**: Compago places a small verification charge (default \$1 MXN) which is then voided to validate the card
4. **Card Saved**: Once verified, the payment method status changes to `ACTIVE` and the card is securely stored
5. **Charge on Demand**: You can now charge the saved card at any time by calling the charge endpoint

## Payment Method Statuses

| Status    | Description                                                                                    |
| --------- | ---------------------------------------------------------------------------------------------- |
| `PENDING` | Payment method created, waiting for the customer to complete the checkout and save their card. |
| `ACTIVE`  | Card has been verified and saved. You can charge this payment method.                          |
| `EXPIRED` | The checkout link expired before the customer completed the card-saving process.               |
| `REVOKED` | The payment method has been permanently revoked and can no longer be charged.                  |

## Payment Statuses

When you charge a saved payment method, each payment has its own status:

| Status            | Description                                              |
| ----------------- | -------------------------------------------------------- |
| `NOT_INITIALIZED` | Payment has been created but processing has not started. |
| `PENDING`         | Payment is being processed.                              |
| `CONFIRMED`       | Payment has been successfully completed.                 |
| `CANCELLED`       | Payment was cancelled during processing.                 |
| `REFUNDED`        | Payment has been fully refunded.                         |

## Prerequisites

Before using payment methods, ensure you have:

* An active Compago account with API access
* A valid API key (generate one at **Configuraciones → Desarrollador** in your [Compago Dashboard](https://app.compago.com))
* Your integration configured to use **MXN currency**

<Note>
  Payment methods currently support **MXN (Mexican Peso)** only. Transactions in other currencies will be rejected.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Save a Card" icon="credit-card" href="/payment-method/save-card">
    Learn how to create a payment method and guide your customer through the card-saving checkout.
  </Card>

  <Card title="Charge a Saved Card" icon="money-bill" href="/payment-method/charge">
    Charge a customer's saved card on demand via API.
  </Card>

  <Card title="Manage Payment Methods" icon="list" href="/payment-method/manage">
    List, retrieve, and revoke saved payment methods and their payments.
  </Card>

  <Card title="Process Refunds" icon="rotate-left" href="/payment-method/refund">
    Issue full refunds for charges made against saved cards.
  </Card>
</CardGroup>
