# Result

The merchant frontend always receives a result when the customer exits the Pledg funnel.

# Success

In case of success, the result is a JSON which fields depend on the payment mode (see back mode, transfer mode).

# Error

In case of error, the result is a JSON which format is the same for all payment modes.

The error is an object containing two properties: type and message, for instance:

{
    type: "invalid_request_error",
    message: "The provided property email is invalid"
}

The different values for error.type are the following:

Name Cause
Initialization errors
invalid_request_error Your settings are malformed (ex.: invalid merchantId, invalid email, invalid amountCents, ...)
maintenance The Pledg backend is under maintenance
internal_error The Pledg backend failed
network_error The network failed
Payment errors
payment_refused The PSP of Pledg failed
bad_gateway The PSP of the merchant failed (back mode only)
3DS_confirmation_timeout The 3DS payment process could not be completed on time
not_eligible The customer is not eligible to this type of payment (an authorization may appear on the customer account but no money will be debited)

When an error occurs, it is passed to the merchant frontend and the payment funnel is closed.

If a payment is rejected by the PSP (3DS failed, insufficient funds, etc.), an error message is displayed to the user inside the payment funnel, but no error is passed to the merchant frontend. Indeed, in such as situation, the user keeps the possibility to retry with another card.