login_and_pay_for_magento - Version 1.3.0

Version Notes

v1.3.0 Release
Enhancements:
- Automated Amazon key checking on save from admin page
- Fixed an issue in Asyncrhonous mode where orders wouldnt be updated if any previous orders had mutiple payment methods attached
- Added diagnostics tool to help support

Other Feature Additions:
- Added modman, composer.json support (see https://github.com/magento-hackathon/magento-composer-installer)
- Async cron job is more durable, will not exit on errors
- Better manual syncing on async orders when admin presses Sync With Amazon button
- Async capture bug
- Better messaging to buyer when existing customer account is found

Pull Requests Merged:
#134 Add modman, composer.json
#125 Update Amazon Login Account Merging Text
#120 Diagnostics
#119 Check for user_id in amazon profile data.
#117 Fixed Amazon Login after Amazon account e-mail change

Bug Fixes:
#122 Sandbox orders should be identifiable to a merchant
#116 Display Plugin Version in Config
#110 Disable Login with Amazon from customer account page if disabled product in cart
#107 Onepage checkout. Moving to Amazon logged in user persists checkout preview items
#106 Add key checking on save from payment configuration
#104 Order Review Block Issues on Some Sites
#103 Add Site Badge
#102 Add Badge to OnePage Payment Label

Download this release

Release Info

Developer Amazon Payments
Extension login_and_pay_for_magento
Version 1.3.0
Comparing to
See all releases


Code changes from version 1.2.2 to 1.3.0

Files changed (45) hide show
  1. app/code/community/Amazon/Diagnostics/Block/Adminhtml/System/Config/Form/Button.php +41 -0
  2. app/code/community/Amazon/Diagnostics/Block/Adminhtml/System/Config/Form/Textarea.php +24 -0
  3. app/code/community/Amazon/Diagnostics/Helper/Data.php +5 -0
  4. app/code/community/Amazon/Diagnostics/controllers/Adminhtml/DiagnosticsController.php +227 -0
  5. app/code/community/Amazon/Diagnostics/etc/adminhtml.xml +34 -0
  6. app/code/community/Amazon/Diagnostics/etc/config.xml +39 -0
  7. app/code/community/Amazon/Diagnostics/etc/system.xml +58 -0
  8. app/code/community/Amazon/Login/Model/Customer.php +9 -5
  9. app/code/community/Amazon/Payments/Block/Button.php +10 -0
  10. app/code/community/Amazon/Payments/Block/Form.php +9 -1
  11. app/code/community/Amazon/Payments/Block/Onepage/Widget.php +6 -0
  12. app/code/community/Amazon/Payments/Helper/Data.php +9 -2
  13. app/code/community/Amazon/Payments/Model/Async.php +80 -70
  14. app/code/community/Amazon/Payments/Model/Config.php +12 -0
  15. app/code/community/Amazon/Payments/Model/Observer/Onepage.php +1 -1
  16. app/code/community/Amazon/Payments/Model/PaymentMethod.php +7 -2
  17. app/code/community/Amazon/Payments/Model/System/Config/Backend/Enabled.php +49 -19
  18. app/code/community/Amazon/Payments/etc/config.xml +2 -1
  19. app/code/community/Amazon/Payments/etc/system.xml +11 -1
  20. app/design/adminhtml/default/default/template/amazon_payments/button.phtml +26 -0
  21. app/design/adminhtml/default/default/template/amazon_payments/textarea.phtml +13 -0
  22. app/design/frontend/base/default/layout/amazon_payments.xml +26 -2
  23. app/design/frontend/base/default/template/amazon_login/verify.phtml +2 -2
  24. app/design/frontend/base/default/template/amazon_payments/button_badge.phtml +20 -0
  25. app/design/frontend/base/default/template/amazon_payments/checkout.phtml +3 -3
  26. app/design/frontend/base/default/template/amazon_payments/mark.phtml +19 -0
  27. app/design/frontend/base/default/template/amazon_payments/onepage/widget.phtml +2 -0
  28. app/etc/modules/Amazon_Diagnostics.xml +17 -0
  29. lib/MarketplaceWebServiceSellers/Client.php +752 -0
  30. lib/MarketplaceWebServiceSellers/Exception.php +151 -0
  31. lib/MarketplaceWebServiceSellers/Interface.php +66 -0
  32. lib/MarketplaceWebServiceSellers/KeycheckClient.php +752 -0
  33. lib/MarketplaceWebServiceSellers/Model.php +445 -0
  34. lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsRequest.php +142 -0
  35. lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsResponse.php +223 -0
  36. lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsResult.php +190 -0
  37. lib/MarketplaceWebServiceSellers/Model/ListMarketplaces.php +112 -0
  38. lib/MarketplaceWebServiceSellers/Model/ListParticipations.php +112 -0
  39. lib/MarketplaceWebServiceSellers/Model/Marketplace.php +334 -0
  40. lib/MarketplaceWebServiceSellers/Model/Participation.php +189 -0
  41. lib/MarketplaceWebServiceSellers/Model/ResponseHeaderMetaData.php +89 -0
  42. lib/MarketplaceWebServiceSellers/Model/ResponseHeaderMetadata.php +89 -0
  43. lib/MarketplaceWebServiceSellers/Model/ResponseMetaData.php +94 -0
  44. lib/MarketplaceWebServiceSellers/Model/ResponseMetadata.php +94 -0
  45. package.xml +33 -12
app/code/community/Amazon/Diagnostics/Block/Adminhtml/System/Config/Form/Button.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amazon Diagnostics
5
+ *
6
+ * @category Amazon
7
+ * @package Amazon_Diagnostics
8
+ * @copyright Copyright (c) 2015 Amazon.com
9
+ * @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
10
+ */
11
+ class Amazon_Diagnostics_Block_Adminhtml_System_Config_Form_Button extends Mage_Adminhtml_Block_System_Config_Form_Field {
12
+
13
+ protected function _construct() {
14
+
15
+ parent::_construct();
16
+ $this->setTemplate('amazon_payments/button.phtml');
17
+ }
18
+
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
20
+
21
+ return $this->_toHtml();
22
+ }
23
+
24
+ public function getDiagnoseUrl() {
25
+
26
+ return Mage::helper('adminhtml')->getUrl('adminhtml/adminhtml_diagnostics/check');
27
+ }
28
+
29
+ public function getButtonHtml() {
30
+
31
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
32
+ ->setData(array(
33
+ 'id' => 'amazon_diagnose_button',
34
+ 'label' => $this->helper('adminhtml')->__('Run Diagnostics'),
35
+ 'onclick' => 'javascript:diagnose(); return false;'
36
+ ));
37
+
38
+ return $button->toHtml();
39
+ }
40
+
41
+ }
app/code/community/Amazon/Diagnostics/Block/Adminhtml/System/Config/Form/Textarea.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amazon Diagnostics
5
+ *
6
+ * @category Amazon
7
+ * @package Amazon_Diagnostics
8
+ * @copyright Copyright (c) 2015 Amazon.com
9
+ * @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
10
+ */
11
+ class Amazon_Diagnostics_Block_Adminhtml_System_Config_Form_Textarea extends Mage_Adminhtml_Block_System_Config_Form_Field {
12
+
13
+ protected function _construct() {
14
+
15
+ parent::_construct();
16
+ $this->setTemplate('amazon_payments/textarea.phtml');
17
+ }
18
+
19
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
20
+
21
+ return $this->_toHtml();
22
+ }
23
+
24
+ }
app/code/community/Amazon/Diagnostics/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+ class Amazon_Diagnostics_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ }
app/code/community/Amazon/Diagnostics/controllers/Adminhtml/DiagnosticsController.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Amazon Diagnostics
5
+ *
6
+ * @category Amazon
7
+ * @package Amazon_Diagnostics
8
+ * @copyright Copyright (c) 2015 Amazon.com
9
+ * @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
10
+ */
11
+ class Amazon_Diagnostics_Adminhtml_DiagnosticsController extends Mage_Adminhtml_Controller_Action {
12
+
13
+ private $_basepath = "";
14
+ private $_designpath = "";
15
+ private $_layoutpath = "";
16
+ private $_logpath = "";
17
+ private $_apppath = "";
18
+ private $_modules = array();
19
+ private $_logs = array();
20
+ private $_global_results = array();
21
+
22
+ public function checkAction() {
23
+
24
+ ini_set("auto_detect_line_endings", true);
25
+
26
+ $this->_basepath = Mage::getBaseDir('base');
27
+ $this->_apppath = Mage::getBaseDir('app');
28
+ $this->_designpath = Mage::getBaseDir('design');
29
+ $this->_logpath = Mage::getBaseDir('log');
30
+ $this->_layoutpath = $this->_designpath . "/frontend/base/default/layout";
31
+
32
+ /* do some diagnostics */
33
+ $this->getMagento();
34
+ $this->getPayments();
35
+ $this->getLogin();
36
+ $this->getModules();
37
+ $this->getLogs();
38
+
39
+ /* send the response */
40
+ Mage::app()->getResponse()->setBody(print_r($this->_global_results, true));
41
+ }
42
+
43
+ private function getMagento() {
44
+ $this->_global_results['magento']['version'] = Mage::getVersion();
45
+ $this->_global_results['magento']['edition'] = Mage::getEdition();
46
+ $this->_global_results['magento']['base_path'] = $this->_basepath;
47
+ $this->_global_results['magento']['secure_frontend'] = (Mage::getStoreConfig('web/secure/use_in_frontend') == 1 ? 'yes' : 'no');
48
+ $this->_global_results['magento']['store_name'] = Mage::getStoreConfig('general/store_information/name');
49
+ }
50
+
51
+ private function getPayments() {
52
+ $payments_secret_key = Mage::getStoreConfig('payment/amazon_payments/access_secret');
53
+ if (strlen($payments_secret_key) > 6) {
54
+ $payments_secret_key = substr($payments_secret_key, 0, 3) . "..." . substr($payments_secret_key, strlen($payments_secret_key - 3), 3);
55
+ }
56
+ $payments_seller_id = Mage::getStoreConfig('payment/amazon_payments/seller_id');
57
+ $payments_access_key = Mage::getStoreConfig('payment/amazon_payments/access_key');
58
+
59
+ /* get checkout page type, make it clear which one is being used */
60
+ $page_type = Mage::getStoreConfig('payment/amazon_payments/checkout_page');
61
+ switch ($page_type) {
62
+ case "amazon":
63
+ $page_type = "amazon standalone";
64
+ break;
65
+ case "onepage":
66
+ $page_type = "magento core onepage";
67
+ break;
68
+ }
69
+
70
+ $this->_global_results['payments']['enabled'] = (Mage::getStoreConfig('payment/amazon_payments/enabled') == 1 ? 'yes' : 'no');
71
+ $this->_global_results['payments']['seller_id'] = "'" . $payments_seller_id . "'";
72
+ if (preg_match('/\s/', $payments_seller_id)) {
73
+ $this->_global_results['payments']['seller_id'] .= " ** white space detected **";
74
+ }
75
+ $this->_global_results['payments']['access_key'] = "'" . $payments_access_key . "'";
76
+ if (preg_match('/\s/', $payments_access_key)) {
77
+ $this->_global_results['payments']['access_key'] .= " ** white space detected **";
78
+ }
79
+ $this->_global_results['payments']['secret_key'] = "'" . $payments_secret_key . "'";
80
+ if (preg_match('/\s/', $payments_secret_key)) {
81
+ $this->_global_results['secret_key'] .= "** white space detected **";
82
+ }
83
+ $this->_global_results['payments']['page_type'] = $page_type;
84
+ $this->_global_results['payments']['button_on_cart'] = (Mage::getStoreConfig('payment/amazon_payments/show_pay_cart') == 1 ? 'yes' : 'no');
85
+ $this->_global_results['payments']['action'] = Mage::getStoreConfig('payment/amazon_payments/payment_action');
86
+ $this->_global_results['payments']['secure_cart'] = (Mage::getSingleton('amazon_payments/config')->isSecureCart() == 1 ? 'yes' : 'no');
87
+ $this->_global_results['payments']['payment_option'] = (Mage::getStoreConfig('payment/amazon_payments/use_in_checkout') == 1 ? 'yes' : 'no');
88
+ $this->_global_results['payments']['async'] = (Mage::getStoreConfig('payment/amazon_payments/is_async') == 1 ? 'yes' : 'no');
89
+ $this->_global_results['payments']['sandbox'] = (Mage::getStoreConfig('payment/amazon_payments/sandbox') == 1 ? 'yes' : 'no');
90
+ }
91
+
92
+ private function getLogin() {
93
+ $login_client_id = Mage::getStoreConfig('amazon_login/settings/client_id');
94
+ $login_client_secret = Mage::getStoreConfig('amazon_login/settings/client_secret');
95
+ if (strlen($login_client_secret) > 6) {
96
+ $login_client_secret = substr($login_client_secret, 0, 3) . "..." . substr($login_client_secret, strlen($login_client_secret - 3), 3);
97
+ }
98
+
99
+ $this->_global_results['login']['enabled'] = (Mage::getStoreConfig('amazon_login/settings/enabled') == 1 ? 'yes' : 'no');
100
+ $this->_global_results['login']['button_type'] = Mage::getStoreConfig('amazon_login/settings/button_type');
101
+ $this->_global_results['login']['popup'] = (Mage::getStoreConfig('amazon_login/settings/popup') == 1 ? 'yes' : 'no');
102
+ $this->_global_results['login']['client_id'] = "'" . $login_client_id . "'";
103
+ if (preg_match('/\s/', $login_client_id)) {
104
+ $this->_global_results['login']['client_id'] = " ** white space detected **";
105
+ }
106
+ $this->_global_results['login']['client_secret'] = "'" . $login_client_secret . "'";
107
+ if (preg_match('/\s/', $login_client_secret)) {
108
+ $this->_global_results['login']['client_secret'] .= "** white space detected **";
109
+ }
110
+ }
111
+
112
+ private function getModules() {
113
+
114
+ $modules_folder = $this->_apppath . "/etc/modules";
115
+
116
+ try {
117
+ /* get list of modules */
118
+ if ($h = opendir($modules_folder)) {
119
+
120
+ /* loop through the modules */
121
+ while (false !== ($entry = readdir($h))) {
122
+
123
+ /* we don't want . and .. */
124
+ if ($entry !== "." && $entry !== "..") {
125
+
126
+ /* get file extension */
127
+ $ext = pathinfo($modules_folder . "/" . $entry, PATHINFO_EXTENSION);
128
+
129
+ /* make sure it's xml */
130
+ if ($ext == "xml") {
131
+
132
+ /* load the module xml */
133
+ $xml = simplexml_load_file($modules_folder . "/" . $entry);
134
+
135
+ /* convert xml to associative array */
136
+ $xml = json_encode($xml);
137
+ $xml = json_decode($xml, true);
138
+
139
+ foreach ($xml['modules'] as $k => $v) {
140
+
141
+ /* filter out core modules and */
142
+ if ($v['codePool'] !== 'core') {
143
+
144
+ /* get status */
145
+ $this->_modules[$k]['active'] = $v['active'];
146
+
147
+ /* get codepool */
148
+ $this->_modules[$k]['pool'] = $v['codePool'];
149
+
150
+ /* parse the module config.xml */
151
+ $modulepath = implode("/", explode("_", $k));
152
+ $mxml = simplexml_load_file($this->_apppath . "/code/" . $v['codePool'] . "/" . $modulepath . "/etc/config.xml");
153
+
154
+ /* convert to associative array */
155
+ $mxml = json_encode($mxml);
156
+ $mxml = json_decode($mxml, true);
157
+
158
+ /* get version */
159
+ $this->_modules[$k]['version'] = $mxml['modules'][$k]['version'];
160
+
161
+ /* get global blocks */
162
+ if (isset($mxml['global']['blocks'])) {
163
+ foreach ($mxml['global']['blocks'] as $mk => $mv) {
164
+ $this->_modules[$k]['blocks'][] = $mk;
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ } catch (Exception $e) {
174
+ /* log any errors */
175
+ $this->_global_results['errors'][] = $e->getMessage();
176
+ }
177
+ @closedir($h);
178
+ $this->_global_results['modules'] = $this->_modules;
179
+ }
180
+
181
+ private function getLogs() {
182
+
183
+ try {
184
+ /* get list of log files */
185
+ if ($h = opendir($this->_logpath)) {
186
+
187
+ /* loop through the files */
188
+ while (false !== ($entry = readdir($h))) {
189
+
190
+ /* we don't want . and .. */
191
+ if ($entry !== "." && $entry !== "..") {
192
+
193
+ /* not using due to exceeding memory limits on large files */
194
+ //$filearray = file($this->_logpath . "/" . $entry, FILE_SKIP_EMPTY_LINES);
195
+
196
+ $filearray = array();
197
+
198
+ /* get last 15 lines of any logs */
199
+ $lh = @fopen($this->_logpath . "/" . $entry, "r");
200
+ if ($lh) {
201
+ while (($buffer = fgets($lh, 8192)) !== false) {
202
+ if (count($filearray) < 15) {
203
+ array_push($filearray, trim($buffer));
204
+ } else {
205
+ $junk = array_pop($filearray);
206
+ array_push($filearray, trim($buffer));
207
+ }
208
+ }
209
+ $this->_logs[pathinfo($this->_logpath . "/" . $entry, PATHINFO_FILENAME)] = $filearray;
210
+ } else {
211
+
212
+ /* couldn't read the file */
213
+ $this->_logs[pathinfo($this->_logpath . "/" . $entry, PATHINFO_FILENAME)] = "Could not read file.";
214
+ }
215
+ @fclose($lh);
216
+ }
217
+ }
218
+ }
219
+ } catch (Exception $e) {
220
+ /* log any errors */
221
+ $this->_global_results['errors'][] = $e->getMessage();
222
+ }
223
+ @closedir($h);
224
+ $this->_global_results['logs'] = $this->_logs;
225
+ }
226
+
227
+ }
app/code/community/Amazon/Diagnostics/etc/adminhtml.xml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Amazon
5
+ * @package Amazon_Diagnostics
6
+ * @copyright Copyright (c) 2015 Amazon.com
7
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <acl>
12
+ <resources>
13
+ <all>
14
+ <title>Allow Everything</title>
15
+ </all>
16
+ <admin>
17
+ <children>
18
+ <system>
19
+ <children>
20
+ <config>
21
+ <children>
22
+ <amazon_diagnostics translate="title">
23
+ <title>Amazon Diagnostics</title>
24
+ <sort_order>100</sort_order>
25
+ </amazon_diagnostics>
26
+ </children>
27
+ </config>
28
+ </children>
29
+ </system>
30
+ </children>
31
+ </admin>
32
+ </resources>
33
+ </acl>
34
+ </config>
app/code/community/Amazon/Diagnostics/etc/config.xml ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Amazon
5
+ * @package Amazon_Diagnostics
6
+ * @copyright Copyright (c) 2015 Amazon.com
7
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Amazon_Diagnostics>
13
+ <version>1.0.0</version>
14
+ </Amazon_Diagnostics>
15
+ </modules>
16
+ <global>
17
+ <helpers>
18
+ <amazon_diagnostics>
19
+ <class>Amazon_Diagnostics_Helper</class>
20
+ </amazon_diagnostics>
21
+ </helpers>
22
+ <blocks>
23
+ <amazon_diagnostics>
24
+ <class>Amazon_Diagnostics_Block</class>
25
+ </amazon_diagnostics>
26
+ </blocks>
27
+ </global>
28
+ <admin>
29
+ <routers>
30
+ <adminhtml>
31
+ <args>
32
+ <modules>
33
+ <amazon_diagnostics after="Mage_Adminhtml">Amazon_Diagnostics</amazon_diagnostics>
34
+ </modules>
35
+ </args>
36
+ </adminhtml>
37
+ </routers>
38
+ </admin>
39
+ </config>
app/code/community/Amazon/Diagnostics/etc/system.xml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Amazon Diagnostics
5
+ *
6
+ * @category Amazon
7
+ * @package Amazon_Diagnostics
8
+ * @copyright Copyright (c) 2015 Amazon.com
9
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
10
+ */
11
+ -->
12
+ <config>
13
+ <sections>
14
+ <dev>
15
+ <groups>
16
+ <diagnostics translate="label">
17
+ <label>Login and Pay with Amazon Diagnostics</label>
18
+ <frontend_type>text</frontend_type>
19
+ <sort_order>0</sort_order>
20
+ <show_in_default>1</show_in_default>
21
+ <show_in_website>1</show_in_website>
22
+ <show_in_store>0</show_in_store>
23
+ <comment>
24
+ <![CDATA[
25
+ Login and Pay with Amazon Diagnostics can be used to help developers troubleshoot your Login and Pay with Amazon integration.
26
+ <br/>
27
+ <div style="clear:both;"></div>
28
+ ]]>
29
+ </comment>
30
+ <fields>
31
+ <check translate="label">
32
+ <frontend_type>button</frontend_type>
33
+ <frontend_model>amazon_diagnostics/adminhtml_system_config_form_button</frontend_model>
34
+ <sort_order>0</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>0</show_in_store>
38
+ </check>
39
+ <results translate='label'>
40
+ <label>Results:</label>
41
+ <comment>
42
+ <![CDATA[
43
+ Copy/paste results to developer support if requested.
44
+ ]]>
45
+ </comment>
46
+ <frontend_type>textarea</frontend_type>
47
+ <frontend_model>amazon_diagnostics/adminhtml_system_config_form_textarea</frontend_model>
48
+ <sort_order>5</sort_order>
49
+ <show_in_default>1</show_in_default>
50
+ <show_in_website>1</show_in_website>
51
+ <show_in_store>0</show_in_store>
52
+ </results>
53
+ </fields>
54
+ </diagnostics>
55
+ </groups>
56
+ </dev>
57
+ </sections>
58
+ </config>
app/code/community/Amazon/Login/Model/Customer.php CHANGED
@@ -21,13 +21,17 @@ class Amazon_Login_Model_Customer extends Mage_Customer_Model_Customer
21
  {
22
  $amazonProfile = $this->getAmazonProfile($token);
23
 
24
- if ($amazonProfile && isset($amazonProfile['email'])) {
25
-
26
- // Load customer by email
27
- $this->setWebsiteId(Mage::app()->getWebsite()->getId())->loadByEmail($amazonProfile['email']);
28
-
29
  // Load Amazon Login association
30
  $row = Mage::getModel('amazon_login/login')->load($amazonProfile['user_id'], 'amazon_uid');
 
 
 
 
 
 
 
 
31
 
32
  // If Magento customer account exists and there is no association, then the Magento account
33
  // must be verified, as Amazon does not verify email addresses.
21
  {
22
  $amazonProfile = $this->getAmazonProfile($token);
23
 
24
+ if ($amazonProfile && isset($amazonProfile['user_id']) && isset($amazonProfile['email'])) {
 
 
 
 
25
  // Load Amazon Login association
26
  $row = Mage::getModel('amazon_login/login')->load($amazonProfile['user_id'], 'amazon_uid');
27
+
28
+ if ($row->getLoginId()) {
29
+ // Load customer by id
30
+ $this->setWebsiteId(Mage::app()->getWebsite()->getId())->load($row->getCustomerId());
31
+ } else {
32
+ // Load customer by email
33
+ $this->setWebsiteId(Mage::app()->getWebsite()->getId())->loadByEmail($amazonProfile['email']);
34
+ }
35
 
36
  // If Magento customer account exists and there is no association, then the Magento account
37
  // must be verified, as Amazon does not verify email addresses.
app/code/community/Amazon/Payments/Block/Button.php CHANGED
@@ -119,6 +119,16 @@ class Amazon_Payments_Block_Button extends Mage_Core_Block_Template
119
  }
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
122
  /**
123
  * Is Amazon Payments enabled on product level?
124
  */
119
  }
120
  }
121
 
122
+ /**
123
+ * Is button badge enabled?
124
+ *
125
+ * @return bool
126
+ */
127
+ public function isButtonBadgeEnabled()
128
+ {
129
+ return $this->helper('amazon_payments')->isButtonBadgeEnabled();
130
+ }
131
+
132
  /**
133
  * Is Amazon Payments enabled on product level?
134
  */
app/code/community/Amazon/Payments/Block/Form.php CHANGED
@@ -12,6 +12,14 @@ class Amazon_Payments_Block_Form extends Mage_Payment_Block_Form
12
  protected function _construct()
13
  {
14
  parent::_construct();
15
- $this->setTemplate('amazon_payments/form.phtml');
 
 
 
 
 
 
 
 
16
  }
17
  }
12
  protected function _construct()
13
  {
14
  parent::_construct();
15
+
16
+ // Acceptance Mark/Badge
17
+ $mark = Mage::getConfig()->getBlockClassName('core/template');
18
+ $mark = new $mark;
19
+ $mark->setTemplate('amazon_payments/mark.phtml');
20
+
21
+ $this->setTemplate('amazon_payments/form.phtml')
22
+ ->setMethodLabelAfterHtml($mark->toHtml())
23
+ ->setMethodTitle('');
24
  }
25
  }
app/code/community/Amazon/Payments/Block/Onepage/Widget.php CHANGED
@@ -17,6 +17,12 @@ class Amazon_Payments_Block_Onepage_Widget extends Mage_Checkout_Block_Onepage_A
17
  'is_show' => $this->isShow()
18
  ));
19
  parent::_construct();
 
 
 
 
 
 
20
  }
21
 
22
  /**
17
  'is_show' => $this->isShow()
18
  ));
19
  parent::_construct();
20
+
21
+ $this->getCheckout()->setStepData('shipping', 'is_show', true); // Display "Shipping Information" progress widget
22
+
23
+ // Reset checkout steps if switching from OnePage core
24
+ $this->getCheckout()->setStepData('billing', 'is_show', false);
25
+ $this->getCheckout()->setStepData('payment', 'is_show', false);
26
  }
27
 
28
  /**
app/code/community/Amazon/Payments/Helper/Data.php CHANGED
@@ -174,6 +174,13 @@ class Amazon_Payments_Helper_Data extends Mage_Core_Helper_Abstract
174
  return (Mage::app()->getRequest()->getParam('amazon_modal') && $this->getConfig()->isCheckoutModal());
175
  }
176
 
177
-
178
-
 
 
 
 
 
 
 
179
  }
174
  return (Mage::app()->getRequest()->getParam('amazon_modal') && $this->getConfig()->isCheckoutModal());
175
  }
176
 
177
+ /**
178
+ * Is button bade (acceptance mark) enabled?
179
+ *
180
+ * @return bool
181
+ */
182
+ public function isButtonBadgeEnabled($store = null)
183
+ {
184
+ return ($this->getConfig()->isButtonBadgeEnabled() && $this->getConfig()->isEnabled());
185
+ }
186
  }
app/code/community/Amazon/Payments/Model/Async.php CHANGED
@@ -50,102 +50,112 @@ class Amazon_Payments_Model_Async extends Mage_Core_Model_Abstract
50
  {
51
  $_api = $this->_getApi();
52
  $message = '';
53
- $amazonOrderReference = $order->getPayment()->getAdditionalInformation('order_reference');
54
 
55
- $orderReferenceDetails = $_api->getOrderReferenceDetails($amazonOrderReference);
56
 
57
- if ($orderReferenceDetails) {
 
 
 
 
 
 
58
 
59
- // Retrieve Amazon Authorization Details
60
- try {
61
  // Last transaction ID is Amazon Authorize Reference ID
62
  $lastAmazonReference = $order->getPayment()->getLastTransId();
63
  $resultAuthorize = $this->_getApi()->getAuthorizationDetails($lastAmazonReference);
64
  $amazonAuthorizationState = $resultAuthorize->getAuthorizationStatus()->getState();
65
  $reasonCode = $resultAuthorize->getAuthorizationStatus()->getReasonCode();
66
- } catch (Exception $e) {
67
- Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
68
- return;
69
- }
70
 
71
- // Re-authorize if holded, an Open order reference, and manual sync
72
- if ($order->getState() == Mage_Sales_Model_Order::STATE_HOLDED && $orderReferenceDetails->getOrderReferenceStatus()->getState() == 'Open' && $isManualSync) {
73
- $payment = $order->getPayment();
74
- $amount = $payment->getAmountOrdered();
75
- $method = $payment->getMethodInstance();
76
-
77
- // Re-authorize
78
- $payment->setTransactionId($amazonOrderReference);
79
-
80
- switch ($method->getConfigData('payment_action')) {
81
- case $method::ACTION_AUTHORIZE:
82
- $method->authorize($payment, $amount, false);
83
- break;
84
-
85
- case $method::ACTION_AUTHORIZE_CAPTURE:
86
- $this->authorize($payment, $amount, true);
87
- break;
88
- default:
89
- break;
 
 
 
 
 
90
  }
91
 
92
- // Resync
93
- $this->syncOrderStatus($order);
94
- return;
95
- }
96
 
97
- $message = Mage::helper('payment')->__('Sync with Amazon: Authorization state is %s.', $amazonAuthorizationState);
 
 
 
 
98
 
99
- switch ($amazonAuthorizationState) {
100
- // Pending (All Authorization objects are in the Pending state for 30 seconds after Authorize request)
101
- case Amazon_Payments_Model_Api::AUTH_STATUS_PENDING:
102
- $message .= ' (Payment is currently authorizing. Please try again momentarily.)';
103
- break;
104
-
105
- // Declined
106
- case Amazon_Payments_Model_Api::AUTH_STATUS_DECLINED:
107
- if ($order->getState() != Mage_Sales_Model_Order::STATE_HOLDED) {
108
- $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true);
109
- }
110
 
111
- $message .= " Order placed on hold due to $reasonCode. Please direct customer to Amazon Payments site to update their payment method.";
112
- break;
113
 
114
- // Open (Authorize Only)
115
- case Amazon_Payments_Model_Api::AUTH_STATUS_OPEN:
116
- $order->setState(Mage_Sales_Model_Order::STATE_NEW);
117
- $order->setStatus($_api->getConfig()->getNewOrderStatus());
118
- break;
119
 
120
- // Closed (Authorize and Capture)
121
- case Amazon_Payments_Model_Api::AUTH_STATUS_CLOSED:
122
 
 
 
 
 
123
 
124
- // Payment captured; create invoice
125
- if ($reasonCode == 'MaxCapturesProcessed') {
126
- $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
127
- $order->setStatus($_api->getConfig()->getNewOrderStatus());
 
 
128
 
129
- if ($this->_createInvoice($order, $orderReferenceDetails->getIdList()->getmember())) {
130
- $message .= ' ' . Mage::helper('payment')->__('Invoice created.');
131
  }
132
- }
133
- else {
134
- $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true);
135
 
136
- $message .= ' Unable to create invoice due to Authorization Reason Code: ' . $reasonCode;
137
- }
138
 
139
- break;
140
- }
 
 
 
141
 
142
- // Update order
143
- if ($amazonAuthorizationState != Amazon_Payments_Model_Api::AUTH_STATUS_PENDING) {
 
 
 
 
 
144
  $order->addStatusToHistory($order->getStatus(), $message, false);
145
  $order->save();
146
  }
147
 
148
- Mage::getSingleton('adminhtml/session')->addSuccess($message);
 
149
  }
150
  }
151
 
@@ -164,7 +174,7 @@ class Amazon_Payments_Model_Async extends Mage_Core_Model_Abstract
164
  ;
165
 
166
  foreach ($orderCollection as $orderRow) {
167
- $order = Mage::getModel('sales/order')->load($orderRow->getId());
168
  $this->syncOrderStatus($order);
169
  }
170
  }
