ApiCardPreAuthorizations class provides methods to create and manage card pre-authorizations, which reserve funds on a card without immediately capturing them.
Methods
Create
Create a new pre-authorization.The CardPreAuthorization object to create
Optional idempotency key for safe retries
\MangoPay\CardPreAuthorization - The created CardPreAuthorization object
Example:
Get
Get a pre-authorization by its ID.The unique identifier of the pre-authorization
\MangoPay\CardPreAuthorization - The CardPreAuthorization object
Example:
Update
Update a pre-authorization (typically to cancel it or adjust the payment status).The CardPreAuthorization object to update (must include Id)
\MangoPay\CardPreAuthorization - The updated CardPreAuthorization object
Example:
GetTransactions
Get all transactions (pay-ins) associated with a pre-authorization.The ID of the pre-authorization
Pagination object (passed by reference)
Filtering options
Sorting options
\MangoPay\Transaction[] - Array of Transaction objects
Example:
CardPreAuthorization Entity
TheCardPreAuthorization entity represents a reservation of funds on a payment card.
Properties
The unique identifier of the pre-authorization
Unix timestamp of when the pre-authorization was created
Custom data for your use
The user ID of the pre-authorization author
The amount to pre-authorize on the card
The status of the pre-authorization:
CREATED, SUCCEEDED, FAILEDThe payment status:
WAITING, CANCELED, EXPIRED, VALIDATEDThe result code of the pre-authorization
The result message explaining the result code
A description that appears on the bank statement
How the pre-authorization is executed (always
CARD)The 3D Secure mode:
DEFAULT, FORCE, NO_CHOICEThe ID of the registered card to use
Whether 3D Secure validation was required
The URL to redirect users to for 3D Secure validation
The URL where users are redirected after 3D Secure validation
Unix timestamp when the pre-authorization expires (typically 30 days)
Unix timestamp when the pre-authorization was authorized
The type of payment (always
CARD)The ID of the associated pay-in (if captured)
Billing information for the transaction
Security validation information
Whether multiple captures are allowed for this pre-authorization
The remaining funds available for capture
The IP address of the user
Browser information for 3DS2
Shipping information
The requested 3D Secure version
The 3D Secure version that was applied
Information about the card used
The payment category:
ECommerce (default), TelephoneOrder3DS authentication result
Usage Examples
Create a Pre-Authorization
Capture Pre-Authorized Funds
Cancel a Pre-Authorization
Pre-authorizations typically expire after 30 days. Make sure to capture the funds before the expiration date.