Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php |
2 | ||
3 | /** | |
4 | * Copyright (C) 2006 Google Inc. | |
5 | * | |
6 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
7 | * you may not use this file except in compliance with the License. | |
8 | * You may obtain a copy of the License at | |
9 | * | |
10 | * http://www.apache.org/licenses/LICENSE-2.0 | |
11 | * | |
12 | * Unless required by applicable law or agreed to in writing, software | |
13 | * distributed under the License is distributed on an "AS IS" BASIS, | |
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
15 | * See the License for the specific language governing permissions and | |
16 | * limitations under the License. | |
17 | */ | |
18 | ||
19 | /* This class is used to create items to be added to the shopping cart | |
20 | * Invoke a separate instance of this class for each item to be | |
21 | * added to the cart. | |
22 | * Required fields are the item name, description, quantity and price | |
23 | * The private-data and tax-selector for each item can be set in the | |
24 | * constructor call or using individual Set functions | |
25 | */ | |
26 | class GoogleItem { | |
27 | ||
28 | var $item_name; | |
29 | var $item_description; | |
30 | var $unit_price; | |
31 | var $currency; | |
32 | var $quantity; | |
33 | var $merchant_private_data; | |
34 | var $tax_table_selector; | |
35 | ||
36 | /** | |
37 | * @param $name | |
38 | * @param $desc | |
39 | * @param $qty | |
40 | * @param $price | |
41 | * @param string $money | |
42 | * @param string $private_data | |
43 | * @param string $tax_selector | |
44 | */ | |
45 | function GoogleItem($name, $desc, $qty, $price, $money = "USD", | |
46 | $private_data = "", $tax_selector = "" | |
47 | ) { | |
48 | $this->item_name = $name; | |
49 | $this->item_description = $desc; | |
50 | $this->unit_price = $price; | |
51 | $this->quantity = $qty; | |
52 | $this->currency = $money; | |
53 | $this->merchant_private_data = $private_data; | |
54 | $this->tax_table_selector = $tax_selector; | |
55 | } | |
56 | ||
57 | /** | |
58 | * @param $private_data | |
59 | */ | |
60 | function SetMerchantPrivateData($private_data) { | |
61 | $this->merchant_private_data = $private_data; | |
62 | } | |
63 | ||
64 | /** | |
65 | * @param $tax_selector | |
66 | */ | |
67 | function SetTaxTableSelector($tax_selector) { | |
68 | $this->tax_table_selector = $tax_selector; | |
69 | } | |
70 | } | |
71 |