Download the PHP package kayon-ariel/pix-php without Composer
On this page you can find all versions of the php package kayon-ariel/pix-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kayon-ariel/pix-php
More information about kayon-ariel/pix-php
Files in kayon-ariel/pix-php
Package pix-php
Short Description Library to generate Static PIX codes in PHP
License MIT
Informations about the package pix-php
PixPhp
A PHP library to generate static PIX codes, facilitating online payments with PIX copy and paste.
Table of Contents
- Installation
- Usage
- Accepted Key Types
- Example Usage
Installation
You can install the library via Composer. Run the following command:
Usage
Step 1: Include the Autoloader
Once installed, include the Composer autoloader in your PHP script:
Step 2: Import the Namespace
Import the PixPhp namespace at the beginning of your PHP file:
Step 3: Generate a PIX Code
You can generate a PIX code using the generatePix method. Here's a basic example:
Accepted Key Types
In the PixPhp
library, the following types of keys are accepted for generating PIX codes:
-
CPF (Cadastro de Pessoas Físicas)
- Format:
123.456.789-09
- Description: A Brazilian individual taxpayer identification number. The library accepts CPF numbers with or without formatting.
- Format:
-
CNPJ (Cadastro Nacional da Pessoa Jurídica)
- Format:
12.345.678/0001-95
- Description: A Brazilian business taxpayer identification number. The library accepts CNPJ numbers with or without formatting.
- Format:
-
Email
- Format:
[email protected]
- Description: A valid email address. The library accepts well-formed email addresses as PIX keys.
- Format:
-
Phone
- Format:
+55 11 91234-5678
- Description: A Brazilian phone number including the country code. The library accepts phone numbers with various formatting styles, including spaces and dashes, while retaining the
+55
prefix.
- Format:
- Random Key
- Format:
617ef6be-e18e-427f-919b-6e43bae33400
- Description: The Pix random key is a 32-character alphanumeric code, randomly generated by the Central Bank to be linked to a single account.
- Format:
Example Usage
You can pass any of the accepted key types to the generatePix
method: