Channel: 14
Provider: Trio Brasil
Payment Method: APM
Available Currencies
Name | Code | Country |
---|---|---|
Brazilian real | BRL | Brazil |
Request example
curl --request POST \
--url http://paymentscert.alps.cl/justpay/check-out/SecurePayment \
--data public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks \
--data time=2022-10-13T14:39:09 \
--data channel=14 \
--data amount=100 \
--data currency=BRL \
--data trans_id=1 \
--data time_expired=120 \
--data url_ok=https://bit.ly/3S4I7iR \
--data url_error=https://bit.ly/3S5aOwc \
--data signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208 \
--data 'shopper_information={"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://paymentscert.alps.cl/justpay/check-out/SecurePayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks&time=2022-10-13T14%3A39%3A09&channel=14&amount=100¤cy=BRL&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208&shopper_information=%7B%22Phone%22%3A%20%2211995588222%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%22country_code%22%3A%20%22BRL%22%2C%22name_shopper%22%3A%20%22Jhon%22%2C%22Num_doc_identi%22%3A%20%2244227766880%22%2C%22type_doc_identi%22%3A%20%22CPF%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22address%22%3A%20%7B%22zipcode%22%3A%20%2201156060%22%2C%22street%22%3A%20%22Rua%20J%C3%BAlio%20Gonzalez%22%2C%22number%22%3A%20%221044%22%2C%22district%22%3A%20%22Barra%20Funda%22%2C%22complement%22%3A%20%22Sala%2001%22%2C%22city%22%3A%20%22S%C3%A3o%20Paulo%22%2C%22state%22%3A%20%22SP%22%7D%7D",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests
url = "http://paymentscert.alps.cl/justpay/check-out/SecurePayment"
payload = "public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks&time=2022-10-13T14%3A39%3A09&channel=14&amount=100¤cy=BRL&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208&shopper_information=%7B%22Phone%22%3A%20%2211995588222%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%22country_code%22%3A%20%22BRL%22%2C%22name_shopper%22%3A%20%22Jhon%22%2C%22Num_doc_identi%22%3A%20%2244227766880%22%2C%22type_doc_identi%22%3A%20%22CPF%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22address%22%3A%20%7B%22zipcode%22%3A%20%2201156060%22%2C%22street%22%3A%20%22Rua%20J%C3%BAlio%20Gonzalez%22%2C%22number%22%3A%20%221044%22%2C%22district%22%3A%20%22Barra%20Funda%22%2C%22complement%22%3A%20%22Sala%2001%22%2C%22city%22%3A%20%22S%C3%A3o%20Paulo%22%2C%22state%22%3A%20%22SP%22%7D%7D"
response = requests.request("POST", url, data=payload)
print(response.text)
const qs = require("querystring");
const http = require("http");
const options = {
"method": "POST",
"hostname": "paymentscert.alps.cl",
"port": null,
"path": "/justpay/check-out/SecurePayment",
"headers": {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(qs.stringify({
public_key: 'zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks',
time: '2022-10-13T14:39:09',
channel: '14',
amount: '100',
currency: 'BRL',
trans_id: '1',
time_expired: '120',
url_ok: 'https://bit.ly/3S4I7iR',
url_error: 'https://bit.ly/3S5aOwc',
signature: 'e22ef7fd3b7a7fa155f39dd966098b17cf7106b41e38544383487de0124e6208',
shopper_information: '{"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'
}));
req.end();
Mandatory Data
Attribute | Mandatory | Data type | Description |
---|---|---|---|
public_key | True | String (255) | Public key, unique value that identifies the commerce |
time | True | Datetime | Request data time |
channel | True | Integer | Payment Channel |
amount | True | Double | The amount of the transaction. Use 2 decimals. |
currency | True | String (3) | Transaction currency code |
trans_id | True | String (255) | Transaction id |
time_expired | True | String (255) | Time in minutes to expire the token. Value given in minutes. Minimum Suggested: Online: 30 minutes Cash: 2 hours For Brazil: Online: 2 hours Cash 24 hrs |
url_ok | True | String (255) | URL where shopper will be redirected from the online banking if payment was successful (Must be Https) |
url_error | True | String (255) | URL where shopper will be redirected from the online banking if payment was wrong.(Must be Https) |
signature | True | String (255) | Signature hash256: Review signature calculation |
shopper_information | True | JSON String | JSON String Data: Review JSON index & format |
shopper_information
JSON format
shopper_information
JSON formatField shopper_information must be send in string format (JSON encode).
'{"Phone": "11995588222","email": "[email protected]","country_code": "BRL","name_shopper": "Jhon","Num_doc_identi": "44227766880","type_doc_identi": "CPF","last_name_Shopper": "Snow","address": {"zipcode": "01156060","street": "Rua Júlio Gonzalez","number": "1044","district": "Barra Funda","complement": "Sala 01","city": "São Paulo","state": "SP"}}'
The shopper_information
field is a column corresponding to a json with the next keys:
Parameter | Mandatory | Data Type | Description |
---|---|---|---|
name_shopper | True | String (255) | Shopper's name |
last_name_Shopper | True | String (255) | Shopper's last name |
type_doc_identi | True | String (3) | Identification document [CPF, CNPJ ] |
Num_doc_identi | True | String (12) | Identification document number |
email | True | String (255) | Shopper's email |
country_code | True | String (4) | Country's phone code [+57 ] |
Phone | True | String (12) | Shopper's phone number |
country | True | String (3) | Country ISO code [BRA ] |
direct_integration | False | Boolean | Use direct integration. Server will response JSON Object |
Direct integration
You have the option to create a direct checkout, for this integration you'll receive a JSON Object instead of the checkout url.
Aditional fields for direct integration
Attribute | Mandatory | Data type | Description |
---|---|---|---|
direct_integration | True | Integer | Send 1 for direct integration |
Errors
To better error handling, we'll return the errors in the response body using the following fields:
{
"error":{
"code":"UNAUTHORIZED_RESOURCE",
"message":"Resource being accessed is unauthorized."
}
}
General error handling
Code | Message |
---|---|
TRIO_SERVICE_UNAVAILABLE | Unavailable service |
TRIO_SERVICE_REQUEST_TIMED_OUT | Timeout |
TRIO_SERVICE_REQUEST_METHOD_FORBIDDEN | Method not allowed |
ALREADY_EXISTS_RESOURCE | A {resource} already exists for the given reference. |
INVALID_RESOURCE | {resource} is invalid. |
NOT_FOUND_RESOURCE | {resource} was not found. |
INVALID_PARAMETER | Field {parameter} is invalid. |
REQUIRED_PARAMETER | Field {parameter} is required. |
Authentication error handling
Code | Message |
---|---|
UNAUTHORIZED_RESOURCE | Unauthorized feature |
TRIO_CLIENT_SECRET_INVALID | Invalid client secret. |
TRIO_CLIENT_ID_INVALID | Invalid client id. |
Integrations error handling
Code | Message |
---|---|
INTEGRATION_ERROR | An unexpected error occurred in bank integration. |
INTEGRATION_TIMEOUT | Bank integration time was longer than expected. |
Business error handling
Code | Message |
---|---|
ENTITY_IN_ANALYSIS | Entity is under review, wait for approval. Reference: #{id}. |
ENTITY_INVALID_CURRENCY | Transaction currency different from the one informed in the entity. Use currency #{currency}. |
ENTITY_INVALID_ADDRESS | Entity does not have a valid address. Reference: #{id}. |
BANK_ACCOUNT_IN_ANALYSIS | Bank account is under review, wait for approval. Reference: #{id}. |
BANK_ACCOUNT_DAILY_TRANS_LIMIT_REACHED | Daily transaction limit reached. |
BANK_ACCOUNT_DAILY_AMOUNT_LIMIT_REACHED | Daily transaction value limit reached. |
BANK_ACCOUNT_OVERNIGHT_TRANS_LIMIT_REACHED | Nightly transaction limit reached. |
BANK_ACCOUNT_OVERNIGHT_AMOUNT_LIMIT_REACHED | Nightly transaction amount limit reached. |
BANK_ACCOUNT_MIN_SINGLE_TRANS_AMOUNT_REACHED | Minimum transaction amount threshold has not been reached. |
BANK_ACCOUNT_MAX_SINGLE_TRANS_AMOUNT_REACHED | Maximum transaction amount limit reached. |
BANK_ACCOUNT_MAX_COUNTERPARTY_TRANS_REACHED | Daily transaction limit for an offset reached. |
BANK_ACCOUNT_MAX_COUNTERPARTY_AMOUNT_REACHED | Daily transaction value limit for an offset reached. |
PIX_KEY_CANCELED | Pix key is cancelled. Reference: #{id}. |
PIX_KEY_CONFIRMED | Pix key has already been confirmed. Reference: #{id}. |
PIX_KEY_ALREADY_EXISTS | There is already a pix key created or confirmed. Reference: #{key}. |
PIX_KEY_INVALID_KEY | Invalid pix key |
PIX_KEY_REQUIRED | The key must be informed when the type is 'random_key'. |
PIX_KEY_INVALID_TYPE | The type must be: 'tax_number', 'email', 'phone' or 'random_key.' |
PIX_KEY_CONFIRMATION_TYPE_INVALID | Code confirmation should only be performed for pix keys of type: 'email' or 'phone'. |
PIX_KEY_PENDING | Pix key not confirmed. Reference: #{id}. |
COLLECTING_DOCUMENT_NOT_SETTLED | Receipt document is not settled. Reference: #{id}. |
COLLECTING_DOCUMENT_WITHOUT_BALANCE | Return amount #{amount}, greater than the balance #{balance} of the receipt document. |
PAYMENT_BRCODE_ALREADY_USED | Brcode #{id}, already has a linked document #{id}. |
PAYMENT_AMOUNT_ERROR | Payment amount #{amount} must be equal to the value of the brocode #{id}, value #{amount}. |
PAYMENT_ACCOUNT_WITHOUT_BALANCE | Insufficient balance to execute the payment. Current balance #{amount}. |
DICT_QUERY_LIMIT_REACHED | Query limit reached. Try again in 1 minute. |
DICT_KEY_NOT_FOUND | Pix key not found. Reference: {key}. |
DICT_BRCODE_NOT_FOUND | Brcode not found. Reference: {brcode}. |
VIRTUAL_TRANSFER_DIFFERENT_BANK_ACCOUNT | Bank account of source and destination virtual accounts are different. For virtual transfers they must be the same. |