Skip to content

Commit 84861a7

Browse files
author
Eren AKPINAR
committed
Add request example for products
1 parent c5041ff commit 84861a7

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

examples/Products.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
namespace Parasut\Examples;
4+
5+
use Parasut\Entity\Product\Request\CreateProduct;
6+
use Parasut\Entity\Product\Request\IndexProduct;
7+
use Parasut\Entity\Product\Response;
8+
9+
class Products
10+
{
11+
/**
12+
* @return Response\IndexProducts
13+
*/
14+
public function index()
15+
{
16+
$product = new IndexProduct();
17+
$product->setCode('code');
18+
19+
return $product->send();
20+
}
21+
22+
/**
23+
* @return Response\CreateProduct
24+
*/
25+
public function create()
26+
{
27+
$product = new CreateProduct();
28+
$product->setCode('A23B');
29+
$product->setName('Core');
30+
$product->setVatRate(18);
31+
$product->setUnit(1);
32+
$product->setCommunicationsTaxRate(1);
33+
$product->setArchived(false);
34+
$product->setListPrice(0);
35+
$product->setCurrency('TRL');
36+
$product->setBuyingPrice(0);
37+
$product->setBuyingCurrency('TRL');
38+
$product->setInventoryTracking(false);
39+
$product->setInitialStockCount(9000000);
40+
41+
return $product->send();
42+
}
43+
}

0 commit comments

Comments
 (0)