This package offers an easy-to-use interface for integrating with Sicoob Pix API. With this package, you can get transaction information quickly and efficiently in your Flutter apps.
Explore the docs Β»
Report Bug
Β·
Request Feature
Table of Contents
This package offers an easy-to-use interface for integrating with Sicoob's Pix API. With this package, you can get transaction information quickly and efficiently in your Flutter apps.
- Key Pix registered with Sicoob
- Exclusive for legal entities
- Valid certificate issued by an external CAs complying with the international standard x.509
- Registration on the Sicoob Developers Portal
To install This package in your project you can follow the instructions below:
a) Add in your pubspec.yaml:
dependencies:
pix_sicoob: <last-version>b) or use:
dart pub add pix_sicoobThis package is ready for get transactions information quickly!
- First instantiate the class passing the appropriate parameters
- Second get the token
- Third fetch your Pix transactions quickly!
final pixSicoob = PixSicoob(
clientID:'CLIENT_ID',
certificateBase64String: 'X509_Parsed_TO_BASE64_STRING',
/*
This package offer a method to parses file certificate to base64 String
Method:
final certBase64String = pixSicoob.certFileToBase64String(
pkcs12CertificateFile: File('test/cert/cert.pfx'),
);
*/
certificatePassword: 'CERTIFICATE_PASSWORD',
);final token = await pixSicoob.getToken();final listPix = await pixSicoob.fetchTransactions(
token: token,
);
// Returns the transactions from the last 4 daysFor more examples, please refer to the Documentation
- β Authentication: Securely retrieve OAuth2 tokens from Sicoob.
- β Fetch Transactions: Retrieve Pix transactions within a specified date range.
- β Certificate Management: Easily convert X.509 certificates to Base64 strings.
final certBase64String = pixSicoob.certFileToBase64String(
pkcs12CertificateFile: File('test/cert/cert.pfx'));final token = await pixSicoob.getToken();- Default Time Range
final listPix = await pixSicoob.fetchTransactions(
token: token,
);
//Returns the last 4 days transactions- Custom Time Range
final listPix = await pixSicoob.fetchTransactions(
token: token,
dateTimeRange: DateTimeRange(
start: DateTime.now().subtract(Duration(days: 360)),
end: DateTime.now(),
);
);
//Returns the transactions of the specified date rangeThis package provides structured ways to map and handle different types of errors. Below are common error keys you might encounter:
- the-certificate-password-is-incorrect: The certificate password provided is incorrect.
- invalid-certificate-file: The provided certificate file is invalid.
- invalid-certificate-base64string: The certificate Base64 string is malformed or invalid.
- empty-certificate-password: The certificate password cannot be empty.
- empty-certificate-base64string: The certificate Base64 string cannot be empty.
- could-not-find-the-certificate-path: The system could not locate the certificate file at the specified path.
- client-id-cannot-be-empty: The Client ID must be provided.
- date-range-must-be-in-the-same-month: Filtering is restricted to within the same calendar month.
- Certificate Parsing Errors:
- Ensure your
.pfxor.p12certificate is valid and not expired. - Double-check the password; it must match the one set when the certificate was exported.
- Ensure your
- Connectivity Issues:
- Ensure your application has internet access and can reach
api.sicoob.com.br. - Verify that your Client ID is correctly registered on the Sicoob Developers Portal.
- Ensure your application has internet access and can reach
- Authentication Failures:
- Confirm that the certificate corresponds to the Client ID used.
- Ensure you are using the correct production or sandbox URLs (currently defaults to production).
π§ Contributing Guidelines - Currently being updated π§
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the appropriate tag. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Remember to include a tag, and to follow Conventional Commits and Semantic Versioning when uploading your commit and/or creating the issue.
Distributed under the MIT LICENSE.txt for more information.
Check the architecture used in the project ARCHITECTURE.md
Thank you to all the people who contributed to this project. Without you, this project would not be here today.
Built and maintained by AcxTech Sistemas.