This document provides information on how to use the /api/notify endpoint in the SANDBOX environment for the Payments Service

🚧

This function is only available for SANDBOX environment

Endpoint: /api/notify

curl --request POST \
  --url https://paymentscert.alps.cl/justpay/api/notify/ \
  --data public_key=asdasdads333 \
  --data trans_id=8764684519 \
  --data signature=f6248bc2ffdea1c112d49a9a649db7a4995a65ff5f1a78940135c52578324f69
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://paymentscert.alps.cl/justpay/api/notify/",
  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=sdadad33d3&trans_id=8764684519&signature=f6248bc2ffdea1c112d49a9a649db7a4995a65ff5f1a78940135c52578324f69",
]);

$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/notify/"

payload = "public_key=asdas9898ad98a98sd&trans_id=8764684519&signature=f6248bc2ffdea1c112d49a9a649db7a4995a65ff5f1a78940135c52578324f69"
response = requests.request("POST", url, data=payload)

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

const options = {
  method: 'POST',
  url: 'https://paymentscert.alps.cl/justpay/api/notify/',
  form: {
    public_key: 'zyssglikvtltbd2se2hudwl50jjomil2uytp7tpvjtxyfdw469jagk8yvnex9jks',
    trans_id: '8764684519',
    signature: 'f6248bc2ffdea1c112d49a9a649db7a4995a65ff5f1a78940135c52578324f69'
  }
};

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

  console.log(body);
});

Mandatory Data

AttributeMandatoryData typeDescription
public_keyTrueString (255)Public key, unique value that identifies the commerce
trans_idTrueString (255)Merchant's transaction id
signatureTrueString (255)Signature hash256: Review signature calculation

Signature calculation

<?php
$public_key = 'asdasdads333';
$trans_id = 8764684519;

$request_chain = $public_key.$trans_id;
$signature = hash('sha256', $request_chain);

>?