Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Panel Aukcji Allegro
S3baso
post
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 16.07.2010

Ostrzeżenie: (0%)
-----


PLIK: Pobierz_Aukcje.php wygląda tak:
  1. <?php
  2. $op['login'] = 'xxxx';
  3. $op['haslo'] = 'xxxx';
  4. $op['country_code'] = '1'; // dla allegro
  5. $op['webapi_key'] = 'xxxx';
  6.  
  7. require_once('./allegro.inc.php');
  8.  
  9. $all = new Allegro($op);
  10. $all -> getAuctionsFromAllegro(6);
  11. ?>


Witajcie, próbuję napisać własny panel aukcji allegro i napotkałem 1 problem a mianowicie gdy otwieram plik pobierz_aukcje.php wyskakuje mi taki error:
Kod
Fatal error: Call to undefined method Allegro::getAuctionsFromAllegro() in pobierz_aukcje.php on line 10


Prosiłbym o jak najszybszą pomoc (IMG:style_emoticons/default/smile.gif)




#EDIT
#phpion
hahaha OMG nie spojrzalem, ze klucz jest niepoprawny

Ten post edytował S3baso 19.07.2011, 10:31:26
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
S3baso
post
Post #2





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 16.07.2010

Ostrzeżenie: (0%)
-----


Jest to całkiem możliwe, że coś zwaliłem (IMG:style_emoticons/default/smile.gif)

Proszę ciebie bardzo:

Kod
<?php
class Allegro {
public function __construct($opcje=array())
{
foreach($opcje as $n=>$v) $this->$n=$v;
}
public function login()
{
  $this->soap = new SoapClient('http://webapi.allegro.pl/uploader.php?wsdl', array('encoding'=>'UTF-8'));
  $this->soap->soap_defencoding = 'UTF-8';
  $this->soap->decode_utf8 = false;

  $params = array(
   'sysvar' => 1, // 1 dla AllegroWebApi
   'country-id' => $this->country_code,
   'webapi-key' => $this->webapi_key
  );
  $result = $this->soap->__soapCall('doQuerySysStatus',$params);
  $this->local_version = $result['ver-key'];

  $msg = array(
   'user-login' => $this->login,
   'user-password' => $this->haslo,
   'country-code' => $this->country_code,
   'webapi-key' => $this->webapi_key,
   'local-version' => $this->local_version
  );

  $response = $this->soap->__call('doLogin', $msg);
  $this->session_handle_part= $response['session-handle-part'];
  $msg= array('country-id'=> $this->country_code, 'user-login'=>$this->login);
  $this->user_id= $this->soap->__call('doGetUserID', $msg);
return true;
}
    public function getAuctionsFromAllegro()
    {
$msg=array(
  'user-id' => $this->user_id,
  'webapi-key' => $this->webapi_key,
  'country-id' => $this->country_code,
  'offset' => $this->offset);
$allAuctions= $this->soap->__call('doGetUserItems', $msg);
   }

}
?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 03:41