PHP library
The library requires data in utf-8. For example, if you have data in windows-1250, you need to convert it to utf-8 before passing to the library, e.g., using iconv.
For a description of how to install the library, visit the e-shop administration integration section.
class Address
Address::__construct (name, street, city, zipcode, country, phone_number)
| Argument | type |
|---|---|
| name | string |
| street | string |
| city | string |
| zipcode | string |
| country | string |
| phone_number | string |
class Customer
Customer::__construct (email, [name], [facebook_id], [company_id], [vat_id])
| Argument | type |
|---|---|
| string | |
| name | string |
| facebook_id | string |
| company_id | string |
| vat_id | string |
class Invoice
Invoice::__construct (twisto, invoice_id)
| Argument | type |
|---|---|
| twisto | Twisto |
| invoice_id | string |
Invoice::get ()
Fetch invoice data from API
Invoice::cancel ()
Perform cancel invoice API request
Invoice::activate ()
Perform activate invoice API request
Invoice::save ()
Save invoice items
Invoice::create (twisto, transaction_id, [eshop_invoice_id])
Create new invoice using transaction_id from check
| Argument | type |
|---|---|
| twisto | Twisto |
| transaction_id | string |
| eshop_invoice_id | string |
Invoice::returnItems (items, [discounts])
Perform invoice return API request
| Argument | type |
|---|---|
| items | ItemReturn[] |
| discounts | ItemDiscountReturn[] |
Invoice::returnAll ()
Perform invoice return all API request
Invoice::refund (amount)
Performs invoice refund API request
| Argument | type |
|---|---|
| amount | float |
Invoice::splitItems (items)
Request for Invoice API split. Returns new Invoice object.
| Argument | type |
|---|---|
| items | ItemSplit[] |
class Item
Item::__construct (type, name, product_id, quantity, price_vat, vat, [ean_code], [isbn_code], [issn_code], [heureka_category])
| Argument | type |
|---|---|
| type | int |
| name | string |
| product_id | string |
| quantity | int |
| price_vat | float |
| vat | float |
| ean_code | string |
| isbn_code | string |
| issn_code | string |
| heureka_category | int |
class Order
Order::__construct (date_created, billing_address, delivery_address, total_price_vat, items)
| Argument | type |
|---|---|
| date_created | DateTime |
| billing_address | BaseAddress |
| delivery_address | BaseAddress |
| total_price_vat | float |
| items | Item[] |
class Twisto
Twisto::Twisto ([public_key])
| Argument | type |
|---|---|
| public_key | string |
Twisto::setSecretKey (key)
| Argument | type |
|---|---|
| key | string |
Twisto::setPublicKey (key)
| Argument | type |
|---|---|
| key | string |
Twisto::setApiUrl (api_url)
| Argument | type |
|---|---|
| api_url | string |
Twisto::requestJson (method, url, [data])
Perform API request and decode response JSON
| Argument | type |
|---|---|
| method | string |
| url | string |
| data | array |
Twisto::request (method, url, [data])
Perform API request
| Argument | type |
|---|---|
| method | string |
| url | string |
| data | array |
Twisto::getCheckPayload (customer, order, previous_orders)
Create check payload
| Argument | type |
|---|---|
| customer | Customer |
| order | Order |
| previous_orders | Order[] |