http://checkout.mangopay.comThe script must not be bundled or hosted on other domains. You must reference it directly from our domain.
Policy | URLs |
---|---|
script-src | *.google.com |
connect-src | api.mangopay.comapi.sandbox.mangopay.com*.payline.com |
Property | Type | Description |
---|---|---|
elementOrSelector | HTMLElement | String REQUIRED | The container element or the selector of the container element. |
options | Object REQUIRED | The options of the Checkout SDK configuration. |
options
object parameter:
Property | Type | Description |
---|---|---|
clientId | String REQUIRED | The unique identifier associated with the Mangopay API key, giving access to the Mangopay API. |
environment | String | The Mangopay environment. Allowed values: SANDBOX, PRODUCTION Default values: SANDBOX |
profilingMerchantId | String REQUIRED | The unique identifier associated with your fraud protection package. Contact Mangopay to obtain this value. |
amount | String REQUIRED | Information about the debited funds.The currency (ISO_4217 format) and value (expressed in minor units) of the debited funds. |
paymentMethods | Array REQUIRED | The payment methods presented to the user.Array of objects detailing the type and configuration options for specific payment methods. Each payment method includes configuration options tailored to its specific requirements. |
respectPaymentMethodsOrder | Boolean | Controls how payment methods are ordered and which one is initially active.When true , the SDK renders methods in the order provided by paymentMethods and the first item in that array becomes the initial selection.When false (default), card is rendered first and used as the initial selection; other methods are rendered in an order determined by the SDK.Default value: false |
branding | Object | The custom branding of the payment page (see Customization section below). |
locale | String | Object | The language for the payment page. Specify one of the built-in languages (en , fr ) or send an object with custom messages (see Customization section below). |
tenantId | String | The Mangopay tenant being used by the platform. Platforms that have contracted with Mangopay’s UK entity must set the value to UK .Allowed values: EU , UK
Default value: EU |
Property | Type | Description |
---|---|---|
ref | React.RefObject<MangopayCheckoutForwardedRef> | React reference object: import { MangopayCheckoutForwardedRef } from '@mangopay/checkout-sdk-react'; |
onPaymentComplete | Function(event) | Triggered when the transaction is completed, whatever the outcome (whether successful or failed). |
options | Object | Checkout SDK configuration options |
disabled | Boolean | Applies a disabled state to the Checkout component such that user input is not accepted. |
onError | Function(event) | Triggered when an internal SDK error has occurred. |
onLoaded | Function(event) | Triggered when the Checkout SDK is loaded. |
onChange | Function(event) | Triggered when data exposed by the Checkout SDK is changed. |
onTokenizationComplete | Function(event) | Triggered when:
|
onPaymentComplete | Function(event) | Triggered when the transaction is completed, whatever the outcome (whether successful or failed). |
onCancel | Function() | Triggered when the payment process is canceled by the user. This can occur when the 3D Secure authentication window or PayPal, Google Pay, or Apple Pay popup is closed before completion. |
updateOptions
method. Make sure you pass a complete updated options
object as specified in the Configuration section.
SecureModeReturnURL
or ReturnURL
(depending on the payment method):http://checkout.mangopay.comThe user must be returned to this URL after redirection.
options.onCreatePayment
function to request the transaction from your backend.
Subsequently, and when necessary for the transaction type, the Checkout SDK seamlessly manages additional redirect actions for 3DS authorization or otherwise validating the payment.
To manage transaction redirects effectively with the SDK:
Define onCreatePayment
paymentMethods
configurations, define an options.onCreatePayment
attribute as a function.Within your function:
The SDK:
onPaymentComplete
event with the ID and status of the transaction.card
as the type
of the paymentMethods
object. For the options
, use the following configuration parameters.
Property | Type | Description |
---|---|---|
options.supportedCardBrands | Array REQUIRED | The card brands supported. Allowed values: VISA, MASTERCARD, AMEX, MAESTRO, CB |
options.onCreateCardRegistration | Function REQUIRED | Use this attribute to request and return a Card Registration. |
options.onCreatePayment | Function REQUIRED | To handle 3DS redirects for card payments, use this attribute to request and return a pay-in. |
options.enableSaveCard | Boolean | If set to true , a Save Card checkbox will appear in the UI. When checked, SaveCard: true will be returned in the CreatePaymentData object, and you can forward this flag to your backend for further handling (read more about managing saved cards). |
options.savedCards | Array of SavedCard | A list of cards previously saved by the user. If provided, a button will appear within the card number input field that opens a dropdown of saved cards to select from. |
options.onDeactivateSavedCard | Function | A callback that is triggered when the user chooses to deactivate a saved card. Receives an object containing { cardId: string } . You can use this ID to inform your backend which card should be deactivated. |
options
for the card payment method, create a function to handle creation of Card Registration event handler in the paymentMethods
object:
onCreateCardRegistration
function calls your server, and passes it the card brand of the user.onCreateCardRegistration
function, return the unmodified Card Registration object to the SDK.CardId
which is used for payment.CardId
) for requests with the following API objects:
SecureModeReturnURL
parameter is set to https://checkout.mangopay.com
PreferredCardNetwork
value if it was received by onCreatePayment
Enable saving cards
enableSaveCard
to true
to present a Save card checkbox on the user interface.Deactivate if card not saved
CreatePaymentData
object returns SaveCard : false
. In this case, you must systematically call PUT Deactivate or edit a Card to deactivate it in the Mangopay API.If saved, store tokenized card in your system
SaveCard
flag is set to true
and passed to your onCreatePayment
handler. You can then store the card object in your system.Re-use saved cards
savedCards
array in the payment method configuration.If sent, then a dropdown appears in the interface in the card number input field. When a saved card is selected, the SDK uses it for the payment process.Deactivate card if user removes it
onDeactivateSavedCard
is triggered and you must:CreatePaymentData
returns SaveCard : false
, indicating the user doesn’t wish to save it, then you must call PUT Deactivate or edit a Card to deactivate it in the Mangopay API.The same is true if the onDeactivateSavedCard
is triggered, indicating that the user wishes to remove the card.apple_pay
as the type
of the paymentMethods
object. For the options
, use the following configuration parameters.
Property | Type | Description |
---|---|---|
paymentRequest | Object REQUIRED | The specifications of the payment request. |
onCreatePayment | Function REQUIRED | Function called after the user has successfully authenticated a card for payment from the Apple Pay sheet. Use this attribute to implement backend creation of the Apple Pay PayIn from your server. After creating the pay-in, return the pay-in object to the SDK. |
Property | Type | Description |
---|---|---|
countryCode | String REQUIRED | The platform’s two-letter ISO 3166 country code. |
currencyCode | String REQUIRED | The three-letter ISO 4217 code (EUR, GBP, etc) of a supported currency (depends on feature, contract, and activation settings). |
merchantCapabilities | Array REQUIRED | Information about the card types and authentication protocols you support (see Apple Pay documentation). |
supportedNetworks | Array REQUIRED | The card networks supported by mangopayAllowed values: VISA, MASTERCARD |
total | Object REQUIRED | The line item total for the payment (see Apple Pay documentation). |
merchantIdentifier | String REQUIRED | Your platform’s Apple Pay Merchant ID. |
merchantName | String REQUIRED | The name of your platform. |
onValidateMerchant | Function REQUIRED | Use this attribute to request and return a ApplePay session. Function called when the SDK receives an onvalidatemerchant merchant event from the Apple Pay sheet. The assigned function should implement backend creation of the merchant session object from your server. After creating the session object, return the session object to the SDK. |
requiredBillingContactFields | Array REQUIRED | The billing information to fulfill the order (see Apple Pay documentation). |
onValidateMerchant
function calls your server and passes it the static hostname apple-pay-gateway.apple.com
as the validation URL. In the China region, use cn-apple-pay-gateway.apple.com
.MerchantSession
.completeMerchantValidation
method of the SDK (see Apple Pay documentation for more information on this method).PaymentData
.
onCreatePayment
attribute in your Apple Pay options.onCreatePayment
function and pass the PaymentData
to it.PaymentData
provided.checkout.mangopay.com
along with your domain to the authorized list in the Google Business Console to view the Google Pay payment popup.This allows the Checkout SDK to ensure the Google Pay experience is presented appropriately to your users. Not following this guidance may impact your payment acceptance on Google Pay.google_pay
as the type
of the paymentMethods
object. For the options
, use the following configuration parameters.
Property | Type | Description |
---|---|---|
merchantInfo.merchantId | String REQUIRED | Your Google Pay Business ID, which you can find in Google Pay & Wallet Console. |
merchantInfo.merchantName | String REQUIRED | Your Google Pay Business Name, which you can find in Google Pay & Wallet Console. |
gateway | String REQUIRED | The orchestration used: in this case, whenthen. Allowed values: whenthen |
gatewayMerchantId | String REQUIRED | Your Mangopay ClientId . |
cardParameters.allowedAuthMethods | Array REQUIRED | The supported authentication methods: PAN_ONLY, meaning the card is registered in the user’s Google account and requires additional authentication; CRYPTOGRAM_3DS, meaning the card is enrolled in the customer’s Google Wallet and authentication is handled by Google, with no 3DS redirection and no liability for the platform. Allowed values: PAN_ONLY, CRYPTOGRAM_3DS |
cardParameters.allowedCardNetworks | Array REQUIRED | The card networks supported by Mangopay.Allowed values: VISA, MASTERCARD |
transactionInfo | Object REQUIRED | Information about the transaction and its authorization, such as whether the user agrees to the transaction, the total price and price status. For more information on this object parameter, see the Google Pay documentation. |
onCreatePayment | Function REQUIRED | Function called after the user has successfully authorized a card for payment from the Google Pay sheet.The assigned function should implement backend creation of the Google Pay PayIn from your server. After creating the pay-in, return the pay-in object to the SDK. |
button.buttonColor | String | The color of the button.Default value: defaultAllowed values:
|
button.buttonType | String | The type of the button, determining the text to display.Default value: buyAllowed values:
|
button.buttonLocale | String | The ISO 639-1 code representing the desired button language.Default value: The browser or operating system language settings.Allowed values: en, ar, bg, ca, cs, da, de, el, es, et, fi, fr, hr, id, it, ja, ko, ms, nl, no, pl, pt, ru, sk, sl, sr, sv, th, tr, uk, and zh. |
onTokenizationComplete
function is called after the user approves the payment on the Google Pay form. The output contains the paymentData
object (see Google Pay documentation) which is needed to request the Google Pay payment via the API from your backend.
PaymentData
and ensure that the SecureModeReturnURL
parameter is set to https://checkout.mangopay.com
.
onCreatePayment
attribute in your Google Pay options.onCreatePayment
function and pass the PaymentData
to it.PaymentData
provided.paypal
as the type
of the paymentMethods
object. For the options
, use the following configuration parameters.
Property | Type | Description |
---|---|---|
options.onCreatePayment | Function REQUIRED | Use this attribute to request and return a PayPal pay-in.The assigned function should implement backend creation of the PayPal pay-in from your server. |
options.merchantId | string REQUIRED | A unique identifier for your merchant account, required to associate the payment with it when processing PayPal pay-ins.You can find your merchantId in your PayPal Business Account Dashboard. |
ReturnURL
parameter is set to https://checkout.mangopay.com
.
browserInfo
object is required when submitting a pay-in request. To get the required values for the transaction, use the getBrowserInfo
function from the Checkout SDK instance. Pass on the values to your server.
onPaymentComplete
event is triggered, verify the status of the relevant Mangopay API object:
false
. This provides a temporary state for the user until the full payment is complete, including calls from your platform’s backend.
The setLoading
method handles the loading state for displaying and dismissing the spinner.
cardFormElement
with your ClientId
and select your environment (Sandbox or Production).
Property | Type | Description |
---|---|---|
paymentMethod | Object | The payment method used with the card form element. Only 'card' is supported. See Configuring card payments section for details |
branding
object.
rules
and variables
objects for further customization.
FieldContainer
or .FieldContainer
), and specify the styles to apply. The feature supports all native CSS properties and nesting.
customLanguage
object.