socinal/php-kore

A PHP library to integrate any PHP project with Socinal

Installs: 154

Dependents: 0

Suggesters: 0

Security: 0

pkg:composer/socinal/php-kore

v0.0.8 2025-10-23 19:50 UTC

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:

NameTypeRequiredDescription
$privstringYesPrivate key to sign request body
$dronestringYesDrone ID generated and provided by Socinal
$environmentstringNoEnvironment 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:

NameTypeRequiredDefaultDescription
$startDatestringNoYesterday 00:00:00Initial date in ISO8601 string
$endDatestringNoToday 23:59:00End Date in ISO8601 string

Return: Type: array

Additional notes:

  • Throws an Exception if 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:

NameTypeRequiredDefaultDescription
$dataArrayYesArray with transaction ID

Return: Type: array

Additional notes:

  • Throws an Exception if 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:

NameTypeRequiredDescription
$privstringYesPrivate key to sign request body
$dronestringYesDrone ID generated and provided by Socinal
$environmentstringNoEnvironment 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:

NameTypeRequiredDefaultDescription
$dataarrayYesAn array with the data needed to generate the charge

Data:

KeyTypeRequiredDescriptionExample
amountintNoCharge amount or suggested amount10000 (R$100,00)
txidstringYesTransaction identifier"098765432111"
pix_keystringNoRecipient PIX Key"12345678911"
messagestringNoOptional message to payer"Mensagem ao usuário"

Return: Type: array

Additional notes:

  • Throws an Exception if 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:

NameTypeRequiredDefaultDescription
$dataarrayYesAn array with the data needed to generate the charge

Data:

KeyTypeRequiredDescriptionExample
amountintYesCharge amount or suggested amount10000 (R$100,00)
txidstringYesTransaction identifier"098765432111"
pix_keystringNoRecipient PIX Key"12345678911"

Return: Type: array

Additional notes:

  • Throws an Exception if 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:

NameTypeRequiredDescription
$privstringYesPrivate key to sign request body
$dronestringYesDrone ID generated and provided by Socinal
$environmentstringNoEnvironment 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:

NameTypeRequiredDefaultDescription
$dataarrayYesAn array with the data needed to generate the charge

Data:

KeyTypeRequiredDescriptionExample
amountintYesAmount to transfer10000 (R$100,00)
pix_keystringYesRecipient PIX Key"12345678911"
txidstringYesTransaction identifier"098765432111"

Return: Type: array

Additional notes:

  • Throws an Exception if 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:

NameTypeRequiredDescription
$privstringYesPrivate key to sign request body
$dronestringYesDrone ID generated and provided by Socinal
$environmentstringNoEnvironment to be used - Accept: PROD or DEV - Default: DEV

BankSlip Domain:

Fee Types:

TypeDescription
percentMonthly percentage
amountAmount per day (calendar days)
noneNo fee applied

Fine Types:

TypeDescription
percentPercentage over total amount
amountFixed 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:

NameTypeRequiredDefaultDescription
$dataarrayYesAn array with the data needed to generate the charge

Data:

KeyTypeRequiredDescriptionExample
due_datedateYesBank slip due date2025-03-15
limit_datedateYesBank slip limit date for payment2025-03-15
amountintegerYesBank slip amount1000 (R$10,00)
accountstringYesCompany's checking account12345-6
walletstringYesBank wallet number001
company_usestringYesInternal/Custom ID use1234567890
payer_namestringYesBank slip payer nameJohn Doe
payer_documentstringYesPayer brazilian document123456789011
payer_streetstringNoPayer address lineRua das Flores
payer_complementstringNoPayer address complementApt 123
payer_citystringNoPayer citySao Paulo
payer_statestringNoPayer state - Accept only Brazilian states in UF standartSP
payer_numberstringNoPayer address number1230
payer_zipcodestringNoPayer address zipcode11100010
reduction_amountintegerNoReduction amount0
fee_typestringYesType of fee applied to the charge - Accept: percent, amount or none - Domainpercent
fee_amountintegerNoRequired if fee_type is not equal to percent or amount10
our_numberstringNoBank slip number, if set as null, will generate a number automatically0009
fine_typestringNoType of fine applied to the charge - Accept: percent or amount - Domainpercent
fine_amountintegerNoRequired if fine_type is set1000
fine_datestringNoRequired if fine_type is set - Date from which the fine is charged2025-03-18
discount1_datedateNoRequired if discount1_amount is set - First discount limit date2025-03-10
discount1_amountintegerNoRequired if discount1_date is set - First discount fixed amount1000
discount2_datedateNoRequired if discount2_amount is set - Second discount limit date2025-03-12
discount2_amountintegerNoRequired if discount2_date is set - Second discount fixed amount1000
discount3_datedateNoRequired if discount3_amount is set - Third discount limit date2025-03-13
discount3_amountintegerNoRequired if discount3_date is set - Third discount fixed amount`1000
document_numberstringNoRecipient document number2187abvc
descriptionstringNoBank slip descriptionInvoice 4000 payment
final_recipient_namestringNoFinal recipient nameJane Doe LTDA
final_recipient_documentstringNoFinal recipient document1231213123
final_recipient_company_namestringNoFinal recipient company nameJane Doe Foods

Return: Type: array

Additional notes:

  • Throws an Exception if any requested data is missing or has invalid value.