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

# About

> Learn how credit card charges work in WEPayments

## About credit-card charges

Credit card charges are created as `PAYIN_CREATED` status. It goes from `PAYIN_CREATED` to `PAYIN_AWAITING_APPROVAL` when the checkout is requested.

The checkout can be done in 2 different ways:

* **Payments page**
* **Transparent checkout**

## Payment page

We provide you a simple payment page where you can view the instructions and request the payment. To use the page you will need the `key` field, which is returned when you create the charge. **For security reasons, it is not possible to open the payment page within an iframe.**

The payment page url is: `https://page.goboleto.com/?hash={key}`. In sandbox environment the page url is: `https://page.sandbox.goboleto.com/?hash={key}`.

After creating the charge, access to the credit-card checkout will be available via the URL of our payments page (in the description above).

### Required information for checkout

The following additional information will be required to proceed with the checkout:

* Credit card number
* Cardholder Name
* Address (that will be the payer' credit-card billing address)
* Number of installments

## Transparent checkout

The transparent checkout is a one-step process to create and pay the charge.

There is some additional data to request a transparent checkout.

When creating a credit-card charge, if the input `checkout` is present within the payload the charge will be created and processed.

To get all required data to process a transparent checkout our SDK must be implemented.

For further information, please read our documentation in the link below about Transparent Checkout and how to integrate our SDK: [Transparent Checkout](/credit-card/transparent-checkout)

## Transparent checkout with stored credit-card

To perform the fast-checkout action, you only need to inform the `card_id` parameter inside the checkout object. This parameter refers to the saved credit card ID. To recover this parameter, just consult the list of cards saved for a customer.

2 endpoints are available for listing customer information and their saved cards:

* List of customers for a given client: `/v1/payin/customers/{clientId}/cards`
* List of cards for a given customer: `/v1/payin/customers/{customerId}/cards`

If you inform the `card_id` parameter you MUST NOT inform `token` and `payment_method_id` parameters.

## Optional inputs (Payment page)

During the checkout process, we provide the option to redirect the user to a custom success or failure page (according to the transaction status). Here follows the options for redirection:

* `external_url.redirect_on_success`: The URL where the user will be redirected after a successful credit-card checkout.
* `external_url.redirect_on_fail`: The URL where the user will be redirected after a failed credit-card checkout

You can also provide a custom image URL to be displayed at our payment page by sending the `external_url.checkout_image_url` input.

All 3 options are optional, and the user will be redirected to our default pages after the checkout if any of the redirect urls are present as well as the checkout image.

## Expiration date format

The `expireDate` field is formatted as `YYYY-MM-DDTHH:SS`. Ex.: 2021-12-31T23:59:59

## Possible charge statuses

<AccordionGroup>
  <Accordion title="PAYIN_CREATED">
    The first status when the payin is created.
  </Accordion>

  <Accordion title="PAYIN_CANCELED">
    Payin canceled due to expiration.
  </Accordion>

  <Accordion title="PAYIN_PAID">
    Payin was paid.
  </Accordion>

  <Accordion title="PAYIN_CREDITED">
    Payin was paid and the amount was credited on your wallet.
  </Accordion>

  <Accordion title="PAYIN_DROP_REQUESTED">
    Payin expiration requested.
  </Accordion>

  <Accordion title="PAYIN_AWAITING_APPROVAL">
    When the checkout is made, the charge goes from `PAYIN_CREATED` to `PAYIN_AWAITING_APPROVAL` (intermediate status) before the confirmation or any other payment final status occurs.
  </Accordion>

  <Accordion title="PAYIN_REJECTED">
    The payment was rejected and could not be processed.
  </Accordion>
</AccordionGroup>

## Possible refund mode

When creating a charge, you must know how the wallet values will be debited if a refund is requested. You can choose from the 3 options below:

<CardGroup cols={3}>
  <Card title="FULL_REFUND_CLIENT" icon="wallet">
    If none is informed, it will be selected by default. In this mode, the refund amount will be fully debited from the client wallet.
  </Card>

  <Card title="FULL_REFUND_RECIPIENT" icon="user">
    In this mode, the refund amount will be fully debited from the sub-portfolio or sub-client informed in the split. In this mode, the refund will only be allowed if you have a maximum of 1 split.
  </Card>

  <Card title="REFUND_BY_SPLIT" icon="split">
    In this mode, the refund amount will be debited proportionally as informed in the split and main wallet. In this mode, the refund will only be allowed if you have a maximum of 1 split.
  </Card>
</CardGroup>

## Security

<Warning>
  Regarding the safety of our customers, it is very important to emphasize that we DO NOT keep any information about credit-card and all credit-card information filled in the checkout page are only used once to confirm the transaction.
</Warning>

For any further questions you can contact us through our customer service channels.

## Related Resources

<CardGroup cols={2}>
  <Card title="Create Credit Card Charge" icon="plus" href="/api-reference/credit-card/create-charge">
    Create a new credit card charge
  </Card>

  <Card title="Webhook Signature" icon="webhook" href="/concepts/webhooks">
    Learn how to verify webhook signatures
  </Card>

  <Card title="KYC Verification" icon="user-check" href="/api-reference/kyc/list-kyc">
    Know Your Customer verification
  </Card>

  <Card title="FAQ" icon="circle-question" href="/faq">
    Frequently asked questions
  </Card>
</CardGroup>
