PHP code example of codebuglab / laravel-like4card
1. Go to this page and download the library: Download codebuglab/laravel-like4card library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
codebuglab / laravel-like4card example snippets
'providers' => [
...
CodeBugLab\Like4Card\Like4CardServiceProvider::class,
];
[
'device_id' => env('LIKE4CARD_DEVICE_ID', null),
'email' => env('LIKE4CARD_EMAIL', null),
'password' => env('LIKE4CARD_PASSWORD', null),
'security_code' => env('LIKE4CARD_SECURITY_CODE', null),
'lang_id' => env('LIKE4CARD_LANG_ID', 1)
]
$response = Like4Card::balance();
$response = Like4Card::categories();
$product_ids = [1, 2, 3]; // cts($product_ids);
$category_id = 1;
$response = Like4Card::getProductsByCategoryId($category_id);
// all options are not => 1,
'orderType' => 'asc',
'from' => 1621327053,
'to' => 1623998253
];
$response = Like4Card::orders($options);
$order_id = 1;
$response = Like4Card::order($order_id);
$product_id = 1;
$local_id = 123; // the id from your local orders table
$response = Like4Card::createOrder($product_id, $local_id);
try {
$response = Like4Card::balance();
} catch (\CodeBugLab\Like4Card\Exceptions\WrongCredentialsException $ex) {
echo $ex->getMessage(); // "Incorrect Login - invalid email or password"
}
try {
$data = Like4Card::getProductsByCategoryId(1);
} catch (\CodeBugLab\Like4Card\Exceptions\ProductsNotFoundException $ex) {
echo $ex->getMessage(); // "No available products"
}