1. Go to this page and download the library: Download culqi/culqi-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
culqi / culqi-php example snippets
// Cargamos Requests y Culqi PHP
de_once dirname(__FILE__).'/libraries/culqi-php/lib/culqi.php';
// Configurar tu API Key y autenticación
$PUBLIC_KEY = "{PUBLIC KEY}";
$SECRET_KEY = "{SECRET KEY}";
$culqi = new Culqi\Culqi(array('api_key' => $SECRET_KEY));
$encryption_params = array(
"rsa_public_key" => "la llave pública RSA",
"rsa_id" => "el id de tu llave"
);
$req_body = array(
"card_number" => "4111111111111111",
"cvv" => "123",
"email" => "culqi".uniqid()."@culqi.com", //email must not repeated
"expiration_month" => "7",
"expiration_year" => $futureDate,
"fingerprint" => uniqid(),
"metadata" => array("dni" => "71702935")
);
$token = $culqi->Tokens->create(
$req_body,
$encryption_params
);
$req_body = array(
"card_number" => "4111111111111111",
"cvv" => "123",
"email" => "culqi".uniqid()."@culqi.com", //email must not repeated
"expiration_month" => "7",
"expiration_year" => $futureDate,
"fingerprint" => uniqid(),
"metadata" => array("dni" => "71702935")
);
// Creando token a una tarjeta sin encriptar
$token = $culqi->Tokens->create(
$req_body
);
//Respuesta
print_r($charge);
bash
# Ejecutar el ejemplo de creación de planes
php examples/plan/02-create-plan.php
# Ejecutar el ejemplo de creación de suscripciones
php examples/subscription/01-create-subscription.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.