ID: 27 - Wallet (PEN)

Channel: 27

Provider: BCP - Yape

Payment Method: Wallet

Available Currencies

NameCodeCountry
Peruvian PesosPENPeru

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="27"' \
--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' => '27','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': '27',
'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': '27',
    '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

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: 120 minutes
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

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:

ParameterMandatoryData TypeDescription
name_shopperTrueString (255)Shopper's name
last_name_ShopperTrueString (255)Shopper's last name
type_doc_identiTrueString (3)Identification document [CI, RUT, PAS, DNI]
Num_doc_identiTrueString (12)Identification document number
emailTrueString (255)Shopper's email
country_codeTrueString (4)Country's phone code [+51]
PhoneTrueString (12)Shopper's phone number
countryTrueString (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

AttributeMandatoryData typeDescription
direct_integrationTrueIntegerSend 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=27" \
     --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=27&amount=50&currency=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": "27",
                "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=27&amount=50&currency=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.yape.com.pe?XXXXXXXXXXXXXXXXXXX",
  "bcp_channel": "yape"
}

Errors

This payment integration only sends notifications for successfully completed transactions. This means that error messages will not be generated for failed transactions.