2. Pay In Response

2.1 Success Response:

When you receive a successful response, it contains a URL directing your customer to P4F's authentication page.

Steps:

  • Your customer will provide authentication credentials, specifically a valid CPF (a Brazilian personal ID number).

  • Upon successful authentication, the Pay in process initiates.

  • If everything proceeds correctly, you'll receive a response as below:


    "code": 201,
    "message": "success message",
    "url": "<P4F_API>/1.0/go/auth/<KEY>"
}

You may load the URL to an iframe or redirect your customer to the URL where the Pay in processing will occur, and the transaction performed.

Iframe instructions

To embed our interface within an iframe, please adhere to the following guidelines:

  1. The recommended minimum dimensions for the iframe are as illustrated in the example below:

htmlCopy code<iframe src="<P4F_API>/1.0/go/auth/<KEY>" width="100%" height="640"></iframe>
  1. Please note that the iframe should be nested within a parent element. This parent element should define the maximum width and height. Adjust the height value as necessary.

If you choose to embed Pay4Fun GO within an iFrame, remember to provide us with the domain for registration in our infrastructure.

Parameter
Type
Description

code

Integer

HTTP response code

message

String

Response message

url

String

URL for customer redirection to P4F for authentication & confirmation of the transaction

2.2 Unsuccessful Response :

An example of a fail response:

{
    "code": 400,
    "message": "error message"
}
  • Analyze the Message to determine the reason for failure.

  • Correct the identified issues.

  • Retry the request.

If any detail prevents transaction being completed, API will redirect your customer to your Not Ok URL.

Important

Please, note that the reason for the failure will always be appended to your "Not Ok" URL as a query string. For instance:

List of possible erros

HTTP Status Code 400 (Bad Request):

  • INVALID_EXTERNAL_INVOICE_ID: The provided external invoice ID is invalid.

  • MERCHANT_NOT_FOUND: The specified merchant was not found.

  • INVALID_CONFIRMATION_URL: The provided confirmation URL is invalid.

  • INVALID_REQUEST_CURRENCY: The requested currency is invalid.

  • INVALID_CUSTOMER_MAIN_ID: The provided customer main ID is invalid.

  • INVALID_EMAIL: The provided email address is invalid.

  • MERCHANT_ACCOUNT_NOT_LIVE: The merchant account is not live.

  • MERCHANT_NOT_AUTHORIZED: The merchant is not authorized.

  • MERCHANT_IP_NOT_AUTHORIZED: The IP address of the merchant is not authorized.

  • INVALID_SECURITY_HASH: The provided security hash is invalid.

  • EXTERNAL_INVOICE_ID_ALREADY_USED: The external invoice ID has already been used.

  • MINIMUM_AMOUNT_NOT_REACHED: The minimum amount has not been reached.

  • MAXIMUM_AMOUNT_EXCEEDED: The maximum amount has been exceeded.

  • PROCESSING_ERROR: An error occurred during processing.

Last updated

Was this helpful?