Easily integrate invoice4u library web services for Payments into any PHP project.
Invoice4u is an Israeli invoice API provider for generating and sending invoices programmatically. This component provides a wrapper class that interfaces with the invoice4u API and allows you to easily add invoicing capabilities to your ecommerce website.
Include the class in your PHP project, and instance and new Invoice object. Use the various methods to define the invoice properties:
$invoice=new Invoice(); $invoice->setUsername("Test@Username"); $invoice->setType(Invoice::INVOICE); $invoice->addProduct( array("id"=>"00000001", "desc"=>"Product 1 bla", "count"=>"5", "price"=>"1000") ); $invoice->setEmail("email@example.com"); $invoice->setSubject("Test - Invoice"); $invoice->setCompanyInfo("Test Company"); $invoic->send();
Please note: You need an email to send invoices to clients.
send() method returns a response / error code, as detailed below.
Code Value Meaning 100 Success completed successfully 101 UsernameInvalid attempted transaction with invalid username 102 CompanyCodeAlreadyExists attempted to create a company with an existing company code 103 CompanyCodeDoesNotExist company code does not exit 104 CompanyCodeInvalidFormat company code format is not numeric 105 DocumentInvalidSubject subject line is invalid 106 DocumentDoesNotExit document number was not found 107 SendEmailAborted e-mailing document failed 108 EmailInvalid invalid e-mail format 109 CultureInvalid invalid culture 110 KeyInvalid invalid key 111 AccountExpired account has expired 112 DocumentInvalidItemNumber multiple items in an invoice are in the wrong format 113 DocumentInvalidQuantity quantity format is not numeric 114 DocumentInvalidPrice price format is not numeric 116 DocumentDoesNotExistForSpecifiedCompany the specified document doesnt exist or is incompatible with the company code provided 117 CurrencyConversionServiceNotAvailable currency conversion service is out of service 118 InvalidItemCode unaccpetable item code 119 CurrencyInWrongFormat currency is not an integer 120 DocumentMissingItem quantity, price, description and code must match 121 DocumentInvalidDateFormatDDMMYY date format: DDMMYY 122 PaymentAmountDoesntMatchInvoice total receivables must be positive 123 DocumentAmountInvalid amount must be double 124 CashInvalidAmount amount must be double 125 CheckInvalidAmount amount must be double 126 CCInvalidAmount amount must be double 127 TransInvalidAmount amount must be double 128 CheckInvalidDateFormatDDMMYY date format: DDMMYY 129 CCInvalidDateFormatDDMMYY date format: DDMMYY 130 TransInvalidDateFormatDDMMYY date format: DDMMYY 131 PaymentTotalMustBeEqualToInvoiceTotal Payment total must be equal to invoice total 132 TaxRateInTheDocsIsNotEqual Tax rate in the docs is not equal 133 ClientCompanyNameAlreadyExists Client company name already exists 134 ClientTicketAlreadyExists Client ticket already exists