1. Go to this page and download the library: Download hasan-22/tapin 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/ */
$shopId = "fc45949a-921d-4b4f-1ade-ab5180f7dcve";
$title = "My first product";
$price = 250000; // It should be 'rial'
$weight = 500; // It should be 'gram'
$categoryId = "3d65e6eb-ca0d-47b3-9934-6295a355872f";
$description = ''; // It is not
$shopId = "fc45949a-921d-4b4f-1ade-ab5180f7dcve";
$productId = 322;
$title = "update...";
$price = 200000; // It should be 'rial'
$weight = 550; // It should be 'gram'
$categoryId = "3d65e6eb-ca0d-47b3-9934-6295a355872f";
$description = ''; // It is not
$shopId = "fc45949a-921d-4b4f-1ade-ab5180f7dcve";
// نمونه محصولات (دقت کنید این لیست آرایه از آرایه ها میباشد)
$products = [
[
"count" => 1,
"discount" => 0,
"price" => 5000, // It should be `rial`
"title" => "my product title",
"weight" =>500, // It should be `grams` not `kilograms`
"product_id" => null
]
];
$address = "تهیران ...";
$provinceCode = 1;
$cityCode = 1;
$employeeCode='-1';
$firstName='Hasan';
$lastName="Bahrami";
$mobile="09168963472";
$postalCode="1111111111";
$payType=1;
$orderType=1;
$packageWeight=900; // It should be `grams` not `kilograms`
// This is optional
$kiosk=[
"kiosk_id"=>101,
"height"=>101,
"width"=>101,
"length"=>101,
"turning"=>true
];
// This is optional
$email="[email protected]";
// This is optional
$phone="02111111111";
// This is optional
$description="سفارش شکستنی است لطفا در ارسال آن بیشتر دقت کنید";
$response = \Tapin\Tapin::priceInquiry($shopId, $products, $address, $provinceCode, $cityCode, $employeeCode, $firstName, $lastName, $mobile, $postalCode, $payType, $orderType, $packageWeight, $kiosk, $email, $phone, $description);
$shopId = "fc45949a-921d-4b4f-1ade-ab5180f7dcve";
// نمونه محصولات (دقت کنید این لیست آرایه از آرایه ها میباشد)
$products = [
[
"count" => 1,
"discount" => 0,
"price" => 5000, // It should be `rial`
"title" => "my product title",
"weight" =>500, // It should be `grams` not `kilograms`
"product_id" => null // This must be null
]
];
$address = "تهیران ...";
$provinceCode = 1;
$cityCode = 1;
$firstName='Hasan';
$lastName="Bahrami";
$mobile="09168963472";
$postalCode="1111111111";
$payType=1;
$orderType=1;
$packageWeight=900; // It should be `grams` not `kilograms`
$presenterCode=999;
$manualId=1;
$contentType=1;
// It is set to `0` by default
$registerType=0;
// It is set to `-1` by default
$employeeCode='-1';
// This is optional
$kiosk=[
"kiosk_id"=>101,
"height"=>101,
"width"=>101,
"length"=>101,
"turning"=>true
];
// This is optional
$insuranceId=null,
// This is optional
$email="[email protected]";
// This is optional
$phone="02111111111";
// This is optional
$description="سفارش شکستنی است لطفا در ارسال آن بیشتر دقت کنید";
$response = \Tapin\Tapin::createOrder(
$shopId,
$products,
$address,
$provinceCode,
$cityCode,
$firstName,
$lastName,
$mobile,
$postalCode,
$payType,
$orderType,
$packageWeight,
$presenterCode,
$manualId,
$contentType,
$registerType,
$employeeCode,
$kiosk,
$insuranceId,
$email,
$phone,
$description
);
$shopId = "fc45949a-921d-4b4f-1ade-ab5180f7dcve";
$orders = [
[
"address"=> "tehran-...",
"city_code"=> "1",
"province_code"=> "1",
"first_name"=> "hasan",
"last_name"=> "bahrami",
"mobile"=> "09168963472",
"postal_code"=> "1313131313",
"pay_type"=> "1",
"order_type"=> "1",
"package_weight"=> 10,
"presenter_code"=>999,
"content_type"=>1,
"register_type"=> 0, // It is set to `0` by default
"employee_code"=> "-1", // It is set to `-1` by default
"insurance_id"=>null, // This is optional
"description"=> null, // This is optional
"email"=> null, // This is optional
"phone"=> null, // This is optional
// Products must be an array of arrays
"products"=> [
[
"count"=> 1,
"discount"=> 0,
"price"=> 5000,
"title"=> "my product title",
"weight"=> 500,
"product_id"=> null // This must be null
]
]
]
];
$response = \Tapin\Tapin::createBatchOfOrders($shopId, $orders);