Make a card payment to get funds into a Mangopay wallet
ClientId
and an API key – if you don’t have these, contact Sales to get access to the Mangopay DashboardPOST /V2.01/{ClientId}/users/natural
Id
for the user, which you’ll need for the next step.
Id
of the user as the owner of the wallet:
POST /V2.01/{ClientId}/wallets
Id
for the wallet, which you’ll need to request the payment.
Id
of the user as the UserId
.
You also need to define the currency and type of the card at this stage.
POST /v2.01/{ClientId}/cardregistrations
AccessKey
PreregistrationData
CardRegistrationURL
CardId
.Simplify your integration on web, iOS, and Android.CardRegistrationURL
using the previously saved AccessKey
and PreregistrationData
:
AccessKey
data for the accessKeyRef
parameterPreregistrationData
data for the data
parameterProperty | Type | Description |
---|---|---|
cardNumber | string | The card number to be tokenized, without any separators. |
cardExpirationDate | string (Format: “MMYY”) | The expiration date of the card. |
cardCvx | string | The card verification code (on the back of the card, usually 3 digits). |
POST {CardRegistrationURL}
RegistrationData
.
You should also provide the cardholder’s name at this stage, which will be added to the Card object.
PUT /v2.01/{ClientId}/cardregistrations/CardRegistrationId
CardId
is the tokenized version of the card that you can use in the next step to request the payment.
See parameter details
API child parameter | Type | Description | JavaScript example |
---|---|---|---|
AcceptHeader | string | The exact content of the HTTP accept headers as sent to the platform from the end user’s browser. | None, collected server-side |
JavaEnabled | boolean | Whether or not the end user’s browser has the ability to execute Java. | navigator.javaEnabled() |
Language | string (Max. length: 6 characters) | The browser language, made up of the language code and the country (e.g., “en-US”). | navigator.language or navigator.userLanguage |
ColorDepth | integer (Allowed values: 1, 4, 8, 15, 16, 24, 30, 32, 48) | The value representing the depth of the screen’s color palette for displaying images, in bits per pixel. | window.screen.colorDepth |
ScreenHeight | integer (Max. length: 6 characters) | The height of the screen in pixels. | window.screen.height |
ScreenWidth | integer (Max. length: 6 characters) | The width of the screen in pixels. | window.screen.width |
TimeZoneOffset | integer | The difference in minutes between the browser’s timezone and UTC. | new Date().getTimezoneOffset() |
UserAgent | string (Max. length: 255 characters) | The exact content of the HTTP User-Agent header. Max. length: 255 characters. | navigator.userAgent |
JavascriptEnabled | boolean | Whether or not the end user’s browser has the ability to execute JavaScript. | true |
CardId
, you can request the payment to the wallet using the Direct Card PayIn object.
CardId
Id
of the User as the AuthorId
Id
of the user’s Wallet as the CreditedWalletId
POST /v2.01/{ClientId}/payins/card/direct
SecureModeRedirectURL
value to complete strong customer authentication with the 3DS protocol, unless it is null
. If SecureModeRedirectURL
is null
, this means that 3DS is not required and no redirection is needed.
You can also use the SecureModeNeeded
boolean to determine this redirection behavior.
In Sandbox, follow the link returned in the SecureModeRedirectURL
to access the authentication simulator.
SecureModeReturnURL
which you defined.
The Mangopay API returns your SecureModeReturnURL
with the Id
of the pay-in transaction attached as a query parameter in the following format:
https://www.example.com?transactionId=Id
Mangopay updates the Status
of the pay-in to indicate a successful or failed payment depending on the outcome of the end user’s authentication.
You should set up hook notifications for the following event types to be notified of the outcome:
Id
) to confirm the result of the transaction. This allows you to customize the end user’s experience after the payment.
If the pay-in is successful, the card’s Validity
parameter is set to Valid
and it can be used for other payments at a later stage.
Active
parameter to false to deactivate the card. This action is irreversible.
PUT /v2.01/{ClientId}/cards/{CardId}