socinal / php-kore
A PHP library to integrate any PHP project with Socinal
Requires
- phpseclib/phpseclib: ~3.0
This package is not auto-updated.
Last update: 2025-12-18 20:44:28 UTC
README
Index
Requirements
- PHP 7.0 or greater
Installation
Run in your project directory this command to install with composer:
composer require socinal/php-kore- Now everything is ready to use.
- If your project doesn't have "composer" installed, you can clone this repository and install by yourself on your project.
Class: Ledger
Description: Default class to use Kore's transactions, statements and balance functions.
How to Use:
$class = new \Socinal\PhpKore\Ring\Ledger($priv, $drone, $environment);
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
$priv | string | Yes | Private key to sign request body |
$drone | string | Yes | Drone ID generated and provided by Socinal |
$environment | string | No | Environment to be used - Accept: PROD or DEV - Default: DEV |
Function Get Statement: getStatement
Description: Returns account statement.
How to use:
$startDate = '2025-06-03T23:59:00+0000';
$endDate = '2025-08-03T14:00:00+0000';
$class = new \Socinal\PhpKore\Ring\Ledger($priv, $drone, 'DEV');
$class->getStatement($startDate, $endDate);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$startDate | string | No | Yesterday 00:00:00 | Initial date in ISO8601 string |
$endDate | string | No | Today 23:59:00 | End Date in ISO8601 string |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.
Function Get by TXID: getTxId
Description: Get a transaction data using TXID. This function accepts many TXIDs in an array, so you can get many transactions by once.
How to use:
$class = new \Socinal\PhpKore\Ring\Ledger($priv, $drone, 'DEV');
$class->getTxId(['123abc']);
OR
$class = new \Socinal\PhpKore\Ring\Ledger($priv, $drone, 'DEV');
$class->getTxId(['123abc','456def','789ghi','1000jkl']);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$data | Array | Yes | — | Array with transaction ID |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.
Class: Charges\Pix
Description: Default class to use Kore's Pix functions, used to generate charges.
How to Use:
$class = new \Socinal\PhpKore\Ring\Charges\Pix($priv, $drone, $environment);
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
$priv | string | Yes | Private key to sign request body |
$drone | string | Yes | Drone ID generated and provided by Socinal |
$environment | string | No | Environment to be used - Accept: PROD or DEV - Default: DEV |
Function Pix Static Charge: newPixChargeStatic
Description: Generates a Static PIX Charge with or without a predefined amount.
How to use:
$class = new \Socinal\PhpKore\Ring\Charges\Pix($priv, $drone, 'DEV');
$class->newPixChargeStatic($data);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$data | array | Yes | — | An array with the data needed to generate the charge |
Data:
| Key | Type | Required | Description | Example |
|---|---|---|---|---|
amount | int | No | Charge amount or suggested amount | 10000 (R$100,00) |
txid | string | Yes | Transaction identifier | "098765432111" |
pix_key | string | No | Recipient PIX Key | "12345678911" |
message | string | No | Optional message to payer | "Mensagem ao usuário" |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.
Function Pix Charge: newPixCharge
Description: Generates a PIX Charge.
How to use:
$class = new \Socinal\PhpKore\Ring\Charges\Pix($priv, $drone, 'DEV');
$class->newPixCharge($data);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$data | array | Yes | — | An array with the data needed to generate the charge |
Data:
| Key | Type | Required | Description | Example |
|---|---|---|---|---|
amount | int | Yes | Charge amount or suggested amount | 10000 (R$100,00) |
txid | string | Yes | Transaction identifier | "098765432111" |
pix_key | string | No | Recipient PIX Key | "12345678911" |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.
Class: Transactions\Pix
Description: Default class to use Kore's transaction Pix functions, used to transfer values to another pix key.
How to Use:
$class = new \Socinal\PhpKore\Ring\Transactions\Pix($priv, $drone, $environment);
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
$priv | string | Yes | Private key to sign request body |
$drone | string | Yes | Drone ID generated and provided by Socinal |
$environment | string | No | Environment to be used - Accept: PROD or DEV - Default: DEV |
Function Pix New Transfer: newTransfer
Description: Transfer values from your account to another using a Pix Key.
How to use:
$class = new \Socinal\PhpKore\Ring\Transactions\Pix($priv, $drone, 'DEV');
$class->newTransfer($data);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$data | array | Yes | — | An array with the data needed to generate the charge |
Data:
| Key | Type | Required | Description | Example |
|---|---|---|---|---|
amount | int | Yes | Amount to transfer | 10000 (R$100,00) |
pix_key | string | Yes | Recipient PIX Key | "12345678911" |
txid | string | Yes | Transaction identifier | "098765432111" |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.
Class: BankSlip
Description: Default class to use Kore's Bank Slip functions, used to manage bank slip charges.
How to Use:
$class = new \Socinal\PhpKore\Ring\Charges\BankSlip($priv, $drone, $environment);
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
$priv | string | Yes | Private key to sign request body |
$drone | string | Yes | Drone ID generated and provided by Socinal |
$environment | string | No | Environment to be used - Accept: PROD or DEV - Default: DEV |
BankSlip Domain:
Fee Types:
| Type | Description |
|---|---|
| percent | Monthly percentage |
| amount | Amount per day (calendar days) |
| none | No fee applied |
Fine Types:
| Type | Description |
|---|---|
| percent | Percentage over total amount |
| amount | Fixed amount |
Function BankSlip: new
Description: Generates a new Bank Slip.
How to use:
$class = new \Socinal\PhpKore\Ring\Charges\BankSlip($priv, $drone, 'DEV');
$class->new($data);
Parameters:
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
$data | array | Yes | — | An array with the data needed to generate the charge |
Data:
| Key | Type | Required | Description | Example |
|---|---|---|---|---|
due_date | date | Yes | Bank slip due date | 2025-03-15 |
limit_date | date | Yes | Bank slip limit date for payment | 2025-03-15 |
amount | integer | Yes | Bank slip amount | 1000 (R$10,00) |
account | string | Yes | Company's checking account | 12345-6 |
wallet | string | Yes | Bank wallet number | 001 |
company_use | string | Yes | Internal/Custom ID use | 1234567890 |
payer_name | string | Yes | Bank slip payer name | John Doe |
payer_document | string | Yes | Payer brazilian document | 123456789011 |
payer_street | string | No | Payer address line | Rua das Flores |
payer_complement | string | No | Payer address complement | Apt 123 |
payer_city | string | No | Payer city | Sao Paulo |
payer_state | string | No | Payer state - Accept only Brazilian states in UF standart | SP |
payer_number | string | No | Payer address number | 1230 |
payer_zipcode | string | No | Payer address zipcode | 11100010 |
reduction_amount | integer | No | Reduction amount | 0 |
fee_type | string | Yes | Type of fee applied to the charge - Accept: percent, amount or none - Domain | percent |
fee_amount | integer | No | Required if fee_type is not equal to percent or amount | 10 |
our_number | string | No | Bank slip number, if set as null, will generate a number automatically | 0009 |
fine_type | string | No | Type of fine applied to the charge - Accept: percent or amount - Domain | percent |
fine_amount | integer | No | Required if fine_type is set | 1000 |
fine_date | string | No | Required if fine_type is set - Date from which the fine is charged | 2025-03-18 |
discount1_date | date | No | Required if discount1_amount is set - First discount limit date | 2025-03-10 |
discount1_amount | integer | No | Required if discount1_date is set - First discount fixed amount | 1000 |
discount2_date | date | No | Required if discount2_amount is set - Second discount limit date | 2025-03-12 |
discount2_amount | integer | No | Required if discount2_date is set - Second discount fixed amount | 1000 |
discount3_date | date | No | Required if discount3_amount is set - Third discount limit date | 2025-03-13 |
discount3_amount | integer | No | Required if discount3_date is set - Third discount fixed amount | `1000 |
document_number | string | No | Recipient document number | 2187abvc |
description | string | No | Bank slip description | Invoice 4000 payment |
final_recipient_name | string | No | Final recipient name | Jane Doe LTDA |
final_recipient_document | string | No | Final recipient document | 1231213123 |
final_recipient_company_name | string | No | Final recipient company name | Jane Doe Foods |
Return:
Type: array
Additional notes:
- Throws an
Exceptionif any requested data is missing or has invalid value.