Jak zrozumieć Allegro (klasy etc)?

Chciałbym np. pobrać sobie funkcje MyBilling()

  1.  
  2. <?php
  3. header('Content-type: text/html; charset=utf-8');
  4. class AllegroWebAPI {
  5. protected $_instance;
  6. protected $_config;
  7. protected $_session;
  8. protected $_client;
  9. protected $_local_version;
  10. /* Określenie kraju (1 = Polska) */
  11. const COUNTRY_CODE = '1';
  12.  
  13. public function __construct() {
  14. $this->_config = array(
  15. 'allegro_id' => '1',
  16. 'allegro_key' => 'key',
  17. 'allegro_login' => 'login',
  18. 'allegro_password' => (base64_encode(hash('sha256', 'haslo', true)))
  19. );
  20. $this->_client = new SoapClient('https://webapi.allegro.pl/uploader.php?wsdl');
  21. }
  22.  
  23. public function QuerySysStatus($Component) {
  24. return $this->_client->doQuerySysStatus(
  25. $Component, self::COUNTRY_CODE, $this->_config['allegro_key']
  26. );
  27. }
  28.  
  29. public function LoginEnc() {
  30. $version = $this->QuerySysStatus(1);
  31. $this->_local_version = $version['ver-key'];
  32. //do
  33. $session = $this->_client->doLoginEnc(
  34. $this->_config['allegro_login'], $this->_config['allegro_password'], self::COUNTRY_CODE, $this->_config['allegro_key'], $version['ver-key']
  35. );
  36. $this->_session = $session;
  37. unset($this->_config['allegro_password']);
  38. }
  39.  
  40.  
  41. public function MyBilling() {
  42. return $this->_client->doMyBilling(
  43. self::COUNTRY_CODE
  44. );
  45. }
  46.  
  47. }
  48.  
  49. try {
  50. $allegro = new AllegroWebAPI();
  51. $allegro->LoginEnc();
  52.  
  53.  
  54.  
  55. echo "<pre>";
  56. print_r($allegro);
  57. echo "</pre>";
  58.  
  59. }catch(SoapFault $fault) {
  60. print($fault->faultstring);
  61. }
  62.  
  63. ?>


wyprintowałem sobie narazie $allegro: co daje nam:
  1. AllegroWebAPI Object
  2. (
  3. [_instance:protected] =>
  4. [_config:protected] => Array
  5. (
  6. [allegro_id] => 1
  7. [allegro_key] => XXXX
  8. [allegro_login] => XXX
  9. )
  10.  
  11. [_session:protected] => Array
  12. (
  13. [session-handle-part] => XXX
  14. [user-id] => XXXX
  15. [server-time] => XXX
  16. )
  17.  
  18. [_client:protected] => SoapClient Object
  19. (
  20. [_soap_version] => 1
  21. [sdl] => Resource id #1
  22. [httpsocket] => Resource id #2
  23. [_use_proxy] => 0
  24. [httpurl] => Resource id #4
  25. [_cookies] => Array
  26. (
  27. [ws2] => Array
  28. (
  29. [0] => XXX
  30. [1] => /
  31. [2] => .allegro.pl
  32. )
  33.  
  34. [ws3] => Array
  35. (
  36. [0] => XXX
  37. [1] => /
  38. [2] => .allegro.pl
  39. )
  40.  
  41. [ws4] => Array
  42. (
  43. [0] => x
  44. [1] => /
  45. [2] => .allegro.pl
  46. )
  47.  
  48. [QXLSESSID] => Array
  49. (
  50. [0] => XXX
  51. [1] => /
  52. [2] => .allegro.pl
  53. )
  54.  
  55. [qeppo_login2] => Array
  56. (
  57. [0] => XXX
  58. [1] => /
  59. [2] => .allegro.pl
  60. )
  61.  
  62. [QXLDATA] => Array
  63. (
  64. [0] =>XXX
  65. [1] => /
  66. [2] => .allegro.pl
  67. )
  68.  
  69. [qeppo_priv_cookie] => Array
  70. (
  71. [0] => XXX
  72. [1] => /
  73. [2] => .allegro.pl
  74. )
  75.  
  76. [_bS] => Array
  77. (
  78. [0] => 0
  79. [1] => /
  80. [2] => .allegro.pl
  81. )
  82.  
  83. )
  84.  
  85. )
  86.  
  87. [_local_version:protected] => XXX
  88. )


Dokumentacja Allegro pokazuje (http://allegro.pl/webapi/documentation.php/show/id,109):
  1. $domybilling_request = array(
  2. 'sessionHandle' => '22eb99326c6be29aa16d07d622bcfbcbee94ad54846f2f4e03_1'
  3. );


Nie rozumiem, też dlaczego tak jest:
  1. 'sessionHandle' => $allegro->sessionHandlePart


skoro jeśli printuje sobie $allegro to pokazuje session-handle-part

Zrobienie tak:
  1. $domybilling_request = array('sessionHandle' => $allegro->session-handle-part);
  2. echo "<pre>";
  3. print_r($domybilling_request);
  4. echo "</pre>";


daje nam:
  1.  
  2. Array
  3. (
  4. [sessionHandle] => 0
  5. )


nikt nie pomoże ?

czy powodem tego , że $allegro->session-handle-part daje nam 0 , może być to, że protected $_session; ?