Download the PHP package codebuglab/laravel-like4card without Composer
On this page you can find all versions of the php package codebuglab/laravel-like4card. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codebuglab/laravel-like4card
More information about codebuglab/laravel-like4card
Files in codebuglab/laravel-like4card
Package laravel-like4card
Short Description Integrate Like4Card API with Laravel
License MIT
Homepage https://github.com/akhled/laravel-like4card
Informations about the package laravel-like4card
Laravel Like4Card
Integrate Like4Card api with Laravel.
Table of Contents
- Installation
- Config
- Available api methods
- Get merchant balance
- Categories
- Products by products ids
- Products by category
- Get all orders
- Get an order info
- Create new order
- API Exceptions
- Wrong credentials
- example
- Products not available
- example
- License
Installation
Require via composer
In config/app.php
file
Config
Add your info to .env
file
The config file looks like
Available api methods
Get merchant balance
Operation that help the merchant to get his balance and user Id.
$response
is an Object with the following parameters
Parameter | Description |
---|---|
response | 1 for success, 0 for failure |
userId | merchant account identifier |
balance | merchant account balance |
currency |
Categories
Operation to get all categories available for this merchant.
$response
is an Array with the following parameters
Parameter | Description |
---|---|
id | - |
categoryParentId | - |
categoryName | - |
amazonImage | - |
childs | Array of sub-categories with same parent category structure |
Products by products ids
There's an issue in API request param: This will only get the first ID
Operation to get all products available by an array of products identifiers.
$response
is an array. Each element is an object with the following parameters
When no products found:
$response
is astring
with error message
Parameter | Description |
---|---|
productId | - |
categoryId | - |
productName | - |
productImage | - |
productCurrency | - |
productPrice | that represents the product price including vat that the merchant paid for product |
productPriceWithoutVat | - |
sellPrice | that represents the price the customer pays for the product to the merchant. |
sellPriceWithoutVat | - |
available | determines if stock for this product is available or not. |
optionalFieldsExist | 1 optional fields required, 0 there are no required optional fields. |
productOptionalFields | array of optional fields where |
vatAmount | - |
vatPercentage | - |
Each optional field has
Parameter | Description |
---|---|
id | identifier of the optional field |
required | '1' means it's required, '0' means it's optional and not required |
defaultValue | default value for this field |
hint | placeholder for this field |
label | label displayed on top of this field on UI |
fieldTypeId | 1 plaintext ,7 email address, 10 phone number ,other number plaintext |
fieldCode | |
options | array of choices in case option is multi choice field |
Products by category
Operation to get all products available by category id.
$response
is an array. Each element is an object with the following parameters.
When no products found:
$response
is astring
with error message
Parameter | Description |
---|---|
productId | - |
categoryId | - |
productName | - |
productImage | - |
productCurrency | - |
productPrice | that represents the product price including vat that the merchant paid for product |
productPriceWithoutVat | - |
sellPrice | that represents the price the customer pays for the product to the merchant. |
sellPriceWithoutVat | - |
available | determines if stock for this product is available or not. |
optionalFieldsExist | 1 optional fields required, 0 there are no required optional fields. |
productOptionalFields | array of optional fields where |
vatAmount | - |
vatPercentage | - |
Each optional field has
Parameter | Description |
---|---|
id | identifier of the optional field |
required | '1' means it's required, '0' means it's optional and not required |
defaultValue | default value for this field |
hint | placeholder for this field |
label | label displayed on top of this field on UI |
fieldTypeId | 1 plaintext ,7 email address, 10 phone number ,other number plaintext |
fieldCode | |
options | array of choices in case option is multi choice field |
Get all orders
Operation to get all orders made by this merchant. This api can receive the following options:
Parameter | Description |
---|---|
page | page number(default is 1), where page size is fixed value of 100 order per page |
order_type | desc or asc, arranged by order create date orderCreateDate |
from | get all orders with create date bigger than this timestamp |
to | get all orders with create date less than this timestamp |
$response
is an Object with the following parameters
Parameter | Description |
---|---|
orderNumber | - |
orderFinalTotal | represent the price the merchant will pay for LikeCard for this order |
currencySymbol | - |
orderCreateDate | - |
orderCurrentStatus | - |
orderPaymentMethod | - |
Get an order info
Operation to get one order details by its id.
$response
is an Object with the following parameters
Parameter | Description |
---|---|
response | 1 for success, 0 for failure |
serials | array of objects, each object represent a purchased product details. |
each serial object has
Parameter | Description |
---|---|
serialCode | is the encrypted serial given to customer to be used |
serialNumber | is the card manufacturing No |
validTo | is the validation time for card |
Create new order
Operation to create new order. This api can receive the following parameters:
Parameter | Description |
---|---|
product_id | product identifier Required |
reference_id | merchant reference (Required and must be unique) |
quantity | always 1 |
$response
is an Object with the following parameters
Parameter | Description |
---|---|
response | 1 for success, 0 for failure |
API Exceptions
If the API response = 0, the service throws an exception. It could be one of the following exceptions
Wrong credentials
It been thrown if you enter wrong deviceId, username, password or securityCode.
example
Products not available
It's been thrown if no products found with given category id or products ids array
example
License
Laravel Like4Card is a free software distributed under the terms of the MIT license.