50
  {
51
  $_api = $this->_getApi();
52
  $message = '';
 
53
 
54
+ try {
55
 
56
+ $amazonOrderReference = $order->getPayment()->getAdditionalInformation('order_reference');
57
+
58
+ $orderReferenceDetails = $_api->getOrderReferenceDetails($amazonOrderReference);
59
+
60
+ if ($orderReferenceDetails) {
61
+
62
+ // Retrieve Amazon Authorization Details
63
 
 
 
64
  // Last transaction ID is Amazon Authorize Reference ID
65
  $lastAmazonReference = $order->getPayment()->getLastTransId();
66
  $resultAuthorize = $this->_getApi()->getAuthorizationDetails($lastAmazonReference);
67
  $amazonAuthorizationState = $resultAuthorize->getAuthorizationStatus()->getState();
68
  $reasonCode = $resultAuthorize->getAuthorizationStatus()->getReasonCode();
 
 
 
 
69
 
70
+ // Re-authorize if holded, an Open order reference, and manual sync
71
+ if ($order->getState() == Mage_Sales_Model_Order::STATE_HOLDED && $orderReferenceDetails->getOrderReferenceStatus()->getState() == 'Open' && $isManualSync) {
72
+ $payment = $order->getPayment();
73
+ $amount = $payment->getAmountOrdered();
74
+ $method = $payment->getMethodInstance();
75
+
76
+ // Re-authorize
77
+ $payment->setTransactionId($amazonOrderReference);
78
+
79
+ switch ($method->getConfigData('payment_action')) {
80
+ case $method::ACTION_AUTHORIZE:
81
+ $method->authorize($payment, $amount, false);
82
+ break;
83
+
84
+ case $method::ACTION_AUTHORIZE_CAPTURE:
85
+ $method->authorize($payment, $amount, true);
86
+ break;
87
+ default:
88
+ break;
89
+ }
90
+
91
+ // Resync
92
+ $this->syncOrderStatus($order);
93
+ return;
94
  }
95
 
96
+ $message = Mage::helper('payment')->__('Sync with Amazon: Authorization state is %s.', $amazonAuthorizationState);
 
 
 
97
 
98
+ switch ($amazonAuthorizationState) {
99
+ // Pending (All Authorization objects are in the Pending state for 30 seconds after Authorize request)
100
+ case Amazon_Payments_Model_Api::AUTH_STATUS_PENDING:
101
+ $message .= ' (Payment is currently authorizing. Please try again momentarily.)';
102
+ break;
103
 
104
+ // Declined
105
+ case Amazon_Payments_Model_Api::AUTH_STATUS_DECLINED:
106
+ if ($order->getState() != Mage_Sales_Model_Order::STATE_HOLDED) {
107
+ $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true);
108
+ }
 
 
 
 
 
 
109
 
110
+ $message .= " Order placed on hold due to $reasonCode. Please direct customer to Amazon Payments site to update their payment method.";
111
+ break;
112
 
113
+ // Open (Authorize Only)
114
+ case Amazon_Payments_Model_Api::AUTH_STATUS_OPEN:
115
+ $order->setState(Mage_Sales_Model_Order::STATE_NEW);
116
+ $order->setStatus($_api->getConfig()->getNewOrderStatus());
117
+ break;
118
 
119
+ // Closed (Authorize and Capture)
120
+ case Amazon_Payments_Model_Api::AUTH_STATUS_CLOSED:
121
 
122
+ // Payment captured; create invoice
123
+ if ($reasonCode == 'MaxCapturesProcessed') {
124
+ $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING);
125
+ $order->setStatus($_api->getConfig()->getNewOrderStatus());
126
 
127
+ if ($this->_createInvoice($order, $orderReferenceDetails->getIdList()->getmember())) {
128
+ $message .= ' ' . Mage::helper('payment')->__('Invoice created.');
129
+ }
130
+ }
131
+ else {
132
+ $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true);
133
 
134
+ $message .= ' Unable to create invoice due to Authorization Reason Code: ' . $reasonCode;
 
135
  }
 
 
 
136
 
137
+ break;
138
+ }
139
 
140
+ // Update order
141
+ if ($amazonAuthorizationState != Amazon_Payments_Model_Api::AUTH_STATUS_PENDING) {
142
+ $order->addStatusToHistory($order->getStatus(), $message, false);
143
+ $order->save();
144
+ }
145
 
146
+ Mage::getSingleton('adminhtml/session')->addSuccess($message);
147
+ }
148
+ } catch (Exception $e) {
149
+ // Change order to "On Hold"
150
+ if ($order->getState() != Mage_Sales_Model_Order::STATE_HOLDED) {
151
+ $message = 'Error exception during sync. Please check exception.log';
152
+ $order->setState(Mage_Sales_Model_Order::STATE_HOLDED, true);
153
  $order->addStatusToHistory($order->getStatus(), $message, false);
154
  $order->save();
155
  }
156
 
157
+ Mage::logException($e);
158
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
159
  }
160
  }
161
 
174
  ;
175
 
176
  foreach ($orderCollection as $orderRow) {
177
+ $order = Mage::getModel('sales/order')->load($orderRow->getParentId());
178
  $this->syncOrderStatus($order);
179
  }
180
  }
app/code/community/Amazon/Payments/Model/Config.php CHANGED
@@ -35,6 +35,7 @@ class Amazon_Payments_Model_Config
35
  const CONFIG_XML_PATH_BUTTON_TYPE = 'payment/amazon_payments/button_type';
36
  const CONFIG_XML_PATH_BUTTON_COLOR = 'payment/amazon_payments/button_color';
37
  const CONFIG_XML_PATH_BUTTON_SIZE = 'payment/amazon_payments/button_size';
 
38
 
39
  const CONFIG_XML_PATH_LOGIN_ENABLED = 'amazon_login/settings/enabled';
40
 
@@ -310,4 +311,15 @@ class Amazon_Payments_Model_Config
310
  return $this->_getStoreConfig(self::CONFIG_XML_PATH_BUTTON_SIZE, $store);
311
  }
312
 
 
 
 
 
 
 
 
 
 
 
 
313
  }
35
  const CONFIG_XML_PATH_BUTTON_TYPE = 'payment/amazon_payments/button_type';
36
  const CONFIG_XML_PATH_BUTTON_COLOR = 'payment/amazon_payments/button_color';
37
  const CONFIG_XML_PATH_BUTTON_SIZE = 'payment/amazon_payments/button_size';
38
+ const CONFIG_XML_PATH_BUTTON_BADGE = 'payment/amazon_payments/button_badge';
39
 
40
  const CONFIG_XML_PATH_LOGIN_ENABLED = 'amazon_login/settings/enabled';
41
 
311
  return $this->_getStoreConfig(self::CONFIG_XML_PATH_BUTTON_SIZE, $store);
312
  }
313
 
314
+ /**
315
+ * Is button bade (acceptance mark) enabled?
316
+ *
317
+ * @param store $store
318
+ * @return bool
319
+ */
320
+ public function isButtonBadgeEnabled($store = null)
321
+ {
322
+ return ($this->_getStoreConfig(self::CONFIG_XML_PATH_BUTTON_BADGE, $store));
323
+ }
324
+
325
  }
app/code/community/Amazon/Payments/Model/Observer/Onepage.php CHANGED
@@ -23,7 +23,7 @@ class Amazon_Payments_Model_Observer_Onepage
23
  $fullActionName = $observer->getEvent()->getAction()->getFullActionName();
24
 
25
 
26
- if ($fullActionName == 'checkout_onepage_index' && $_helper->getConfig()->isEnabled() && $_helper->isCheckoutAmazonSession()) {
27
  // If One Page is disable and user has active Amazon Session, redirect to standalone checkout
28
  if (!$_helper->getConfig()->isCheckoutOnepage()) {
29
  Mage::app()->getFrontController()->getResponse()->setRedirect($_helper->getStandaloneUrl());
23
  $fullActionName = $observer->getEvent()->getAction()->getFullActionName();
24
 
25
 
26
+ if ($fullActionName == 'checkout_onepage_index' && $_helper->getConfig()->isEnabled() && $_helper->isCheckoutAmazonSession() && $_helper->isEnableProductPayments()) {
27
  // If One Page is disable and user has active Amazon Session, redirect to standalone checkout
28
  if (!$_helper->getConfig()->isCheckoutOnepage()) {
29
  Mage::app()->getFrontController()->getResponse()->setRedirect($_helper->getStandaloneUrl());
app/code/community/Amazon/Payments/Model/PaymentMethod.php CHANGED
@@ -248,7 +248,12 @@ class Amazon_Payments_Model_PaymentMethod extends Mage_Payment_Model_Method_Abst
248
 
249
  $payment->setIsTransactionClosed(false);
250
  $payment->setSkipOrderProcessing(true);
251
- $message = Mage::helper('payment')->__(($this->getConfigData('is_async') ? 'Asynchronous ' : '') . 'Order of %s sent to Amazon Payments.', $order->getStore()->convertPrice($amount, true, false));
 
 
 
 
 
252
  $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER, null, false, $message);
253
 
254
 
@@ -447,7 +452,7 @@ class Amazon_Payments_Model_PaymentMethod extends Mage_Payment_Model_Method_Abst
447
  */
448
  public function canUseCheckout()
449
  {
450
- return (Mage::getSingleton('amazon_payments/config')->isEnabled() && ((Mage::helper('amazon_payments')->isCheckoutAmazonSession() && $this->getConfigData('checkout_page') == 'onepage') || $this->getConfigData('use_in_checkout')));
451
  }
452
 
453
 
248
 
249
  $payment->setIsTransactionClosed(false);
250
  $payment->setSkipOrderProcessing(true);
251
+
252
+ $comment = $this->getConfigData('is_async') ? 'Asynchronous ' : '';
253
+ $comment .= $this->_getApi()->getConfig()->isSandbox() ? 'Sandbox ' : '';
254
+ $comment .= 'Order of %s sent to Amazon Payments.';
255
+ $message = Mage::helper('payment')->__($comment, $order->getStore()->convertPrice($amount, true, false));
256
+
257
  $payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER, null, false, $message);
258
 
259
 
452
  */
453
  public function canUseCheckout()
454
  {
455
+ return (Mage::getSingleton('amazon_payments/config')->isEnabled() && Mage::helper('amazon_payments')->isEnableProductPayments() && ((Mage::helper('amazon_payments')->isCheckoutAmazonSession() && $this->getConfigData('checkout_page') == 'onepage') || $this->getConfigData('use_in_checkout')));
456
  }
457
 
458
 
app/code/community/Amazon/Payments/Model/System/Config/Backend/Enabled.php CHANGED
@@ -26,39 +26,69 @@ class Amazon_Payments_Model_System_Config_Backend_Enabled extends Mage_Core_Mode
26
  }
27
  return parent::save();
28
  }
29
-
30
-
31
  /**
32
  * Perform API call to Amazon to validate keys
33
  *
34
  */
35
- /*
36
  public function _afterSaveCommit()
37
  {
38
-
39
  $data = $this->getFieldsetData();
40
  $isEnabled = $this->getValue();
41
- $idTest = 'S23-1234567-1234567';
42
 
43
  if ($isEnabled) {
44
- $_api = Mage::getSingleton('amazon_payments/api');
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
 
 
46
  try {
47
- $result = $_api->getOrderReferenceDetails($idTest);
48
- }
49
- catch (Exception $e) {
50
- if (strpos($e->getMessage(), $idTest) === FALSE) {
51
- $matches = array();
52
- preg_match("/'(.*)'/", $e->getMessage(), $matches);
53
- if ($matches[0]) {
54
- Mage::getSingleton('core/session')->addError('Error: ' . $matches[0]);
55
- }
56
-
 
 
 
 
 
 
 
 
 
 
 
57
  }
58
  }
59
  }
60
-
61
  return parent::_afterSaveCommit();
62
  }
63
- */
64
- }
 
 
 
 
 
 
 
 
 
 
26
  }
27
  return parent::save();
28
  }
 
 
29
  /**
30
  * Perform API call to Amazon to validate keys
31
  *
32
  */
 
33
  public function _afterSaveCommit()
34
  {
 
35
  $data = $this->getFieldsetData();
36
  $isEnabled = $this->getValue();
 
37
 
38
  if ($isEnabled) {
39
+ $config = array (
40
+ 'ServiceURL' => "https://mws.amazonservices.com/Sellers/2011-07-01",
41
+ 'ProxyHost' => null,
42
+ 'ProxyPort' => -1,
43
+ 'ProxyUsername' => null,
44
+ 'ProxyPassword' => null,
45
+ 'MaxErrorRetry' => 3,
46
+ );
47
+ $service = new MarketplaceWebServiceSellers_Client(
48
+ $data['access_key'],
49
+ $data['access_secret'],
50
+ 'Login and Pay for Magento',
51
+ '1.3',
52
+ $config);
53
 
54
+ $request = new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest();
55
+ $request->setSellerId($data['seller_id']);
56
  try {
57
+ $service->ListMarketplaceParticipations($request);
58
+ Mage::getSingleton('core/session')->addSuccess("All of your Amazon API keys are correct!");
59
+ }
60
+ catch (MarketplaceWebServiceSellers_Exception $ex) {
61
+ if ($ex->getErrorCode() == 'InvalidAccessKeyId'){
62
+ Mage::getSingleton('core/session')->addError("The Amazon MWS Access Key is incorrect");
63
+ }
64
+ else if ($ex->getErrorCode() == 'SignatureDoesNotMatch'){
65
+ Mage::getSingleton('core/session')->addError("The Amazon MWS Secret Key is incorrect");
66
+ }
67
+ else if ($ex->getErrorCode() == 'InvalidParameterValue'){
68
+ Mage::getSingleton('core/session')->addError("The Amazon Seller/Merchant ID is incorrect");
69
+ }
70
+ else if ($ex->getErrorCode() == 'AccessDenied') {
71
+ Mage::getSingleton('core/session')->addError("The Amazon Seller/Merchant ID does not match the MWS keys provided");
72
+ }
73
+ else{
74
+ $string = " Error Message: " . $ex->getMessage();
75
+ $string .= " Response Status Code: " . $ex->getStatusCode();
76
+ $string .= " Error Code: " . $ex->getErrorCode();
77
+ Mage::getSingleton('core/session')->addError($string);
78
  }
79
  }
80
  }
 
81
  return parent::_afterSaveCommit();
82
  }
83
+
84
+ /**
85
+ * Return dynamic help/comment text
86
+ *
87
+ */
88
+ public function getCommentText(Mage_Core_Model_Config_Element $element, $currentValue)
89
+ {
90
+ $version = Mage::getConfig()->getModuleConfig("Amazon_Payments")->version;
91
+ return "v$version";
92
+ }
93
+
94
+ }
app/code/community/Amazon/Payments/etc/config.xml CHANGED
@@ -10,7 +10,7 @@
10
  <config>
11
  <modules>
12
  <Amazon_Payments>
13
- <version>0.1.0</version>
14
  </Amazon_Payments>
15
  </modules>
16
  <global>
@@ -157,6 +157,7 @@
157
  <button_type>PwA</button_type>
158
  <button_color>Gold</button_color>
159
  <button_size>medium</button_size>
 
160
  </amazon_payments>
161
  </payment>
162
  </default>
10
  <config>
11
  <modules>
12
  <Amazon_Payments>
13
+ <version>1.3.0</version>
14
  </Amazon_Payments>
15
  </modules>
16
  <global>
157
  <button_type>PwA</button_type>
158
  <button_color>Gold</button_color>
159
  <button_size>medium</button_size>
160
+ <button_badge>1</button_badge>
161
  </amazon_payments>
162
  </payment>
163
  </default>
app/code/community/Amazon/Payments/etc/system.xml CHANGED
@@ -47,6 +47,7 @@
47
  <frontend_type>select</frontend_type>
48
  <source_model>adminhtml/system_config_source_yesno</source_model>
49
  <backend_model>amazon_payments/system_config_backend_enabled</backend_model>
 
50
  <sort_order>5</sort_order>
51
  <show_in_default>1</show_in_default>
52
  <show_in_website>1</show_in_website>
@@ -276,7 +277,16 @@
276
  <show_in_store>1</show_in_store>
277
  </button_size>
278
 
279
-
 
 
 
 
 
 
 
 
 
280
 
281
  <heading_dev translate="label">
282
  <label>Development</label>
47
  <frontend_type>select</frontend_type>
48
  <source_model>adminhtml/system_config_source_yesno</source_model>
49
  <backend_model>amazon_payments/system_config_backend_enabled</backend_model>
50
+ <comment><model>amazon_payments/system_config_backend_enabled</model></comment>
51
  <sort_order>5</sort_order>
52
  <show_in_default>1</show_in_default>
53
  <show_in_website>1</show_in_website>
277
  <show_in_store>1</show_in_store>
278
  </button_size>
279
 
280
+ <button_badge translate="label">
281
+ <label>Display Acceptance Badge</label>
282
+ <comment><![CDATA[Display "Amazon Payments" acceptance mark in right sidebar.]]></comment>
283
+ <frontend_type>select</frontend_type>
284
+ <source_model>adminhtml/system_config_source_yesno</source_model>
285
+ <sort_order>450</sort_order>
286
+ <show_in_default>1</show_in_default>
287
+ <show_in_website>1</show_in_website>
288
+ <show_in_store>0</show_in_store>
289
+ </button_badge>
290
 
291
  <heading_dev translate="label">
292
  <label>Development</label>
app/design/adminhtml/default/default/template/amazon_payments/button.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amazon Diagnostics
4
+ *
5
+ * @category Amazon
6
+ * @package Amazon_Diagnostics
7
+ * @copyright Copyright (c) 2015 Amazon.com
8
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
9
+ */
10
+ /* @var $this Amazon_Payments_Block_Adminhtml_Diagnostics */
11
+ ?>
12
+
13
+ <script type="text/javascript">
14
+ function diagnose() {
15
+ new Ajax.Request("<?php echo $this->getDiagnoseUrl() ?>", {
16
+ method: 'get',
17
+ onSuccess: function (transport) {
18
+ if (transport.responseText) {
19
+ document.getElementById('amazon_diagnostics_result').value = transport.responseText;
20
+ }
21
+ }
22
+ });
23
+ }
24
+ </script>
25
+
26
+ <?php echo $this->getButtonHtml() ?>
app/design/adminhtml/default/default/template/amazon_payments/textarea.phtml ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amazon Diagnostics
4
+ *
5
+ * @category Amazon
6
+ * @package Amazon_Diagnostics
7
+ * @copyright Copyright (c) 2015 Amazon.com
8
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
9
+ */
10
+ /* @var $this Amazon_Payments_Block_Adminhtml_Diagnostics */
11
+ ?>
12
+
13
+ <textarea id="amazon_diagnostics_result" cols="40" style="width:100%; font-family:monospace;" wrap="off" readonly="readonly"></textarea>
app/design/frontend/base/default/layout/amazon_payments.xml CHANGED
@@ -103,8 +103,8 @@
103
 
104
  <reference name="checkout.progress.wrapper">
105
  <block type="amazon_payments/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
106
- <block type="amazon_payments/onepage_progress" name="shipping.progress" template="amazon_payments/onepage/progress/widget.phtml"></block>
107
- <block type="amazon_payments/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml"></block>
108
  </block>
109
  </reference>
110
 
@@ -268,9 +268,33 @@
268
  <block>addtocart-amazon-button</block>
269
  </action>
270
  </reference>
 
 
 
 
 
271
  </catalog_product_view>
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
 
 
 
 
 
 
274
 
275
  <!--
276
  Fire Checkout
103
 
104
  <reference name="checkout.progress.wrapper">
105
  <block type="amazon_payments/onepage_progress" name="checkout.progress" before="-" template="checkout/onepage/progress.phtml">
106
+ <block type="amazon_payments/onepage_progress" name="shipping.progress" template="amazon_payments/onepage/progress/widget.phtml" />
107
+ <block type="amazon_payments/onepage_progress" name="shippingmethod.progress" template="checkout/onepage/progress/shipping_method.phtml" />
108
  </block>
109
  </reference>
110
 
268
  <block>addtocart-amazon-button</block>
269
  </action>
270
  </reference>
271
+
272
+ <reference name="right">
273
+ <block type="amazon_payments/button" name="amazon_payments.button.right.logo" template="amazon_payments/button_badge.phtml" />
274
+ </reference>
275
+
276
  </catalog_product_view>
277
 
278
+ <!--
279
+ Acceptance Mark/Badge
280
+ -->
281
+ <catalog_category_default>
282
+ <reference name="right">
283
+ <block type="amazon_payments/button" name="amazon_payments.button.right.logo" template="amazon_payments/button_badge.phtml" />
284
+ </reference>
285
+ </catalog_category_default>
286
+
287
+ <catalog_category_layered>
288
+ <reference name="right">
289
+ <block type="amazon_payments/button" name="amazon_payments.button.right.logo" template="amazon_payments/button_badge.phtml" />
290
+ </reference>
291
+ </catalog_category_layered>
292
 
293
+ <cms_index_index>
294
+ <reference name="right">
295
+ <block type="amazon_payments/button" name="amazon_payments.button.right.logo" template="amazon_payments/button_badge.phtml" />
296
+ </reference>
297
+ </cms_index_index>
298
 
299
  <!--
300
  Fire Checkout
app/design/frontend/base/default/template/amazon_login/verify.phtml CHANGED
@@ -14,7 +14,7 @@
14
 
15
  <div class="col2-set">
16
 
17
- <p><?php echo $this->__('This email address is currently associated with an existing %s customer account. Please log in to Magento in order to associate your Amazon account with this customer.', Mage::app()->getStore()->getName()); ?></p>
18
 
19
  <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
20
  <?php echo $this->getBlockHtml('formkey'); ?>
@@ -49,4 +49,4 @@
49
  //<![CDATA[
50
  var dataForm = new VarienForm('login-form', true);
51
  //]]>
52
- </script>
14
 
15
  <div class="col2-set">
16
 
17
+ <p>This email address is currently associated with an existing customer account. Please log in to associate your Amazon account with this customer.</p>
18
 
19
  <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
20
  <?php echo $this->getBlockHtml('formkey'); ?>
49
  //<![CDATA[
50
  var dataForm = new VarienForm('login-form', true);
51
  //]]>
52
+ </script>
app/design/frontend/base/default/template/amazon_payments/button_badge.phtml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amazon Payments
4
+ *
5
+ * @category Amazon
6
+ * @package Amazon_Payments
7
+ * @copyright Copyright (c) 2014 Amazon.com
8
+ * @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
9
+ */
10
+ ?>
11
+
12
+ <?php if ($this->isButtonBadgeEnabled()): ?>
13
+
14
+ <div class="amazon-payments-logo" style="text-align:center;">
15
+ <a href="https://payments.amazon.com/customer" target="_blank">
16
+ <img src="https://images-na.ssl-images-amazon.com/images/G/01/Iris3_US/en_US/inca/images/60x38-whitegrad-x2.png" border="0" alt="Amazon Payments" />
17
+ </a>
18
+ </div>
19
+
20
+ <?php endif; ?>
app/design/frontend/base/default/template/amazon_payments/checkout.phtml CHANGED
@@ -148,6 +148,7 @@ AmazonPaymentsMageCheckout.prototype = {
148
  $$(".button.btn-checkout").invoke('writeAttribute','onclick', 'amazonPaymentsMageCheckout.saveOrder()');
149
  this.agreementsForm = $('checkout-agreements')
150
  $("amz-review-loader").hide();
 
151
  },
152
 
153
  saveOrder: function() {
@@ -223,14 +224,13 @@ AmazonPaymentsMageCheckout.prototype = {
223
  review.setOpacity(0.5);
224
  loader.show();
225
  }
226
- btn.invoke('writeAttribute','disabled','disabled');
227
  } else {
228
  if (review) {
229
  review.setOpacity(1);
230
  loader.hide();
231
  }
232
-
233
- btn.invoke('removeAttribute','disabled');
234
  }
235
  }
236
  };
148
  $$(".button.btn-checkout").invoke('writeAttribute','onclick', 'amazonPaymentsMageCheckout.saveOrder()');
149
  this.agreementsForm = $('checkout-agreements')
150
  $("amz-review-loader").hide();
151
+ this.toggleOrderSubmit(false);
152
  },
153
 
154
  saveOrder: function() {
224
  review.setOpacity(0.5);
225
  loader.show();
226
  }
227
+ btn.each(function(el, i) { el.disable(); });
228
  } else {
229
  if (review) {
230
  review.setOpacity(1);
231
  loader.hide();
232
  }
233
+ btn.each(function(el, i) { el.enable(); });
 
234
  }
235
  }
236
  };
app/design/frontend/base/default/template/amazon_payments/mark.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Amazon Payments
4
+ *
5
+ * @category Amazon
6
+ * @package Amazon_Payments
7
+ * @copyright Copyright (c) 2014 Amazon.com
8
+ * @license http://opensource.org/licenses/Apache-2.0 Apache License, Version 2.0
9
+ */
10
+ ?>
11
+
12
+
13
+ <img src="https://images-na.ssl-images-amazon.com/images/G/01/Iris3_US/en_US/inca/images/37x23-whitegrad-x1-TEMP.png" width"37" height="23">
14
+
15
+ <!--
16
+ <img src="https://images-na.ssl-images-amazon.com/images/G/01/lwa/btnLWA_gold_32x32.png" height="23">
17
+ -->
18
+
19
+ <?php print $this->__('Amazon Payments'); ?>
app/design/frontend/base/default/template/amazon_payments/onepage/widget.phtml CHANGED
@@ -11,6 +11,8 @@
11
 
12
  <form id="co-widget-form" action="">
13
  <div class="amazon-widget" id="checkout-widget">
 
 
14
  <input type="hidden" name="amazon_order_reference_id" value="" />
15
  <input type="hidden" name="payment[method]" value="amazon_payments" />
16
 
11
 
12
  <form id="co-widget-form" action="">
13
  <div class="amazon-widget" id="checkout-widget">
14
+ <input type="checkbox" style="display:none;"> <!-- MageMonkey Mailchimp compatibility (their JS requires a form element to dynamically append input element) -->
15
+
16
  <input type="hidden" name="amazon_order_reference_id" value="" />
17
  <input type="hidden" name="payment[method]" value="amazon_payments" />
18
 
