Channel: 1

Provider: SafetyPay

Payment Method: APM

Available Currencies

NameCodeCountry
Chilean PesosCLPChile
Peruvian SolPENPeru
US DollarUSDPeru, Ecuador
Mexican pesoMXNMexico
Brazilian realBRLBrazil

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=1 \
  --data amount=1 \
  --data currency=CLP \
  --data trans_id=1 \
  --data time_expired=120 \
  --data url_ok=https://bit.ly/3S4I7iR \
  --data url_error=https://bit.ly/3S5aOwc \
  --data signature=607efda41de9dbeb16ce193048963f1f0a1b699e47351184d3aa5809c2553c5a
  --data 'shopper_information={"name_shopper": "Jon","last_name_Shopper": "Snow","type_doc_identi": "DNI","Num_doc_identi": "92738009","email": "[email protected]","country_code": "+56","Phone": "999763655"}'
<?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=1&amount=1&currency=CLP&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=607efda41de9dbeb16ce193048963f1f0a1b699e47351184d3aa5809c2553c5a&shopper_information=%7B%22name_shopper%22%3A%20%22Jon%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22type_doc_identi%22%3A%20%22DNI%22%2C%22Num_doc_identi%22%3A%20%2292738009%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%20%22country_code%22%3A%20%22%2B51%22%2C%20%22Phone%22%3A%20%22999763655%22%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=1&amount=1&currency=CLP&trans_id=1&time_expired=120&url_ok=https%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature=607efda41de9dbeb16ce193048963f1f0a1b699e47351184d3aa5809c2553c5a&shopper_information=%7B%22name_shopper%22%3A%20%22Jon%22%2C%22last_name_Shopper%22%3A%20%22Snow%22%2C%22type_doc_identi%22%3A%20%22DNI%22%2C%22Num_doc_identi%22%3A%20%2292738009%22%2C%22email%22%3A%20%22no-reply%40alps.cl%22%2C%20%22country_code%22%3A%20%22%2B51%22%2C%20%22Phone%22%3A%20%22999763655%22%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: '1',
  amount: '1',
  currency: 'CLP',
  trans_id: '1',
  time_expired: '120',
  url_ok: 'https://bit.ly/3S4I7iR',
  url_error: 'https://bit.ly/3S5aOwc',
  signature: '607efda41de9dbeb16ce193048963f1f0a1b699e47351184d3aa5809c2553c5a',
  shopper_information:'{"name_shopper": "Jon","last_name_Shopper": "Snow","type_doc_identi": "DNI","Num_doc_identi": "92738009","email": "[email protected]","country_code": "+56","Phone": "999763655"}'
}));
req.end();

Mandatory Data

AttributeMandatoryData typeDescription
public_keyTrueString (255)Public key, unique value that identifies the commerce
timeTrueDatetimeRequest data time
channelTrueIntegerPayment Channel
amountTrueDoubleThe amount of the transaction. Use 2 decimals.
currencyTrueString (3)Transaction currency code
trans_idTrueString (255)Transaction id
time_expiredTrueString (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_okTrueString (255)URL where shopper will be redirected from the online banking if payment was successful (Must be Https)
url_errorTrueString (255)URL where shopper will be redirected from the online banking if payment was wrong.(Must be Https)
signatureTrueString (255)Signature hash256: Review signature calculation
shopper_informationTrueJSON StringJSON String Data: Review JSON index & format
filter_byFalseString(40)Filter options by a comma separated list of bank's id(s): 8482, 9298

shopper_information JSON String format

📘

Field shopper_information must be send in string format (JSON encode).

'{"name_shopper": "Jon", "last_name_Shopper": "Snow", "type_doc_identi": "DNI", "Num_doc_identi": "92738009", "email": "[email protected]","country_code": "+56","Phone": "999763655"}'

The shopper_information field is a column corresponding to a json with the next keys:

ParameterMandatoryData TypeDescription
name_shopperTrueString (255)Shopper's name
last_name_ShopperTrueString (255)Shopper's last name
type_doc_identiTrueString (255)Identification document [RUT,DNI,CI, ID etc.]
Num_doc_identiTrueString (255)Identification document number
emailTrueString (255)Shopper's e-mail
country_codeTrueString (10)Country's phone code (Ex. +57)
PhoneTrueString (20)Shopper's phone number
CountryFalseString (3)Shopper's country code. (Ex. CHL)

Filters

Using the parameter filter_by you may filter to show only the desire banks. You may use a comma separated files with bank ids.

Get Bank ids

Create a GET request to /api/banks/safetypay to obtain all available bank ids by country

ParameterMandatoryData TypeDescription
channelTrueIntegerChannel number [1, 2]
countryTrueString (3)[CHL, PER, BRA, ECU, MEX]
public_keyTrueString (255)Public key, unique value that identifies the commerce

Request example

curl --request GET \
  --url 'https://paymentscert.alps.cl/justpay/api/banks/safetypay?channel=1&country=CHL&public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://paymentscert.alps.cl/justpay/api/banks/safetypay?channel=1&country=CHL&public_key=zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
import requests

url = "https://paymentscert.alps.cl/justpay/api/banks/safetypay"

querystring = {"channel":"1","country":"CHL","public_key":"zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks"}

response = requests.request("GET", url, params=querystring)

print(response.text)
const request = require('request');

const options = {
  method: 'GET',
  url: 'https://paymentscert.alps.cl/justpay/api/banks/safetypay',
  qs: {
    channel: '1',
    country: 'CHL',
    public_key: 'zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks'
  }
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

QR Codes

If you want to filter by PIX, Boleto, Cuotealo or QR to your available payment methods use the field filter_by as follow:

CountryMethodfilter_by
BRAPIX8439
BRABoleto Flash8382
BRABoleto Flash8366
PERCuotealo8391
PERQR (Yape, Plin, etc.)8502

Test Transactions

Simulate payments

Once the notification URL is configured, please follow the steps below to begin the tests.

  1. Create a Transaction: The first thing you need to do is create a transaction, you will be redirected to SafetyPay.
  2. Select the SafetyPay Test Bank Direct and click on the button: Ir a banca por internet to complete the transaction
  3. Log In: Enter the following credential and then log in:
    • username: test
    • password: test
  1. Confirm Payment: Click Confirm and then click on Close Online Bank.
  1. Check the transaction status: The transaction will be confirmed to merchant and receive the success webhook notification