Download the PHP package jafar-albadarneh/jofotara without Composer
On this page you can find all versions of the php package jafar-albadarneh/jofotara. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jafar-albadarneh/jofotara
More information about jafar-albadarneh/jofotara
Files in jafar-albadarneh/jofotara
Package jofotara
Short Description PHP SDK to integrate with the Jordanian E-Invoice Portal (Jofotara)
License MIT
Homepage https://github.com/jafar-albadarneh/jofotara
Informations about the package jofotara
JoFotara SDK - Jordan E-Invoice Integration
A powerful, developer-friendly PHP SDK for seamless integration with Jordan's electronic tax invoicing system (JoFotara). This package provides:
- ๐ Simple, Fluent API: Intuitive builder pattern for creating invoices
- โ Full UBL 2.1 Compliance: Generates valid XML according to Jordan Tax Authority standards
- ๐ Built-in Validation: Ensures all required fields and business rules are satisfied
- ๐ Multiple Invoice Types: Support for sales, income, credit invoices, and more
- ๐ณ Flexible Payment Methods: Handle both cash and receivable transactions
- ๐งฎ Automatic Calculations: Built-in tax and total calculations
๐ฆ Installation
๐ Quick Start
๐ Documentation
Invoice Types
The SDK supports all JoFotara invoice types:
Payment Methods
JoFotara supports two payment methods:
Tax Handling
The SDK supports various tax scenarios:
Response Handling
๐งช Testing
Important: JoFotara does not provide a sandbox environment. For testing:
- You need a registered entity with Jordan Tax Department
- Your entity must be registered for JoFotara
- Use past dates for test invoices
- Always issue credit invoices to reverse test transactions
Running Tests
๐ Security
Never commit your JoFotara credentials to version control. Use environment variables:
๐ License
The MIT License (MIT). Please see the License File for more information.
Basic Invoice Information
Seller Information
Buyer Information
Supplier Income Source
The supplier income source sequence (ุชุณูุณู ู ุตุฏุฑ ุงูุฏุฎู) is a required value that must be set for each invoice. This value is obtained from your JoFotara portal and represents your business's income source sequence number.
Important: The supplier income source sequence is mandatory and must be set before generating the invoice XML. You can find this value in the table where it shows your client ID and secret, under column "ุชุณูุณู ู ุตุฏุฑ ุงูุฏุฎู".
Example usage in a complete invoice:
The supplier income source sequence is used by the JoFotara system to:
- Track your business's income sources
- Validate invoice submissions
- Ensure proper tax reporting
Invoice Items and Tax Handling
Automatic Total Calculations
The SDK automatically calculates all invoice totals based on the items you add:
- Tax exclusive amount (before tax)
- Tax inclusive amount (after tax)
- Total discounts
- Total tax amount
- Final payable amount
Automatic calculations are applied once you call ->invoiceTotals()
. This method must be called after all items have been added.
For special cases, you can manually set totals:
Note: When manually setting totals, they must match the calculated values from the items, or an exception will be thrown to ensure data integrity.
API Communication
The send()
method handles the complete flow:
- XML generation and validation
- Base64 encoding
- API authentication
- Error handling
Validation
The SDK includes comprehensive validation to ensure your invoice meets JoFotara requirements:
- All required fields are present and properly formatted
- Date formats follow dd-mm-yyyy pattern
- Tax calculations are accurate and consistent
- Totals match line items
- Valid city codes and tax categories
Validation errors throw InvalidArgumentException
with descriptive messages to help you quickly identify and fix issues.
Development Testing
Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Jafar Albadarneh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of jofotara with dependencies
ext-curl Version *