app/etc/modules/Amazon_Diagnostics.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * @category Amazon
5
+ * @package Amazon_Diagnostics
6
+ * @copyright Copyright (c) 2015 Amazon.com
7
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
8
+ */
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Amazon_Diagnostics>
13
+ <active>true</active>
14
+ <codePool>community</codePool>
15
+ </Amazon_Diagnostics>
16
+ </modules>
17
+ </config>
lib/MarketplaceWebServiceSellers/Client.php ADDED
@@ -0,0 +1,752 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Interface
22
+ */
23
+ require_once ('Interface.php');
24
+
25
+ /**
26
+ * MarketplaceWebServiceSellers_Client is an implementation of MarketplaceWebServiceSellers
27
+ *
28
+ */
29
+ class MarketplaceWebServiceSellers_Client implements MarketplaceWebServiceSellers_Interface
30
+ {
31
+
32
+ const SERVICE_VERSION = '2011-07-01';
33
+ const MWS_CLIENT_VERSION = '2014-10-20';
34
+
35
+ /** @var string */
36
+ private $_awsAccessKeyId = null;
37
+
38
+ /** @var string */
39
+ private $_awsSecretAccessKey = null;
40
+
41
+ /** @var array */
42
+ private $_config = array ('ServiceURL' => null,
43
+ 'UserAgent' => 'MarketplaceWebServiceSellers PHP5 Library',
44
+ 'SignatureVersion' => 2,
45
+ 'SignatureMethod' => 'HmacSHA256',
46
+ 'ProxyHost' => null,
47
+ 'ProxyPort' => -1,
48
+ 'ProxyUsername' => null,
49
+ 'ProxyPassword' => null,
50
+ 'MaxErrorRetry' => 3,
51
+ 'Headers' => array()
52
+ );
53
+
54
+
55
+ /**
56
+ * Get Service Status
57
+ * Returns the service status of a particular MWS API section. The operation
58
+ * takes no input.
59
+ * All API sections within the API are required to implement this operation.
60
+ *
61
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_GetServiceStatus request or MarketplaceWebServiceSellers_Model_GetServiceStatus object itself
62
+ * @see MarketplaceWebServiceSellers_Model_GetServiceStatusRequest
63
+ * @return MarketplaceWebServiceSellers_Model_GetServiceStatusResponse
64
+ *
65
+ * @throws MarketplaceWebServiceSellers_Exception
66
+ */
67
+ public function getServiceStatus($request)
68
+ {
69
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_GetServiceStatusRequest)) {
70
+ $request = new MarketplaceWebServiceSellers_Model_GetServiceStatusRequest($request);
71
+ }
72
+ $parameters = $request->toQueryParameterArray();
73
+ $parameters['Action'] = 'GetServiceStatus';
74
+ $httpResponse = $this->_invoke($parameters);
75
+
76
+ $response = MarketplaceWebServiceSellers_Model_GetServiceStatusResponse::fromXML($httpResponse['ResponseBody']);
77
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
78
+ return $response;
79
+ }
80
+
81
+
82
+ /**
83
+ * Convert GetServiceStatusRequest to name value pairs
84
+ */
85
+ private function _convertGetServiceStatus($request) {
86
+
87
+ $parameters = array();
88
+ $parameters['Action'] = 'GetServiceStatus';
89
+ if ($request->isSetSellerId()) {
90
+ $parameters['SellerId'] = $request->getSellerId();
91
+ }
92
+ if ($request->isSetMWSAuthToken()) {
93
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
94
+ }
95
+
96
+ return $parameters;
97
+ }
98
+
99
+
100
+ /**
101
+ * List Marketplace Participations
102
+ * Returns a list of marketplaces that the seller submitting the request can sell in,
103
+ * and a list of participations that include seller-specific information in that marketplace.
104
+ *
105
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations object itself
106
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest
107
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse
108
+ *
109
+ * @throws MarketplaceWebServiceSellers_Exception
110
+ */
111
+ public function listMarketplaceParticipations($request)
112
+ {
113
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest)) {
114
+ $request = new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest($request);
115
+ }
116
+ $parameters = $request->toQueryParameterArray();
117
+ $parameters['Action'] = 'ListMarketplaceParticipations';
118
+ $httpResponse = $this->_invoke($parameters);
119
+
120
+ $response = MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse::fromXML($httpResponse['ResponseBody']);
121
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
122
+ return $response;
123
+ }
124
+
125
+
126
+ /**
127
+ * Convert ListMarketplaceParticipationsRequest to name value pairs
128
+ */
129
+ private function _convertListMarketplaceParticipations($request) {
130
+
131
+ $parameters = array();
132
+ $parameters['Action'] = 'ListMarketplaceParticipations';
133
+ if ($request->isSetSellerId()) {
134
+ $parameters['SellerId'] = $request->getSellerId();
135
+ }
136
+ if ($request->isSetMWSAuthToken()) {
137
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
138
+ }
139
+
140
+ return $parameters;
141
+ }
142
+
143
+
144
+ /**
145
+ * List Marketplace Participations By Next Token
146
+ * Returns the next page of marketplaces and participations using the NextToken value
147
+ * that was returned by your previous request to either ListMarketplaceParticipations or
148
+ * ListMarketplaceParticipationsByNextToken.
149
+ *
150
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken object itself
151
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest
152
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenResponse
153
+ *
154
+ * @throws MarketplaceWebServiceSellers_Exception
155
+ */
156
+ public function listMarketplaceParticipationsByNextToken($request)
157
+ {
158
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest)) {
159
+ $request = new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest($request);
160
+ }
161
+ $parameters = $request->toQueryParameterArray();
162
+ $parameters['Action'] = 'ListMarketplaceParticipationsByNextToken';
163
+ $httpResponse = $this->_invoke($parameters);
164
+
165
+ $response = MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
166
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
167
+ return $response;
168
+ }
169
+
170
+
171
+ /**
172
+ * Convert ListMarketplaceParticipationsByNextTokenRequest to name value pairs
173
+ */
174
+ private function _convertListMarketplaceParticipationsByNextToken($request) {
175
+
176
+ $parameters = array();
177
+ $parameters['Action'] = 'ListMarketplaceParticipationsByNextToken';
178
+ if ($request->isSetSellerId()) {
179
+ $parameters['SellerId'] = $request->getSellerId();
180
+ }
181
+ if ($request->isSetMWSAuthToken()) {
182
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
183
+ }
184
+ if ($request->isSetNextToken()) {
185
+ $parameters['NextToken'] = $request->getNextToken();
186
+ }
187
+
188
+ return $parameters;
189
+ }
190
+
191
+
192
+
193
+ /**
194
+ * Construct new Client
195
+ *
196
+ * @param string $awsAccessKeyId AWS Access Key ID
197
+ * @param string $awsSecretAccessKey AWS Secret Access Key
198
+ * @param array $config configuration options.
199
+ * Valid configuration options are:
200
+ * <ul>
201
+ * <li>ServiceURL</li>
202
+ * <li>UserAgent</li>
203
+ * <li>SignatureVersion</li>
204
+ * <li>TimesRetryOnError</li>
205
+ * <li>ProxyHost</li>
206
+ * <li>ProxyPort</li>
207
+ * <li>ProxyUsername<li>
208
+ * <li>ProxyPassword<li>
209
+ * <li>MaxErrorRetry</li>
210
+ * </ul>
211
+ */
212
+ public function __construct($awsAccessKeyId, $awsSecretAccessKey, $applicationName, $applicationVersion, $config = null)
213
+ {
214
+ iconv_set_encoding('output_encoding', 'UTF-8');
215
+ iconv_set_encoding('input_encoding', 'UTF-8');
216
+ iconv_set_encoding('internal_encoding', 'UTF-8');
217
+
218
+ $this->_awsAccessKeyId = $awsAccessKeyId;
219
+ $this->_awsSecretAccessKey = $awsSecretAccessKey;
220
+ if (!is_null($config)) $this->_config = array_merge($this->_config, $config);
221
+ $this->setUserAgentHeader($applicationName, $applicationVersion);
222
+ }
223
+
224
+ private function setUserAgentHeader(
225
+ $applicationName,
226
+ $applicationVersion,
227
+ $attributes = null) {
228
+
229
+ if (is_null($attributes)) {
230
+ $attributes = array ();
231
+ }
232
+
233
+ $this->_config['UserAgent'] =
234
+ $this->constructUserAgentHeader($applicationName, $applicationVersion, $attributes);
235
+ }
236
+
237
+ private function constructUserAgentHeader($applicationName, $applicationVersion, $attributes = null) {
238
+ if (is_null($applicationName) || $applicationName === "") {
239
+ throw new InvalidArgumentException('$applicationName cannot be null');
240
+ }
241
+
242
+ if (is_null($applicationVersion) || $applicationVersion === "") {
243
+ throw new InvalidArgumentException('$applicationVersion cannot be null');
244
+ }
245
+
246
+ $userAgent =
247
+ $this->quoteApplicationName($applicationName)
248
+ . '/'
249
+ . $this->quoteApplicationVersion($applicationVersion);
250
+
251
+ $userAgent .= ' (';
252
+ $userAgent .= 'Language=PHP/' . phpversion();
253
+ $userAgent .= '; ';
254
+ $userAgent .= 'Platform=' . php_uname('s') . '/' . php_uname('m') . '/' . php_uname('r');
255
+ $userAgent .= '; ';
256
+ $userAgent .= 'MWSClientVersion=' . self::MWS_CLIENT_VERSION;
257
+
258
+ foreach ($attributes as $key => $value) {
259
+ if (empty($value)) {
260
+ throw new InvalidArgumentException("Value for $key cannot be null or empty.");
261
+ }
262
+
263
+ $userAgent .= '; '
264
+ . $this->quoteAttributeName($key)
265
+ . '='
266
+ . $this->quoteAttributeValue($value);
267
+ }
268
+
269
+ $userAgent .= ')';
270
+
271
+ return $userAgent;
272
+ }
273
+
274
+ /**
275
+ * Collapse multiple whitespace characters into a single ' ' character.
276
+ * @param $s
277
+ * @return string
278
+ */
279
+ private function collapseWhitespace($s) {
280
+ return preg_replace('/ {2,}|\s/', ' ', $s);
281
+ }
282
+
283
+ /**
284
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
285
+ * and '/' characters from a string.
286
+ * @param $s
287
+ * @return string
288
+ */
289
+ private function quoteApplicationName($s) {
290
+ $quotedString = $this->collapseWhitespace($s);
291
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
292
+ $quotedString = preg_replace('/\//', '\\/', $quotedString);
293
+
294
+ return $quotedString;
295
+ }
296
+
297
+ /**
298
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
299
+ * and '(' characters from a string.
300
+ *
301
+ * @param $s
302
+ * @return string
303
+ */
304
+ private function quoteApplicationVersion($s) {
305
+ $quotedString = $this->collapseWhitespace($s);
306
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
307
+ $quotedString = preg_replace('/\\(/', '\\(', $quotedString);
308
+
309
+ return $quotedString;
310
+ }
311
+
312
+ /**
313
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
314
+ * and '=' characters from a string.
315
+ *
316
+ * @param $s
317
+ * @return unknown_type
318
+ */
319
+ private function quoteAttributeName($s) {
320
+ $quotedString = $this->collapseWhitespace($s);
321
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
322
+ $quotedString = preg_replace('/\\=/', '\\=', $quotedString);
323
+
324
+ return $quotedString;
325
+ }
326
+
327
+ /**
328
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape ';', '\',
329
+ * and ')' characters from a string.
330
+ *
331
+ * @param $s
332
+ * @return unknown_type
333
+ */
334
+ private function quoteAttributeValue($s) {
335
+ $quotedString = $this->collapseWhitespace($s);
336
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
337
+ $quotedString = preg_replace('/\\;/', '\\;', $quotedString);
338
+ $quotedString = preg_replace('/\\)/', '\\)', $quotedString);
339
+
340
+ return $quotedString;
341
+ }
342
+
343
+
344
+ // Private API ------------------------------------------------------------//
345
+
346
+ /**
347
+ * Invoke request and return response
348
+ */
349
+ private function _invoke(array $parameters)
350
+ {
351
+ try {
352
+ if (empty($this->_config['ServiceURL'])) {
353
+ require_once (dirname(__FILE__) . '/Exception.php');
354
+ throw new MarketplaceWebServiceSellers_Exception(
355
+ array ('ErrorCode' => 'InvalidServiceURL',
356
+ 'Message' => "Missing serviceUrl configuration value. You may obtain a list of valid MWS URLs by consulting the MWS Developer's Guide, or reviewing the sample code published along side this library."));
357
+ }
358
+ $parameters = $this->_addRequiredParameters($parameters);
359
+ $retries = 0;
360
+ for (;;) {
361
+ $response = $this->_httpPost($parameters);
362
+ $status = $response['Status'];
363
+ if ($status == 200) {
364
+ return array('ResponseBody' => $response['ResponseBody'],
365
+ 'ResponseHeaderMetadata' => $response['ResponseHeaderMetadata']);
366
+ }
367
+ if ($status == 500 && $this->_pauseOnRetry(++$retries)) {
368
+ continue;
369
+ }
370
+ throw $this->_reportAnyErrors($response['ResponseBody'],
371
+ $status, $response['ResponseHeaderMetadata']);
372
+ }
373
+ } catch (MarketplaceWebServiceSellers_Exception $se) {
374
+ throw $se;
375
+ } catch (Exception $t) {
376
+ require_once (dirname(__FILE__) . '/Exception.php');
377
+ throw new MarketplaceWebServiceSellers_Exception(array('Exception' => $t, 'Message' => $t->getMessage()));
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Look for additional error strings in the response and return formatted exception
383
+ */
384
+ private function _reportAnyErrors($responseBody, $status, $responseHeaderMetadata, Exception $e = null)
385
+ {
386
+ $exProps = array();
387
+ $exProps["StatusCode"] = $status;
388
+ $exProps["ResponseHeaderMetadata"] = $responseHeaderMetadata;
389
+
390
+ libxml_use_internal_errors(true); // Silence XML parsing errors
391
+ $xmlBody = simplexml_load_string($responseBody);
392
+
393
+ if ($xmlBody !== false) { // Check XML loaded without errors
394
+ $exProps["XML"] = $responseBody;
395
+ $exProps["ErrorCode"] = $xmlBody->Error->Code;
396
+ $exProps["Message"] = $xmlBody->Error->Message;
397
+ $exProps["ErrorType"] = !empty($xmlBody->Error->Type) ? $xmlBody->Error->Type : "Unknown";
398
+ $exProps["RequestId"] = !empty($xmlBody->RequestID) ? $xmlBody->RequestID : $xmlBody->RequestId; // 'd' in RequestId is sometimes capitalized
399
+ } else { // We got bad XML in response, just throw a generic exception
400
+ $exProps["Message"] = "Internal Error";
401
+ }
402
+
403
+ require_once (dirname(__FILE__) . '/Exception.php');
404
+ return new MarketplaceWebServiceSellers_Exception($exProps);
405
+ }
406
+
407
+
408
+
409
+ /**
410
+ * Perform HTTP post with exponential retries on error 500 and 503
411
+ *
412
+ */
413
+ private function _httpPost(array $parameters)
414
+ {
415
+ $config = $this->_config;
416
+ $query = $this->_getParametersAsString($parameters);
417
+ $url = parse_url ($config['ServiceURL']);
418
+ $uri = array_key_exists('path', $url) ? $url['path'] : null;
419
+ if (!isset ($uri)) {
420
+ $uri = "/";
421
+ }
422
+
423
+ switch ($url['scheme']) {
424
+ case 'https':
425
+ $scheme = 'https://';
426
+ $port = isset($url['port']) ? $url['port'] : 443;
427
+ break;
428
+ default:
429
+ $scheme = 'http://';
430
+ $port = isset($url['port']) ? $url['port'] : 80;
431
+ }
432
+
433
+ $allHeaders = $config['Headers'];
434
+ $allHeaders['Content-Type'] = "application/x-www-form-urlencoded; charset=utf-8"; // We need to make sure to set utf-8 encoding here
435
+ $allHeaders['Expect'] = null; // Don't expect 100 Continue
436
+ $allHeadersStr = array();
437
+ foreach($allHeaders as $name => $val) {
438
+ $str = $name . ": ";
439
+ if(isset($val)) {
440
+ $str = $str . $val;
441
+ }
442
+ $allHeadersStr[] = $str;
443
+ }
444
+
445
+ $ch = curl_init();
446
+ curl_setopt($ch, CURLOPT_URL, $scheme . $url['host'] . $uri);
447
+ curl_setopt($ch, CURLOPT_PORT, $port);
448
+ $this->setSSLCurlOptions($ch);
449
+ curl_setopt($ch, CURLOPT_USERAGENT, $this->_config['UserAgent']);
450
+ curl_setopt($ch, CURLOPT_POST, true);
451
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
452
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $allHeadersStr);
453
+ curl_setopt($ch, CURLOPT_HEADER, true);
454
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
455
+ if ($config['ProxyHost'] != null && $config['ProxyPort'] != -1)
456
+ {
457
+ curl_setopt($ch, CURLOPT_PROXY, $config['ProxyHost'] . ':' . $config['ProxyPort']);
458
+ }
459
+ if ($config['ProxyUsername'] != null && $config['ProxyPassword'] != null)
460
+ {
461
+ curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['ProxyUsername'] . ':' . $config['ProxyPassword']);
462
+ }
463
+
464
+ $response = "";
465
+ $response = curl_exec($ch);
466
+
467
+ if($response === false) {
468
+ require_once (dirname(__FILE__) . '/Exception.php');
469
+ $exProps["Message"] = curl_error($ch);
470
+ $exProps["ErrorType"] = "HTTP";
471
+ curl_close($ch);
472
+ throw new MarketplaceWebServiceSellers_Exception($exProps);
473
+ }
474
+
475
+ curl_close($ch);
476
+ return $this->_extractHeadersAndBody($response);
477
+ }
478
+
479
+ /**
480
+ * This method will attempt to extract the headers and body of our response.
481
+ * We need to split the raw response string by 2 'CRLF's. 2 'CRLF's should indicate the separation of the response header
482
+ * from the response body. However in our case we have some circumstances (certain client proxies) that result in
483
+ * multiple responses concatenated. We could encounter a response like
484
+ *
485
+ * HTTP/1.1 100 Continue
486
+ *
487
+ * HTTP/1.1 200 OK
488
+ * Date: Tue, 01 Apr 2014 13:02:51 GMT
489
+ * Content-Type: text/html; charset=iso-8859-1
490
+ * Content-Length: 12605
491
+ *
492
+ * ... body ..
493
+ *
494
+ * This method will throw away extra response status lines and attempt to find the first full response headers and body
495
+ *
496
+ * return [status, body, ResponseHeaderMetadata]
497
+ */
498
+ private function _extractHeadersAndBody($response){
499
+ //First split by 2 'CRLF'
500
+ $responseComponents = preg_split("/(?:\r?\n){2}/", $response);
501
+ $body = null;
502
+ for ($count = 0;
503
+ $count < count($responseComponents) && $body == null;
504
+ $count++) {
505
+
506
+ $headers = $responseComponents[$count];
507
+ $responseStatus = $this->_extractHttpStatusCode($headers);
508
+
509
+ if($responseStatus != null &&
510
+ $this->_httpHeadersHaveContent($headers)){
511
+
512
+ $responseHeaderMetadata = $this->_extractResponseHeaderMetadata($headers);
513
+ //The body will be the next item in the responseComponents array
514
+ $body = $responseComponents[++$count];
515
+ }
516
+ }
517
+
518
+ //If the body is null here then we were unable to parse the response and will throw an exception
519
+ if($body == null){
520
+ $exProps["Message"] = "Failed to parse valid HTTP response (" . $response . ")";
521
+ $exProps["ErrorType"] = "HTTP";
522
+ throw new MarketplaceWebServiceSellers_Exception($exProps);
523
+ }
524
+
525
+ return array(
526
+ 'Status' => $responseStatus,
527
+ 'ResponseBody' => $body,
528
+ 'ResponseHeaderMetadata' => $responseHeaderMetadata);
529
+ }
530
+
531
+ /**
532
+ * parse the status line of a header string for the proper format and
533
+ * return the status code
534
+ *
535
+ * Example: HTTP/1.1 200 OK
536
+ * ...
537
+ * returns String statusCode or null if the status line can't be parsed
538
+ */
539
+ private function _extractHttpStatusCode($headers){
540
+ $statusCode = null;
541
+ if (1 === preg_match("/(\\S+) +(\\d+) +([^\n\r]+)(?:\r?\n|\r)/", $headers, $matches)) {
542
+ //The matches array [entireMatchString, protocol, statusCode, the rest]
543
+ $statusCode = $matches[2];
544
+ }
545
+ return $statusCode;
546
+ }
547
+
548
+ /**
549
+ * Tries to determine some valid headers indicating this response
550
+ * has content. In this case
551
+ * return true if there is a valid "Content-Length" or "Transfer-Encoding" header
552
+ */
553
+ private function _httpHeadersHaveContent($headers){
554
+ return (1 === preg_match("/[cC]ontent-[lL]ength: +(?:\\d+)(?:\\r?\\n|\\r|$)/", $headers) ||
555
+ 1 === preg_match("/Transfer-Encoding: +(?!identity[\r\n;= ])(?:[^\r\n]+)(?:\r?\n|\r|$)/i", $headers));
556
+ }
557
+
558
+ /**
559
+ * extract a ResponseHeaderMetadata object from the raw headers
560
+ */
561
+ private function _extractResponseHeaderMetadata($rawHeaders){
562
+ $inputHeaders = preg_split("/\r\n|\n|\r/", $rawHeaders);
563
+ $headers = array();
564
+ $headers['x-mws-request-id'] = null;
565
+ $headers['x-mws-response-context'] = null;
566
+ $headers['x-mws-timestamp'] = null;
567
+ $headers['x-mws-quota-max'] = null;
568
+ $headers['x-mws-quota-remaining'] = null;
569
+ $headers['x-mws-quota-resetsOn'] = null;
570
+
571
+ foreach ($inputHeaders as $currentHeader) {
572
+ $keyValue = explode (': ', $currentHeader);
573
+ if (isset($keyValue[1])) {
574
+ list ($key, $value) = $keyValue;
575
+ if (isset($headers[$key]) && $headers[$key]!==null) {
576
+ $headers[$key] = $headers[$key] . "," . $value;
577
+ } else {
578
+ $headers[$key] = $value;
579
+ }
580
+ }
581
+ }
582
+
583
+ return new MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata(
584
+ $headers['x-mws-request-id'],
585
+ $headers['x-mws-response-context'],
586
+ $headers['x-mws-timestamp'],
587
+ $headers['x-mws-quota-max'],
588
+ $headers['x-mws-quota-remaining'],
589
+ $headers['x-mws-quota-resetsOn']);
590
+ }
591
+
592
+ /**
593
+ * Set curl options relating to SSL. Protected to allow overriding.
594
+ * @param $ch curl handle
595
+ */
596
+ protected function setSSLCurlOptions($ch) {
597
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
598
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
599
+ }
600
+
601
+ /**
602
+ * Exponential sleep on failed request
603
+ *
604
+ * @param retries current retry
605
+ */
606
+ private function _pauseOnRetry($retries)
607
+ {
608
+ if ($retries <= $this->_config['MaxErrorRetry']) {
609
+ $delay = (int) (pow(4, $retries) * 100000);
610
+ usleep($delay);
611
+ return true;
612
+ }
613
+ return false;
614
+ }
615
+
616
+ /**
617
+ * Add authentication related and version parameters
618
+ */
619
+ private function _addRequiredParameters(array $parameters)
620
+ {
621
+ $parameters['AWSAccessKeyId'] = $this->_awsAccessKeyId;
622
+ $parameters['Timestamp'] = $this->_getFormattedTimestamp();
623
+ $parameters['Version'] = self::SERVICE_VERSION;
624
+ $parameters['SignatureVersion'] = $this->_config['SignatureVersion'];
625
+ if ($parameters['SignatureVersion'] > 1) {
626
+ $parameters['SignatureMethod'] = $this->_config['SignatureMethod'];
627
+ }
628
+ $parameters['Signature'] = $this->_signParameters($parameters, $this->_awsSecretAccessKey);
629
+
630
+ return $parameters;
631
+ }
632
+
633
+ /**
634
+ * Convert paremeters to Url encoded query string
635
+ */
636
+ private function _getParametersAsString(array $parameters)
637
+ {
638
+ $queryParameters = array();
639
+ foreach ($parameters as $key => $value) {
640
+ $queryParameters[] = $key . '=' . $this->_urlencode($value);
641
+ }
642
+ return implode('&', $queryParameters);
643
+ }
644
+
645
+
646
+ /**
647
+ * Computes RFC 2104-compliant HMAC signature for request parameters
648
+ * Implements AWS Signature, as per following spec:
649
+ *
650
+ * If Signature Version is 0, it signs concatenated Action and Timestamp
651
+ *
652
+ * If Signature Version is 1, it performs the following:
653
+ *
654
+ * Sorts all parameters (including SignatureVersion and excluding Signature,
655
+ * the value of which is being created), ignoring case.
656
+ *
657
+ * Iterate over the sorted list and append the parameter name (in original case)
658
+ * and then its value. It will not URL-encode the parameter values before
659
+ * constructing this string. There are no separators.
660
+ *
661
+ * If Signature Version is 2, string to sign is based on following:
662
+ *
663
+ * 1. The HTTP Request Method followed by an ASCII newline (%0A)
664
+ * 2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline.
665
+ * 3. The URL encoded HTTP absolute path component of the URI
666
+ * (up to but not including the query string parameters);
667
+ * if this is empty use a forward '/'. This parameter is followed by an ASCII newline.
668
+ * 4. The concatenation of all query string components (names and values)
669
+ * as UTF-8 characters which are URL encoded as per RFC 3986
670
+ * (hex characters MUST be uppercase), sorted using lexicographic byte ordering.
671
+ * Parameter names are separated from their values by the '=' character
672
+ * (ASCII character 61), even if the value is empty.
673
+ * Pairs of parameter and values are separated by the '&' character (ASCII code 38).
674
+ *
675
+ */
676
+ private function _signParameters(array $parameters, $key) {
677
+ $signatureVersion = $parameters['SignatureVersion'];
678
+ $algorithm = "HmacSHA1";
679
+ $stringToSign = null;
680
+ if (2 == $signatureVersion) {
681
+ $algorithm = $this->_config['SignatureMethod'];
682
+ $parameters['SignatureMethod'] = $algorithm;
683
+ $stringToSign = $this->_calculateStringToSignV2($parameters);
684
+ } else {
685
+ throw new Exception("Invalid Signature Version specified");
686
+ }
687
+ return $this->_sign($stringToSign, $key, $algorithm);
688
+ }
689
+
690
+ /**
691
+ * Calculate String to Sign for SignatureVersion 2
692
+ * @param array $parameters request parameters
693
+ * @return String to Sign
694
+ */
695
+ private function _calculateStringToSignV2(array $parameters) {
696
+ $data = 'POST';
697
+ $data .= "\n";
698
+ $endpoint = parse_url ($this->_config['ServiceURL']);
699
+ $data .= $endpoint['host'];
700
+ $data .= "\n";
701
+ $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
702
+ if (!isset ($uri)) {
703
+ $uri = "/";
704
+ }
705
+ $uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
706
+ $data .= $uriencoded;
707
+ $data .= "\n";
708
+ uksort($parameters, 'strcmp');
709
+ $data .= $this->_getParametersAsString($parameters);
710
+ return $data;
711
+ }
712
+
713
+ private function _urlencode($value) {
714
+ return str_replace('%7E', '~', rawurlencode($value));
715
+ }
716
+
717
+
718
+ /**
719
+ * Computes RFC 2104-compliant HMAC signature.
720
+ */
721
+ private function _sign($data, $key, $algorithm)
722
+ {
723
+ if ($algorithm === 'HmacSHA1') {
724
+ $hash = 'sha1';
725
+ } else if ($algorithm === 'HmacSHA256') {
726
+ $hash = 'sha256';
727
+ } else {
728
+ throw new Exception ("Non-supported signing method specified");
729
+ }
730
+ return base64_encode(
731
+ hash_hmac($hash, $data, $key, true)
732
+ );
733
+ }
734
+
735
+
736
+ /**
737
+ * Formats date as ISO 8601 timestamp
738
+ */
739
+ private function _getFormattedTimestamp()
740
+ {
741
+ return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time());
742
+ }
743
+
744
+ /**
745
+ * Formats date as ISO 8601 timestamp
746
+ */
747
+ private function getFormattedTimestamp($dateTime)
748
+ {
749
+ return $dateTime->format(DATE_ISO8601);
750
+ }
751
+
752
+ }
lib/MarketplaceWebServiceSellers/Exception.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+
21
+ /**
22
+ * Marketplace Web Service Sellers Exception provides details of errors
23
+ * returned by Marketplace Web Service Sellers service
24
+ *
25
+ */
26
+ class MarketplaceWebServiceSellers_Exception extends Exception
27
+
28
+ {
29
+ /** @var string */
30
+ private $_message = null;
31
+ /** @var int */
32
+ private $_statusCode = -1;
33
+ /** @var string */
34
+ private $_errorCode = null;
35
+ /** @var string */
36
+ private $_errorType = null;
37
+ /** @var string */
38
+ private $_requestId = null;
39
+ /** @var string */
40
+ private $_xml = null;
41
+
42
+ private $_responseHeaderMetadata = null;
43
+
44
+ /**
45
+ * Constructs MarketplaceWebServiceSellers_Exception
46
+ * @param array $errorInfo details of exception.
47
+ * Keys are:
48
+ * <ul>
49
+ * <li>Message - (string) text message for an exception</li>
50
+ * <li>StatusCode - (int) HTTP status code at the time of exception</li>
51
+ * <li>ErrorCode - (string) specific error code returned by the service</li>
52
+ * <li>ErrorType - (string) Possible types: Sender, Receiver or Unknown</li>
53
+ * <li>RequestId - (string) request id returned by the service</li>
54
+ * <li>XML - (string) compete xml response at the time of exception</li>
55
+ * <li>Exception - (Exception) inner exception if any</li>
56
+ * </ul>
57
+ *
58
+ */
59
+ public function __construct(array $errorInfo = array())
60
+ {
61
+ $this->_message = $errorInfo["Message"];
62
+ parent::__construct($this->_message);
63
+ if (array_key_exists("Exception", $errorInfo)) {
64
+ $exception = $errorInfo["Exception"];
65
+ if ($exception instanceof MarketplaceWebServiceSellers_Exception) {
66
+ $this->_statusCode = $exception->getStatusCode();
67
+ $this->_errorCode = $exception->getErrorCode();
68
+ $this->_errorType = $exception->getErrorType();
69
+ $this->_requestId = $exception->getRequestId();
70
+ $this->_xml= $exception->getXML();
71
+ $this->_responseHeaderMetadata = $exception->getResponseHeaderMetadata();
72
+ }
73
+ } else {
74
+ $this->_statusCode = $this->arr_val($errorInfo, "StatusCode");
75
+ $this->_errorCode = $this->arr_val($errorInfo, "ErrorCode");
76
+ $this->_errorType = $this->arr_val($errorInfo, "ErrorType");
77
+ $this->_requestId = $this->arr_val($errorInfo, "RequestId");
78
+ $this->_xml = $this->arr_val($errorInfo, "XML");
79
+ $this->_responseHeaderMetadata = $this->arr_val($errorInfo, "ResponseHeaderMetadata");
80
+ }
81
+ }
82
+
83
+ private function arr_val($arr, $key) {
84
+ if(array_key_exists($key, $arr)) {
85
+ return $arr[$key];
86
+ } else {
87
+ return null;
88
+ }
89
+ }
90
+
91
+ /**
92
+ * Gets error type returned by the service if available.
93
+ *
94
+ * @return string Error Code returned by the service
95
+ */
96
+ public function getErrorCode(){
97
+ return $this->_errorCode;
98
+ }
99
+
100
+ /**
101
+ * Gets error type returned by the service.
102
+ *
103
+ * @return string Error Type returned by the service.
104
+ * Possible types: Sender, Receiver or Unknown
105
+ */
106
+ public function getErrorType(){
107
+ return $this->_errorType;
108
+ }
109
+
110
+ /**
111
+ * Gets error message
112
+ *
113
+ * @return string Error message
114
+ */
115
+ public function getErrorMessage() {
116
+ return $this->_message;
117
+ }
118
+
119
+ /**
120
+ * Gets status code returned by the service if available. If status
121
+ * code is set to -1, it means that status code was unavailable at the
122
+ * time exception was thrown
123
+ *
124
+ * @return int status code returned by the service
125
+ */
126
+ public function getStatusCode() {
127
+ return $this->_statusCode;
128
+ }
129
+
130
+ /**
131
+ * Gets XML returned by the service if available.
132
+ *
133
+ * @return string XML returned by the service
134
+ */
135
+ public function getXML() {
136
+ return $this->_xml;
137
+ }
138
+
139
+ /**
140
+ * Gets Request ID returned by the service if available.
141
+ *
142
+ * @return string Request ID returned by the service
143
+ */
144
+ public function getRequestId() {
145
+ return $this->_requestId;
146
+ }
147
+
148
+ public function getResponseHeaderMetadata() {
149
+ return $this->_responseHeaderMetadata;
150
+ }
151
+ }
lib/MarketplaceWebServiceSellers/Interface.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ interface MarketplaceWebServiceSellers_Interface
21
+ {
22
+
23
+ /**
24
+ * Get Service Status
25
+ * Returns the service status of a particular MWS API section. The operation
26
+ * takes no input.
27
+ * All API sections within the API are required to implement this operation.
28
+ *
29
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_GetServiceStatus request or MarketplaceWebServiceSellers_Model_GetServiceStatus object itself
30
+ * @see MarketplaceWebServiceSellers_Model_GetServiceStatusRequest
31
+ * @return MarketplaceWebServiceSellers_Model_GetServiceStatusResponse
32
+ *
33
+ * @throws MarketplaceWebServiceSellers_Exception
34
+ */
35
+ public function getServiceStatus($request);
36
+
37
+
38
+ /**
39
+ * List Marketplace Participations
40
+ * Returns a list of marketplaces that the seller submitting the request can sell in,
41
+ * and a list of participations that include seller-specific information in that marketplace.
42
+ *
43
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations object itself
44
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest
45
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse
46
+ *
47
+ * @throws MarketplaceWebServiceSellers_Exception
48
+ */
49
+ public function listMarketplaceParticipations($request);
50
+
51
+
52
+ /**
53
+ * List Marketplace Participations By Next Token
54
+ * Returns the next page of marketplaces and participations using the NextToken value
55
+ * that was returned by your previous request to either ListMarketplaceParticipations or
56
+ * ListMarketplaceParticipationsByNextToken.
57
+ *
58
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken object itself
59
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest
60
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenResponse
61
+ *
62
+ * @throws MarketplaceWebServiceSellers_Exception
63
+ */
64
+ public function listMarketplaceParticipationsByNextToken($request);
65
+
66
+ }
lib/MarketplaceWebServiceSellers/KeycheckClient.php ADDED
@@ -0,0 +1,752 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Interface
22
+ */
23
+ require_once ('Interface.php');
24
+
25
+ /**
26
+ * MarketplaceWebServiceSellers_Client is an implementation of MarketplaceWebServiceSellers
27
+ *
28
+ */
29
+ class MarketplaceWebServiceSellers_Client implements MarketplaceWebServiceSellers_Interface
30
+ {
31
+
32
+ const SERVICE_VERSION = '2011-07-01';
33
+ const MWS_CLIENT_VERSION = '2014-10-20';
34
+
35
+ /** @var string */
36
+ private $_awsAccessKeyId = null;
37
+
38
+ /** @var string */
39
+ private $_awsSecretAccessKey = null;
40
+
41
+ /** @var array */
42
+ private $_config = array ('ServiceURL' => null,
43
+ 'UserAgent' => 'MarketplaceWebServiceSellers PHP5 Library',
44
+ 'SignatureVersion' => 2,
45
+ 'SignatureMethod' => 'HmacSHA256',
46
+ 'ProxyHost' => null,
47
+ 'ProxyPort' => -1,
48
+ 'ProxyUsername' => null,
49
+ 'ProxyPassword' => null,
50
+ 'MaxErrorRetry' => 3,
51
+ 'Headers' => array()
52
+ );
53
+
54
+
55
+ /**
56
+ * Get Service Status
57
+ * Returns the service status of a particular MWS API section. The operation
58
+ * takes no input.
59
+ * All API sections within the API are required to implement this operation.
60
+ *
61
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_GetServiceStatus request or MarketplaceWebServiceSellers_Model_GetServiceStatus object itself
62
+ * @see MarketplaceWebServiceSellers_Model_GetServiceStatusRequest
63
+ * @return MarketplaceWebServiceSellers_Model_GetServiceStatusResponse
64
+ *
65
+ * @throws MarketplaceWebServiceSellers_Exception
66
+ */
67
+ public function getServiceStatus($request)
68
+ {
69
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_GetServiceStatusRequest)) {
70
+ $request = new MarketplaceWebServiceSellers_Model_GetServiceStatusRequest($request);
71
+ }
72
+ $parameters = $request->toQueryParameterArray();
73
+ $parameters['Action'] = 'GetServiceStatus';
74
+ $httpResponse = $this->_invoke($parameters);
75
+
76
+ $response = MarketplaceWebServiceSellers_Model_GetServiceStatusResponse::fromXML($httpResponse['ResponseBody']);
77
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
78
+ return $response;
79
+ }
80
+
81
+
82
+ /**
83
+ * Convert GetServiceStatusRequest to name value pairs
84
+ */
85
+ private function _convertGetServiceStatus($request) {
86
+
87
+ $parameters = array();
88
+ $parameters['Action'] = 'GetServiceStatus';
89
+ if ($request->isSetSellerId()) {
90
+ $parameters['SellerId'] = $request->getSellerId();
91
+ }
92
+ if ($request->isSetMWSAuthToken()) {
93
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
94
+ }
95
+
96
+ return $parameters;
97
+ }
98
+
99
+
100
+ /**
101
+ * List Marketplace Participations
102
+ * Returns a list of marketplaces that the seller submitting the request can sell in,
103
+ * and a list of participations that include seller-specific information in that marketplace.
104
+ *
105
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipations object itself
106
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest
107
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse
108
+ *
109
+ * @throws MarketplaceWebServiceSellers_Exception
110
+ */
111
+ public function listMarketplaceParticipations($request)
112
+ {
113
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest)) {
114
+ $request = new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest($request);
115
+ }
116
+ $parameters = $request->toQueryParameterArray();
117
+ $parameters['Action'] = 'ListMarketplaceParticipations';
118
+ $httpResponse = $this->_invoke($parameters);
119
+
120
+ $response = MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse::fromXML($httpResponse['ResponseBody']);
121
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
122
+ return $response;
123
+ }
124
+
125
+
126
+ /**
127
+ * Convert ListMarketplaceParticipationsRequest to name value pairs
128
+ */
129
+ private function _convertListMarketplaceParticipations($request) {
130
+
131
+ $parameters = array();
132
+ $parameters['Action'] = 'ListMarketplaceParticipations';
133
+ if ($request->isSetSellerId()) {
134
+ $parameters['SellerId'] = $request->getSellerId();
135
+ }
136
+ if ($request->isSetMWSAuthToken()) {
137
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
138
+ }
139
+
140
+ return $parameters;
141
+ }
142
+
143
+
144
+ /**
145
+ * List Marketplace Participations By Next Token
146
+ * Returns the next page of marketplaces and participations using the NextToken value
147
+ * that was returned by your previous request to either ListMarketplaceParticipations or
148
+ * ListMarketplaceParticipationsByNextToken.
149
+ *
150
+ * @param mixed $request array of parameters for MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken request or MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextToken object itself
151
+ * @see MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest
152
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenResponse
153
+ *
154
+ * @throws MarketplaceWebServiceSellers_Exception
155
+ */
156
+ public function listMarketplaceParticipationsByNextToken($request)
157
+ {
158
+ if (!($request instanceof MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest)) {
159
+ $request = new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenRequest($request);
160
+ }
161
+ $parameters = $request->toQueryParameterArray();
162
+ $parameters['Action'] = 'ListMarketplaceParticipationsByNextToken';
163
+ $httpResponse = $this->_invoke($parameters);
164
+
165
+ $response = MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsByNextTokenResponse::fromXML($httpResponse['ResponseBody']);
166
+ $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
167
+ return $response;
168
+ }
169
+
170
+
171
+ /**
172
+ * Convert ListMarketplaceParticipationsByNextTokenRequest to name value pairs
173
+ */
174
+ private function _convertListMarketplaceParticipationsByNextToken($request) {
175
+
176
+ $parameters = array();
177
+ $parameters['Action'] = 'ListMarketplaceParticipationsByNextToken';
178
+ if ($request->isSetSellerId()) {
179
+ $parameters['SellerId'] = $request->getSellerId();
180
+ }
181
+ if ($request->isSetMWSAuthToken()) {
182
+ $parameters['MWSAuthToken'] = $request->getMWSAuthToken();
183
+ }
184
+ if ($request->isSetNextToken()) {
185
+ $parameters['NextToken'] = $request->getNextToken();
186
+ }
187
+
188
+ return $parameters;
189
+ }
190
+
191
+
192
+
193
+ /**
194
+ * Construct new Client
195
+ *
196
+ * @param string $awsAccessKeyId AWS Access Key ID
197
+ * @param string $awsSecretAccessKey AWS Secret Access Key
198
+ * @param array $config configuration options.
199
+ * Valid configuration options are:
200
+ * <ul>
201
+ * <li>ServiceURL</li>
202
+ * <li>UserAgent</li>
203
+ * <li>SignatureVersion</li>
204
+ * <li>TimesRetryOnError</li>
205
+ * <li>ProxyHost</li>
206
+ * <li>ProxyPort</li>
207
+ * <li>ProxyUsername<li>
208
+ * <li>ProxyPassword<li>
209
+ * <li>MaxErrorRetry</li>
210
+ * </ul>
211
+ */
212
+ public function __construct($awsAccessKeyId, $awsSecretAccessKey, $applicationName, $applicationVersion, $config = null)
213
+ {
214
+ iconv_set_encoding('output_encoding', 'UTF-8');
215
+ iconv_set_encoding('input_encoding', 'UTF-8');
216
+ iconv_set_encoding('internal_encoding', 'UTF-8');
217
+
218
+ $this->_awsAccessKeyId = $awsAccessKeyId;
219
+ $this->_awsSecretAccessKey = $awsSecretAccessKey;
220
+ if (!is_null($config)) $this->_config = array_merge($this->_config, $config);
221
+ $this->setUserAgentHeader($applicationName, $applicationVersion);
222
+ }
223
+
224
+ private function setUserAgentHeader(
225
+ $applicationName,
226
+ $applicationVersion,
227
+ $attributes = null) {
228
+
229
+ if (is_null($attributes)) {
230
+ $attributes = array ();
231
+ }
232
+
233
+ $this->_config['UserAgent'] =
234
+ $this->constructUserAgentHeader($applicationName, $applicationVersion, $attributes);
235
+ }
236
+
237
+ private function constructUserAgentHeader($applicationName, $applicationVersion, $attributes = null) {
238
+ if (is_null($applicationName) || $applicationName === "") {
239
+ throw new InvalidArgumentException('$applicationName cannot be null');
240
+ }
241
+
242
+ if (is_null($applicationVersion) || $applicationVersion === "") {
243
+ throw new InvalidArgumentException('$applicationVersion cannot be null');
244
+ }
245
+
246
+ $userAgent =
247
+ $this->quoteApplicationName($applicationName)
248
+ . '/'
249
+ . $this->quoteApplicationVersion($applicationVersion);
250
+
251
+ $userAgent .= ' (';
252
+ $userAgent .= 'Language=PHP/' . phpversion();
253
+ $userAgent .= '; ';
254
+ $userAgent .= 'Platform=' . php_uname('s') . '/' . php_uname('m') . '/' . php_uname('r');
255
+ $userAgent .= '; ';
256
+ $userAgent .= 'MWSClientVersion=' . self::MWS_CLIENT_VERSION;
257
+
258
+ foreach ($attributes as $key => $value) {
259
+ if (empty($value)) {
260
+ throw new InvalidArgumentException("Value for $key cannot be null or empty.");
261
+ }
262
+
263
+ $userAgent .= '; '
264
+ . $this->quoteAttributeName($key)
265
+ . '='
266
+ . $this->quoteAttributeValue($value);
267
+ }
268
+
269
+ $userAgent .= ')';
270
+
271
+ return $userAgent;
272
+ }
273
+
274
+ /**
275
+ * Collapse multiple whitespace characters into a single ' ' character.
276
+ * @param $s
277
+ * @return string
278
+ */
279
+ private function collapseWhitespace($s) {
280
+ return preg_replace('/ {2,}|\s/', ' ', $s);
281
+ }
282
+
283
+ /**
284
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
285
+ * and '/' characters from a string.
286
+ * @param $s
287
+ * @return string
288
+ */
289
+ private function quoteApplicationName($s) {
290
+ $quotedString = $this->collapseWhitespace($s);
291
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
292
+ $quotedString = preg_replace('/\//', '\\/', $quotedString);
293
+
294
+ return $quotedString;
295
+ }
296
+
297
+ /**
298
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
299
+ * and '(' characters from a string.
300
+ *
301
+ * @param $s
302
+ * @return string
303
+ */
304
+ private function quoteApplicationVersion($s) {
305
+ $quotedString = $this->collapseWhitespace($s);
306
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
307
+ $quotedString = preg_replace('/\\(/', '\\(', $quotedString);
308
+
309
+ return $quotedString;
310
+ }
311
+
312
+ /**
313
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape '\',
314
+ * and '=' characters from a string.
315
+ *
316
+ * @param $s
317
+ * @return unknown_type
318
+ */
319
+ private function quoteAttributeName($s) {
320
+ $quotedString = $this->collapseWhitespace($s);
321
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
322
+ $quotedString = preg_replace('/\\=/', '\\=', $quotedString);
323
+
324
+ return $quotedString;
325
+ }
326
+
327
+ /**
328
+ * Collapse multiple whitespace characters into a single ' ' and backslash escape ';', '\',
329
+ * and ')' characters from a string.
330
+ *
331
+ * @param $s
332
+ * @return unknown_type
333
+ */
334
+ private function quoteAttributeValue($s) {
335
+ $quotedString = $this->collapseWhitespace($s);
336
+ $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
337
+ $quotedString = preg_replace('/\\;/', '\\;', $quotedString);
338
+ $quotedString = preg_replace('/\\)/', '\\)', $quotedString);
339
+
340
+ return $quotedString;
341
+ }
342
+
343
+
344
+ // Private API ------------------------------------------------------------//
345
+
346
+ /**
347
+ * Invoke request and return response
348
+ */
349
+ private function _invoke(array $parameters)
350
+ {
351
+ try {
352
+ if (empty($this->_config['ServiceURL'])) {
353
+ require_once (dirname(__FILE__) . '/Exception.php');
354
+ throw new MarketplaceWebServiceSellers_Exception(
355
+ array ('ErrorCode' => 'InvalidServiceURL',
356
+ 'Message' => "Missing serviceUrl configuration value. You may obtain a list of valid MWS URLs by consulting the MWS Developer's Guide, or reviewing the sample code published along side this library."));
357
+ }
358
+ $parameters = $this->_addRequiredParameters($parameters);
359
+ $retries = 0;
360
+ for (;;) {
361
+ $response = $this->_httpPost($parameters);
362
+ $status = $response['Status'];
363
+ if ($status == 200) {
364
+ return array('ResponseBody' => $response['ResponseBody'],
365
+ 'ResponseHeaderMetadata' => $response['ResponseHeaderMetadata']);
366
+ }
367
+ if ($status == 500 && $this->_pauseOnRetry(++$retries)) {
368
+ continue;
369
+ }
370
+ throw $this->_reportAnyErrors($response['ResponseBody'],
371
+ $status, $response['ResponseHeaderMetadata']);
372
+ }
373
+ } catch (MarketplaceWebServiceSellers_Exception $se) {
374
+ throw $se;
375
+ } catch (Exception $t) {
376
+ require_once (dirname(__FILE__) . '/Exception.php');
377
+ throw new MarketplaceWebServiceSellers_Exception(array('Exception' => $t, 'Message' => $t->getMessage()));
378
+ }
379
+ }
380
+
381
+ /**
382
+ * Look for additional error strings in the response and return formatted exception
383
+ */
384
+ private function _reportAnyErrors($responseBody, $status, $responseHeaderMetadata, Exception $e = null)
385
+ {
386
+ $exProps = array();
387
+ $exProps["StatusCode"] = $status;
388
+ $exProps["ResponseHeaderMetadata"] = $responseHeaderMetadata;
389
+
390
+ libxml_use_internal_errors(true); // Silence XML parsing errors
391
+ $xmlBody = simplexml_load_string($responseBody);
392
+
393
+ if ($xmlBody !== false) { // Check XML loaded without errors
394
+ $exProps["XML"] = $responseBody;
395
+ $exProps["ErrorCode"] = $xmlBody->Error->Code;
396
+ $exProps["Message"] = $xmlBody->Error->Message;
397
+ $exProps["ErrorType"] = !empty($xmlBody->Error->Type) ? $xmlBody->Error->Type : "Unknown";
398
+ $exProps["RequestId"] = !empty($xmlBody->RequestID) ? $xmlBody->RequestID : $xmlBody->RequestId; // 'd' in RequestId is sometimes capitalized
399
+ } else { // We got bad XML in response, just throw a generic exception
400
+ $exProps["Message"] = "Internal Error";
401
+ }
402
+
403
+ require_once (dirname(__FILE__) . '/Exception.php');
404
+ return new MarketplaceWebServiceSellers_Exception($exProps);
405
+ }
406
+
407
+
408
+
409
+ /**
410
+ * Perform HTTP post with exponential retries on error 500 and 503
411
+ *
412
+ */
413
+ private function _httpPost(array $parameters)
414
+ {
415
+ $config = $this->_config;
416
+ $query = $this->_getParametersAsString($parameters);
417
+ $url = parse_url ($config['ServiceURL']);
418
+ $uri = array_key_exists('path', $url) ? $url['path'] : null;
419
+ if (!isset ($uri)) {
420
+ $uri = "/";
421
+ }
422
+
423
+ switch ($url['scheme']) {
424
+ case 'https':
425
+ $scheme = 'https://';
426
+ $port = isset($url['port']) ? $url['port'] : 443;
427
+ break;
428
+ default:
429
+ $scheme = 'http://';
430
+ $port = isset($url['port']) ? $url['port'] : 80;
431
+ }
432
+
433
+ $allHeaders = $config['Headers'];
434
+ $allHeaders['Content-Type'] = "application/x-www-form-urlencoded; charset=utf-8"; // We need to make sure to set utf-8 encoding here
435
+ $allHeaders['Expect'] = null; // Don't expect 100 Continue
436
+ $allHeadersStr = array();
437
+ foreach($allHeaders as $name => $val) {
438
+ $str = $name . ": ";
439
+ if(isset($val)) {
440
+ $str = $str . $val;
441
+ }
442
+ $allHeadersStr[] = $str;
443
+ }
444
+
445
+ $ch = curl_init();
446
+ curl_setopt($ch, CURLOPT_URL, $scheme . $url['host'] . $uri);
447
+ curl_setopt($ch, CURLOPT_PORT, $port);
448
+ $this->setSSLCurlOptions($ch);
449
+ curl_setopt($ch, CURLOPT_USERAGENT, $this->_config['UserAgent']);
450
+ curl_setopt($ch, CURLOPT_POST, true);
451
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
452
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $allHeadersStr);
453
+ curl_setopt($ch, CURLOPT_HEADER, true);
454
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
455
+ if ($config['ProxyHost'] != null && $config['ProxyPort'] != -1)
456
+ {
457
+ curl_setopt($ch, CURLOPT_PROXY, $config['ProxyHost'] . ':' . $config['ProxyPort']);
458
+ }
459
+ if ($config['ProxyUsername'] != null && $config['ProxyPassword'] != null)
460
+ {
461
+ curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['ProxyUsername'] . ':' . $config['ProxyPassword']);
462
+ }
463
+
464
+ $response = "";
465
+ $response = curl_exec($ch);
466
+
467
+ if($response === false) {
468
+ require_once (dirname(__FILE__) . '/Exception.php');
469
+ $exProps["Message"] = curl_error($ch);
470
+ $exProps["ErrorType"] = "HTTP";
471
+ curl_close($ch);
472
+ throw new MarketplaceWebServiceSellers_Exception($exProps);
473
+ }
474
+
475
+ curl_close($ch);
476
+ return $this->_extractHeadersAndBody($response);
477
+ }
478
+
479
+ /**
480
+ * This method will attempt to extract the headers and body of our response.
481
+ * We need to split the raw response string by 2 'CRLF's. 2 'CRLF's should indicate the separation of the response header
482
+ * from the response body. However in our case we have some circumstances (certain client proxies) that result in
483
+ * multiple responses concatenated. We could encounter a response like
484
+ *
485
+ * HTTP/1.1 100 Continue
486
+ *
487
+ * HTTP/1.1 200 OK
488
+ * Date: Tue, 01 Apr 2014 13:02:51 GMT
489
+ * Content-Type: text/html; charset=iso-8859-1
490
+ * Content-Length: 12605
491
+ *
492
+ * ... body ..
493
+ *
494
+ * This method will throw away extra response status lines and attempt to find the first full response headers and body
495
+ *
496
+ * return [status, body, ResponseHeaderMetadata]
497
+ */
498
+ private function _extractHeadersAndBody($response){
499
+ //First split by 2 'CRLF'
500
+ $responseComponents = preg_split("/(?:\r?\n){2}/", $response);
501
+ $body = null;
502
+ for ($count = 0;
503
+ $count < count($responseComponents) && $body == null;
504
+ $count++) {
505
+
506
+ $headers = $responseComponents[$count];
507
+ $responseStatus = $this->_extractHttpStatusCode($headers);
508
+
509
+ if($responseStatus != null &&
510
+ $this->_httpHeadersHaveContent($headers)){
511
+
512
+ $responseHeaderMetadata = $this->_extractResponseHeaderMetadata($headers);
513
+ //The body will be the next item in the responseComponents array
514
+ $body = $responseComponents[++$count];
515
+ }
516
+ }
517
+
518
+ //If the body is null here then we were unable to parse the response and will throw an exception
519
+ if($body == null){
520
+ $exProps["Message"] = "Failed to parse valid HTTP response (" . $response . ")";
521
+ $exProps["ErrorType"] = "HTTP";
522
+ throw new MarketplaceWebServiceSellers_Exception($exProps);
523
+ }
524
+
525
+ return array(
526
+ 'Status' => $responseStatus,
527
+ 'ResponseBody' => $body,
528
+ 'ResponseHeaderMetadata' => $responseHeaderMetadata);
529
+ }
530
+
531
+ /**
532
+ * parse the status line of a header string for the proper format and
533
+ * return the status code
534
+ *
535
+ * Example: HTTP/1.1 200 OK
536
+ * ...
537
+ * returns String statusCode or null if the status line can't be parsed
538
+ */
539
+ private function _extractHttpStatusCode($headers){
540
+ $statusCode = null;
541
+ if (1 === preg_match("/(\\S+) +(\\d+) +([^\n\r]+)(?:\r?\n|\r)/", $headers, $matches)) {
542
+ //The matches array [entireMatchString, protocol, statusCode, the rest]
543
+ $statusCode = $matches[2];
544
+ }
545
+ return $statusCode;
546
+ }
547
+
548
+ /**
549
+ * Tries to determine some valid headers indicating this response
550
+ * has content. In this case
551
+ * return true if there is a valid "Content-Length" or "Transfer-Encoding" header
552
+ */
553
+ private function _httpHeadersHaveContent($headers){
554
+ return (1 === preg_match("/[cC]ontent-[lL]ength: +(?:\\d+)(?:\\r?\\n|\\r|$)/", $headers) ||
555
+ 1 === preg_match("/Transfer-Encoding: +(?!identity[\r\n;= ])(?:[^\r\n]+)(?:\r?\n|\r|$)/i", $headers));
556
+ }
557
+
558
+ /**
559
+ * extract a ResponseHeaderMetadata object from the raw headers
560
+ */
561
+ private function _extractResponseHeaderMetadata($rawHeaders){
562
+ $inputHeaders = preg_split("/\r\n|\n|\r/", $rawHeaders);
563
+ $headers = array();
564
+ $headers['x-mws-request-id'] = null;
565
+ $headers['x-mws-response-context'] = null;
566
+ $headers['x-mws-timestamp'] = null;
567
+ $headers['x-mws-quota-max'] = null;
568
+ $headers['x-mws-quota-remaining'] = null;
569
+ $headers['x-mws-quota-resetsOn'] = null;
570
+
571
+ foreach ($inputHeaders as $currentHeader) {
572
+ $keyValue = explode (': ', $currentHeader);
573
+ if (isset($keyValue[1])) {
574
+ list ($key, $value) = $keyValue;
575
+ if (isset($headers[$key]) && $headers[$key]!==null) {
576
+ $headers[$key] = $headers[$key] . "," . $value;
577
+ } else {
578
+ $headers[$key] = $value;
579
+ }
580
+ }
581
+ }
582
+
583
+ return new MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata(
584
+ $headers['x-mws-request-id'],
585
+ $headers['x-mws-response-context'],
586
+ $headers['x-mws-timestamp'],
587
+ $headers['x-mws-quota-max'],
588
+ $headers['x-mws-quota-remaining'],
589
+ $headers['x-mws-quota-resetsOn']);
590
+ }
591
+
592
+ /**
593
+ * Set curl options relating to SSL. Protected to allow overriding.
594
+ * @param $ch curl handle
595
+ */
596
+ protected function setSSLCurlOptions($ch) {
597
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
598
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
599
+ }
600
+
601
+ /**
602
+ * Exponential sleep on failed request
603
+ *
604
+ * @param retries current retry
605
+ */
606
+ private function _pauseOnRetry($retries)
607
+ {
608
+ if ($retries <= $this->_config['MaxErrorRetry']) {
609
+ $delay = (int) (pow(4, $retries) * 100000);
610
+ usleep($delay);
611
+ return true;
612
+ }
613
+ return false;
614
+ }
615
+
616
+ /**
617
+ * Add authentication related and version parameters
618
+ */
619
+ private function _addRequiredParameters(array $parameters)
620
+ {
621
+ $parameters['AWSAccessKeyId'] = $this->_awsAccessKeyId;
622
+ $parameters['Timestamp'] = $this->_getFormattedTimestamp();
623
+ $parameters['Version'] = self::SERVICE_VERSION;
624
+ $parameters['SignatureVersion'] = $this->_config['SignatureVersion'];
625
+ if ($parameters['SignatureVersion'] > 1) {
626
+ $parameters['SignatureMethod'] = $this->_config['SignatureMethod'];
627
+ }
628
+ $parameters['Signature'] = $this->_signParameters($parameters, $this->_awsSecretAccessKey);
629
+
630
+ return $parameters;
631
+ }
632
+
633
+ /**
634
+ * Convert paremeters to Url encoded query string
635
+ */
636
+ private function _getParametersAsString(array $parameters)
637
+ {
638
+ $queryParameters = array();
639
+ foreach ($parameters as $key => $value) {
640
+ $queryParameters[] = $key . '=' . $this->_urlencode($value);
641
+ }
642
+ return implode('&', $queryParameters);
643
+ }
644
+
645
+
646
+ /**
647
+ * Computes RFC 2104-compliant HMAC signature for request parameters
648
+ * Implements AWS Signature, as per following spec:
649
+ *
650
+ * If Signature Version is 0, it signs concatenated Action and Timestamp
651
+ *
652
+ * If Signature Version is 1, it performs the following:
653
+ *
654
+ * Sorts all parameters (including SignatureVersion and excluding Signature,
655
+ * the value of which is being created), ignoring case.
656
+ *
657
+ * Iterate over the sorted list and append the parameter name (in original case)
658
+ * and then its value. It will not URL-encode the parameter values before
659
+ * constructing this string. There are no separators.
660
+ *
661
+ * If Signature Version is 2, string to sign is based on following:
662
+ *
663
+ * 1. The HTTP Request Method followed by an ASCII newline (%0A)
664
+ * 2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline.
665
+ * 3. The URL encoded HTTP absolute path component of the URI
666
+ * (up to but not including the query string parameters);
667
+ * if this is empty use a forward '/'. This parameter is followed by an ASCII newline.
668
+ * 4. The concatenation of all query string components (names and values)
669
+ * as UTF-8 characters which are URL encoded as per RFC 3986
670
+ * (hex characters MUST be uppercase), sorted using lexicographic byte ordering.
671
+ * Parameter names are separated from their values by the '=' character
672
+ * (ASCII character 61), even if the value is empty.
673
+ * Pairs of parameter and values are separated by the '&' character (ASCII code 38).
674
+ *
675
+ */
676
+ private function _signParameters(array $parameters, $key) {
677
+ $signatureVersion = $parameters['SignatureVersion'];
678
+ $algorithm = "HmacSHA1";
679
+ $stringToSign = null;
680
+ if (2 == $signatureVersion) {
681
+ $algorithm = $this->_config['SignatureMethod'];
682
+ $parameters['SignatureMethod'] = $algorithm;
683
+ $stringToSign = $this->_calculateStringToSignV2($parameters);
684
+ } else {
685
+ throw new Exception("Invalid Signature Version specified");
686
+ }
687
+ return $this->_sign($stringToSign, $key, $algorithm);
688
+ }
689
+
690
+ /**
691
+ * Calculate String to Sign for SignatureVersion 2
692
+ * @param array $parameters request parameters
693
+ * @return String to Sign
694
+ */
695
+ private function _calculateStringToSignV2(array $parameters) {
696
+ $data = 'POST';
697
+ $data .= "\n";
698
+ $endpoint = parse_url ($this->_config['ServiceURL']);
699
+ $data .= $endpoint['host'];
700
+ $data .= "\n";
701
+ $uri = array_key_exists('path', $endpoint) ? $endpoint['path'] : null;
702
+ if (!isset ($uri)) {
703
+ $uri = "/";
704
+ }
705
+ $uriencoded = implode("/", array_map(array($this, "_urlencode"), explode("/", $uri)));
706
+ $data .= $uriencoded;
707
+ $data .= "\n";
708
+ uksort($parameters, 'strcmp');
709
+ $data .= $this->_getParametersAsString($parameters);
710
+ return $data;
711
+ }
712
+
713
+ private function _urlencode($value) {
714
+ return str_replace('%7E', '~', rawurlencode($value));
715
+ }
716
+
717
+
718
+ /**
719
+ * Computes RFC 2104-compliant HMAC signature.
720
+ */
721
+ private function _sign($data, $key, $algorithm)
722
+ {
723
+ if ($algorithm === 'HmacSHA1') {
724
+ $hash = 'sha1';
725
+ } else if ($algorithm === 'HmacSHA256') {
726
+ $hash = 'sha256';
727
+ } else {
728
+ throw new Exception ("Non-supported signing method specified");
729
+ }
730
+ return base64_encode(
731
+ hash_hmac($hash, $data, $key, true)
732
+ );
733
+ }
734
+
735
+
736
+ /**
737
+ * Formats date as ISO 8601 timestamp
738
+ */
739
+ private function _getFormattedTimestamp()
740
+ {
741
+ return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time());
742
+ }
743
+
744
+ /**
745
+ * Formats date as ISO 8601 timestamp
746
+ */
747
+ private function getFormattedTimestamp($dateTime)
748
+ {
749
+ return $dateTime->format(DATE_ISO8601);
750
+ }
751
+
752
+ }
lib/MarketplaceWebServiceSellers/Model.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * MarketplaceWebServiceSellers_Model - base class for all model classes
22
+ */
23
+
24
+ require_once ('Model/ListMarketplaceParticipationsResponse.php');
25
+ require_once ('Model/ListMarketplaceParticipationsResult.php');
26
+ require_once ('Model/ListParticipations.php');
27
+ require_once ('Model/ListMarketplaces.php');
28
+ require_once ('Model/Participation.php');
29
+ require_once ('Model/Marketplace.php');
30
+ require_once ('Model/ResponseHeaderMetaData.php');
31
+ require_once ('Model/ResponseMetaData.php');
32
+
33
+ abstract class MarketplaceWebServiceSellers_Model
34
+ {
35
+
36
+ /** @var array */
37
+ protected $_fields = array ();
38
+
39
+ /**
40
+ * Construct new model class
41
+ *
42
+ * @param mixed $data - DOMElement or Associative Array to construct from.
43
+ */
44
+ public function __construct($data = null)
45
+ {
46
+ if (!is_null($data)) {
47
+ if ($this->_isAssociativeArray($data)) {
48
+ $this->_fromAssociativeArray($data);
49
+ } elseif ($this->_isDOMElement($data)) {
50
+ $this->_fromDOMElement($data);
51
+ } else {
52
+ throw new Exception ("Unable to construct from provided data. Please be sure to pass associative array or DOMElement");
53
+ }
54
+ }
55
+ }
56
+
57
+ /**
58
+ * Support for virtual properties getters.
59
+ *
60
+ * Virtual property call example:
61
+ *
62
+ * $action->Property
63
+ *
64
+ * Direct getter(preferred):
65
+ *
66
+ * $action->getProperty()
67
+ *
68
+ * @param string $propertyName name of the property
69
+ */
70
+ public function __get($propertyName)
71
+ {
72
+ $getter = "get$propertyName";
73
+ return $this->$getter();
74
+ }
75
+
76
+ /**
77
+ * Support for virtual properties setters.
78
+ *
79
+ * Virtual property call example:
80
+ *
81
+ * $action->Property = 'ABC'
82
+ *
83
+ * Direct setter (preferred):
84
+ *
85
+ * $action->setProperty('ABC')
86
+ *
87
+ * @param string $propertyName name of the property
88
+ */
89
+ public function __set($propertyName, $propertyValue)
90
+ {
91
+ $setter = "set$propertyName";
92
+ $this->$setter($propertyValue);
93
+ return $this;
94
+ }
95
+
96
+ /**
97
+ * Construct from DOMElement
98
+ *
99
+ * This function iterates over object fields and queries XML
100
+ * for corresponding tag value. If query succeeds, value extracted
101
+ * from xml, and field value properly constructed based on field type.
102
+ *
103
+ * Field types defined as arrays always constructed as arrays,
104
+ * even if XML contains a single element - to make sure that
105
+ * data structure is predictable, and no is_array checks are
106
+ * required.
107
+ *
108
+ * @param DOMElement $dom XML element to construct from
109
+ */
110
+ private function _fromDOMElement(DOMElement $dom)
111
+ {
112
+ $xpath = new DOMXPath($dom->ownerDocument);
113
+
114
+ foreach ($this->_fields as $fieldName => $field) {
115
+ $fieldType = $field['FieldType'];
116
+ if (is_array($fieldType)) {
117
+ if ($fieldType[0] == "object") {
118
+ $elements = $dom->childNodes;
119
+ for($i = 0 ; $i < $elements->length; $i++) {
120
+ $this->_fields[$fieldName]['FieldValue'][] = $elements->item($i);
121
+ }
122
+ } else if ($this->_isComplexType($fieldType[0])) {
123
+ if (isset($field['ListMemberName'])) {
124
+ $memberName = $field['ListMemberName'];
125
+ $elements = $xpath->query("./*[local-name()='$fieldName']/*[local-name()='$memberName']", $dom);
126
+ } else {
127
+ $elements = $xpath->query("./*[local-name()='$fieldName']", $dom);
128
+ }
129
+ if ($elements->length >= 1) {
130
+ foreach ($elements as $element) {
131
+ $this->_fields[$fieldName]['FieldValue'][] = new $fieldType[0]($element);
132
+ }
133
+ }
134
+ } else {
135
+ if (isset($field['ListMemberName'])) {
136
+ $memberName = $field['ListMemberName'];
137
+ $elements = $xpath->query("./*[local-name()='$fieldName']/*[local-name()='$memberName']", $dom);
138
+ } else {
139
+ $elements = $xpath->query("./*[local-name()='$fieldName']", $dom);
140
+ }
141
+ if ($elements->length >= 1) {
142
+ foreach ($elements as $element) {
143
+ $text = $xpath->query('./text()', $element);
144
+ $this->_fields[$fieldName]['FieldValue'][] = $text->item(0)->data;
145
+ }
146
+ }
147
+ }
148
+ } else {
149
+ if ($this->_isComplexType($fieldType)) {
150
+ $elements = $xpath->query("./*[local-name()='$fieldName']", $dom);
151
+ if ($elements->length == 1) {
152
+ $this->_fields[$fieldName]['FieldValue'] = new $fieldType($elements->item(0));
153
+ }
154
+ } else {
155
+ if($fieldType[0] == "@") {
156
+ $attribute = $xpath->query("./@$fieldName", $dom);
157
+ if ($attribute->length == 1) {
158
+ $this->_fields[$fieldName]['FieldValue'] = $attribute->item(0)->nodeValue;
159
+ if (isset ($this->_fields['Value'])) {
160
+ $parentNode = $attribute->item(0)->parentNode;
161
+ $this->_fields['Value']['FieldValue'] = $parentNode->nodeValue;
162
+ }
163
+ }
164
+ } else {
165
+ $element = $xpath->query("./*[local-name()='$fieldName']/text()", $dom);
166
+ if ($element->length == 1) {
167
+ $this->_fields[$fieldName]['FieldValue'] = $element->item(0)->data;
168
+ }
169
+ }
170
+
171
+ $attribute = $xpath->query("./@$fieldName", $dom);
172
+ if ($attribute->length == 1) {
173
+ $this->_fields[$fieldName]['FieldValue'] = $attribute->item(0)->nodeValue;
174
+ if (isset ($this->_fields['Value'])) {
175
+ $parentNode = $attribute->item(0)->parentNode;
176
+ $this->_fields['Value']['FieldValue'] = $parentNode->nodeValue;
177
+ }
178
+ }
179
+
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+
186
+ /**
187
+ * Construct from Associative Array
188
+ *
189
+ *
190
+ * @param array $array associative array to construct from
191
+ */
192
+ private function _fromAssociativeArray(array $array)
193
+ {
194
+ foreach ($this->_fields as $fieldName => $field) {
195
+ $fieldType = $field['FieldType'];
196
+ if (is_array($fieldType)) {
197
+ if ($this->_isComplexType($fieldType[0])) {
198
+ if (array_key_exists($fieldName, $array)) {
199
+ $elements = $array[$fieldName];
200
+ if (!$this->_isNumericArray($elements)) {
201
+ $elements = array($elements);
202
+ }
203
+ if (count ($elements) >= 1) {
204
+ require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $fieldType[0]) . ".php");
205
+
206
+ foreach ($elements as $element) {
207
+ $this->_fields[$fieldName]['FieldValue'][] = new $fieldType[0]($element);
208
+ }
209
+ }
210
+ }
211
+ } else {
212
+ if (array_key_exists($fieldName, $array)) {
213
+ $elements = $array[$fieldName];
214
+ if (!$this->_isNumericArray($elements)) {
215
+ $elements = array($elements);
216
+ }
217
+ if (count ($elements) >= 1) {
218
+ foreach ($elements as $element) {
219
+ $this->_fields[$fieldName]['FieldValue'][] = $element;
220
+ }
221
+ }
222
+ }
223
+ }
224
+ } else {
225
+ if ($this->_isComplexType($fieldType)) {
226
+ if (array_key_exists($fieldName, $array)) {
227
+ require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $fieldType) . ".php");
228
+ $this->_fields[$fieldName]['FieldValue'] = new $fieldType($array[$fieldName]);
229
+ }
230
+ } else {
231
+ if (array_key_exists($fieldName, $array)) {
232
+ $this->_fields[$fieldName]['FieldValue'] = $array[$fieldName];
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Convert to query parameters suitable for POSTing.
241
+ * @return array of query parameters
242
+ */
243
+ public function toQueryParameterArray() {
244
+ return $this->_toQueryParameterArray("");
245
+ }
246
+
247
+ protected function _toQueryParameterArray($prefix) {
248
+ $arr = array();
249
+ foreach($this->_fields as $fieldName => $fieldAttrs) {
250
+ $fieldType = $fieldAttrs['FieldType'];
251
+ $fieldValue = $fieldAttrs['FieldValue'];
252
+ $newPrefix = $prefix . $fieldName . '.';
253
+ $currentArr = $this->__toQueryParameterArray($newPrefix, $fieldType, $fieldValue, $fieldAttrs);
254
+ $arr = array_merge($arr, $currentArr);
255
+ }
256
+ return $arr;
257
+ }
258
+
259
+ private function __toQueryParameterArray($prefix, $fieldType, $fieldValue, $fieldAttrs) {
260
+ $arr = array();
261
+ if(is_array($fieldType)) {
262
+ if(isset($fieldAttrs['ListMemberName'])) {
263
+ $listMemberName = $fieldAttrs['ListMemberName'];
264
+ $itemPrefix = $prefix . $listMemberName . '.';
265
+ } else {
266
+ $itemPrefix = $prefix;
267
+ }
268
+
269
+ for($i = 1; $i <= count($fieldValue); $i++) {
270
+ $indexedPrefix = $itemPrefix . $i . '.';
271
+ $memberType = $fieldType[0];
272
+ $arr = array_merge($arr,
273
+ $this->__toQueryParameterArray($indexedPrefix,
274
+ $memberType, $fieldValue[$i - 1], null));
275
+ }
276
+
277
+ } else if($this->_isComplexType($fieldType)) {
278
+ // Struct
279
+ if(isset($fieldValue)) {
280
+ $arr = array_merge($arr, $fieldValue->_toQueryParameterArray($prefix));
281
+ }
282
+ } else {
283
+ // Primitive
284
+ if ($fieldValue!==null && $fieldValue!=="") {
285
+ if ($fieldType=='bool') {
286
+ $fieldValue = ($fieldValue)?'true':'false';
287
+ }
288
+ $arr[rtrim($prefix, '.')] = $fieldValue;
289
+ }
290
+ }
291
+ return $arr;
292
+ }
293
+
294
+ /**
295
+ * XML fragment representation of this object
296
+ * Note, name of the root determined by caller
297
+ * This fragment returns inner fields representation only
298
+ * @return string XML fragment for this object
299
+ */
300
+ protected function _toXMLFragment()
301
+ {
302
+ $xml = "";
303
+ foreach ($this->_fields as $fieldName => $field) {
304
+ $fieldValue = $field['FieldValue'];
305
+ if (!is_null($fieldValue) && $field['FieldType'] != "MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata") {
306
+ $fieldType = $field['FieldType'];
307
+ if (is_array($fieldType)) {
308
+ if ($fieldType[0] == "object") {
309
+ foreach ($fieldValue as $item) {
310
+ $newDoc = new DOMDocument();
311
+ $importedNode = $newDoc->importNode($item, true);
312
+ $newDoc->appendChild($importedNode);
313
+ $xmlStr = $newDoc->saveXML();
314
+ $xmlStr = substr($xmlStr, strpos($xmlStr, "?>") + 2);
315
+ $xml .= trim($xmlStr);
316
+ }
317
+ } else if ($this->_isComplexType($fieldType[0])) {
318
+ if (isset($field['ListMemberName'])) {
319
+ $memberName = $field['ListMemberName'];
320
+ $xml .= "<$fieldName>";
321
+ foreach ($fieldValue as $item) {
322
+ $xml .= "<$memberName>";
323
+ $xml .= $item->_toXMLFragment();
324
+ $xml .= "</$memberName>";
325
+ }
326
+ $xml .= "</$fieldName>";
327
+ } else {
328
+ foreach ($fieldValue as $item) {
329
+ $xml .= "<$fieldName";
330
+ $xml .= $item->_getAttributes();
331
+ $xml .= ">";
332
+ $xml .= $item->_toXMLFragment();
333
+ $xml .= "</$fieldName>";
334
+ }
335
+ }
336
+ } else {
337
+ if(isset($field['ListMemberName'])) {
338
+ $memberName = $field['ListMemberName'];
339
+ $xml .= "<$fieldName>";
340
+ foreach ($fieldValue as $item) {
341
+ $xml .= "<$memberName>";
342
+ $xml .= $this->_escapeXML($item);
343
+ $xml .= "</$memberName>";
344
+ }
345
+ $xml .= "</$fieldName>";
346
+ } else {
347
+ foreach ($fieldValue as $item) {
348
+ $xml .= "<$fieldName>";
349
+ $xml .= $this->_escapeXML($item);
350
+ $xml .= "</$fieldName>";
351
+ }
352
+ }
353
+ }
354
+ } else {
355
+ if ($this->_isComplexType($fieldType)) {
356
+ $xml .= "<$fieldName";
357
+ $xml .= $fieldValue->_getAttributes();
358
+ $xml .= ">";
359
+ $xml .= $fieldValue->_toXMLFragment();
360
+ $xml .= "</$fieldName>";
361
+ } else if($fieldType[0] != "@") {
362
+ $xml .= "<$fieldName>";
363
+ $xml .= $this->_escapeXML($fieldValue);
364
+ $xml .= "</$fieldName>";
365
+ }
366
+ }
367
+ }
368
+ }
369
+ return $xml;
370
+ }
371
+
372
+ protected function _getAttributes() {
373
+ $xml = "";
374
+ foreach ($this->_fields as $fieldName => $field) {
375
+ $fieldValue = $field['FieldValue'];
376
+ if (!is_null($fieldValue)) {
377
+ $fieldType = $field['FieldType'];
378
+ if($fieldType[0] == "@") {
379
+ $xml .= " " . $fieldName . "='" . $this->_escapeXML($fieldValue) . "'";
380
+ }
381
+ }
382
+ }
383
+ return $xml;
384
+ }
385
+
386
+ /**
387
+ * Escape special XML characters
388
+ * @return string with escaped XML characters
389
+ */
390
+ private function _escapeXML($str)
391
+ {
392
+ $from = array( "&", "<", ">", "'", "\"");
393
+ $to = array( "&amp;", "&lt;", "&gt;", "&#039;", "&quot;");
394
+ return str_replace($from, $to, $str);
395
+ }
396
+
397
+ /**
398
+ * Determines if field is complex type
399
+ *
400
+ * @param string $fieldType field type name
401
+ */
402
+ private function _isComplexType ($fieldType)
403
+ {
404
+ return preg_match("/^MarketplaceWebServiceSellers_/", $fieldType);
405
+ }
406
+
407
+ /**
408
+ * Checks whether passed variable is an associative array
409
+ *
410
+ * @param mixed $var
411
+ * @return TRUE if passed variable is an associative array
412
+ */
413
+ private function _isAssociativeArray($var)
414
+ {
415
+ return is_array($var) && array_keys($var) !== range(0, sizeof($var) - 1);
416
+ }
417
+
418
+ /**
419
+ * Checks whether passed variable is DOMElement
420
+ *
421
+ * @param mixed $var
422
+ * @return TRUE if passed variable is DOMElement
423
+ */
424
+ private function _isDOMElement($var)
425
+ {
426
+ return $var instanceof DOMElement;
427
+ }
428
+
429
+ /**
430
+ * Checks whether passed variable is numeric array
431
+ *
432
+ * @param mixed $var
433
+ * @return TRUE if passed variable is an numeric array
434
+ */
435
+ protected function _isNumericArray($var)
436
+ {
437
+ if (!is_array($var))
438
+ {
439
+ return false;
440
+ }
441
+ $sz = sizeof($var);
442
+ return ($sz===0 || array_keys($var) === range(0, sizeof($var) - 1));
443
+ }
444
+
445
+ }
lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsRequest.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>SellerId: string</li>
34
+ * <li>MWSAuthToken: string</li>
35
+ *
36
+ * </ul>
37
+ */
38
+
39
+ class MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsRequest extends MarketplaceWebServiceSellers_Model {
40
+
41
+ public function __construct($data = null)
42
+ {
43
+ $this->_fields = array (
44
+ 'SellerId' => array('FieldValue' => null, 'FieldType' => 'string'),
45
+ 'MWSAuthToken' => array('FieldValue' => null, 'FieldType' => 'string'),
46
+ );
47
+ parent::__construct($data);
48
+ }
49
+
50
+ /**
51
+ * Get the value of the SellerId property.
52
+ *
53
+ * @return String SellerId.
54
+ */
55
+ public function getSellerId()
56
+ {
57
+ return $this->_fields['SellerId']['FieldValue'];
58
+ }
59
+
60
+ /**
61
+ * Set the value of the SellerId property.
62
+ *
63
+ * @param string sellerId
64
+ * @return this instance
65
+ */
66
+ public function setSellerId($value)
67
+ {
68
+ $this->_fields['SellerId']['FieldValue'] = $value;
69
+ return $this;
70
+ }
71
+
72
+ /**
73
+ * Check to see if SellerId is set.
74
+ *
75
+ * @return true if SellerId is set.
76
+ */
77
+ public function isSetSellerId()
78
+ {
79
+ return !is_null($this->_fields['SellerId']['FieldValue']);
80
+ }
81
+
82
+ /**
83
+ * Set the value of SellerId, return this.
84
+ *
85
+ * @param sellerId
86
+ * The new value to set.
87
+ *
88
+ * @return This instance.
89
+ */
90
+ public function withSellerId($value)
91
+ {
92
+ $this->setSellerId($value);
93
+ return $this;
94
+ }
95
+
96
+ /**
97
+ * Get the value of the MWSAuthToken property.
98
+ *
99
+ * @return String MWSAuthToken.
100
+ */
101
+ public function getMWSAuthToken()
102
+ {
103
+ return $this->_fields['MWSAuthToken']['FieldValue'];
104
+ }
105
+
106
+ /**
107
+ * Set the value of the MWSAuthToken property.
108
+ *
109
+ * @param string mwsAuthToken
110
+ * @return this instance
111
+ */
112
+ public function setMWSAuthToken($value)
113
+ {
114
+ $this->_fields['MWSAuthToken']['FieldValue'] = $value;
115
+ return $this;
116
+ }
117
+
118
+ /**
119
+ * Check to see if MWSAuthToken is set.
120
+ *
121
+ * @return true if MWSAuthToken is set.
122
+ */
123
+ public function isSetMWSAuthToken()
124
+ {
125
+ return !is_null($this->_fields['MWSAuthToken']['FieldValue']);
126
+ }
127
+
128
+ /**
129
+ * Set the value of MWSAuthToken, return this.
130
+ *
131
+ * @param mwsAuthToken
132
+ * The new value to set.
133
+ *
134
+ * @return This instance.
135
+ */
136
+ public function withMWSAuthToken($value)
137
+ {
138
+ $this->setMWSAuthToken($value);
139
+ return $this;
140
+ }
141
+
142
+ }
lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsResponse.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+
25
+
26
+ /**
27
+ * MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse
28
+ *
29
+ * Properties:
30
+ * <ul>
31
+ *
32
+ * <li>ListMarketplaceParticipationsResult: MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResult</li>
33
+ * <li>ResponseMetadata: MarketplaceWebServiceSellers_Model_ResponseMetadata</li>
34
+ * <li>ResponseHeaderMetadata: MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata</li>
35
+ *
36
+ * </ul>
37
+ */
38
+
39
+ class MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse extends MarketplaceWebServiceSellers_Model {
40
+
41
+ public function __construct($data = null)
42
+ {
43
+ $this->_fields = array (
44
+ 'ListMarketplaceParticipationsResult' => array('FieldValue' => null, 'FieldType' => 'MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResult'),
45
+ 'ResponseMetadata' => array('FieldValue' => null, 'FieldType' => 'MarketplaceWebServiceSellers_Model_ResponseMetadata'),
46
+ 'ResponseHeaderMetadata' => array('FieldValue' => null, 'FieldType' => 'MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata'),
47
+ );
48
+ parent::__construct($data);
49
+ }
50
+
51
+ /**
52
+ * Get the value of the ListMarketplaceParticipationsResult property.
53
+ *
54
+ * @return ListMarketplaceParticipationsResult ListMarketplaceParticipationsResult.
55
+ */
56
+ public function getListMarketplaceParticipationsResult()
57
+ {
58
+ return $this->_fields['ListMarketplaceParticipationsResult']['FieldValue'];
59
+ }
60
+
61
+ /**
62
+ * Set the value of the ListMarketplaceParticipationsResult property.
63
+ *
64
+ * @param MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResult listMarketplaceParticipationsResult
65
+ * @return this instance
66
+ */
67
+ public function setListMarketplaceParticipationsResult($value)
68
+ {
69
+ $this->_fields['ListMarketplaceParticipationsResult']['FieldValue'] = $value;
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ * Check to see if ListMarketplaceParticipationsResult is set.
75
+ *
76
+ * @return true if ListMarketplaceParticipationsResult is set.
77
+ */
78
+ public function isSetListMarketplaceParticipationsResult()
79
+ {
80
+ return !is_null($this->_fields['ListMarketplaceParticipationsResult']['FieldValue']);
81
+ }
82
+
83
+ /**
84
+ * Set the value of ListMarketplaceParticipationsResult, return this.
85
+ *
86
+ * @param listMarketplaceParticipationsResult
87
+ * The new value to set.
88
+ *
89
+ * @return This instance.
90
+ */
91
+ public function withListMarketplaceParticipationsResult($value)
92
+ {
93
+ $this->setListMarketplaceParticipationsResult($value);
94
+ return $this;
95
+ }
96
+
97
+ /**
98
+ * Get the value of the ResponseMetadata property.
99
+ *
100
+ * @return ResponseMetadata ResponseMetadata.
101
+ */
102
+ public function getResponseMetadata()
103
+ {
104
+ return $this->_fields['ResponseMetadata']['FieldValue'];
105
+ }
106
+
107
+ /**
108
+ * Set the value of the ResponseMetadata property.
109
+ *
110
+ * @param MarketplaceWebServiceSellers_Model_ResponseMetadata responseMetadata
111
+ * @return this instance
112
+ */
113
+ public function setResponseMetadata($value)
114
+ {
115
+ $this->_fields['ResponseMetadata']['FieldValue'] = $value;
116
+ return $this;
117
+ }
118
+
119
+ /**
120
+ * Check to see if ResponseMetadata is set.
121
+ *
122
+ * @return true if ResponseMetadata is set.
123
+ */
124
+ public function isSetResponseMetadata()
125
+ {
126
+ return !is_null($this->_fields['ResponseMetadata']['FieldValue']);
127
+ }
128
+
129
+ /**
130
+ * Set the value of ResponseMetadata, return this.
131
+ *
132
+ * @param responseMetadata
133
+ * The new value to set.
134
+ *
135
+ * @return This instance.
136
+ */
137
+ public function withResponseMetadata($value)
138
+ {
139
+ $this->setResponseMetadata($value);
140
+ return $this;
141
+ }
142
+
143
+ /**
144
+ * Get the value of the ResponseHeaderMetadata property.
145
+ *
146
+ * @return ResponseHeaderMetadata ResponseHeaderMetadata.
147
+ */
148
+ public function getResponseHeaderMetadata()
149
+ {
150
+ return $this->_fields['ResponseHeaderMetadata']['FieldValue'];
151
+ }
152
+
153
+ /**
154
+ * Set the value of the ResponseHeaderMetadata property.
155
+ *
156
+ * @param MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata responseHeaderMetadata
157
+ * @return this instance
158
+ */
159
+ public function setResponseHeaderMetadata($value)
160
+ {
161
+ $this->_fields['ResponseHeaderMetadata']['FieldValue'] = $value;
162
+ return $this;
163
+ }
164
+
165
+ /**
166
+ * Check to see if ResponseHeaderMetadata is set.
167
+ *
168
+ * @return true if ResponseHeaderMetadata is set.
169
+ */
170
+ public function isSetResponseHeaderMetadata()
171
+ {
172
+ return !is_null($this->_fields['ResponseHeaderMetadata']['FieldValue']);
173
+ }
174
+
175
+ /**
176
+ * Set the value of ResponseHeaderMetadata, return this.
177
+ *
178
+ * @param responseHeaderMetadata
179
+ * The new value to set.
180
+ *
181
+ * @return This instance.
182
+ */
183
+ public function withResponseHeaderMetadata($value)
184
+ {
185
+ $this->setResponseHeaderMetadata($value);
186
+ return $this;
187
+ }
188
+ /**
189
+ * Construct MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse from XML string
190
+ *
191
+ * @param $xml
192
+ * XML string to construct from
193
+ *
194
+ * @return MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse
195
+ */
196
+ public static function fromXML($xml)
197
+ {
198
+ $dom = new DOMDocument();
199
+ $dom->loadXML($xml);
200
+ $xpath = new DOMXPath($dom);
201
+ $response = $xpath->query("//*[local-name()='ListMarketplaceParticipationsResponse']");
202
+ if ($response->length == 1) {
203
+ return new MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse(($response->item(0)));
204
+ } else {
205
+ throw new Exception ("Unable to construct MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResponse from provided XML.
206
+ Make sure that ListMarketplaceParticipationsResponse is a root element");
207
+ }
208
+ }
209
+ /**
210
+ * XML Representation for this object
211
+ *
212
+ * @return string XML for this object
213
+ */
214
+ public function toXML()
215
+ {
216
+ $xml = "";
217
+ $xml .= "<ListMarketplaceParticipationsResponse xmlns=\"https://mws.amazonservices.com/Sellers/2011-07-01\">";
218
+ $xml .= $this->_toXMLFragment();
219
+ $xml .= "</ListMarketplaceParticipationsResponse>";
220
+ return $xml;
221
+ }
222
+
223
+ }
lib/MarketplaceWebServiceSellers/Model/ListMarketplaceParticipationsResult.php ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResult
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>NextToken: string</li>
34
+ * <li>ListParticipations: MarketplaceWebServiceSellers_Model_ListParticipations</li>
35
+ * <li>ListMarketplaces: MarketplaceWebServiceSellers_Model_ListMarketplaces</li>
36
+ *
37
+ * </ul>
38
+ */
39
+
40
+ class MarketplaceWebServiceSellers_Model_ListMarketplaceParticipationsResult extends MarketplaceWebServiceSellers_Model {
41
+
42
+ public function __construct($data = null)
43
+ {
44
+ $this->_fields = array (
45
+ 'NextToken' => array('FieldValue' => null, 'FieldType' => 'string'),
46
+ 'ListParticipations' => array('FieldValue' => null, 'FieldType' => 'MarketplaceWebServiceSellers_Model_ListParticipations'),
47
+ 'ListMarketplaces' => array('FieldValue' => null, 'FieldType' => 'MarketplaceWebServiceSellers_Model_ListMarketplaces'),
48
+ );
49
+ parent::__construct($data);
50
+ }
51
+
52
+ /**
53
+ * Get the value of the NextToken property.
54
+ *
55
+ * @return String NextToken.
56
+ */
57
+ public function getNextToken()
58
+ {
59
+ return $this->_fields['NextToken']['FieldValue'];
60
+ }
61
+
62
+ /**
63
+ * Set the value of the NextToken property.
64
+ *
65
+ * @param string nextToken
66
+ * @return this instance
67
+ */
68
+ public function setNextToken($value)
69
+ {
70
+ $this->_fields['NextToken']['FieldValue'] = $value;
71
+ return $this;
72
+ }
73
+
74
+ /**
75
+ * Check to see if NextToken is set.
76
+ *
77
+ * @return true if NextToken is set.
78
+ */
79
+ public function isSetNextToken()
80
+ {
81
+ return !is_null($this->_fields['NextToken']['FieldValue']);
82
+ }
83
+
84
+ /**
85
+ * Set the value of NextToken, return this.
86
+ *
87
+ * @param nextToken
88
+ * The new value to set.
89
+ *
90
+ * @return This instance.
91
+ */
92
+ public function withNextToken($value)
93
+ {
94
+ $this->setNextToken($value);
95
+ return $this;
96
+ }
97
+
98
+ /**
99
+ * Get the value of the ListParticipations property.
100
+ *
101
+ * @return ListParticipations ListParticipations.
102
+ */
103
+ public function getListParticipations()
104
+ {
105
+ return $this->_fields['ListParticipations']['FieldValue'];
106
+ }
107
+
108
+ /**
109
+ * Set the value of the ListParticipations property.
110
+ *
111
+ * @param MarketplaceWebServiceSellers_Model_ListParticipations listParticipations
112
+ * @return this instance
113
+ */
114
+ public function setListParticipations($value)
115
+ {
116
+ $this->_fields['ListParticipations']['FieldValue'] = $value;
117
+ return $this;
118
+ }
119
+
120
+ /**
121
+ * Check to see if ListParticipations is set.
122
+ *
123
+ * @return true if ListParticipations is set.
124
+ */
125
+ public function isSetListParticipations()
126
+ {
127
+ return !is_null($this->_fields['ListParticipations']['FieldValue']);
128
+ }
129
+
130
+ /**
131
+ * Set the value of ListParticipations, return this.
132
+ *
133
+ * @param listParticipations
134
+ * The new value to set.
135
+ *
136
+ * @return This instance.
137
+ */
138
+ public function withListParticipations($value)
139
+ {
140
+ $this->setListParticipations($value);
141
+ return $this;
142
+ }
143
+
144
+ /**
145
+ * Get the value of the ListMarketplaces property.
146
+ *
147
+ * @return ListMarketplaces ListMarketplaces.
148
+ */
149
+ public function getListMarketplaces()
150
+ {
151
+ return $this->_fields['ListMarketplaces']['FieldValue'];
152
+ }
153
+
154
+ /**
155
+ * Set the value of the ListMarketplaces property.
156
+ *
157
+ * @param MarketplaceWebServiceSellers_Model_ListMarketplaces listMarketplaces
158
+ * @return this instance
159
+ */
160
+ public function setListMarketplaces($value)
161
+ {
162
+ $this->_fields['ListMarketplaces']['FieldValue'] = $value;
163
+ return $this;
164
+ }
165
+
166
+ /**
167
+ * Check to see if ListMarketplaces is set.
168
+ *
169
+ * @return true if ListMarketplaces is set.
170
+ */
171
+ public function isSetListMarketplaces()
172
+ {
173
+ return !is_null($this->_fields['ListMarketplaces']['FieldValue']);
174
+ }
175
+
176
+ /**
177
+ * Set the value of ListMarketplaces, return this.
178
+ *
179
+ * @param listMarketplaces
180
+ * The new value to set.
181
+ *
182
+ * @return This instance.
183
+ */
184
+ public function withListMarketplaces($value)
185
+ {
186
+ $this->setListMarketplaces($value);
187
+ return $this;
188
+ }
189
+
190
+ }
lib/MarketplaceWebServiceSellers/Model/ListMarketplaces.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ListMarketplaces
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>Marketplace: array</li>
34
+ *
35
+ * </ul>
36
+ */
37
+
38
+ class MarketplaceWebServiceSellers_Model_ListMarketplaces extends MarketplaceWebServiceSellers_Model {
39
+
40
+ public function __construct($data = null)
41
+ {
42
+ $this->_fields = array (
43
+ 'Marketplace' => array('FieldValue' => array(), 'FieldType' => array('MarketplaceWebServiceSellers_Model_Marketplace')),
44
+ );
45
+ parent::__construct($data);
46
+ }
47
+
48
+ /**
49
+ * Get the value of the Marketplace property.
50
+ *
51
+ * @return List<Marketplace> Marketplace.
52
+ */
53
+ public function getMarketplace()
54
+ {
55
+ if ($this->_fields['Marketplace']['FieldValue'] == null)
56
+ {
57
+ $this->_fields['Marketplace']['FieldValue'] = array();
58
+ }
59
+ return $this->_fields['Marketplace']['FieldValue'];
60
+ }
61
+
62
+ /**
63
+ * Set the value of the Marketplace property.
64
+ *
65
+ * @param array marketplace
66
+ * @return this instance
67
+ */
68
+ public function setMarketplace($value)
69
+ {
70
+ if (!$this->_isNumericArray($value)) {
71
+ $value = array ($value);
72
+ }
73
+ $this->_fields['Marketplace']['FieldValue'] = $value;
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * Clear Marketplace.
79
+ */
80
+ public function unsetMarketplace()
81
+ {
82
+ $this->_fields['Marketplace']['FieldValue'] = array();
83
+ }
84
+
85
+ /**
86
+ * Check to see if Marketplace is set.
87
+ *
88
+ * @return true if Marketplace is set.
89
+ */
90
+ public function isSetMarketplace()
91
+ {
92
+ return !empty($this->_fields['Marketplace']['FieldValue']);
93
+ }
94
+
95
+ /**
96
+ * Add values for Marketplace, return this.
97
+ *
98
+ * @param marketplace
99
+ * New values to add.
100
+ *
101
+ * @return This instance.
102
+ */
103
+ public function withMarketplace()
104
+ {
105
+ foreach (func_get_args() as $Marketplace)
106
+ {
107
+ $this->_fields['Marketplace']['FieldValue'][] = $Marketplace;
108
+ }
109
+ return $this;
110
+ }
111
+
112
+ }
lib/MarketplaceWebServiceSellers/Model/ListParticipations.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ListParticipations
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>Participation: array</li>
34
+ *
35
+ * </ul>
36
+ */
37
+
38
+ class MarketplaceWebServiceSellers_Model_ListParticipations extends MarketplaceWebServiceSellers_Model {
39
+
40
+ public function __construct($data = null)
41
+ {
42
+ $this->_fields = array (
43
+ 'Participation' => array('FieldValue' => array(), 'FieldType' => array('MarketplaceWebServiceSellers_Model_Participation')),
44
+ );
45
+ parent::__construct($data);
46
+ }
47
+
48
+ /**
49
+ * Get the value of the Participation property.
50
+ *
51
+ * @return List<Participation> Participation.
52
+ */
53
+ public function getParticipation()
54
+ {
55
+ if ($this->_fields['Participation']['FieldValue'] == null)
56
+ {
57
+ $this->_fields['Participation']['FieldValue'] = array();
58
+ }
59
+ return $this->_fields['Participation']['FieldValue'];
60
+ }
61
+
62
+ /**
63
+ * Set the value of the Participation property.
64
+ *
65
+ * @param array participation
66
+ * @return this instance
67
+ */
68
+ public function setParticipation($value)
69
+ {
70
+ if (!$this->_isNumericArray($value)) {
71
+ $value = array ($value);
72
+ }
73
+ $this->_fields['Participation']['FieldValue'] = $value;
74
+ return $this;
75
+ }
76
+
77
+ /**
78
+ * Clear Participation.
79
+ */
80
+ public function unsetParticipation()
81
+ {
82
+ $this->_fields['Participation']['FieldValue'] = array();
83
+ }
84
+
85
+ /**
86
+ * Check to see if Participation is set.
87
+ *
88
+ * @return true if Participation is set.
89
+ */
90
+ public function isSetParticipation()
91
+ {
92
+ return !empty($this->_fields['Participation']['FieldValue']);
93
+ }
94
+
95
+ /**
96
+ * Add values for Participation, return this.
97
+ *
98
+ * @param participation
99
+ * New values to add.
100
+ *
101
+ * @return This instance.
102
+ */
103
+ public function withParticipation()
104
+ {
105
+ foreach (func_get_args() as $Participation)
106
+ {
107
+ $this->_fields['Participation']['FieldValue'][] = $Participation;
108
+ }
109
+ return $this;
110
+ }
111
+
112
+ }
lib/MarketplaceWebServiceSellers/Model/Marketplace.php ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_Marketplace
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>MarketplaceId: string</li>
34
+ * <li>Name: string</li>
35
+ * <li>DefaultCountryCode: string</li>
36
+ * <li>DefaultCurrencyCode: string</li>
37
+ * <li>DefaultLanguageCode: string</li>
38
+ * <li>DomainName: string</li>
39
+ *
40
+ * </ul>
41
+ */
42
+
43
+ class MarketplaceWebServiceSellers_Model_Marketplace extends MarketplaceWebServiceSellers_Model {
44
+
45
+ public function __construct($data = null)
46
+ {
47
+ $this->_fields = array (
48
+ 'MarketplaceId' => array('FieldValue' => null, 'FieldType' => 'string'),
49
+ 'Name' => array('FieldValue' => null, 'FieldType' => 'string'),
50
+ 'DefaultCountryCode' => array('FieldValue' => null, 'FieldType' => 'string'),
51
+ 'DefaultCurrencyCode' => array('FieldValue' => null, 'FieldType' => 'string'),
52
+ 'DefaultLanguageCode' => array('FieldValue' => null, 'FieldType' => 'string'),
53
+ 'DomainName' => array('FieldValue' => null, 'FieldType' => 'string'),
54
+ );
55
+ parent::__construct($data);
56
+ }
57
+
58
+ /**
59
+ * Get the value of the MarketplaceId property.
60
+ *
61
+ * @return String MarketplaceId.
62
+ */
63
+ public function getMarketplaceId()
64
+ {
65
+ return $this->_fields['MarketplaceId']['FieldValue'];
66
+ }
67
+
68
+ /**
69
+ * Set the value of the MarketplaceId property.
70
+ *
71
+ * @param string marketplaceId
72
+ * @return this instance
73
+ */
74
+ public function setMarketplaceId($value)
75
+ {
76
+ $this->_fields['MarketplaceId']['FieldValue'] = $value;
77
+ return $this;
78
+ }
79
+
80
+ /**
81
+ * Check to see if MarketplaceId is set.
82
+ *
83
+ * @return true if MarketplaceId is set.
84
+ */
85
+ public function isSetMarketplaceId()
86
+ {
87
+ return !is_null($this->_fields['MarketplaceId']['FieldValue']);
88
+ }
89
+
90
+ /**
91
+ * Set the value of MarketplaceId, return this.
92
+ *
93
+ * @param marketplaceId
94
+ * The new value to set.
95
+ *
96
+ * @return This instance.
97
+ */
98
+ public function withMarketplaceId($value)
99
+ {
100
+ $this->setMarketplaceId($value);
101
+ return $this;
102
+ }
103
+
104
+ /**
105
+ * Get the value of the Name property.
106
+ *
107
+ * @return String Name.
108
+ */
109
+ public function getName()
110
+ {
111
+ return $this->_fields['Name']['FieldValue'];
112
+ }
113
+
114
+ /**
115
+ * Set the value of the Name property.
116
+ *
117
+ * @param string name
118
+ * @return this instance
119
+ */
120
+ public function setName($value)
121
+ {
122
+ $this->_fields['Name']['FieldValue'] = $value;
123
+ return $this;
124
+ }
125
+
126
+ /**
127
+ * Check to see if Name is set.
128
+ *
129
+ * @return true if Name is set.
130
+ */
131
+ public function isSetName()
132
+ {
133
+ return !is_null($this->_fields['Name']['FieldValue']);
134
+ }
135
+
136
+ /**
137
+ * Set the value of Name, return this.
138
+ *
139
+ * @param name
140
+ * The new value to set.
141
+ *
142
+ * @return This instance.
143
+ */
144
+ public function withName($value)
145
+ {
146
+ $this->setName($value);
147
+ return $this;
148
+ }
149
+
150
+ /**
151
+ * Get the value of the DefaultCountryCode property.
152
+ *
153
+ * @return String DefaultCountryCode.
154
+ */
155
+ public function getDefaultCountryCode()
156
+ {
157
+ return $this->_fields['DefaultCountryCode']['FieldValue'];
158
+ }
159
+
160
+ /**
161
+ * Set the value of the DefaultCountryCode property.
162
+ *
163
+ * @param string defaultCountryCode
164
+ * @return this instance
165
+ */
166
+ public function setDefaultCountryCode($value)
167
+ {
168
+ $this->_fields['DefaultCountryCode']['FieldValue'] = $value;
169
+ return $this;
170
+ }
171
+
172
+ /**
173
+ * Check to see if DefaultCountryCode is set.
174
+ *
175
+ * @return true if DefaultCountryCode is set.
176
+ */
177
+ public function isSetDefaultCountryCode()
178
+ {
179
+ return !is_null($this->_fields['DefaultCountryCode']['FieldValue']);
180
+ }
181
+
182
+ /**
183
+ * Set the value of DefaultCountryCode, return this.
184
+ *
185
+ * @param defaultCountryCode
186
+ * The new value to set.
187
+ *
188
+ * @return This instance.
189
+ */
190
+ public function withDefaultCountryCode($value)
191
+ {
192
+ $this->setDefaultCountryCode($value);
193
+ return $this;
194
+ }
195
+
196
+ /**
197
+ * Get the value of the DefaultCurrencyCode property.
198
+ *
199
+ * @return String DefaultCurrencyCode.
200
+ */
201
+ public function getDefaultCurrencyCode()
202
+ {
203
+ return $this->_fields['DefaultCurrencyCode']['FieldValue'];
204
+ }
205
+
206
+ /**
207
+ * Set the value of the DefaultCurrencyCode property.
208
+ *
209
+ * @param string defaultCurrencyCode
210
+ * @return this instance
211
+ */
212
+ public function setDefaultCurrencyCode($value)
213
+ {
214
+ $this->_fields['DefaultCurrencyCode']['FieldValue'] = $value;
215
+ return $this;
216
+ }
217
+
218
+ /**
219
+ * Check to see if DefaultCurrencyCode is set.
220
+ *
221
+ * @return true if DefaultCurrencyCode is set.
222
+ */
223
+ public function isSetDefaultCurrencyCode()
224
+ {
225
+ return !is_null($this->_fields['DefaultCurrencyCode']['FieldValue']);
226
+ }
227
+
228
+ /**
229
+ * Set the value of DefaultCurrencyCode, return this.
230
+ *
231
+ * @param defaultCurrencyCode
232
+ * The new value to set.
233
+ *
234
+ * @return This instance.
235
+ */
236
+ public function withDefaultCurrencyCode($value)
237
+ {
238
+ $this->setDefaultCurrencyCode($value);
239
+ return $this;
240
+ }
241
+
242
+ /**
243
+ * Get the value of the DefaultLanguageCode property.
244
+ *
245
+ * @return String DefaultLanguageCode.
246
+ */
247
+ public function getDefaultLanguageCode()
248
+ {
249
+ return $this->_fields['DefaultLanguageCode']['FieldValue'];
250
+ }
251
+
252
+ /**
253
+ * Set the value of the DefaultLanguageCode property.
254
+ *
255
+ * @param string defaultLanguageCode
256
+ * @return this instance
257
+ */
258
+ public function setDefaultLanguageCode($value)
259
+ {
260
+ $this->_fields['DefaultLanguageCode']['FieldValue'] = $value;
261
+ return $this;
262
+ }
263
+
264
+ /**
265
+ * Check to see if DefaultLanguageCode is set.
266
+ *
267
+ * @return true if DefaultLanguageCode is set.
268
+ */
269
+ public function isSetDefaultLanguageCode()
270
+ {
271
+ return !is_null($this->_fields['DefaultLanguageCode']['FieldValue']);
272
+ }
273
+
274
+ /**
275
+ * Set the value of DefaultLanguageCode, return this.
276
+ *
277
+ * @param defaultLanguageCode
278
+ * The new value to set.
279
+ *
280
+ * @return This instance.
281
+ */
282
+ public function withDefaultLanguageCode($value)
283
+ {
284
+ $this->setDefaultLanguageCode($value);
285
+ return $this;
286
+ }
287
+
288
+ /**
289
+ * Get the value of the DomainName property.
290
+ *
291
+ * @return String DomainName.
292
+ */
293
+ public function getDomainName()
294
+ {
295
+ return $this->_fields['DomainName']['FieldValue'];
296
+ }
297
+
298
+ /**
299
+ * Set the value of the DomainName property.
300
+ *
301
+ * @param string domainName
302
+ * @return this instance
303
+ */
304
+ public function setDomainName($value)
305
+ {
306
+ $this->_fields['DomainName']['FieldValue'] = $value;
307
+ return $this;
308
+ }
309
+
310
+ /**
311
+ * Check to see if DomainName is set.
312
+ *
313
+ * @return true if DomainName is set.
314
+ */
315
+ public function isSetDomainName()
316
+ {
317
+ return !is_null($this->_fields['DomainName']['FieldValue']);
318
+ }
319
+
320
+ /**
321
+ * Set the value of DomainName, return this.
322
+ *
323
+ * @param domainName
324
+ * The new value to set.
325
+ *
326
+ * @return This instance.
327
+ */
328
+ public function withDomainName($value)
329
+ {
330
+ $this->setDomainName($value);
331
+ return $this;
332
+ }
333
+
334
+ }
lib/MarketplaceWebServiceSellers/Model/Participation.php ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+
25
+
26
+ /**
27
+ * MarketplaceWebServiceSellers_Model_Participation
28
+ *
29
+ * Properties:
30
+ * <ul>
31
+ *
32
+ * <li>MarketplaceId: string</li>
33
+ * <li>SellerId: string</li>
34
+ * <li>HasSellerSuspendedListings: string</li>
35
+ *
36
+ * </ul>
37
+ */
38
+
39
+ class MarketplaceWebServiceSellers_Model_Participation extends MarketplaceWebServiceSellers_Model {
40
+
41
+ public function __construct($data = null)
42
+ {
43
+ $this->_fields = array (
44
+ 'MarketplaceId' => array('FieldValue' => null, 'FieldType' => 'string'),
45
+ 'SellerId' => array('FieldValue' => null, 'FieldType' => 'string'),
46
+ 'HasSellerSuspendedListings' => array('FieldValue' => null, 'FieldType' => 'string'),
47
+ );
48
+ parent::__construct($data);
49
+ }
50
+
51
+ /**
52
+ * Get the value of the MarketplaceId property.
53
+ *
54
+ * @return String MarketplaceId.
55
+ */
56
+ public function getMarketplaceId()
57
+ {
58
+ return $this->_fields['MarketplaceId']['FieldValue'];
59
+ }
60
+
61
+ /**
62
+ * Set the value of the MarketplaceId property.
63
+ *
64
+ * @param string marketplaceId
65
+ * @return this instance
66
+ */
67
+ public function setMarketplaceId($value)
68
+ {
69
+ $this->_fields['MarketplaceId']['FieldValue'] = $value;
70
+ return $this;
71
+ }
72
+
73
+ /**
74
+ * Check to see if MarketplaceId is set.
75
+ *
76
+ * @return true if MarketplaceId is set.
77
+ */
78
+ public function isSetMarketplaceId()
79
+ {
80
+ return !is_null($this->_fields['MarketplaceId']['FieldValue']);
81
+ }
82
+
83
+ /**
84
+ * Set the value of MarketplaceId, return this.
85
+ *
86
+ * @param marketplaceId
87
+ * The new value to set.
88
+ *
89
+ * @return This instance.
90
+ */
91
+ public function withMarketplaceId($value)
92
+ {
93
+ $this->setMarketplaceId($value);
94
+ return $this;
95
+ }
96
+
97
+ /**
98
+ * Get the value of the SellerId property.
99
+ *
100
+ * @return String SellerId.
101
+ */
102
+ public function getSellerId()
103
+ {
104
+ return $this->_fields['SellerId']['FieldValue'];
105
+ }
106
+
107
+ /**
108
+ * Set the value of the SellerId property.
109
+ *
110
+ * @param string sellerId
111
+ * @return this instance
112
+ */
113
+ public function setSellerId($value)
114
+ {
115
+ $this->_fields['SellerId']['FieldValue'] = $value;
116
+ return $this;
117
+ }
118
+
119
+ /**
120
+ * Check to see if SellerId is set.
121
+ *
122
+ * @return true if SellerId is set.
123
+ */
124
+ public function isSetSellerId()
125
+ {
126
+ return !is_null($this->_fields['SellerId']['FieldValue']);
127
+ }
128
+
129
+ /**
130
+ * Set the value of SellerId, return this.
131
+ *
132
+ * @param sellerId
133
+ * The new value to set.
134
+ *
135
+ * @return This instance.
136
+ */
137
+ public function withSellerId($value)
138
+ {
139
+ $this->setSellerId($value);
140
+ return $this;
141
+ }
142
+
143
+ /**
144
+ * Get the value of the HasSellerSuspendedListings property.
145
+ *
146
+ * @return String HasSellerSuspendedListings.
147
+ */
148
+ public function getHasSellerSuspendedListings()
149
+ {
150
+ return $this->_fields['HasSellerSuspendedListings']['FieldValue'];
151
+ }
152
+
153
+ /**
154
+ * Set the value of the HasSellerSuspendedListings property.
155
+ *
156
+ * @param string hasSellerSuspendedListings
157
+ * @return this instance
158
+ */
159
+ public function setHasSellerSuspendedListings($value)
160
+ {
161
+ $this->_fields['HasSellerSuspendedListings']['FieldValue'] = $value;
162
+ return $this;
163
+ }
164
+
165
+ /**
166
+ * Check to see if HasSellerSuspendedListings is set.
167
+ *
168
+ * @return true if HasSellerSuspendedListings is set.
169
+ */
170
+ public function isSetHasSellerSuspendedListings()
171
+ {
172
+ return !is_null($this->_fields['HasSellerSuspendedListings']['FieldValue']);
173
+ }
174
+
175
+ /**
176
+ * Set the value of HasSellerSuspendedListings, return this.
177
+ *
178
+ * @param hasSellerSuspendedListings
179
+ * The new value to set.
180
+ *
181
+ * @return This instance.
182
+ */
183
+ public function withHasSellerSuspendedListings($value)
184
+ {
185
+ $this->setHasSellerSuspendedListings($value);
186
+ return $this;
187
+ }
188
+
189
+ }
lib/MarketplaceWebServiceSellers/Model/ResponseHeaderMetaData.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ class MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata {
21
+
22
+ const REQUEST_ID = 'x-mws-request-id';
23
+ const RESPONSE_CONTEXT = 'x-mws-response-context';
24
+ const TIMESTAMP = 'x-mws-timestamp';
25
+ const QUOTA_MAX = 'x-mws-quota-max';
26
+ const QUOTA_REMAINING = 'x-mws-quota-remaining';
27
+ const QUOTA_RESETS_AT = 'x-mws-quota-resetsOn';
28
+
29
+ private $metadata = array();
30
+
31
+ public function __construct($requestId = null, $responseContext = null, $timestamp = null,
32
+ $quotaMax = null, $quotaMax = null, $quotaResetsAt = null) {
33
+ $this->metadata[self::REQUEST_ID] = $requestId;
34
+ $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
35
+ $this->metadata[self::TIMESTAMP] = $timestamp;
36
+ $this->metadata[self::QUOTA_MAX] = $quotaMax;
37
+ $this->metadata[self::QUOTA_REMAINING] = $quotaMax;
38
+ $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
39
+ }
40
+
41
+ public function getRequestId() {
42
+ return $this->metadata[self::REQUEST_ID];
43
+ }
44
+
45
+ public function getResponseContext() {
46
+ return $this->metadata[self::RESPONSE_CONTEXT];
47
+ }
48
+
49
+ public function getTimestamp() {
50
+ return $this->metadata[self::TIMESTAMP];
51
+ }
52
+
53
+ /**
54
+ * Gets the max quota allowed for a quota period
55
+ * (from the x-mws-quota-max header)
56
+ *
57
+ * @return the max quota allowed for a quota period
58
+ */
59
+ public function getQuotaMax() {
60
+ return $this->metadata[self::QUOTA_MAX];
61
+ }
62
+
63
+ /**
64
+ * Gets the quota remaining within this quota period
65
+ * (from the x-mws-quota-remaining header)
66
+ *
67
+ * @return the quota remaining within this quota period
68
+ */
69
+ public function getQuotaRemaining() {
70
+ return $this->metadata[self::QUOTA_REMAINING];
71
+ }
72
+
73
+ /**
74
+ * Gets the time that this quota period ends
75
+ * (from the x-mws-quota-resetsOn header)
76
+ *
77
+ * @return the time that this quota period ends
78
+ */
79
+ public function getQuotaResetsAt() {
80
+ return $this->metadata[self::QUOTA_RESETS_AT];
81
+ }
82
+
83
+ public function __toString() {
84
+ return "RequestId: " . $this->getRequestId() . ", ResponseContext: " . $this->getResponseContext() .
85
+ ", Timestamp: " . $this->getTimestamp() . ", Quota Max: " . $this->getQuotaMax() .
86
+ ", Quota Remaining: " . $this->getQuotaRemaining() . ", Quota Resets At: " . $this->getQuotaResetsAt();
87
+ }
88
+
89
+ }
lib/MarketplaceWebServiceSellers/Model/ResponseHeaderMetadata.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ class MarketplaceWebServiceSellers_Model_ResponseHeaderMetadata {
21
+
22
+ const REQUEST_ID = 'x-mws-request-id';
23
+ const RESPONSE_CONTEXT = 'x-mws-response-context';
24
+ const TIMESTAMP = 'x-mws-timestamp';
25
+ const QUOTA_MAX = 'x-mws-quota-max';
26
+ const QUOTA_REMAINING = 'x-mws-quota-remaining';
27
+ const QUOTA_RESETS_AT = 'x-mws-quota-resetsOn';
28
+
29
+ private $metadata = array();
30
+
31
+ public function __construct($requestId = null, $responseContext = null, $timestamp = null,
32
+ $quotaMax = null, $quotaMax = null, $quotaResetsAt = null) {
33
+ $this->metadata[self::REQUEST_ID] = $requestId;
34
+ $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
35
+ $this->metadata[self::TIMESTAMP] = $timestamp;
36
+ $this->metadata[self::QUOTA_MAX] = $quotaMax;
37
+ $this->metadata[self::QUOTA_REMAINING] = $quotaMax;
38
+ $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
39
+ }
40
+
41
+ public function getRequestId() {
42
+ return $this->metadata[self::REQUEST_ID];
43
+ }
44
+
45
+ public function getResponseContext() {
46
+ return $this->metadata[self::RESPONSE_CONTEXT];
47
+ }
48
+
49
+ public function getTimestamp() {
50
+ return $this->metadata[self::TIMESTAMP];
51
+ }
52
+
53
+ /**
54
+ * Gets the max quota allowed for a quota period
55
+ * (from the x-mws-quota-max header)
56
+ *
57
+ * @return the max quota allowed for a quota period
58
+ */
59
+ public function getQuotaMax() {
60
+ return $this->metadata[self::QUOTA_MAX];
61
+ }
62
+
63
+ /**
64
+ * Gets the quota remaining within this quota period
65
+ * (from the x-mws-quota-remaining header)
66
+ *
67
+ * @return the quota remaining within this quota period
68
+ */
69
+ public function getQuotaRemaining() {
70
+ return $this->metadata[self::QUOTA_REMAINING];
71
+ }
72
+
73
+ /**
74
+ * Gets the time that this quota period ends
75
+ * (from the x-mws-quota-resetsOn header)
76
+ *
77
+ * @return the time that this quota period ends
78
+ */
79
+ public function getQuotaResetsAt() {
80
+ return $this->metadata[self::QUOTA_RESETS_AT];
81
+ }
82
+
83
+ public function __toString() {
84
+ return "RequestId: " . $this->getRequestId() . ", ResponseContext: " . $this->getResponseContext() .
85
+ ", Timestamp: " . $this->getTimestamp() . ", Quota Max: " . $this->getQuotaMax() .
86
+ ", Quota Remaining: " . $this->getQuotaRemaining() . ", Quota Resets At: " . $this->getQuotaResetsAt();
87
+ }
88
+
89
+ }
lib/MarketplaceWebServiceSellers/Model/ResponseMetaData.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ResponseMetadata
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>RequestId: string</li>
34
+ *
35
+ * </ul>
36
+ */
37
+
38
+ class MarketplaceWebServiceSellers_Model_ResponseMetadata extends MarketplaceWebServiceSellers_Model {
39
+
40
+ public function __construct($data = null)
41
+ {
42
+ $this->_fields = array (
43
+ 'RequestId' => array('FieldValue' => null, 'FieldType' => 'string'),
44
+ );
45
+ parent::__construct($data);
46
+ }
47
+
48
+ /**
49
+ * Get the value of the RequestId property.
50
+ *
51
+ * @return String RequestId.
52
+ */
53
+ public function getRequestId()
54
+ {
55
+ return $this->_fields['RequestId']['FieldValue'];
56
+ }
57
+
58
+ /**
59
+ * Set the value of the RequestId property.
60
+ *
61
+ * @param string requestId
62
+ * @return this instance
63
+ */
64
+ public function setRequestId($value)
65
+ {
66
+ $this->_fields['RequestId']['FieldValue'] = $value;
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * Check to see if RequestId is set.
72
+ *
73
+ * @return true if RequestId is set.
74
+ */
75
+ public function isSetRequestId()
76
+ {
77
+ return !is_null($this->_fields['RequestId']['FieldValue']);
78
+ }
79
+
80
+ /**
81
+ * Set the value of RequestId, return this.
82
+ *
83
+ * @param requestId
84
+ * The new value to set.
85
+ *
86
+ * @return This instance.
87
+ */
88
+ public function withRequestId($value)
89
+ {
90
+ $this->setRequestId($value);
91
+ return $this;
92
+ }
93
+
94
+ }
lib/MarketplaceWebServiceSellers/Model/ResponseMetadata.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*******************************************************************************
3
+ * Copyright 2009-2014 Amazon Services. All Rights Reserved.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ *
6
+ * You may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
8
+ * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
10
+ * specific language governing permissions and limitations under the License.
11
+ *******************************************************************************
12
+ * PHP Version 5
13
+ * @category Amazon
14
+ * @package Marketplace Web Service Sellers
15
+ * @version 2011-07-01
16
+ * Library Version: 2014-10-20
17
+ * Generated: Fri Oct 17 18:34:06 GMT 2014
18
+ */
19
+
20
+ /**
21
+ * @see MarketplaceWebServiceSellers_Model
22
+ */
23
+
24
+ require_once (dirname(__FILE__) . '/../Model.php');
25
+
26
+
27
+ /**
28
+ * MarketplaceWebServiceSellers_Model_ResponseMetadata
29
+ *
30
+ * Properties:
31
+ * <ul>
32
+ *
33
+ * <li>RequestId: string</li>
34
+ *
35
+ * </ul>
36
+ */
37
+
38
+ class MarketplaceWebServiceSellers_Model_ResponseMetadata extends MarketplaceWebServiceSellers_Model {
39
+
40
+ public function __construct($data = null)
41
+ {
42
+ $this->_fields = array (
43
+ 'RequestId' => array('FieldValue' => null, 'FieldType' => 'string'),
44
+ );
45
+ parent::__construct($data);
46
+ }
47
+
48
+ /**
49
+ * Get the value of the RequestId property.
50
+ *
51
+ * @return String RequestId.
52
+ */
53
+ public function getRequestId()
54
+ {
55
+ return $this->_fields['RequestId']['FieldValue'];
56
+ }
57
+
58
+ /**
59
+ * Set the value of the RequestId property.
60
+ *
61
+ * @param string requestId
62
+ * @return this instance
63
+ */
64
+ public function setRequestId($value)
65
+ {
66
+ $this->_fields['RequestId']['FieldValue'] = $value;
67
+ return $this;
68
+ }
69
+
70
+ /**
71
+ * Check to see if RequestId is set.
72
+ *
73
+ * @return true if RequestId is set.
74
+ */
75
+ public function isSetRequestId()
76
+ {
77
+ return !is_null($this->_fields['RequestId']['FieldValue']);
78
+ }
79
+
80
+ /**
81
+ * Set the value of RequestId, return this.
82
+ *
83
+ * @param requestId
84
+ * The new value to set.
85
+ *
86
+ * @return This instance.
87
+ */
88
+ public function withRequestId($value)
89
+ {
90
+ $this->setRequestId($value);
91
+ return $this;
92
+ }
93
+
94
+ }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>login_and_pay_for_magento</name>
4
- <version>1.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
@@ -31,19 +31,40 @@
31
  Keep your customers secure! Leverage the same user authentication system used on Amazon.com.&lt;/p&gt;&#xD;
32
  &#xD;
33
  </description>
34
- <notes>v1.2.2 Release&#xD;
35
- Fixes issues related to decline flows in both synchronous + onepage and asynchronous modes.&#xD;
36
- Allows merchants to reauthorize on declined asynchronous purchases after Amazon buyer updates their payment method at payments.amazon.com&#xD;
 
 
37
  &#xD;
38
- Issues Resolved&#xD;
39
- -- #94 add semicolon to fix JS minify/whitespace stripping&#xD;
40
- -- #101 add wallet reload on onepage payment errors&#xD;
41
- -- #105 for async, reauthorize on open order reference&#xD;
42
- </notes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  <authors><author><name>Amazon Payments</name><user>payments-cp-devel</user><email>payments-cp-devel@amazon.com</email></author></authors>
44
- <date>2014-12-17</date>
45
- <time>23:19:45</time>
46
- <contents><target name="magecommunity"><dir name="Amazon"><dir name="Login"><dir name="Block"><file name="Button.php" hash="6522fd3c81a5959c75979b8d17a62000"/><file name="Script.php" hash="40c4cca328e24521e3562f1466251c55"/><file name="Verify.php" hash="7345e0c12f6f558029dfbea647441e81"/></dir><dir name="Helper"><file name="Data.php" hash="ae6797f0228b6cada765368d661d6bf6"/></dir><dir name="Model"><file name="Api.php" hash="48a3f6306d97f31fa4c3b954a665f334"/><file name="Customer.php" hash="e6dc82ee00ae5aac40c443a3c3627997"/><file name="Login.php" hash="81a09b4f2c0c62e874ad209ef78ef462"/><dir name="Resource"><file name="Login.php" hash="cea5ac352d61cace9965f1cb940a7272"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Enabled.php" hash="94bc7fde24ab2ee54ed15bbe7084f118"/><file name="Popupcomment.php" hash="ebcfc96661affbbe5de8ab4d4fc9d4bb"/></dir><dir name="Source"><file name="Buttoncolor.php" hash="ac335e432cd8e47c9ca4be601c706072"/><file name="Buttonsize.php" hash="76ef1db11834db449a7d52c34f3668d8"/><file name="Buttontype.php" hash="5e333d6cb1d70d0227766d78e390530b"/></dir></dir></dir></dir><dir name="controllers"><file name="CustomerController.php" hash="d326a02cb53c18bb78f988adb94a6478"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0aa18eecfebd3e0bb1d84cd6b1040f50"/><file name="config.xml" hash="5f320a09ff6ab1d1799b43b6ddaa3d51"/><file name="system.xml" hash="cc00b85cef386caf51e2cfa729183091"/></dir><dir name="sql"><dir name="login_setup"><file name="install-0.1.0.php" hash="690c4c33f4c5221185c0589e3add63b3"/></dir></dir></dir><dir name="Payments"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="793824c5014d1269f0aee1a795e948b9"/></dir><file name="Button.php" hash="72e72541893f0cd50f25163b9e265f79"/><file name="Checkout.php" hash="532f647be6bd8ed047ae72d380461b7a"/><file name="Form.php" hash="99202f27e0ac21ba8cd2e003fb0a49cd"/><file name="Link.php" hash="47c237fe4604333b2080588c5498a865"/><dir name="Onepage"><file name="Progress.php" hash="ab5ba2e80b849d77f81f10d64e0a141c"/><file name="Widget.php" hash="f10bb86d3e7e5a88dfdfa4e645a61086"/></dir><file name="Onepage.php" hash="1d865069483bbe776f511119e0e2252b"/><dir name="Review"><file name="Info.php" hash="8d3688c55137971b18aec41272cf13a6"/></dir><file name="Review.php" hash="d9cf9b6ef7d6f063a06e006e01f09513"/></dir><dir name="Controller"><file name="Checkout.php" hash="898f925b89e5230bb72962bdd8bda0e3"/></dir><dir name="Helper"><file name="Data.php" hash="b8a91e228801ed8adbbffc003e6847f3"/></dir><dir name="Model"><file name="Api.php" hash="d6991ebdc6c9610599172ec9d5544957"/><file name="Async.php" hash="cfda11aa130c99e372445d5422c9294b"/><file name="Config.php" hash="b041641452ecd4552e56a0d6859407a1"/><dir name="Observer"><file name="Action.php" hash="d38e500e635b4531ef71f08e92375f34"/><file name="Adminhtml.php" hash="54596e530f3cd3365b8c61313827c0b6"/><file name="Onepage.php" hash="683d31f08d4304f0d377da72ec49cf0b"/><file name="Order.php" hash="783f2f46726c4db21f5e5d2b47a9b25d"/></dir><dir name="Order"><file name="Creditmemo.php" hash="6732791d2839272564cf27ecda80707c"/></dir><file name="PaymentMethod.php" hash="5a85620e328fc6a71af95a457a62f49c"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Clientid.php" hash="4512003bcffedf26bc2fe415b91b1be7"/><file name="Clientsecret.php" hash="d2d5f275e4275676e3f494da704e41da"/><file name="Enabled.php" hash="ac17bd3379ddf8d83013497088af85c5"/></dir><dir name="Source"><file name="Buttoncolor.php" hash="2564780faa369e54339bded78a882636"/><file name="Buttonsize.php" hash="7f740927b5a58a3ea15d07ac4cfbed28"/><file name="Buttontype.php" hash="735083e4848fa2258b95670b1a546843"/><file name="Checkoutpage.php" hash="2969f9eaa9d87571e0fa8f005e2cdeaf"/><file name="Paymentaction.php" hash="4dba1ce3518538d1a5add743d65c8695"/><file name="Region.php" hash="0718cf97d03a8c56c73fb7ea3a103bc5"/></dir></dir></dir><dir name="Type"><file name="Checkout.php" hash="5465e73384c60df94c9243bb09262dff"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Amazon"><file name="PaymentsController.php" hash="21442b140d7a8a5350019925e750290b"/></dir></dir><file name="CheckoutController.php" hash="6d005be14745219d5f7d28d4c6f51a4b"/><file name="IndexController.php" hash="128f218a9e1bf4af4f7b380f14d87a52"/><file name="OnepageController.php" hash="cc03d109ee1cf98f85aba606f5a44654"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3c56d63f30e0e5cc8c22d3686046631b"/><file name="config.xml" hash="49ca891c4d4c09d8a4afa76d24b6b47a"/><file name="system.xml" hash="55bf4bfdfae0de4fa2d442fe36d801ba"/></dir><dir name="sql"><dir name="payments_setup"><file name="install-0.1.0.php" hash="658f9d8c8634b3158cee7b59866e6f39"/></dir></dir></dir></dir></target><target name="magelib"><dir name="OffAmazonPayments"><file name="Model.php" hash="a608217f17166ba11901f5334ad445de"/><file name=".autoloader.php" hash="193fddab8b5ca74646bb78243c0c7dda"/></dir><dir name="OffAmazonPaymentsNotifications"><file name="Client.php" hash="0ab53a8a0a0c069f13e1de3731eaebde"/><dir name="Impl"><file name="IpnNotificationParser.php" hash="fcad418dc58a93e87b854e4067f1e24d"/><file name="Message.php" hash="2ab8cb01bd97ceaeaae0df2bf93ddbf5"/><file name="OpenSslVerifySignature.php" hash="427e2e171daab9ef454ca4ce939edd68"/><file name="SnsMessageParser.php" hash="6a1088096d27a3cdc586e4c298ddf068"/><file name="SnsMessageValidator.php" hash="076f63d5960e4c72a3dc63a76e75316c"/><file name="VerifySignature.php" hash="b18edb328fbe91c1c7b0aa8afe2904d0"/><file name="XmlNotificationParser.php" hash="4881b7d021a86215e43798497bceea24"/></dir><file name="Interface.php" hash="effe919508aab0c2aa1e585d2783c4e6"/><file name="InvalidMessageException.php" hash="2edda9cd6cc0c059846c4858cedfcd66"/><dir name="Model"><file name="AuthorizationDetails.php" hash="843711e02fb56fffcdfb6afcf097e373"/><file name="AuthorizationNotification.php" hash="b00c64bd48ae3bd3c3fa6d991e4b9f5c"/><file name="BillingAgreement.php" hash="677eadcbc4c91282eab548afc6482fdc"/><file name="BillingAgreementLimits.php" hash="a1bd8e8ec111f516528e09340c47de4a"/><file name="BillingAgreementNotification.php" hash="e39a3189bdc937b29b8488e0ef62b562"/><file name="BillingAgreementStatus.php" hash="fae14e95f03245fe6c53e7c7b725c5ca"/><file name="CaptureDetails.php" hash="adb45ebf66daa15990e032025a420e1b"/><file name="CaptureNotification.php" hash="14c2bdc8f6bd6ce881f4403d1f08c6ef"/><file name="IdList.php" hash="2907bdba4b5a534f535c026c40e6d6cc"/><file name="IpnNotificationMetadata.php" hash="58674fca7aa30eea82cb4cba17dec04e"/><file name="MerchantRegistrationDetails.php" hash="37ecb29de3d2d98fbe6f6c8c23f670a2"/><file name="NotificationImpl.php" hash="bfd2e22da29de6dfa15c82a19240132a"/><file name="NotificationMetadataImpl.php" hash="b297f69b967338d433ff90054e06da4b"/><file name="OrderItemCategories.php" hash="a0655ec5a9127ddbd51174ef9e046c5d"/><file name="OrderReference.php" hash="94b51567b72f62355d885e37e365a032"/><file name="OrderReferenceNotification.php" hash="8e6e3a67bf0ae55e86bd718ceca20e0e"/><file name="OrderReferenceStatus.php" hash="e29870a166b75c6d90955a08e0dfe048"/><file name="OrderTotal.php" hash="4141b92ed1bdeb9cfa4c13837df41221"/><file name="Price.php" hash="d94b947bb989fb974e076f2727a0dceb"/><file name="ProviderCreditDetails.php" hash="bf29c9938744effcd759cd95b8a7beab"/><file name="ProviderCreditNotification.php" hash="14b3d8a09ee0feb53cfb701e93e3180e"/><file name="ProviderCreditReversalDetails.php" hash="e9980476af6da3f09de6faff86220f85"/><file name="ProviderCreditReversalNotification.php" hash="bfff2d0e347b1f1dd9e96b0612c87b46"/><file name="ProviderCreditReversalSummary.php" hash="1e69dc1cde4ffac600f89487930cc38c"/><file name="ProviderCreditReversalSummaryList.php" hash="b4b7edc94d7dad37221ca1da5f0969f9"/><file name="ProviderCreditSummary.php" hash="946e787472dc1ee7c9dbcb5d29d62af2"/><file name="ProviderCreditSummaryList.php" hash="fad79864ec1797eed4412d9463c0d02c"/><file name="RefundDetails.php" hash="e0c9fd8c1a921097b4c7e6eb71c20f47"/><file name="RefundNotification.php" hash="28f003801abeb45e0978df05068d73da"/><file name="SellerBillingAgreementAttributes.php" hash="79572632ec2c776fb6a7e96554d7291a"/><file name="SellerOrderAttributes.php" hash="aa6f71cb667d2efb50cc336603b6029c"/><file name="SnsNotificationMetadata.php" hash="835ebe9f84b23e6d59e3f7e2101df531"/><file name="SolutionProviderMerchantNotification.php" hash="91b02852ed507b91e70907e5db488f6f"/><file name="SolutionProviderOption.php" hash="33eca51f6789687e5472cded23be5328"/><file name="SolutionProviderOptions.php" hash="806d915cdd1bd0be5c0e92a3040d49aa"/><file name="Status.php" hash="60765642cca51b523276421d995be784"/></dir><file name="Notification.php" hash="edaf311309c64b67a4fd82ccb86393a3"/><file name="NotificationMetadata.php" hash="9ffe2779593da053e82587dbb61da7d1"/></dir><dir name="OffAmazonPaymentsService"><file name="Client.php" hash="2b5807dda8510506c32adda6686f19e8"/><file name="Environments.php" hash="d84e7322b3394033b427f91be0a0abdb"/><file name="Exception.php" hash="dd85e54cfa5783c7ef7b1f93ca3995b2"/><file name="Interface.php" hash="ca1693109051f319740e4cd7e8ed4de7"/><file name="MerchantValues.php" hash="adb10859cd24d7ab62fecb3c0b67b90d"/><dir name="Model"><file name="Address.php" hash="3b3c00f4b50a4a6f42da15701343ce91"/><file name="AuthorizationDetails.php" hash="77aa03389903c2f777930d838d396da5"/><file name="AuthorizeOnBillingAgreementRequest.php" hash="fcb797660fa5c9cde02c4d482ec69f79"/><file name="AuthorizeOnBillingAgreementResponse.php" hash="c641d4e41db304d6f8f4136ea5d2f500"/><file name="AuthorizeOnBillingAgreementResult.php" hash="7b10d0dc68e7cbf18681abb4e600cca4"/><file name="AuthorizeRequest.php" hash="e7944fb6372becb0c3dd022bb30a9140"/><file name="AuthorizeResponse.php" hash="fb396a94285cacc3eb0fb798a0895466"/><file name="AuthorizeResult.php" hash="0c8f0581538ebba22a5dac5287c0fcc9"/><file name="BillingAddress.php" hash="bef3c0a443ba48ad19d832b91e8740b9"/><file name="BillingAgreementAttributes.php" hash="fe9c760e12c3db71125412ada5a65ec2"/><file name="BillingAgreementDetails.php" hash="0fef2badb342c32a01c44389bcfb52bc"/><file name="BillingAgreementLimits.php" hash="974d1252d7b914169203acdfa6e7082b"/><file name="BillingAgreementStatus.php" hash="002b0516c52264ea95847ea840d68545"/><file name="Buyer.php" hash="83759bcb729cdd8718cdb80182d9a237"/><file name="CancelOrderReferenceRequest.php" hash="86a2753aac94ae645fda1117cf90a926"/><file name="CancelOrderReferenceResponse.php" hash="4d6bc1d4818d81fd5b5820510b608275"/><file name="CancelOrderReferenceResult.php" hash="32013170a09bccf0aac178a7acb56a30"/><file name="CaptureDetails.php" hash="9ca070a0a890be4ec84d7a7264b33800"/><file name="CaptureRequest.php" hash="436da55de37deb4227a685167eb4eaa3"/><file name="CaptureResponse.php" hash="05540d55de14a3252f909fd17c8b62b6"/><file name="CaptureResult.php" hash="20e0bc168c13eb69848f09b520232eeb"/><file name="CloseAuthorizationRequest.php" hash="92d56fd8a0ae338213fdd4f8a5d1b5fc"/><file name="CloseAuthorizationResponse.php" hash="d5887ecf3981534842a9a2371ae063f0"/><file name="CloseAuthorizationResult.php" hash="0505c8c12f3b5252ad389c0c5b94ca8d"/><file name="CloseBillingAgreementRequest.php" hash="c845cdde3cde3242d4c40b1381e0ab2f"/><file name="CloseBillingAgreementResponse.php" hash="51530b8a5d14896488dbf82d6b5a37dc"/><file name="CloseBillingAgreementResult.php" hash="21cb77e2fa38defbc076263c71593168"/><file name="CloseOrderReferenceRequest.php" hash="85ae367281cb4d59f5d347be8bf0147d"/><file name="CloseOrderReferenceResponse.php" hash="d06107418145176a4038f2b0937fd9d7"/><file name="CloseOrderReferenceResult.php" hash="17bc6d72eb29b021fad7d8a222f366dc"/><file name="ConfirmBillingAgreementRequest.php" hash="965b88fe77576f07ce439bc4909e5723"/><file name="ConfirmBillingAgreementResponse.php" hash="989a66f5c217ad50a2a36afd00c763f1"/><file name="ConfirmBillingAgreementResult.php" hash="f0acdd5b7e2e1027bec651e6a6f4681d"/><file name="ConfirmOrderReferenceRequest.php" hash="8561edc4d074fd376e647bd0cdf9a686"/><file name="ConfirmOrderReferenceResponse.php" hash="b94a17b5afd4d923bda35d606c974982"/><file name="Constraint.php" hash="436ed3c926e321bcc9d9c6eaf9b4003a"/><file name="Constraints.php" hash="0063db27ee04067daf94c448f57d5c30"/><file name="CreateOrderReferenceForIdRequest.php" hash="b1c22ce6d83e510d0b9530c99b955711"/><file name="CreateOrderReferenceForIdResponse.php" hash="c811a7c44241a8b968bf4408218ac08f"/><file name="CreateOrderReferenceForIdResult.php" hash="f532299b151a1c4fe4264891737efeaf"/><file name="Destination.php" hash="4e6067e4a3b5f9acb3b9c96452b216fe"/><file name="Error.php" hash="56651e2c89e0214a3c4226903ca84d87"/><file name="ErrorResponse.php" hash="6df06e3cca71a1e73dbcde4bc6b30a3f"/><file name="GetAuthorizationDetailsRequest.php" hash="a0eb816954b6770a7fd8d54d0d75bc1a"/><file name="GetAuthorizationDetailsResponse.php" hash="82b879ccc0212f0752446b40d5338332"/><file name="GetAuthorizationDetailsResult.php" hash="a23e9463ce78b01cc51c45c21b065b6e"/><file name="GetBillingAgreementDetailsRequest.php" hash="91f33b1b1533cc4e98a019ce2c405850"/><file name="GetBillingAgreementDetailsResponse.php" hash="3abcae092618211ae5487f678a45c94f"/><file name="GetBillingAgreementDetailsResult.php" hash="37dc2407a2e9e8dd3e7feae1f690d160"/><file name="GetCaptureDetailsRequest.php" hash="48a9edebb0c7c8284241ac12b53e2d41"/><file name="GetCaptureDetailsResponse.php" hash="49cb6ae36cfba0aedef3c74c24256d53"/><file name="GetCaptureDetailsResult.php" hash="9110dbde9258a74d9933f8a50d10bd3b"/><file name="GetOrderReferenceDetailsRequest.php" hash="b1704b0e1e1f98778501792b82403c50"/><file name="GetOrderReferenceDetailsResponse.php" hash="3ea19407068d478f6c2b077bf8489a74"/><file name="GetOrderReferenceDetailsResult.php" hash="51bc2cd9a665edfb00cec970fc1fd328"/><file name="GetProviderCreditDetailsRequest.php" hash="2ff598dcc690c90b36727351f95bc76a"/><file name="GetProviderCreditDetailsResponse.php" hash="7ec3943a5c7fb0890d1304ccf52cb7d3"/><file name="GetProviderCreditDetailsResult.php" hash="a9033131b919f4f79b1000268892e64b"/><file name="GetProviderCreditReversalDetailsRequest.php" hash="5502cdd97afce7c42d177706cdcb7d0b"/><file name="GetProviderCreditReversalDetailsResponse.php" hash="19d4d9337646583f4a69776965a9f193"/><file name="GetProviderCreditReversalDetailsResult.php" hash="bb56c2f2ec45144234d7534352fe35c4"/><file name="GetRefundDetailsRequest.php" hash="c798b0b57c53e22d20e7e4a92d9eb225"/><file name="GetRefundDetailsResponse.php" hash="c1011e3b07e32792c4ac8ceabab3bc6b"/><file name="GetRefundDetailsResult.php" hash="463db01fb3a45adf9634116f3397f8a7"/><file name="IdList.php" hash="07daf191c601560ddfe50440f9006450"/><file name="OrderItemCategories.php" hash="2820e45ffb6cb36a14368a1dfe89fa84"/><file name="OrderReferenceAttributes.php" hash="990daffb0857fca0c05292ae2fb465cf"/><file name="OrderReferenceDetails.php" hash="2c75125691a884aa8bdc40318bce3b06"/><file name="OrderReferenceStatus.php" hash="04459e930111cf70c989196440f6400f"/><file name="OrderTotal.php" hash="6fda4ce95b066f960eebe41731717925"/><file name="ParentDetails.php" hash="1c6738a58079ffdaaef6e3d5e6afff01"/><file name="Price.php" hash="ea1d5a6e473542f5b0cb8ed1e70436bd"/><file name="ProviderCredit.php" hash="9834503bcc2f619b38157400984377e4"/><file name="ProviderCreditDetails.php" hash="a74f8e42aacd945989e6c5513d808fb3"/><file name="ProviderCreditList.php" hash="1c90c2d71fd33e9b059503b0b0815b53"/><file name="ProviderCreditReversal.php" hash="37aa96053d61a290d98d595d3c3c9226"/><file name="ProviderCreditReversalDetails.php" hash="7585eab585360dcabe7acb0e616f3afb"/><file name="ProviderCreditReversalList.php" hash="e30c2373f4a708443e7dde8f75e1d794"/><file name="ProviderCreditReversalSummary.php" hash="03b0b5aefae44ea5dcac06a4322e57cd"/><file name="ProviderCreditReversalSummaryList.php" hash="23a82515eb4d9f288dbc97691fef9153"/><file name="ProviderCreditSummary.php" hash="530091cb8d5e103ca3e44a0a3384eff2"/><file name="ProviderCreditSummaryList.php" hash="23115d04c6987208d7ba307781e433a5"/><file name="RefundDetails.php" hash="01866f818651ad6c0a7bc12d3c7e6644"/><file name="RefundRequest.php" hash="22b14eadcf9679a92c4325225dbf8c39"/><file name="RefundResponse.php" hash="b01d5c4c81a040bca2e1109e5d34b3e9"/><file name="RefundResult.php" hash="8f2478b1f27a295bff8f30664fd45235"/><file name="ResponseHeaderMetadata.php" hash="d8024e3bf444e8a843a6f2f6a2f836ca"/><file name="ResponseMetadata.php" hash="18e8035d5fc28d2919c1500b9f8734c5"/><file name="ReverseProviderCreditRequest.php" hash="d1b710b8911346ee0437de4e6178ac8e"/><file name="ReverseProviderCreditResponse.php" hash="38c6958d2ceb9ee244e86adee3c55acf"/><file name="ReverseProviderCreditResult.php" hash="313db1523bd575da7ab1fd956866a15d"/><file name="SellerBillingAgreementAttributes.php" hash="b4dc6401ae4340df3c484c00622d234f"/><file name="SellerOrderAttributes.php" hash="9ec79bc1be30eb322d7e88c4102a4ced"/><file name="SetBillingAgreementDetailsRequest.php" hash="9b47c3c72825fe661948aa36a2947da2"/><file name="SetBillingAgreementDetailsResponse.php" hash="7b6886f3597c434e585fb576d84fd9eb"/><file name="SetBillingAgreementDetailsResult.php" hash="d03a4c84cb96eb30f7ef5c76f981d086"/><file name="SetOrderReferenceDetailsRequest.php" hash="eed7e3485bc27f9f73cf7b67a893a1fa"/><file name="SetOrderReferenceDetailsResponse.php" hash="145bdfcfbf3bb091e0eada1361d6f581"/><file name="SetOrderReferenceDetailsResult.php" hash="246c06e0c62ee6a6ec0cfe504940c12d"/><file name="Status.php" hash="11c00f2cc32b11d4cfb8541d5ba2c279"/><file name="ValidateBillingAgreementRequest.php" hash="60250e9c62eaffa0a841bce7238ace22"/><file name="ValidateBillingAgreementResponse.php" hash="c77eebf5805b5972de84a814b3872cc7"/><file name="ValidateBillingAgreementResult.php" hash="95d4e8efc88317a097e376a4aa37a287"/></dir><file name="Model.php" hash="1147a05809ff0cc5f115bb213e38cf02"/><file name="OffAmazonPaymentsService.config.inc.php" hash="20807040ef4565a6b78f09cda6529a34"/><file name="RegionSpecificProperties.php" hash="b18f449745ebbbde5eae769eaf89ade1"/><file name="Regions.php" hash="a544d12c6321899770c039426e063cce"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="amazon_payments.xml" hash="86dc7900219559e892ffc0728e8bb136"/></dir><dir name="template"><dir name="amazon_payments"><file name="notifications.phtml" hash="b94eb031ad1f207078fd705818641503"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="amazon_login.xml" hash="8a64187752279fe95b7d46052b032f08"/><file name="amazon_payments.xml" hash="31e925986c996b632e296e22041d3110"/></dir><dir name="template"><dir name="amazon_login"><file name="button.phtml" hash="f480e98b14c76a712f71a9f396dec198"/><file name="script.phtml" hash="d88a072633c10bc92aa43e2b23632ae1"/><file name="script_authorize.phtml" hash="b48b1dd8bd8c2f79e3656f16d522f388"/><file name="verify.phtml" hash="bdc80396ca2a7f096ac334f97b402a0a"/></dir><dir name="amazon_payments"><file name="button.phtml" hash="e799a97c3f971e10d4f6d6a0ca025d6a"/><file name="button_shortcut.phtml" hash="08609929765e01f759d5259727d9dbe1"/><file name="cart.phtml" hash="20375f05aabc98f1384f1d7bf74750fc"/><file name="checkout.phtml" hash="d5230e842878d397d4db193905e73546"/><file name="form.phtml" hash="4cbc8e5d2d8c91fdb604c8f71b3cf51d"/><dir name="onepage"><file name="button.phtml" hash="a30ed2b190c5a04c2a66a1bad8be6dcd"/><file name="login.phtml" hash="0bf0f852666f60f603268a5443dc2329"/><file name="login_cancel.phtml" hash="ef82f978828a3f81bb9b6c525c5874e1"/><dir name="progress"><file name="widget.phtml" hash="cc26b9857c9f95f5a239e0adb94f6c3e"/></dir><file name="widget.phtml" hash="c5a70e2cd46fa28f87c09f6e0d7431b6"/></dir><file name="script.phtml" hash="b298e7b8f164831eb8488ab84aab93eb"/><file name="shipping_method.phtml" hash="b8ab8fcb1a91d7646e0f53d0997c231f"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="amazon_payments"><dir name="css"><file name="popup_alphacube.css" hash="bef655ef0df54d92bd06cec2b2c1a202"/><file name="styles_checkout.css" hash="54b6cf8ea2957b247b668605dfc00d00"/><file name="styles_onepage.css" hash="8c0889b17279ccfb2e7cbd018c3b554c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amazon_Login.xml" hash="d8a59c5f864353ed00225b56d4567e19"/><file name="Amazon_Payments.xml" hash="524c5cecde418e14ed6e44c16fd8bae6"/></dir></target></contents>
47
  <compatible/>
48
  <dependencies><required><php><min>5.2.1</min><max>6.0.0</max></php></required></dependencies>
49
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>login_and_pay_for_magento</name>
4
+ <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License, Version 2.0</license>
7
  <channel>community</channel>
31
  Keep your customers secure! Leverage the same user authentication system used on Amazon.com.&lt;/p&gt;&#xD;
32
  &#xD;
33
  </description>
34
+ <notes>v1.3.0 Release&#xD;
35
+ Enhancements:&#xD;
36
+ - Automated Amazon key checking on save from admin page&#xD;
37
+ - Fixed an issue in Asyncrhonous mode where orders wouldnt be updated if any previous orders had mutiple payment methods attached&#xD;
38
+ - Added diagnostics tool to help support&#xD;
39
  &#xD;
40
+ Other Feature Additions:&#xD;
41
+ - Added modman, composer.json support (see https://github.com/magento-hackathon/magento-composer-installer)&#xD;
42
+ - Async cron job is more durable, will not exit on errors&#xD;
43
+ - Better manual syncing on async orders when admin presses Sync With Amazon button&#xD;
44
+ - Async capture bug&#xD;
45
+ - Better messaging to buyer when existing customer account is found&#xD;
46
+ &#xD;
47
+ Pull Requests Merged:&#xD;
48
+ #134 Add modman, composer.json &#xD;
49
+ #125 Update Amazon Login Account Merging Text &#xD;
50
+ #120 Diagnostics &#xD;
51
+ #119 Check for user_id in amazon profile data. &#xD;
52
+ #117 Fixed Amazon Login after Amazon account e-mail change &#xD;
53
+ &#xD;
54
+ Bug Fixes:&#xD;
55
+ #122 Sandbox orders should be identifiable to a merchant &#xD;
56
+ #116 Display Plugin Version in Config &#xD;
57
+ #110 Disable Login with Amazon from customer account page if disabled product in cart&#xD;
58
+ #107 Onepage checkout. Moving to Amazon logged in user persists checkout preview items &#xD;
59
+ #106 Add key checking on save from payment configuration &#xD;
60
+ #104 Order Review Block Issues on Some Sites&#xD;
61
+ #103 Add Site Badge&#xD;
62
+ #102 Add Badge to OnePage Payment Label&#xD;
63
+ </notes>
64
  <authors><author><name>Amazon Payments</name><user>payments-cp-devel</user><email>payments-cp-devel@amazon.com</email></author></authors>
65
+ <date>2015-02-24</date>
66
+ <time>18:11:44</time>
67
+ <contents><target name="magecommunity"><dir name="Amazon"><dir name="Diagnostics"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="db8abb5277728f87d8c2c7a87b742fd1"/><file name="Textarea.php" hash="66064028ab9b3af0eaacc9610fccefea"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="e8800fc7aad8435830912270b9f8934d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DiagnosticsController.php" hash="6a858701139b15b56512e5651427dda7"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e05b867b605e5bf45d96b309deca3840"/><file name="config.xml" hash="5d67503384148675dd519e42ceb3aae6"/><file name="system.xml" hash="bba43fb7caa81fd00c0a98adda4fd4ff"/></dir></dir><dir name="Login"><dir name="Block"><file name="Button.php" hash="6522fd3c81a5959c75979b8d17a62000"/><file name="Script.php" hash="40c4cca328e24521e3562f1466251c55"/><file name="Verify.php" hash="7345e0c12f6f558029dfbea647441e81"/></dir><dir name="Helper"><file name="Data.php" hash="ae6797f0228b6cada765368d661d6bf6"/></dir><dir name="Model"><file name="Api.php" hash="48a3f6306d97f31fa4c3b954a665f334"/><file name="Customer.php" hash="ce836d13885b02c5cf41b7ddbd02e44c"/><file name="Login.php" hash="81a09b4f2c0c62e874ad209ef78ef462"/><dir name="Resource"><file name="Login.php" hash="cea5ac352d61cace9965f1cb940a7272"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Enabled.php" hash="94bc7fde24ab2ee54ed15bbe7084f118"/><file name="Popupcomment.php" hash="ebcfc96661affbbe5de8ab4d4fc9d4bb"/></dir><dir name="Source"><file name="Buttoncolor.php" hash="ac335e432cd8e47c9ca4be601c706072"/><file name="Buttonsize.php" hash="76ef1db11834db449a7d52c34f3668d8"/><file name="Buttontype.php" hash="5e333d6cb1d70d0227766d78e390530b"/></dir></dir></dir></dir><dir name="controllers"><file name="CustomerController.php" hash="d326a02cb53c18bb78f988adb94a6478"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0aa18eecfebd3e0bb1d84cd6b1040f50"/><file name="config.xml" hash="5f320a09ff6ab1d1799b43b6ddaa3d51"/><file name="system.xml" hash="cc00b85cef386caf51e2cfa729183091"/></dir><dir name="sql"><dir name="login_setup"><file name="install-0.1.0.php" hash="690c4c33f4c5221185c0589e3add63b3"/></dir></dir></dir><dir name="Payments"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="793824c5014d1269f0aee1a795e948b9"/></dir><file name="Button.php" hash="067ec17c7909052fe60fcc431ff3069b"/><file name="Checkout.php" hash="532f647be6bd8ed047ae72d380461b7a"/><file name="Form.php" hash="d4de8f8cef523b792b31f2d7be157af3"/><file name="Link.php" hash="47c237fe4604333b2080588c5498a865"/><dir name="Onepage"><file name="Progress.php" hash="ab5ba2e80b849d77f81f10d64e0a141c"/><file name="Widget.php" hash="3bdd30d05fe8af5ef5be4ccacadd6bc4"/></dir><file name="Onepage.php" hash="1d865069483bbe776f511119e0e2252b"/><dir name="Review"><file name="Info.php" hash="8d3688c55137971b18aec41272cf13a6"/></dir><file name="Review.php" hash="d9cf9b6ef7d6f063a06e006e01f09513"/></dir><dir name="Controller"><file name="Checkout.php" hash="898f925b89e5230bb72962bdd8bda0e3"/></dir><dir name="Helper"><file name="Data.php" hash="ce942bfa3bf835aab83ae87eeeae604c"/></dir><dir name="Model"><file name="Api.php" hash="d6991ebdc6c9610599172ec9d5544957"/><file name="Async.php" hash="f2f260346ae7fd34d0b7121b5993f72d"/><file name="Config.php" hash="171715d47e571ced6b4649f79c60c2bc"/><dir name="Observer"><file name="Action.php" hash="d38e500e635b4531ef71f08e92375f34"/><file name="Adminhtml.php" hash="54596e530f3cd3365b8c61313827c0b6"/><file name="Onepage.php" hash="7541e3931dcdaa334860840f2fb11b54"/><file name="Order.php" hash="783f2f46726c4db21f5e5d2b47a9b25d"/></dir><dir name="Order"><file name="Creditmemo.php" hash="6732791d2839272564cf27ecda80707c"/></dir><file name="PaymentMethod.php" hash="119e65f3976033d51c21c49e1c9789af"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Clientid.php" hash="4512003bcffedf26bc2fe415b91b1be7"/><file name="Clientsecret.php" hash="d2d5f275e4275676e3f494da704e41da"/><file name="Enabled.php" hash="420b81387e51e14dae8220fd17897bdb"/></dir><dir name="Source"><file name="Buttoncolor.php" hash="2564780faa369e54339bded78a882636"/><file name="Buttonsize.php" hash="7f740927b5a58a3ea15d07ac4cfbed28"/><file name="Buttontype.php" hash="735083e4848fa2258b95670b1a546843"/><file name="Checkoutpage.php" hash="2969f9eaa9d87571e0fa8f005e2cdeaf"/><file name="Paymentaction.php" hash="4dba1ce3518538d1a5add743d65c8695"/><file name="Region.php" hash="0718cf97d03a8c56c73fb7ea3a103bc5"/></dir></dir></dir><dir name="Type"><file name="Checkout.php" hash="5465e73384c60df94c9243bb09262dff"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Amazon"><file name="PaymentsController.php" hash="21442b140d7a8a5350019925e750290b"/></dir></dir><file name="CheckoutController.php" hash="6d005be14745219d5f7d28d4c6f51a4b"/><file name="IndexController.php" hash="128f218a9e1bf4af4f7b380f14d87a52"/><file name="OnepageController.php" hash="cc03d109ee1cf98f85aba606f5a44654"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3c56d63f30e0e5cc8c22d3686046631b"/><file name="config.xml" hash="09d0ae764799124ec65558a8741e604b"/><file name="system.xml" hash="08b19094feb2beb005fa41c2c8d61758"/></dir><dir name="sql"><dir name="payments_setup"><file name="install-0.1.0.php" hash="658f9d8c8634b3158cee7b59866e6f39"/></dir></dir></dir></dir></target><target name="magelib"><dir name="OffAmazonPayments"><file name="Model.php" hash="a608217f17166ba11901f5334ad445de"/><file name=".autoloader.php" hash="193fddab8b5ca74646bb78243c0c7dda"/></dir><dir name="OffAmazonPaymentsNotifications"><file name="Client.php" hash="0ab53a8a0a0c069f13e1de3731eaebde"/><dir name="Impl"><file name="IpnNotificationParser.php" hash="fcad418dc58a93e87b854e4067f1e24d"/><file name="Message.php" hash="2ab8cb01bd97ceaeaae0df2bf93ddbf5"/><file name="OpenSslVerifySignature.php" hash="427e2e171daab9ef454ca4ce939edd68"/><file name="SnsMessageParser.php" hash="6a1088096d27a3cdc586e4c298ddf068"/><file name="SnsMessageValidator.php" hash="076f63d5960e4c72a3dc63a76e75316c"/><file name="VerifySignature.php" hash="b18edb328fbe91c1c7b0aa8afe2904d0"/><file name="XmlNotificationParser.php" hash="4881b7d021a86215e43798497bceea24"/></dir><file name="Interface.php" hash="effe919508aab0c2aa1e585d2783c4e6"/><file name="InvalidMessageException.php" hash="2edda9cd6cc0c059846c4858cedfcd66"/><dir name="Model"><file name="AuthorizationDetails.php" hash="843711e02fb56fffcdfb6afcf097e373"/><file name="AuthorizationNotification.php" hash="b00c64bd48ae3bd3c3fa6d991e4b9f5c"/><file name="BillingAgreement.php" hash="677eadcbc4c91282eab548afc6482fdc"/><file name="BillingAgreementLimits.php" hash="a1bd8e8ec111f516528e09340c47de4a"/><file name="BillingAgreementNotification.php" hash="e39a3189bdc937b29b8488e0ef62b562"/><file name="BillingAgreementStatus.php" hash="fae14e95f03245fe6c53e7c7b725c5ca"/><file name="CaptureDetails.php" hash="adb45ebf66daa15990e032025a420e1b"/><file name="CaptureNotification.php" hash="14c2bdc8f6bd6ce881f4403d1f08c6ef"/><file name="IdList.php" hash="2907bdba4b5a534f535c026c40e6d6cc"/><file name="IpnNotificationMetadata.php" hash="58674fca7aa30eea82cb4cba17dec04e"/><file name="MerchantRegistrationDetails.php" hash="37ecb29de3d2d98fbe6f6c8c23f670a2"/><file name="NotificationImpl.php" hash="bfd2e22da29de6dfa15c82a19240132a"/><file name="NotificationMetadataImpl.php" hash="b297f69b967338d433ff90054e06da4b"/><file name="OrderItemCategories.php" hash="a0655ec5a9127ddbd51174ef9e046c5d"/><file name="OrderReference.php" hash="94b51567b72f62355d885e37e365a032"/><file name="OrderReferenceNotification.php" hash="8e6e3a67bf0ae55e86bd718ceca20e0e"/><file name="OrderReferenceStatus.php" hash="e29870a166b75c6d90955a08e0dfe048"/><file name="OrderTotal.php" hash="4141b92ed1bdeb9cfa4c13837df41221"/><file name="Price.php" hash="d94b947bb989fb974e076f2727a0dceb"/><file name="ProviderCreditDetails.php" hash="bf29c9938744effcd759cd95b8a7beab"/><file name="ProviderCreditNotification.php" hash="14b3d8a09ee0feb53cfb701e93e3180e"/><file name="ProviderCreditReversalDetails.php" hash="e9980476af6da3f09de6faff86220f85"/><file name="ProviderCreditReversalNotification.php" hash="bfff2d0e347b1f1dd9e96b0612c87b46"/><file name="ProviderCreditReversalSummary.php" hash="1e69dc1cde4ffac600f89487930cc38c"/><file name="ProviderCreditReversalSummaryList.php" hash="b4b7edc94d7dad37221ca1da5f0969f9"/><file name="ProviderCreditSummary.php" hash="946e787472dc1ee7c9dbcb5d29d62af2"/><file name="ProviderCreditSummaryList.php" hash="fad79864ec1797eed4412d9463c0d02c"/><file name="RefundDetails.php" hash="e0c9fd8c1a921097b4c7e6eb71c20f47"/><file name="RefundNotification.php" hash="28f003801abeb45e0978df05068d73da"/><file name="SellerBillingAgreementAttributes.php" hash="79572632ec2c776fb6a7e96554d7291a"/><file name="SellerOrderAttributes.php" hash="aa6f71cb667d2efb50cc336603b6029c"/><file name="SnsNotificationMetadata.php" hash="835ebe9f84b23e6d59e3f7e2101df531"/><file name="SolutionProviderMerchantNotification.php" hash="91b02852ed507b91e70907e5db488f6f"/><file name="SolutionProviderOption.php" hash="33eca51f6789687e5472cded23be5328"/><file name="SolutionProviderOptions.php" hash="806d915cdd1bd0be5c0e92a3040d49aa"/><file name="Status.php" hash="60765642cca51b523276421d995be784"/></dir><file name="Notification.php" hash="edaf311309c64b67a4fd82ccb86393a3"/><file name="NotificationMetadata.php" hash="9ffe2779593da053e82587dbb61da7d1"/></dir><dir name="OffAmazonPaymentsService"><file name="Client.php" hash="2b5807dda8510506c32adda6686f19e8"/><file name="Environments.php" hash="d84e7322b3394033b427f91be0a0abdb"/><file name="Exception.php" hash="dd85e54cfa5783c7ef7b1f93ca3995b2"/><file name="Interface.php" hash="ca1693109051f319740e4cd7e8ed4de7"/><file name="MerchantValues.php" hash="adb10859cd24d7ab62fecb3c0b67b90d"/><dir name="Model"><file name="Address.php" hash="3b3c00f4b50a4a6f42da15701343ce91"/><file name="AuthorizationDetails.php" hash="77aa03389903c2f777930d838d396da5"/><file name="AuthorizeOnBillingAgreementRequest.php" hash="fcb797660fa5c9cde02c4d482ec69f79"/><file name="AuthorizeOnBillingAgreementResponse.php" hash="c641d4e41db304d6f8f4136ea5d2f500"/><file name="AuthorizeOnBillingAgreementResult.php" hash="7b10d0dc68e7cbf18681abb4e600cca4"/><file name="AuthorizeRequest.php" hash="e7944fb6372becb0c3dd022bb30a9140"/><file name="AuthorizeResponse.php" hash="fb396a94285cacc3eb0fb798a0895466"/><file name="AuthorizeResult.php" hash="0c8f0581538ebba22a5dac5287c0fcc9"/><file name="BillingAddress.php" hash="bef3c0a443ba48ad19d832b91e8740b9"/><file name="BillingAgreementAttributes.php" hash="fe9c760e12c3db71125412ada5a65ec2"/><file name="BillingAgreementDetails.php" hash="0fef2badb342c32a01c44389bcfb52bc"/><file name="BillingAgreementLimits.php" hash="974d1252d7b914169203acdfa6e7082b"/><file name="BillingAgreementStatus.php" hash="002b0516c52264ea95847ea840d68545"/><file name="Buyer.php" hash="83759bcb729cdd8718cdb80182d9a237"/><file name="CancelOrderReferenceRequest.php" hash="86a2753aac94ae645fda1117cf90a926"/><file name="CancelOrderReferenceResponse.php" hash="4d6bc1d4818d81fd5b5820510b608275"/><file name="CancelOrderReferenceResult.php" hash="32013170a09bccf0aac178a7acb56a30"/><file name="CaptureDetails.php" hash="9ca070a0a890be4ec84d7a7264b33800"/><file name="CaptureRequest.php" hash="436da55de37deb4227a685167eb4eaa3"/><file name="CaptureResponse.php" hash="05540d55de14a3252f909fd17c8b62b6"/><file name="CaptureResult.php" hash="20e0bc168c13eb69848f09b520232eeb"/><file name="CloseAuthorizationRequest.php" hash="92d56fd8a0ae338213fdd4f8a5d1b5fc"/><file name="CloseAuthorizationResponse.php" hash="d5887ecf3981534842a9a2371ae063f0"/><file name="CloseAuthorizationResult.php" hash="0505c8c12f3b5252ad389c0c5b94ca8d"/><file name="CloseBillingAgreementRequest.php" hash="c845cdde3cde3242d4c40b1381e0ab2f"/><file name="CloseBillingAgreementResponse.php" hash="51530b8a5d14896488dbf82d6b5a37dc"/><file name="CloseBillingAgreementResult.php" hash="21cb77e2fa38defbc076263c71593168"/><file name="CloseOrderReferenceRequest.php" hash="85ae367281cb4d59f5d347be8bf0147d"/><file name="CloseOrderReferenceResponse.php" hash="d06107418145176a4038f2b0937fd9d7"/><file name="CloseOrderReferenceResult.php" hash="17bc6d72eb29b021fad7d8a222f366dc"/><file name="ConfirmBillingAgreementRequest.php" hash="965b88fe77576f07ce439bc4909e5723"/><file name="ConfirmBillingAgreementResponse.php" hash="989a66f5c217ad50a2a36afd00c763f1"/><file name="ConfirmBillingAgreementResult.php" hash="f0acdd5b7e2e1027bec651e6a6f4681d"/><file name="ConfirmOrderReferenceRequest.php" hash="8561edc4d074fd376e647bd0cdf9a686"/><file name="ConfirmOrderReferenceResponse.php" hash="b94a17b5afd4d923bda35d606c974982"/><file name="Constraint.php" hash="436ed3c926e321bcc9d9c6eaf9b4003a"/><file name="Constraints.php" hash="0063db27ee04067daf94c448f57d5c30"/><file name="CreateOrderReferenceForIdRequest.php" hash="b1c22ce6d83e510d0b9530c99b955711"/><file name="CreateOrderReferenceForIdResponse.php" hash="c811a7c44241a8b968bf4408218ac08f"/><file name="CreateOrderReferenceForIdResult.php" hash="f532299b151a1c4fe4264891737efeaf"/><file name="Destination.php" hash="4e6067e4a3b5f9acb3b9c96452b216fe"/><file name="Error.php" hash="56651e2c89e0214a3c4226903ca84d87"/><file name="ErrorResponse.php" hash="6df06e3cca71a1e73dbcde4bc6b30a3f"/><file name="GetAuthorizationDetailsRequest.php" hash="a0eb816954b6770a7fd8d54d0d75bc1a"/><file name="GetAuthorizationDetailsResponse.php" hash="82b879ccc0212f0752446b40d5338332"/><file name="GetAuthorizationDetailsResult.php" hash="a23e9463ce78b01cc51c45c21b065b6e"/><file name="GetBillingAgreementDetailsRequest.php" hash="91f33b1b1533cc4e98a019ce2c405850"/><file name="GetBillingAgreementDetailsResponse.php" hash="3abcae092618211ae5487f678a45c94f"/><file name="GetBillingAgreementDetailsResult.php" hash="37dc2407a2e9e8dd3e7feae1f690d160"/><file name="GetCaptureDetailsRequest.php" hash="48a9edebb0c7c8284241ac12b53e2d41"/><file name="GetCaptureDetailsResponse.php" hash="49cb6ae36cfba0aedef3c74c24256d53"/><file name="GetCaptureDetailsResult.php" hash="9110dbde9258a74d9933f8a50d10bd3b"/><file name="GetOrderReferenceDetailsRequest.php" hash="b1704b0e1e1f98778501792b82403c50"/><file name="GetOrderReferenceDetailsResponse.php" hash="3ea19407068d478f6c2b077bf8489a74"/><file name="GetOrderReferenceDetailsResult.php" hash="51bc2cd9a665edfb00cec970fc1fd328"/><file name="GetProviderCreditDetailsRequest.php" hash="2ff598dcc690c90b36727351f95bc76a"/><file name="GetProviderCreditDetailsResponse.php" hash="7ec3943a5c7fb0890d1304ccf52cb7d3"/><file name="GetProviderCreditDetailsResult.php" hash="a9033131b919f4f79b1000268892e64b"/><file name="GetProviderCreditReversalDetailsRequest.php" hash="5502cdd97afce7c42d177706cdcb7d0b"/><file name="GetProviderCreditReversalDetailsResponse.php" hash="19d4d9337646583f4a69776965a9f193"/><file name="GetProviderCreditReversalDetailsResult.php" hash="bb56c2f2ec45144234d7534352fe35c4"/><file name="GetRefundDetailsRequest.php" hash="c798b0b57c53e22d20e7e4a92d9eb225"/><file name="GetRefundDetailsResponse.php" hash="c1011e3b07e32792c4ac8ceabab3bc6b"/><file name="GetRefundDetailsResult.php" hash="463db01fb3a45adf9634116f3397f8a7"/><file name="IdList.php" hash="07daf191c601560ddfe50440f9006450"/><file name="OrderItemCategories.php" hash="2820e45ffb6cb36a14368a1dfe89fa84"/><file name="OrderReferenceAttributes.php" hash="990daffb0857fca0c05292ae2fb465cf"/><file name="OrderReferenceDetails.php" hash="2c75125691a884aa8bdc40318bce3b06"/><file name="OrderReferenceStatus.php" hash="04459e930111cf70c989196440f6400f"/><file name="OrderTotal.php" hash="6fda4ce95b066f960eebe41731717925"/><file name="ParentDetails.php" hash="1c6738a58079ffdaaef6e3d5e6afff01"/><file name="Price.php" hash="ea1d5a6e473542f5b0cb8ed1e70436bd"/><file name="ProviderCredit.php" hash="9834503bcc2f619b38157400984377e4"/><file name="ProviderCreditDetails.php" hash="a74f8e42aacd945989e6c5513d808fb3"/><file name="ProviderCreditList.php" hash="1c90c2d71fd33e9b059503b0b0815b53"/><file name="ProviderCreditReversal.php" hash="37aa96053d61a290d98d595d3c3c9226"/><file name="ProviderCreditReversalDetails.php" hash="7585eab585360dcabe7acb0e616f3afb"/><file name="ProviderCreditReversalList.php" hash="e30c2373f4a708443e7dde8f75e1d794"/><file name="ProviderCreditReversalSummary.php" hash="03b0b5aefae44ea5dcac06a4322e57cd"/><file name="ProviderCreditReversalSummaryList.php" hash="23a82515eb4d9f288dbc97691fef9153"/><file name="ProviderCreditSummary.php" hash="530091cb8d5e103ca3e44a0a3384eff2"/><file name="ProviderCreditSummaryList.php" hash="23115d04c6987208d7ba307781e433a5"/><file name="RefundDetails.php" hash="01866f818651ad6c0a7bc12d3c7e6644"/><file name="RefundRequest.php" hash="22b14eadcf9679a92c4325225dbf8c39"/><file name="RefundResponse.php" hash="b01d5c4c81a040bca2e1109e5d34b3e9"/><file name="RefundResult.php" hash="8f2478b1f27a295bff8f30664fd45235"/><file name="ResponseHeaderMetadata.php" hash="d8024e3bf444e8a843a6f2f6a2f836ca"/><file name="ResponseMetadata.php" hash="18e8035d5fc28d2919c1500b9f8734c5"/><file name="ReverseProviderCreditRequest.php" hash="d1b710b8911346ee0437de4e6178ac8e"/><file name="ReverseProviderCreditResponse.php" hash="38c6958d2ceb9ee244e86adee3c55acf"/><file name="ReverseProviderCreditResult.php" hash="313db1523bd575da7ab1fd956866a15d"/><file name="SellerBillingAgreementAttributes.php" hash="b4dc6401ae4340df3c484c00622d234f"/><file name="SellerOrderAttributes.php" hash="9ec79bc1be30eb322d7e88c4102a4ced"/><file name="SetBillingAgreementDetailsRequest.php" hash="9b47c3c72825fe661948aa36a2947da2"/><file name="SetBillingAgreementDetailsResponse.php" hash="7b6886f3597c434e585fb576d84fd9eb"/><file name="SetBillingAgreementDetailsResult.php" hash="d03a4c84cb96eb30f7ef5c76f981d086"/><file name="SetOrderReferenceDetailsRequest.php" hash="eed7e3485bc27f9f73cf7b67a893a1fa"/><file name="SetOrderReferenceDetailsResponse.php" hash="145bdfcfbf3bb091e0eada1361d6f581"/><file name="SetOrderReferenceDetailsResult.php" hash="246c06e0c62ee6a6ec0cfe504940c12d"/><file name="Status.php" hash="11c00f2cc32b11d4cfb8541d5ba2c279"/><file name="ValidateBillingAgreementRequest.php" hash="60250e9c62eaffa0a841bce7238ace22"/><file name="ValidateBillingAgreementResponse.php" hash="c77eebf5805b5972de84a814b3872cc7"/><file name="ValidateBillingAgreementResult.php" hash="95d4e8efc88317a097e376a4aa37a287"/></dir><file name="Model.php" hash="1147a05809ff0cc5f115bb213e38cf02"/><file name="OffAmazonPaymentsService.config.inc.php" hash="20807040ef4565a6b78f09cda6529a34"/><file name="RegionSpecificProperties.php" hash="b18f449745ebbbde5eae769eaf89ade1"/><file name="Regions.php" hash="a544d12c6321899770c039426e063cce"/></dir><dir name="MarketplaceWebServiceSellers"><file name="Client.php" hash="9a9b59ba596e1b08d53dd3d07715fa3d"/><file name="Exception.php" hash="022774b205223fb2e09988a6881b57b0"/><file name="Interface.php" hash="8b5cef37a1c02865998510e07b3ad5f0"/><file name="KeycheckClient.php" hash="9a9b59ba596e1b08d53dd3d07715fa3d"/><dir name="Model"><file name="ListMarketplaceParticipationsRequest.php" hash="59e66ae0991177be83cefbcaa962b155"/><file name="ListMarketplaceParticipationsResponse.php" hash="16b6fed10df863cd5ad05c29f85bf920"/><file name="ListMarketplaceParticipationsResult.php" hash="daecc8554eef98039eba934ce51720e5"/><file name="ListMarketplaces.php" hash="151f584eb5e3cd24be59b2f1309fdf97"/><file name="ListParticipations.php" hash="d0179c65514949255db5a2ea2f1a4796"/><file name="Marketplace.php" hash="c234ffbd0c5f0250b9d448a0d8687d2b"/><file name="Participation.php" hash="50f95fa7c5398a1e8be70700103a754c"/><file name="ResponseHeaderMetaData.php" hash="516b66964035a6bfb40177f7d200ab9c"/><file name="ResponseHeaderMetadata.php" hash="516b66964035a6bfb40177f7d200ab9c"/><file name="ResponseMetaData.php" hash="3095644d4bd240ef6a6069f1f3f7bfde"/><file name="ResponseMetadata.php" hash="3095644d4bd240ef6a6069f1f3f7bfde"/></dir><file name="Model.php" hash="1a27b28fc0e8a0fa60494c5847c51e7f"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="amazon_payments.xml" hash="86dc7900219559e892ffc0728e8bb136"/></dir><dir name="template"><dir name="amazon_payments"><file name="button.phtml" hash="59dc517bafe5ea4c3e35ed71d5ddf9ab"/><file name="notifications.phtml" hash="b94eb031ad1f207078fd705818641503"/><file name="textarea.phtml" hash="6045e3a122766622d18e8d7ad7239af4"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="amazon_login.xml" hash="8a64187752279fe95b7d46052b032f08"/><file name="amazon_payments.xml" hash="71b10955a0fb416886b327b8a6abab34"/></dir><dir name="template"><dir name="amazon_login"><file name="button.phtml" hash="f480e98b14c76a712f71a9f396dec198"/><file name="script.phtml" hash="d88a072633c10bc92aa43e2b23632ae1"/><file name="script_authorize.phtml" hash="b48b1dd8bd8c2f79e3656f16d522f388"/><file name="verify.phtml" hash="65ab4a0115af59faf1e5ff3f0341e102"/></dir><dir name="amazon_payments"><file name="button.phtml" hash="e799a97c3f971e10d4f6d6a0ca025d6a"/><file name="button_badge.phtml" hash="4ca1e3ed42f0cd5fc5ba7ce2ae83b127"/><file name="button_shortcut.phtml" hash="08609929765e01f759d5259727d9dbe1"/><file name="cart.phtml" hash="20375f05aabc98f1384f1d7bf74750fc"/><file name="checkout.phtml" hash="424ccd4ae774e7181694132eaef2a803"/><file name="form.phtml" hash="4cbc8e5d2d8c91fdb604c8f71b3cf51d"/><file name="mark.phtml" hash="ca75879d9eec4444385bcb8b52c8b946"/><dir name="onepage"><file name="button.phtml" hash="a30ed2b190c5a04c2a66a1bad8be6dcd"/><file name="login.phtml" hash="0bf0f852666f60f603268a5443dc2329"/><file name="login_cancel.phtml" hash="ef82f978828a3f81bb9b6c525c5874e1"/><dir name="progress"><file name="widget.phtml" hash="cc26b9857c9f95f5a239e0adb94f6c3e"/></dir><file name="widget.phtml" hash="097c4e6fbc51b16fb2bd52293c3afeb0"/></dir><file name="script.phtml" hash="b298e7b8f164831eb8488ab84aab93eb"/><file name="shipping_method.phtml" hash="b8ab8fcb1a91d7646e0f53d0997c231f"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="amazon_payments"><dir name="css"><file name="popup_alphacube.css" hash="bef655ef0df54d92bd06cec2b2c1a202"/><file name="styles_checkout.css" hash="54b6cf8ea2957b247b668605dfc00d00"/><file name="styles_onepage.css" hash="8c0889b17279ccfb2e7cbd018c3b554c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amazon_Login.xml" hash="d8a59c5f864353ed00225b56d4567e19"/><file name="Amazon_Payments.xml" hash="524c5cecde418e14ed6e44c16fd8bae6"/><file name="Amazon_Diagnostics.xml" hash="c56ca83a95a5a3f929fd2ad4e88bd518"/></dir></target></contents>
68
  <compatible/>
69
  <dependencies><required><php><min>5.2.1</min><max>6.0.0</max></php></required></dependencies>
70
  </package>