Channel: 35
Provider: BCP
Payment Method: Bank transfer
Available Currencies
| Name | Code | Country |
|---|---|---|
| Peruvian Pesos | PEN | Peru |
Request example
curl --location 'https://uat-payments.alps.cl/justpay/check-out/SecurePayment' \
--form 'public_key="{YOUR_PUBLIC_KEY}"' \
--form 'time="2024-07-17 16:33:11"' \
--form 'amount="500"' \
--form 'currency="PEN"' \
--form 'trans_id="1"' \
--form 'time_expired="120"' \
--form 'url_ok="https://bit.ly/3S4I7iR"' \
--form 'url_error="https://bit.ly/3S4I7iR"' \
--form 'channel="35"' \
--form 'signature="{YOUR_SIGNATURE}"' \
--form 'shopper_information="{\"Phone\": \"999999999\", \"email\": \"[email protected]\", \"name_shopper\": \"Jon\", \"Num_doc_identi\": \"2341123458\", \"type_doc_identi\": \"PAS\", \"last_name_Shopper\": \"Snow\", \"country\":\"PER\", \"country_code\":\"+51\"}"'<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://uat-payments.alps.cl/justpay/check-out/SecurePayment',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('public_key' => '{YOUR_PUBLIC_KEY}','time' => '2024-07-17 16:33:11','amount' => '500','currency' => 'PEN','trans_id' => '1','time_expired' => '120','url_ok' => 'https://bit.ly/3S4I7iR','url_error' => 'https://bit.ly/3S4I7iR','channel' => '35','signature' => '{YOUR_SIGNATURE}','shopper_information' => '{"Phone": "999999999", "email": "[email protected]", "name_shopper": "Snow", "Num_doc_identi": "234145678", "type_doc_identi": "PAS", "last_name_Shopper": "Snow", "country":"PER", "country_code":"+51"}'),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "http://uat-payments.alps.cl/justpay/check-out/SecurePayment"
payload = {'public_key': '{YOUR_PUBLIC_KEY}',
'time': '2024-07-17 16:33:11',
'amount': '500',
'currency': 'PEN',
'trans_id': '1',
'time_expired': '120',
'url_ok': 'https://bit.ly/3S4I7iR',
'url_error': 'https://bit.ly/3S4I7iR',
'channel': '35',
'signature': '{YOUR_SIGNATURE}',
'shopper_information': '{"Phone": "999999999", "email": "[email protected]", "name_shopper": "Jon", "Num_doc_identi": "232345678", "type_doc_identi": "PAS", "last_name_Shopper": "Snow", "country":"PER", "country_code":"+51"}'}
files=[
]
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
var request = require('request');
var options = {
'method': 'POST',
'url': 'http://uat-payments.alps.cl/justpay/check-out/SecurePayment',
'headers': {
},
formData: {
'public_key': '{YOUR_PUBLIC_KEY}',
'time': '2024-07-17 16:33:11',
'amount': '500',
'currency': 'CLP',
'trans_id': '1',
'time_expired': '120',
'url_ok': 'https://bit.ly/3S4I7iR',
'url_error': 'https://bit.ly/3S4I7iR',
'channel': '35',
'signature': '{YOUR_SIGNATURE}',
'shopper_information': '{"Phone": "9999999", "email": "[email protected]", "name_shopper": "Jon", "Num_doc_identi": "23345678", "type_doc_identi": "PAS", "last_name_Shopper": "Snow", "country":"PER", "country_code":"+51"}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
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: 120 minutes |
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 format
Field shopper_information must be send in string format (JSON encode).
'{"name_shopper": "Test","last_name_Shopper": "User","type_doc_identi": "RUT","Num_doc_identi": "12345678901","email": "[email protected]", "country_code": "593","Phone": "123763456", "country": "MEX"}'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 [CI, RUT, PAS, DNI] |
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 [+51] |
Phone | True | String (12) | Shopper's phone number |
country | True | String (3) | Country ISO code [PER] |
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.
Additional fields for direct integration
| Attribute | Mandatory | Data type | Description |
|---|---|---|---|
direct_integration | True | Integer | Send 1 for direct integration |
Examples
## Create
# Create transaction on payments
curl -X "POST" "https://uat-payments.alps.cl/justpay/check-out/SecurePayment" \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode "public_key={YOUR_PUBLIC_KEY}" \
--data-urlencode "time=2023-10-27T13:22:50" \
--data-urlencode "channel=35" \
--data-urlencode "amount=50" \
--data-urlencode "currency=PEN" \
--data-urlencode "trans_id=04b73345" \
--data-urlencode "time_expired=1660" \
--data-urlencode "url_ok=http://bit.ly/3S4I7iR" \
--data-urlencode "url_error=https://bit.ly/3S5aOwc" \
--data-urlencode "signature={YOUR_SIGNATURE}" \
--data-urlencode "shopper_information={\"name_shopper\": \"Jon\",\"last_name_Shopper\": \"Snow\", \"type_doc_identi\": \"PAS\", \"Num_doc_identi\": \"92738009\", \"email\": \"[email protected]\", \"country_code\":\"51\" , \"Phone\": \"999999999\", \"country\":\"PER\"}" \
--data-urlencode "direct_integration=1"
<?php
// Include Guzzle. If using Composer:
// require 'vendor/autoload.php';
use GuzzleHttp\Pool;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
$client = new Client();
$request = new Request(
"POST",
"https://uat-payments.alps.cl/justpay/check-out/SecurePayment",
[
"Content-Type" => "application/x-www-form-urlencoded; charset=utf-8"
],
"public_key={YOUR_PUBLIC_KEY}&time=2023-10-27T13%3A22%3A50&channel=35&amount=50¤cy=PEN&trans_id=04b73345&time_expired=1660&url_ok=http%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature={YOUR_SIGNATURE}&shopper_information=%7B%22name_shopper%22%3A+%22Jon%22%2C%22last_name_Shopper%22%3A+%22Snow%22%2C+%22type_doc_identi%22%3A+%22PAS%22%2C+%22Num_doc_identi%22%3A+%2292738009%22%2C+%22email%22%3A+%22no-reply%40alps.cl%22%2C+%22country_code%22%3A%22593%22+%2C+%22Phone%22%3A+%22999999999%22%2C+%22country%22%3A%22PER%22%7D&direct_integration=1");
$response = $client->send($request);
echo "Response HTTP : " . $response->getStatusCode() . "
";# Install the Python Requests library:
# `pip install requests`
import requests
def send_request():
# Create
# POST https://uat-payments.alps.cl/justpay/check-out/SecurePayment
try:
response = requests.post(
url="https://uat-payments.alps.cl/justpay/check-out/SecurePayment",
headers={
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
},
data={
"public_key": "{YOUR_PUBLIC_KEY}",
"time": "2023-10-27T13:22:50",
"channel": "35",
"amount": "50",
"currency": "PEN",
"trans_id": "04b73345",
"time_expired": "1660",
"url_ok": "http://bit.ly/3S4I7iR",
"url_error": "https://bit.ly/3S5aOwc",
"signature": "{YOUR_SIGNATURE}",
"shopper_information": "{\"name_shopper\": \"Jon\",\"last_name_Shopper\": \"Snow\", \"type_doc_identi\": \"PAS\", \"Num_doc_identi\": \"92738009\", \"email\": \"[email protected]\", \"country_code\":\"+51\" , \"Phone\": \"999999999\", \"country\":\"PER\"}",
"direct_integration": "1",
},
)
print('Response HTTP Status Code: {status_code}'.format(
status_code=response.status_code))
print('Response HTTP Response Body: {content}'.format(
content=response.content))
except requests.exceptions.RequestException:
print('HTTP Request failed')
// request Create
(function(callback) {
'use strict';
const httpTransport = require('https');
const responseEncoding = 'utf8';
const httpOptions = {
hostname: 'uat-payments.alps.cl',
port: '443',
path: '/justpay/check-out/SecurePayment',
method: 'POST',
headers: {"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"}
};
httpOptions.headers['User-Agent'] = 'node ' + process.version;
// Paw Store Cookies option is not supported
const request = httpTransport.request(httpOptions, (res) => {
let responseBufs = [];
let responseStr = '';
res.on('data', (chunk) => {
if (Buffer.isBuffer(chunk)) {
responseBufs.push(chunk);
}
else {
responseStr = responseStr + chunk;
}
}).on('end', () => {
responseStr = responseBufs.length > 0 ?
Buffer.concat(responseBufs).toString(responseEncoding) : responseStr;
callback(null, res.statusCode, res.headers, responseStr);
});
})
.setTimeout(0)
.on('error', (error) => {
callback(error);
});
request.write("public_key={YOUR_PUBLIC_KEY}&time=2023-10-27T13%3A22%3A50&channel=35&amount=50¤cy=PEN&trans_id=04b73345&time_expired=1660&url_ok=http%3A%2F%2Fbit.ly%2F3S4I7iR&url_error=https%3A%2F%2Fbit.ly%2F3S5aOwc&signature={YOUR_SIGNATURE}&shopper_information=%7B%22name_shopper%22%3A+%22Jon%22%2C%22last_name_Shopper%22%3A+%22Snow%22%2C+%22type_doc_identi%22%3A+%22PAS%22%2C+%22Num_doc_identi%22%3A+%2292738009%22%2C+%22email%22%3A+%22no-reply%40alps.cl%22%2C+%22country_code%22%3A%2251%22+%2C+%22Phone%22%3A+%22999999999%22%2C+%22country%22%3A%22PER%22%7D&direct_integration=1")
request.end();
})((error, statusCode, headers, body) => {
console.log('ERROR:', error);
console.log('STATUS:', statusCode);
console.log('HEADERS:', JSON.stringify(headers));
console.log('BODY:', body);
});
Response
Response from direct integration is a JSON with QR image encoded in base64
{
"consumer_code": "12345678",
"deeplink_url": "https://www.viabcp.com/?XXXXXXXXXXXXXXXXXXX",
"bcp_channel": "bancamovil"
}Checkout Experience by Device
The payment process adapts to your device to ensure a smooth transaction:
-
Mobile Devices
* Tapping Pay will automatically redirect you to the BCP bank app/website. -
Desktop or Laptops
* Requires a manual step: after initiating the payment, please follow the on-screen instructions displayed on the page to complete the process.
Errors
This payment integration only sends notifications for successfully completed transactions. This means that error messages will not be generated for failed transactions.
