Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?PHP
2
/**
3
 * Model for an eBay order
4
 *
5
 * @package Services_Ebay
6
 * @author  Stephan Schmidt <schst@php.net>
7
 */
8
class Services_Ebay_Model_Order extends Services_Ebay_Model
9
{
10
   /**
11
    * create a new order
12
    *
13
    * @param    array
14
    * @param    object
15
    */
16
    public function __construct($props, $session = null)
17
    {
18
        parent::__construct($props, $session);
19
        $this->properties['Transactions'] = array('Transaction' => array());
20
        $this->properties['ShippingServiceOptions'] = array('ShippingServiceOption' => array());
21
        $this->properties['PaymentTerms'] = array();
22
    }
23
 
24
   /**
25
    * add a new transaction
26
    *
27
    * @param    string
28
    * @param    string
29
    */
30
    public function AddTransaction($ItemId, $TransactionId)
31
    {
32
        $Transaction = array(
33
                            'ItemId' => $ItemId,
34
                            'TransactionId' => $TransactionId
35
                            );
36
 
37
        array_push($this->properties['Transactions']['Transaction'], $Transaction);
38
    }
39
 
40
   /**
41
    * add a new shipping option
42
    *
43
    * @param    string
44
    * @param    string
45
    */
46
    public function AddShippingServiceOption($ShippingService, $ShippingServiceCost, $ShippingServicePriority)
47
    {
48
        $Option = array(
49
                            'ShippingService'         => $ShippingService,
50
                            'ShippingServiceCost'     => $ShippingServiceCost,
51
                            'ShippingServicePriority' => $ShippingServicePriority
52
                            );
53
 
54
        array_push($this->properties['ShippingServiceOptions']['ShippingServiceOption'], $Option);
55
    }
56
 
57
   /**
58
    * set the accepted payment terms
59
    *
60
    * @param    string
61
    */
62
    public function AcceptPaymentTerms($methods)
63
    {
64
        $methods = func_get_args();
65
        foreach ($methods as $method) {
66
        	$this->properties['PaymentTerms'][$method] = 1;
67
        }
68
    }
69
 
70
}
71
?>