# Introduction to Cards API

The Card API is defined by distinct services that create several flows.

| Flow | Description | Impact on Customer's Account |
|---|---|---|
| CardVerification | Verifies whether a user's card is valid or not. | None. |
| FundsTransfer | Transfer's funds from a user's account for a purchase. | Single message capture of customer's funds. |
| ReserveCapture | Reserves funds on a user's account and then asynchronously can capture them later. | Dual message, reservation and subsequent capture of customer's funds. |
| Refund | Returns funds to a user's account that were captured by either a FundsTransfer or a ReserveCapture. | Funds returned to user. |

## CardVerification

The CardVerification flow is composed of a single method that is implemented by
the Payment Integrator.
[VerifyCard](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/verifyCard) is
used to validate a user's card. This is typically done with a $0 or $1
authorization, but no funds are ever captured for this flow.

![Verify Card](https://developers.google.com/static/standard-payments/dev/verify-card.png)

## FundsTransfer

The FundsTransfer flow is composed of a single method that is implemented by the
Payment Integrator.
[Capture](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/capture) is used
to capture funds from a user's account. This method synchronously checks for
availible funds and captures those funds.

![Funds Transfer](https://developers.google.com/static/standard-payments/dev/funds-transfer.png)

## Reserve Capture

The ReserveCapture flow is composed of multiple methods that are implemented
both by the Payment Integrator and by Google. It is a dual message payment flow
where funds are first reserved synchronously and then captured asynchronously.
After the funds are reserved, the reservation can be captured or canceled. A
capture initiates the money movement and a cancel will release the hold on the
user's funds.

The Payment Integrator implements the
[ReserveFunds](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/reserveFunds),
[AsynchronousCaptureFundsReservation](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/asynchronousCaptureFundsReservation)
and
[AsynchronousCancelFundsReservation](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/asynchronousCancelFundsReservation)
methods and Google implements the
[CaptureFundsReservationResultNotification](https://developers.google.com/standard-payments/google-card-fop-api/v1/google-card-fop-api.v1/captureFundsReservationResultNotification)
and
[CancelFundsReservationResultNotification](https://developers.google.com/standard-payments/google-card-fop-api/v1/google-card-fop-api.v1/cancelFundsReservationResultNotification)
methods.

### Capture Flow

![Reserve Capture](https://developers.google.com/static/standard-payments/dev/reserve-capture.png)

### Cancel Flow

![Cancel Funds Sequence Diagram](https://developers.google.com/static/standard-payments/dev/cancel-funds.png)

## Refund

The Refund flow is composed of a method implemented by the Payment Integrator
and a method implemented by Google. It is used to return funds that have been
captured through either the FundsTransfer or the ReserveCapture flows. The
Payment Integrator implements the
[AsynchronousRefund](https://developers.google.com/standard-payments/payment-integrator-card-fop-api/v1/payment-integrator-card-fop-api.v1/asynchronousRefund)
and Google implements the
[RefundResultNotification](https://developers.google.com/standard-payments/google-card-fop-api/v1/google-card-fop-api.v1/refundResultNotification)

![Refund](https://developers.google.com/static/standard-payments/dev/refund.png)

## Chargeback

The Chargeback flow is still in development. When ready it's documentation can
be found in this spot.