File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
2+
23$ credentials = [
34 'account_number ' => 'XXXX ' ,
45 'account_user ' => 'XXX ' ,
Original file line number Diff line number Diff line change 11<?php
2+
23require 'vendor/autoload.php ' ;
3- require __DIR__ . '/credentials.php ' ;
4+ require __DIR__ . '/credentials.php ' ;
45
56$ filter = [];
67unset($ argv [0 ]);
Original file line number Diff line number Diff line change 11<?php
2- require __DIR__ .'/loader.php ' ;
2+
3+ require __DIR__ . '/loader.php ' ;
34
45$ client = new Tradebyte \Client (['credentials ' => $ credentials ]);
56$ messageHandler = $ client ->getMessageHandler ();
2930/*
3031 * download mode
3132 */
32- $ messageHandler ->downloadMessageList (__DIR__ . '/files/messages.xml ' , $ params );
33- $ messageList = $ messageHandler ->getMessageListFromFile (__DIR__ . '/files/messages.xml ' );
33+ $ messageHandler ->downloadMessageList (__DIR__ . '/files/messages.xml ' , $ params );
34+ $ messageList = $ messageHandler ->getMessageListFromFile (__DIR__ . '/files/messages.xml ' );
3435
3536foreach ($ messageList ->getMessages () as $ message ) {
3637 echo $ message ->getId ();
Original file line number Diff line number Diff line change 11<?php
2- require __DIR__ .'/loader.php ' ;
2+
3+ require __DIR__ . '/loader.php ' ;
34
45$ client = new Tradebyte \Client (['credentials ' => $ credentials ]);
56$ orderHandler = $ client ->getOrderHandler ();
2829/*
2930 * download mode
3031 */
31- $ orderHandler ->downloadOrderList (__DIR__ . '/files/orders.xml ' , $ filter );
32- $ orderList = $ orderHandler ->getOrderListFromFile (__DIR__ . '/files/orders.xml ' );
32+ $ orderHandler ->downloadOrderList (__DIR__ . '/files/orders.xml ' , $ filter );
33+ $ orderList = $ orderHandler ->getOrderListFromFile (__DIR__ . '/files/orders.xml ' );
3334
3435foreach ($ orderList ->getOrders () as $ order ) {
3536 echo $ order ->getId ();
Original file line number Diff line number Diff line change 11<?php
2- require __DIR__ .'/loader.php ' ;
2+
3+ require __DIR__ . '/loader.php ' ;
34
45$ client = new Tradebyte \Client (['credentials ' => $ credentials ]);
56$ productHandler = $ client ->getProductHandler ();
67
78if (isset ($ filter ['id ' ])) {
89 echo $ productHandler ->getProduct ($ filter ['id ' ], $ filter ['channel ' ])->getId ();
9- $ productHandler ->downloadProduct (__DIR__ .'/files/product_ ' .$ filter ['id ' ].'.xml ' , $ filter ['id ' ], $ filter ['channel ' ]);
10- echo $ productHandler ->getProductFromFile (__DIR__ .'/files/product_ ' .$ filter ['id ' ].'.xml ' )->getId ();
10+ $ productHandler ->downloadProduct (
11+ __DIR__ . '/files/product_ ' . $ filter ['id ' ] . '.xml ' ,
12+ $ filter ['id ' ],
13+ $ filter ['channel ' ]
14+ );
15+ echo $ productHandler ->getProductFromFile (__DIR__ . '/files/product_ ' . $ filter ['id ' ] . '.xml ' )->getId ();
1116} else {
1217 /*
1318 * on the fly mode
2429 /*
2530 * download mode
2631 */
27- $ productHandler ->downloadCatalog (__DIR__ . '/files/products.xml ' , ['channel ' => $ filter ['channel ' ]]);
28- $ catalog = $ productHandler ->getCatalogFromFile (__DIR__ . '/files/products.xml ' );
32+ $ productHandler ->downloadCatalog (__DIR__ . '/files/products.xml ' , ['channel ' => $ filter ['channel ' ]]);
33+ $ catalog = $ productHandler ->getCatalogFromFile (__DIR__ . '/files/products.xml ' );
2934 echo $ catalog ->getSupplierName ();
3035
3136 foreach ($ catalog ->getProducts () as $ product ) {
Original file line number Diff line number Diff line change 11<?php
2- require __DIR__ .'/loader.php ' ;
2+
3+ require __DIR__ . '/loader.php ' ;
34
45$ client = new Tradebyte \Client (['credentials ' => $ credentials ]);
56$ stockHandler = $ client ->getStockHandler ();
2021/*
2122 * download mode
2223 */
23- $ stockHandler ->downloadStockList (__DIR__ . '/files/stock.xml ' , $ params );
24- $ catalog = $ stockHandler ->getStockListFromFile (__DIR__ . '/files/stock.xml ' );
24+ $ stockHandler ->downloadStockList (__DIR__ . '/files/stock.xml ' , $ params );
25+ $ catalog = $ stockHandler ->getStockListFromFile (__DIR__ . '/files/stock.xml ' );
2526echo $ catalog ->getChangeDate ();
2627
2728foreach ($ catalog ->getStock () as $ stock ) {
Original file line number Diff line number Diff line change 11<?php
2- require __DIR__ .'/loader.php ' ;
2+
3+ require __DIR__ . '/loader.php ' ;
34
45$ client = new Tradebyte \Client (['credentials ' => $ credentials ]);
56$ uploadHandler = $ client ->getUploaderHandler ();
6- $ uploadHandler ->uploadFile (__DIR__ . '/files/upload.xml ' , 'test2.xml ' );
7+ $ uploadHandler ->uploadFile (__DIR__ . '/files/upload.xml ' , 'test2.xml ' );
You can’t perform that action at this time.
0 commit comments