Functional examples of all billing services offered in the Gerencianet's API

Seeking to offer a way for customers and integrators to visualize in practice how our charges are issued, we offer several ready examples of integration with the Gerencianet APIs that demonstrate the boleto/Bolix, carnê modality , credit card, Pix, subscriptions (recurring billing), payment link and marketplace (split payment), thus being able to have an experience with our services before going into development.



alt text

In addition to the possibility of running these tests, we make all the codes used in these examples available for download. It is worth mentioning that, in these examples, the PHP SDK was used to integrate with the APIs.


Run examples

To run these examples in your environment you need create a Gerencianet account and create an application to get the credentials.



important

After downloading these examples, don't forget to insert your credentials in the credentials.json file, being the Client_Id and Client_Secret according to the environment used (Approval or production), in addition to remembering that the parameter sandbox is boolean and has 2 possible values, according to the environment, being: sandbox => true is equivalent to the Homologation environment and sandbox => false is equivalent to the production environment.

To use the Pix example, you must also inform the ./certs/ directory in the credentials.json file, in the pix_cert attribute, adding the name of your certificate in .pem format. Here you can find tips for generate your certificate and convert it .p12 to .pem. It is also necessary, in the file ./pix/emitar_pix.php, in the variable $body insert your key pix registered in the Gestornet in the parameter "chave" => "".

For examples involving the issuance of a credit card to work, you must enter your Account Identifier (?) in line 1 of the script contained in the file ./assets/js/payment-token.js. This script is used to obtain the payment_token. It is important to emphasize that this code is specific according to the environment used (production or approval). See this link how to correctly obtain your payment_token.

As this is a merely illustrative and educational example, it is necessary that you adapt it to your needs. We are not responsible for using this example without the necessary adjustments for your production environment.