boolxy / trendyol

Trendyol API Client Library for PHP
MIT License
35 stars 12 forks source link

Update GetProductsRequestBuilder.php #8

Closed Newturko closed 3 years ago

Newturko commented 3 years ago

Request final url sample before editing: "products?approved=$approved&barcode=$barcode&startDate=$startDate&endDate=$endDate&page=$page&dateQueryType=$dateQueryType&size=$size" These variables are not data, they are query parameters. Please check other builders. And not "dataQueryType", its "dateQueryType". You may want to change the class names.

After that request must like this:

$results = Trendyol::create($user, $pass, $supplier_id)
        ->productService()
        ->gettingProducts()
        ->dataQueryType(TrDataQueryType::create(TrDataQueryType::CREATED_DATE))
        ->barcode('')
        ->startDate()
        ->endDate()
        ->page(0)
        ->size(50)
        ->approved(true)
        ->get();

Your tests were successful. I think you missed out on the results, the answer always brought up 20 results with page 0 on your test.

By the way, thank you for sharing this project. Regards.

sezaiozarslan commented 3 years ago

Thanks Oktay.