Recurring card payments
Recurring payments occur when the platform repeatedly charges the end user’s card at regular intervals for the goods and/or services provided.
Learn more about recurring payments →
The recurring card payments feature is testable in Sandbox, and Mangopay provides a specific set of mocks to simulate the errors that occur when working with recurring objects.
1. Select the pay-in to which the mock applies
You can use the mock for a customer-initiated transaction (CIT) or a merchant-initiated transaction (MIT).
To do so, use the POST Create a Recurring PayIn Registration endpoint with the 33501 value in one of the following Amount parameters in the body of the request:
FirstTransactionDebitedFundsto test a CITNextTransactionDebitedFundsto test an MIT
2. Choose the error to simulate in the recurring registration
You can use the value below in the AddressLine2 parameter of the Billing object in your recurring pay-in registration body.
3. Make the recurring pay-in
Make the pay-in (CIT or MIT) using the POST Create a Recurring Card PayIn (CIT or MIT) endpoint, with the amount of 33501 for the DebitedFunds.
Example
This example simulates a failed merchant-initiated transaction due to an inactive card, by following these steps:
- Create a Recurring PayIn Registration with the mock values
- Create an initial CIT for the authentication
- Create an MIT, which fails and returns the 101106 error.
Note – Mocks available in Postman Collection
The Mangopay API Postman Collection contains the full flow for the recurring mocks to help you test faster.