question

cooltronix avatar image
1 Like"
cooltronix asked ·

eBatNs: how to use the protected object data?

Sorry for this beginner question. I like to write a little app to monitor my selling and get the buyers details, address etc. eBatNs's *** sample_GetItemTransactions.php*** does exactly that, but the source file * EbatNs_Environment.php* has a protected object and I can't really use the output from: protected function dumpObject($data) { echo "
" . print_r($data, true) . "
"; } How can handle that protection to make use of the data?
PHPebatns
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

testaccount-intradesys avatar image
1 Like"
testaccount-intradesys answered ·
Hello cooltronix, you could use that if you inherited from the EbatNs_Environment class, but based on the file name * sample_GetItemTransactions.php* it looks as if you were using a quite old version of the SDK. So I'd like to suggest that you - Download an up to date SDK from [ https://sdk.intradesys.com/ebay_api_sdk_online_generator][1] - Select the "GetItemTransactions" call in our API playground at [ https://sdk.intradesys.com/ebay_api_sdk_test_tool][2] - Fill in (sample) form values for all the call parameters that you want to use in your code - Press the "Retrieve PHP code" button below the form That will give a piece of PHP code that you can use with the SDK downloaded earlier. To dump the result as shown in your code above, all you need to do is append the line print_r($response); at the end of the code piece that you retrieved from the Playground. Just let us know if you get stuck anywhere. Best, --Andreas [1]: https://sdk.intradesys.com/ebay_api_sdk_online_generator [2]: https://sdk.intradesys.com/ebay_api_sdk_test_tool
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

cooltronix avatar image
0 Likes"
cooltronix answered ·
Ich kam da leider nicht weiter und hab EBatNs aufgegeben. I use it just for myself anyway and do the few calls that I need just with PHP and XML. Once you get the first line returned from eBay it's quite easy.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

testaccount-intradesys avatar image
0 Likes"
testaccount-intradesys answered ·
Hi all, @templatesun : Glad you found a solution! One additional hint: If you use explicit getters, your IDE will be aware of the types that you're dealing with and thus be able to suppport you better with code completion etc: echo($response->GetItem()->GetCurrency()); @cooltronix : Working with the raw return XML is not very well supported, as the purpose of the SDK is to provide you with OO abstractions of the physical API interaction. You can, however, get access to the XML via loggers. Adding $logger = new EbatNs_Logger(true); $proxy->attachLogger($logger); before the actual API call will e.g. output the outgoing and incoming XML. If you need access to it, you could inherit from EbatNs_Logger and, say, return the XML from there. HTH, Andreas
· 1 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Andreas, thank You very much. :-) Matthias
0 Likes 0 · ·
templatesun avatar image
0 Likes"
templatesun answered ·
Sorry, it was so easy: echo $response->Item->Currency; Best regards... :-)
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

templatesun avatar image
0 Likes"
templatesun answered ·
@cooltronix @testaccount-intradesys Hallo, ich stehe vor dem gleichen Problem. Ich kann das Object mittels print_r lesen, aber wie greife ich auf die Werte zu, z.B. 'Currency'? Über eine eigene Funktion? Über InTradeSys? GetItemResponseType Object ( [Item:protected] => ItemType Object ( [ApplicationData:protected] => 651034.9.3011 [BuyerProtection:protected] => ItemEligible [BuyItNowPrice:protected] => AmountType Object ( [attributeValues] => Array ( [currencyID] => EUR ) [value:protected] => 0.0 ) [Country:protected] => DE [Currency:protected] => EUR ... Hi, I can read the object values with print_r, but how can I put this values, i.e. 'Currency' to an array? I heard, I should do that with Getters, but how is to use that? Best regards, Matthias
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

cooltronix avatar image
0 Likes"
cooltronix answered ·
Danke für das Feedback! I can get EXACTLY what I want from your website using **GetItemTransactionsRequestType** - output with all details in XML format. So I d/l the 903 trading SDK, however, print_r($response); gives me what I have now, a text output that is hard to access. How to do I get that nice XML that I get from your web app output and which would be very easy to work with?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.