Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?PHP
2
/**
3
 * Test-script for bug 4181
4
 *
5
 * $Id: bug4181.php,v 1.1 2005/06/05 13:28:39 schst Exp $
6
 *
7
 * @package     Services_Ebay
8
 * @subpackage  Tests
9
 * @author      Stephan Schmidt
10
 */
11
error_reporting(E_ALL);
12
require_once '../Ebay.php';
13
require_once '../examples/config-local.php';
14
 
15
$session = Services_Ebay::getSession($devId, $appId, $certId);
16
$session->setToken($token);
17
 
18
$session->setDebug(Services_Ebay_Session::DEBUG_PRINT);
19
 
20
$item = Services_Ebay::loadModel('Item', null, $session);
21
 
22
// set the item props
23
$item->AmEx = 1;
24
$item->BuyItNowPrice = 25.32;
25
$item->CashOnPickupAccepted = 1;
26
$item->Category = 2228;
27
$item->CheckoutDetailsSpecified = 1;
28
$item->CheckoutInstructions = 'This is  test of checkout Instructions';
29
$item->Counter = 1;
30
$item->Country = 'US';
31
$item->Currency = '$';
32
$item->Description = 'This book is awesome.';
33
$item->Duration = 10;
34
$item->InsuranceFee = 0.50;
35
$item->Location = 52556;
36
$item->MinimumBid = 1.50;
37
$item->Quantity = 1;
38
$item->ReservePrice = 5.30;
39
$item->ShippingType = 1;
40
$item->Title = 'Beggining CSS';
41
$item->Type = 1;
42
$item->setShipToLocations(array('US', 'UK', 'DE'));
43
$item->addShippingServiceOption(1, 1, 3, 1);
44
 
45
// add the item
46
try {
47
    $item->Add();
48
} catch (Exception $e) {
49
    echo "An exception has been thrown:<br />";
50
    echo $e;
51
    exit();
52
}
53
 
54
echo "<pre>";
55
echo "Checking for more errors\n";
56
foreach ($session->getErrors() as $error) {
57
	echo $error;
58
}
59
echo '</pre>';
60
 
61
echo '<pre>';
62
echo "Getting Item Properties:\n";
63
print_r($item->toArray());
64
echo '</pre>';
65
?>