Version Notes
ADDED: synchronous authorization
ADDED: initial order status config option
Download this release
Release Info
Developer | creativestyle GmbH |
Extension | Creativestyle_AmazonPayments |
Version | 1.6.0 |
Comparing to | |
See all releases |
Code changes from version 1.3.4 to 1.6.0
- app/code/community/Creativestyle/AmazonPayments/Exception/InvalidStatus.php +16 -0
- app/code/community/Creativestyle/AmazonPayments/Exception/InvalidStatus/Recoverable.php +16 -0
- app/code/community/Creativestyle/AmazonPayments/Helper/Data.php +3 -3
- app/code/community/Creativestyle/AmazonPayments/Model/Api/Advanced.php +4 -1
- app/code/community/Creativestyle/AmazonPayments/Model/Checkout.php +2 -1
- app/code/community/Creativestyle/AmazonPayments/Model/Config.php +22 -0
- app/code/community/Creativestyle/AmazonPayments/Model/Lookup/AuthorizationMode.php +30 -0
- app/code/community/Creativestyle/AmazonPayments/Model/Mapper.php +162 -0
- app/code/community/Creativestyle/AmazonPayments/Model/Observer.php +48 -46
- app/code/community/Creativestyle/AmazonPayments/Model/Payment/Abstract.php +785 -16
- app/code/community/Creativestyle/AmazonPayments/Model/Payment/Advanced.php +1 -1
- app/code/community/Creativestyle/AmazonPayments/Model/Payment/Advanced/Sandbox.php +1 -1
- app/code/community/Creativestyle/AmazonPayments/Model/Processor.php +297 -0
- app/code/community/Creativestyle/AmazonPayments/Model/Service/Quote.php +6 -0
- app/code/community/Creativestyle/AmazonPayments/controllers/Adminhtml/OrderController.php +4 -1
- app/code/community/Creativestyle/AmazonPayments/controllers/Advanced/CheckoutController.php +46 -26
- app/code/community/Creativestyle/AmazonPayments/etc/config.xml +3 -1
- app/code/community/Creativestyle/AmazonPayments/etc/system.xml +20 -0
- app/locale/de_DE/Creativestyle_AmazonPayments.csv +2 -0
- app/locale/en_GB/Creativestyle_AmazonPayments.csv +2 -0
- app/locale/en_US/Creativestyle_AmazonPayments.csv +2 -0
- js/creativestyle/apa_checkout.js +47 -6
- js/creativestyle/apa_checkout.min.js +1 -1
- js/creativestyle/apa_sandbox_toolbox.min.js +1 -1
- package.xml +6 -9
app/code/community/Creativestyle/AmazonPayments/Exception/InvalidStatus.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the official Amazon Payments Advanced extension
|
5 |
+
* for Magento (c) creativestyle GmbH <amazon@creativestyle.de>
|
6 |
+
* All rights reserved
|
7 |
+
*
|
8 |
+
* Reuse or modification of this source code is not allowed
|
9 |
+
* without written permission from creativestyle GmbH
|
10 |
+
*
|
11 |
+
* @category Creativestyle
|
12 |
+
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2015 creativestyle GmbH
|
14 |
+
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
+
*/
|
16 |
+
class Creativestyle_AmazonPayments_Exception_InvalidStatus extends Creativestyle_AmazonPayments_Exception {}
|
app/code/community/Creativestyle/AmazonPayments/Exception/InvalidStatus/Recoverable.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the official Amazon Payments Advanced extension
|
5 |
+
* for Magento (c) creativestyle GmbH <amazon@creativestyle.de>
|
6 |
+
* All rights reserved
|
7 |
+
*
|
8 |
+
* Reuse or modification of this source code is not allowed
|
9 |
+
* without written permission from creativestyle GmbH
|
10 |
+
*
|
11 |
+
* @category Creativestyle
|
12 |
+
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2015 creativestyle GmbH
|
14 |
+
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
+
*/
|
16 |
+
class Creativestyle_AmazonPayments_Exception_InvalidStatus_Recoverable extends Creativestyle_AmazonPayments_Exception_InvalidStatus {}
|
app/code/community/Creativestyle/AmazonPayments/Helper/Data.php
CHANGED
@@ -32,7 +32,7 @@ class Creativestyle_AmazonPayments_Helper_Data extends Mage_Core_Helper_Abstract
|
|
32 |
* @param Mage_Sales_Model_Order_Payment $payment
|
33 |
* @param OffAmazonPaymentsService_Model_AuthorizationDetails|OffAmazonPaymentsNotifications_Model_AuthorizationDetails $authorizationDetails
|
34 |
*/
|
35 |
-
public function sendAuthorizationDeclinedEmail($payment, $authorizationDetails) {
|
36 |
$translate = Mage::getSingleton('core/translate');
|
37 |
/* @var $translate Mage_Core_Model_Translate */
|
38 |
$translate->setTranslateInline(false);
|
@@ -102,14 +102,14 @@ class Creativestyle_AmazonPayments_Helper_Data extends Mage_Core_Helper_Abstract
|
|
102 |
return null;
|
103 |
}
|
104 |
|
105 |
-
public function explodeCustomerName($customerName) {
|
106 |
$explodedName = explode(' ', trim($customerName));
|
107 |
$result = array();
|
108 |
if (count($explodedName) > 1) {
|
109 |
$result['firstname'] = reset($explodedName);
|
110 |
$result['lastname'] = trim(str_replace($result['firstname'], "", $customerName));
|
111 |
} else {
|
112 |
-
$result['firstname'] = Mage::helper('amazonpayments')->__(
|
113 |
$result['lastname'] = reset($explodedName);
|
114 |
}
|
115 |
return new Varien_Object($result);
|
32 |
* @param Mage_Sales_Model_Order_Payment $payment
|
33 |
* @param OffAmazonPaymentsService_Model_AuthorizationDetails|OffAmazonPaymentsNotifications_Model_AuthorizationDetails $authorizationDetails
|
34 |
*/
|
35 |
+
public function sendAuthorizationDeclinedEmail($payment, $authorizationDetails = null) {
|
36 |
$translate = Mage::getSingleton('core/translate');
|
37 |
/* @var $translate Mage_Core_Model_Translate */
|
38 |
$translate->setTranslateInline(false);
|
102 |
return null;
|
103 |
}
|
104 |
|
105 |
+
public function explodeCustomerName($customerName, $emptyValuePlaceholder = 'n/a') {
|
106 |
$explodedName = explode(' ', trim($customerName));
|
107 |
$result = array();
|
108 |
if (count($explodedName) > 1) {
|
109 |
$result['firstname'] = reset($explodedName);
|
110 |
$result['lastname'] = trim(str_replace($result['firstname'], "", $customerName));
|
111 |
} else {
|
112 |
+
$result['firstname'] = $emptyValuePlaceholder ? Mage::helper('amazonpayments')->__($emptyValuePlaceholder) : null;
|
113 |
$result['lastname'] = reset($explodedName);
|
114 |
}
|
115 |
return new Varien_Object($result);
|
app/code/community/Creativestyle/AmazonPayments/Model/Api/Advanced.php
CHANGED
@@ -90,7 +90,7 @@ class Creativestyle_AmazonPayments_Model_Api_Advanced extends Creativestyle_Amaz
|
|
90 |
return $response;
|
91 |
}
|
92 |
|
93 |
-
public function authorize($orderReferenceId, $authorizationReferenceId, $authorizationAmount, $authorizationCurrency, $sellerAuthorizationNote = null, $captureNow = false) {
|
94 |
$request = new OffAmazonPaymentsService_Model_AuthorizeRequest(array(
|
95 |
'SellerId' => $this->getMerchantId(),
|
96 |
'AmazonOrderReferenceId' => $orderReferenceId,
|
@@ -104,6 +104,9 @@ class Creativestyle_AmazonPayments_Model_Api_Advanced extends Creativestyle_Amaz
|
|
104 |
if (null !== $sellerAuthorizationNote) {
|
105 |
$request->setSellerAuthorizationNote($sellerAuthorizationNote);
|
106 |
}
|
|
|
|
|
|
|
107 |
$response = $this->_getApi()->authorize($request);
|
108 |
if ($response->isSetAuthorizeResult()) {
|
109 |
$result = $response->getAuthorizeResult();
|
90 |
return $response;
|
91 |
}
|
92 |
|
93 |
+
public function authorize($orderReferenceId, $authorizationReferenceId, $authorizationAmount, $authorizationCurrency, $sellerAuthorizationNote = null, $captureNow = false, $transactionTimeout = null) {
|
94 |
$request = new OffAmazonPaymentsService_Model_AuthorizeRequest(array(
|
95 |
'SellerId' => $this->getMerchantId(),
|
96 |
'AmazonOrderReferenceId' => $orderReferenceId,
|
104 |
if (null !== $sellerAuthorizationNote) {
|
105 |
$request->setSellerAuthorizationNote($sellerAuthorizationNote);
|
106 |
}
|
107 |
+
if (null !== $transactionTimeout) {
|
108 |
+
$request->setTransactionTimeout($transactionTimeout);
|
109 |
+
}
|
110 |
$response = $this->_getApi()->authorize($request);
|
111 |
if ($response->isSetAuthorizeResult()) {
|
112 |
$result = $response->getAuthorizeResult();
|
app/code/community/Creativestyle/AmazonPayments/Model/Checkout.php
CHANGED
@@ -157,7 +157,8 @@ class Creativestyle_AmazonPayments_Model_Checkout extends Mage_Checkout_Model_Ty
|
|
157 |
// add order information to the session
|
158 |
$this->_checkoutSession->setLastOrderId($order->getId())
|
159 |
->setLastRealOrderId($order->getIncrementId())
|
160 |
-
->setOrderReferenceId(null)
|
|
|
161 |
|
162 |
}
|
163 |
|
157 |
// add order information to the session
|
158 |
$this->_checkoutSession->setLastOrderId($order->getId())
|
159 |
->setLastRealOrderId($order->getIncrementId())
|
160 |
+
->setOrderReferenceId(null)
|
161 |
+
->setAmazonSequenceNumber(null);
|
162 |
|
163 |
}
|
164 |
|
app/code/community/Creativestyle/AmazonPayments/Model/Config.php
CHANGED
@@ -24,7 +24,9 @@ class Creativestyle_AmazonPayments_Model_Config {
|
|
24 |
const XML_PATH_GENERAL_SANDBOX = 'amazonpayments/general/sandbox';
|
25 |
const XML_PATH_GENERAL_SANDBOX_TOOLBOX = 'amazonpayments/general/sandbox_toolbox';
|
26 |
const XML_PATH_GENERAL_PAYMENT_ACTION = 'amazonpayments/general/payment_action';
|
|
|
27 |
const XML_PATH_GENERAL_IPN_ACTIVE = 'amazonpayments/general/ipn_active';
|
|
|
28 |
const XML_PATH_GENERAL_ORDER_STATUS = 'amazonpayments/general/authorized_order_status';
|
29 |
const XML_PATH_GENERAL_RECENT_POLLED_TXN = 'amazonpayments/general/recent_polled_transaction';
|
30 |
|
@@ -171,6 +173,14 @@ class Creativestyle_AmazonPayments_Model_Config {
|
|
171 |
return $this->getAuthenticationExperience($store) == Creativestyle_AmazonPayments_Model_Lookup_Authentication::POPUP_EXPERIENCE;
|
172 |
}
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
public function getWidgetUrl($store = null) {
|
175 |
if ($this->isActive() & self::LOGIN_WITH_AMAZON_ACTIVE) {
|
176 |
return $this->getMerchantValues()->getWidgetUrl();
|
@@ -254,6 +264,10 @@ class Creativestyle_AmazonPayments_Model_Config {
|
|
254 |
));
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
257 |
public function authorizeImmediately($store = null) {
|
258 |
return in_array(Mage::getStoreConfig(self::XML_PATH_GENERAL_PAYMENT_ACTION, $store), array(
|
259 |
Creativestyle_AmazonPayments_Model_Payment_Abstract::ACTION_AUTHORIZE,
|
@@ -273,10 +287,18 @@ class Creativestyle_AmazonPayments_Model_Config {
|
|
273 |
return Mage::getStoreConfig(self::XML_PATH_GENERAL_PAYMENT_ACTION, $store) != Creativestyle_AmazonPayments_Model_Payment_Abstract::ACTION_ERP;
|
274 |
}
|
275 |
|
|
|
|
|
|
|
|
|
276 |
public function getAuthorizedOrderStatus($store = null) {
|
277 |
return Mage::getStoreConfig(self::XML_PATH_GENERAL_ORDER_STATUS, $store);
|
278 |
}
|
279 |
|
|
|
|
|
|
|
|
|
280 |
public function sendEmailConfirmation($store = null) {
|
281 |
return Mage::getStoreConfigFlag(self::XML_PATH_EMAIL_ORDER_CONFIRMATION, $store);
|
282 |
}
|
24 |
const XML_PATH_GENERAL_SANDBOX = 'amazonpayments/general/sandbox';
|
25 |
const XML_PATH_GENERAL_SANDBOX_TOOLBOX = 'amazonpayments/general/sandbox_toolbox';
|
26 |
const XML_PATH_GENERAL_PAYMENT_ACTION = 'amazonpayments/general/payment_action';
|
27 |
+
const XML_PATH_GENERAL_AUTHORIZATION_MODE = 'amazonpayments/general/authorization_mode';
|
28 |
const XML_PATH_GENERAL_IPN_ACTIVE = 'amazonpayments/general/ipn_active';
|
29 |
+
const XML_PATH_GENERAL_NEW_ORDER_STATUS = 'amazonpayments/general/new_order_status';
|
30 |
const XML_PATH_GENERAL_ORDER_STATUS = 'amazonpayments/general/authorized_order_status';
|
31 |
const XML_PATH_GENERAL_RECENT_POLLED_TXN = 'amazonpayments/general/recent_polled_transaction';
|
32 |
|
173 |
return $this->getAuthenticationExperience($store) == Creativestyle_AmazonPayments_Model_Lookup_Authentication::POPUP_EXPERIENCE;
|
174 |
}
|
175 |
|
176 |
+
public function getAuthorizationMode($store = null) {
|
177 |
+
return Mage::getStoreConfig(self::XML_PATH_GENERAL_AUTHORIZATION_MODE, $store);
|
178 |
+
}
|
179 |
+
|
180 |
+
public function isAuthorizationSynchronous($store = null) {
|
181 |
+
return $this->getAuthorizationMode($store) == Creativestyle_AmazonPayments_Model_Lookup_AuthorizationMode::SYNCHRONOUS;
|
182 |
+
}
|
183 |
+
|
184 |
public function getWidgetUrl($store = null) {
|
185 |
if ($this->isActive() & self::LOGIN_WITH_AMAZON_ACTIVE) {
|
186 |
return $this->getMerchantValues()->getWidgetUrl();
|
264 |
));
|
265 |
}
|
266 |
|
267 |
+
public function getPaymentAction($store = null) {
|
268 |
+
return Mage::getStoreConfig(self::XML_PATH_GENERAL_PAYMENT_ACTION, $store);
|
269 |
+
}
|
270 |
+
|
271 |
public function authorizeImmediately($store = null) {
|
272 |
return in_array(Mage::getStoreConfig(self::XML_PATH_GENERAL_PAYMENT_ACTION, $store), array(
|
273 |
Creativestyle_AmazonPayments_Model_Payment_Abstract::ACTION_AUTHORIZE,
|
287 |
return Mage::getStoreConfig(self::XML_PATH_GENERAL_PAYMENT_ACTION, $store) != Creativestyle_AmazonPayments_Model_Payment_Abstract::ACTION_ERP;
|
288 |
}
|
289 |
|
290 |
+
public function getNewOrderStatus($store = null) {
|
291 |
+
return Mage::getStoreConfig(self::XML_PATH_GENERAL_NEW_ORDER_STATUS, $store);
|
292 |
+
}
|
293 |
+
|
294 |
public function getAuthorizedOrderStatus($store = null) {
|
295 |
return Mage::getStoreConfig(self::XML_PATH_GENERAL_ORDER_STATUS, $store);
|
296 |
}
|
297 |
|
298 |
+
public function getHoldedOrderStatus($store = null) {
|
299 |
+
return 'holded';
|
300 |
+
}
|
301 |
+
|
302 |
public function sendEmailConfirmation($store = null) {
|
303 |
return Mage::getStoreConfigFlag(self::XML_PATH_EMAIL_ORDER_CONFIRMATION, $store);
|
304 |
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Lookup/AuthorizationMode.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the official Amazon Payments Advanced extension
|
5 |
+
* for Magento (c) creativestyle GmbH <amazon@creativestyle.de>
|
6 |
+
* All rights reserved
|
7 |
+
*
|
8 |
+
* Reuse or modification of this source code is not allowed
|
9 |
+
* without written permission from creativestyle GmbH
|
10 |
+
*
|
11 |
+
* @category Creativestyle
|
12 |
+
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2015 creativestyle GmbH
|
14 |
+
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
+
*/
|
16 |
+
class Creativestyle_AmazonPayments_Model_Lookup_AuthorizationMode extends Creativestyle_AmazonPayments_Model_Lookup_Abstract {
|
17 |
+
|
18 |
+
const ASYNCHRONOUS = 'asynchronous';
|
19 |
+
const SYNCHRONOUS = 'synchronous';
|
20 |
+
|
21 |
+
public function toOptionArray() {
|
22 |
+
if (null === $this->_options) {
|
23 |
+
$this->_options = array(
|
24 |
+
array('value' => self::ASYNCHRONOUS, 'label' => Mage::helper('amazonpayments')->__('Asynchronous')),
|
25 |
+
array('value' => self::SYNCHRONOUS, 'label' => Mage::helper('amazonpayments')->__('Synchronous')),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
return $this->_options;
|
29 |
+
}
|
30 |
+
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Mapper.php
ADDED
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the official Amazon Payments Advanced extension
|
5 |
+
* for Magento (c) creativestyle GmbH <amazon@creativestyle.de>
|
6 |
+
* All rights reserved
|
7 |
+
*
|
8 |
+
* Reuse or modification of this source code is not allowed
|
9 |
+
* without written permission from creativestyle GmbH
|
10 |
+
*
|
11 |
+
* @category Creativestyle
|
12 |
+
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2015 creativestyle GmbH
|
14 |
+
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
+
*/
|
16 |
+
class Creativestyle_AmazonPayments_Model_Mapper {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Check whether provided address lines contain PO Box data
|
20 |
+
*/
|
21 |
+
protected function _isPoBox($addressLine1, $addressLine2 = null) {
|
22 |
+
if (is_numeric($addressLine1)) {
|
23 |
+
return true;
|
24 |
+
}
|
25 |
+
if (strpos(strtolower($addressLine1), 'packstation') !== false) {
|
26 |
+
return true;
|
27 |
+
}
|
28 |
+
if (strpos(strtolower($addressLine2), 'packstation') !== false) {
|
29 |
+
return true;
|
30 |
+
}
|
31 |
+
return false;
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Convert Amazon AddressLine fields to the array indexed with the same
|
36 |
+
* keys Magento order address entities are using. Try to guess if address
|
37 |
+
* lines contain company name or PO Box
|
38 |
+
*
|
39 |
+
* @param string $addressLine1
|
40 |
+
* @param string $addressLine2
|
41 |
+
* @param string $addressLine3
|
42 |
+
* @param string $countryId
|
43 |
+
*
|
44 |
+
* @return array
|
45 |
+
*/
|
46 |
+
protected function _mapAmazonAddressLines($addressLine1, $addressLine2 = null, $addressLine3 = null, $countryId = null) {
|
47 |
+
$data = array('street' => array());
|
48 |
+
if ($countryId && in_array($countryId, array('DE', 'AT'))) {
|
49 |
+
if ($addressLine3) {
|
50 |
+
if ($this->_isPoBox($addressLine1, $addressLine2)) {
|
51 |
+
$data['street'][] = $addressLine1;
|
52 |
+
$data['street'][] = $addressLine2;
|
53 |
+
} else {
|
54 |
+
$data['company'] = trim($addressLine1 . ' ' . $addressLine2);
|
55 |
+
}
|
56 |
+
$data['street'][] = $addressLine3;
|
57 |
+
} else if ($addressLine2) {
|
58 |
+
if ($this->_isPoBox($addressLine1)) {
|
59 |
+
$data['street'][] = $addressLine1;
|
60 |
+
} else {
|
61 |
+
$data['company'] = $addressLine1;
|
62 |
+
}
|
63 |
+
$data['street'][] = $addressLine2;
|
64 |
+
} else {
|
65 |
+
$data['street'][] = $addressLine1;
|
66 |
+
}
|
67 |
+
} else {
|
68 |
+
if ($addressLine1) {
|
69 |
+
$data['street'][] = $addressLine1;
|
70 |
+
}
|
71 |
+
if ($addressLine2) {
|
72 |
+
$data['street'][] = $addressLine2;
|
73 |
+
}
|
74 |
+
if ($addressLine3) {
|
75 |
+
$data['street'][] = $addressLine3;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
return $data;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Convert address object from Amazon Payments API response to Varien_Object
|
83 |
+
* indexed with the same keys Magento order address entities are using
|
84 |
+
*
|
85 |
+
* @param OffAmazonPaymentsService_Model_Address $amazonAddress
|
86 |
+
*
|
87 |
+
* @return Varien_Object
|
88 |
+
*/
|
89 |
+
public function mapAmazonAddress($amazonAddress) {
|
90 |
+
$data = $this->_mapAmazonAddressLines(
|
91 |
+
$amazonAddress->getAddressLine1(),
|
92 |
+
$amazonAddress->getAddressLine2(),
|
93 |
+
$amazonAddress->getAddressLine3(),
|
94 |
+
$amazonAddress->getCountryCode()
|
95 |
+
);
|
96 |
+
$explodedName = Mage::helper('amazonpayments')->explodeCustomerName($amazonAddress->getName());
|
97 |
+
$data['firstname'] = $explodedName->getFirstname();
|
98 |
+
$data['lastname'] = $explodedName->getLastname();
|
99 |
+
$data['country_id'] = $amazonAddress->getCountryCode();
|
100 |
+
$data['city'] = $amazonAddress->getCity();
|
101 |
+
$data['postcode'] = $amazonAddress->getPostalCode();
|
102 |
+
$data['telephone'] = $amazonAddress->getPhone();
|
103 |
+
return new Varien_Object($data);
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Convert transaction info object to Varien_Object indexed with
|
108 |
+
* the same keys as Magento order entity is
|
109 |
+
*
|
110 |
+
* @param OffAmazonPaymentsService_Model|OffAmazonPayments_Model $transactionInfo
|
111 |
+
*
|
112 |
+
* @return Varien_Object
|
113 |
+
*/
|
114 |
+
public function mapTransactionInfo($transactionInfo) {
|
115 |
+
$data = array();
|
116 |
+
// OrderReferenceDetails from API response
|
117 |
+
if ($transactionInfo instanceof OffAmazonPaymentsService_Model_OrderReferenceDetails) {
|
118 |
+
if ($transactionInfo->isSetBuyer()) {
|
119 |
+
$data['customer_email'] = $transactionInfo->getBuyer()->getEmail();
|
120 |
+
$customerName = Mage::helper('amazonpayments')->explodeCustomerName($transactionInfo->getBuyer()->getName(), null);
|
121 |
+
$data['customer_firstname'] = $customerName->getFirstname();
|
122 |
+
$data['customer_lastname'] = $customerName->getLastname();
|
123 |
+
}
|
124 |
+
if ($transactionInfo->isSetDestination()) {
|
125 |
+
if ($transactionInfo->getDestination()->isSetPhysicalDestination()) {
|
126 |
+
$data['shipping_address'] = $this->mapAmazonAddress($transactionInfo->getDestination()->getPhysicalDestination());
|
127 |
+
}
|
128 |
+
}
|
129 |
+
if ($transactionInfo->isSetBillingAddress()) {
|
130 |
+
if ($transactionInfo->getBillingAddress()->isSetPhysicalAddress()) {
|
131 |
+
$data['billing_address'] = $this->mapAmazonAddress($transactionInfo->getBillingAddress()->getPhysicalAddress());
|
132 |
+
$data['customer_firstname'] = $data['billing_address']->getFirstname();
|
133 |
+
$data['customer_lastname'] = $data['billing_address']->getLastname();
|
134 |
+
}
|
135 |
+
} elseif (isset($data['shipping_address'])) {
|
136 |
+
$data['billing_address'] = $data['shipping_address'];
|
137 |
+
}
|
138 |
+
}
|
139 |
+
// OrderReference from OrderReferenceNotification
|
140 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsNotifications_Model_OrderReference) {}
|
141 |
+
// AuthorizationDetails from API response
|
142 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsService_Model_AuthorizationDetails) {
|
143 |
+
if ($transactionInfo->isSetAuthorizationBillingAddress()) {
|
144 |
+
$data['billing_address'] = $this->mapAmazonAddress($transactionInfo->getAuthorizationBillingAddress());
|
145 |
+
$data['customer_firstname'] = $data['billing_address']->getFirstname();
|
146 |
+
$data['customer_lastname'] = $data['billing_address']->getLastname();
|
147 |
+
}
|
148 |
+
}
|
149 |
+
// AuthorizationDetails from AuthorizationNotification
|
150 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsNotifications_Model_AuthorizationDetails) {}
|
151 |
+
// CaptureDetails from API response
|
152 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsService_Model_CaptureDetails) {}
|
153 |
+
// CaptureDetails from CaptureNotification
|
154 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsNotifications_Model_CaptureDetails) {}
|
155 |
+
// RefundDetails from API response
|
156 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsService_Model_RefundDetails) {}
|
157 |
+
// RefundDetails from RefundNotification
|
158 |
+
elseif ($transactionInfo instanceof OffAmazonPaymentsNotifications_Model_RefundDetails) {}
|
159 |
+
return new Varien_Object($data);
|
160 |
+
}
|
161 |
+
|
162 |
+
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Observer.php
CHANGED
@@ -37,12 +37,11 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
37 |
*
|
38 |
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
39 |
*/
|
40 |
-
protected function _fetchTransactionInfo($transaction
|
41 |
$transaction->getOrderPaymentObject()
|
42 |
->setOrder($transaction->getOrder())
|
43 |
->importTransactionInfo($transaction);
|
44 |
-
|
45 |
-
return $transaction->getId();
|
46 |
}
|
47 |
|
48 |
protected function _pollTransactionData() {
|
@@ -66,30 +65,30 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
66 |
foreach ($collection as $transaction) {
|
67 |
try {
|
68 |
$txnType = $transaction->getTxnType();
|
69 |
-
switch (
|
70 |
-
case
|
71 |
-
$recentTransactionId = $this->_fetchTransactionInfo($transaction);
|
72 |
$count++;
|
73 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
74 |
break;
|
75 |
-
case
|
76 |
if ($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER) {
|
77 |
-
$recentTransactionId = $this->_fetchTransactionInfo($transaction);
|
78 |
$count++;
|
79 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
80 |
}
|
81 |
break;
|
82 |
-
case
|
83 |
$txnAge = floor(($dateModel->timestamp() - $dateModel->timestamp($transaction->getCreatedAt())) / (60 * 60 * 24));
|
84 |
if (($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER && $txnAge > 180) ||
|
85 |
($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH && $txnAge > 30)) {
|
86 |
-
$recentTransactionId = $this->_fetchTransactionInfo($transaction);
|
87 |
$count++;
|
88 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
89 |
}
|
90 |
break;
|
91 |
case null:
|
92 |
-
$recentTransactionId = $this->_fetchTransactionInfo($transaction);
|
93 |
$count++;
|
94 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
95 |
break;
|
@@ -112,34 +111,31 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
112 |
}
|
113 |
|
114 |
protected function _shouldUpdateParentTransaction($transaction) {
|
115 |
-
$
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
if (array_key_exists($txnStatus, $updateMatrix) && in_array($txnType, $updateMatrix[$txnStatus])) {
|
133 |
-
return true;
|
134 |
}
|
135 |
return false;
|
136 |
}
|
137 |
|
138 |
-
protected function _updateParentTransaction($transaction
|
139 |
if ($this->_shouldUpdateParentTransaction($transaction)) {
|
140 |
-
$parentTransaction = $transaction->getParentTransaction()
|
141 |
-
|
142 |
-
$this->_fetchTransactionInfo($parentTransaction, $shouldSave);
|
143 |
}
|
144 |
}
|
145 |
return $this;
|
@@ -230,16 +226,17 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
230 |
return $this;
|
231 |
}
|
232 |
|
233 |
-
|
234 |
public function closeTransaction($observer) {
|
235 |
try {
|
236 |
$transaction = $observer->getEvent()->getOrderPaymentTransaction();
|
237 |
if ($transaction->getId() && in_array($transaction->getOrderPaymentObject()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
238 |
-
|
239 |
-
|
|
|
|
|
|
|
|
|
240 |
$transaction->setIsClosed(true);
|
241 |
-
} else {
|
242 |
-
$transaction->setIsClosed(false);
|
243 |
}
|
244 |
}
|
245 |
} catch (Exception $e) {
|
@@ -253,7 +250,6 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
253 |
$transaction = $observer->getEvent()->getOrderPaymentTransaction();
|
254 |
if ($transaction->getId() && in_array($transaction->getOrderPaymentObject()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
255 |
$this->_updateParentTransaction($transaction);
|
256 |
-
$this->_updateOrderTransaction($transaction);
|
257 |
}
|
258 |
} catch (Exception $e) {
|
259 |
Creativestyle_AmazonPayments_Model_Logger::logException($e);
|
@@ -262,12 +258,18 @@ class Creativestyle_AmazonPayments_Model_Observer {
|
|
262 |
}
|
263 |
|
264 |
public function setSecureUrls($observer) {
|
265 |
-
|
266 |
-
|
267 |
-
$
|
268 |
-
|
269 |
-
|
270 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
}
|
272 |
return $this;
|
273 |
}
|
37 |
*
|
38 |
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
39 |
*/
|
40 |
+
protected function _fetchTransactionInfo($transaction) {
|
41 |
$transaction->getOrderPaymentObject()
|
42 |
->setOrder($transaction->getOrder())
|
43 |
->importTransactionInfo($transaction);
|
44 |
+
return $transaction->save();
|
|
|
45 |
}
|
46 |
|
47 |
protected function _pollTransactionData() {
|
65 |
foreach ($collection as $transaction) {
|
66 |
try {
|
67 |
$txnType = $transaction->getTxnType();
|
68 |
+
switch (Mage::helper('amazonpayments')->getTransactionStatus($transaction)) {
|
69 |
+
case Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_PENDING:
|
70 |
+
$recentTransactionId = $this->_fetchTransactionInfo($transaction)->getId();
|
71 |
$count++;
|
72 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
73 |
break;
|
74 |
+
case Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_SUSPENDED:
|
75 |
if ($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER) {
|
76 |
+
$recentTransactionId = $this->_fetchTransactionInfo($transaction)->getId();
|
77 |
$count++;
|
78 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
79 |
}
|
80 |
break;
|
81 |
+
case Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_OPEN:
|
82 |
$txnAge = floor(($dateModel->timestamp() - $dateModel->timestamp($transaction->getCreatedAt())) / (60 * 60 * 24));
|
83 |
if (($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER && $txnAge > 180) ||
|
84 |
($txnType == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH && $txnAge > 30)) {
|
85 |
+
$recentTransactionId = $this->_fetchTransactionInfo($transaction)->getId();
|
86 |
$count++;
|
87 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
88 |
}
|
89 |
break;
|
90 |
case null:
|
91 |
+
$recentTransactionId = $this->_fetchTransactionInfo($transaction)->getId();
|
92 |
$count++;
|
93 |
usleep(self::DATA_POLL_SLEEP_BETWEEN_TIME);
|
94 |
break;
|
111 |
}
|
112 |
|
113 |
protected function _shouldUpdateParentTransaction($transaction) {
|
114 |
+
switch ($transaction->getTxnType()) {
|
115 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH:
|
116 |
+
return in_array(Mage::helper('amazonpayments')->getTransactionStatus($transaction), array(
|
117 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_DECLINED,
|
118 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_CLOSED
|
119 |
+
));
|
120 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE:
|
121 |
+
return in_array(Mage::helper('amazonpayments')->getTransactionStatus($transaction), array(
|
122 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_COMPLETED,
|
123 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_DECLINED,
|
124 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_CLOSED
|
125 |
+
));
|
126 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND:
|
127 |
+
return in_array(Mage::helper('amazonpayments')->getTransactionStatus($transaction), array(
|
128 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_COMPLETED,
|
129 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_DECLINED
|
130 |
+
));
|
|
|
|
|
131 |
}
|
132 |
return false;
|
133 |
}
|
134 |
|
135 |
+
protected function _updateParentTransaction($transaction) {
|
136 |
if ($this->_shouldUpdateParentTransaction($transaction)) {
|
137 |
+
if ($parentTransaction = $transaction->getParentTransaction()) {
|
138 |
+
$this->_fetchTransactionInfo($parentTransaction);
|
|
|
139 |
}
|
140 |
}
|
141 |
return $this;
|
226 |
return $this;
|
227 |
}
|
228 |
|
|
|
229 |
public function closeTransaction($observer) {
|
230 |
try {
|
231 |
$transaction = $observer->getEvent()->getOrderPaymentTransaction();
|
232 |
if ($transaction->getId() && in_array($transaction->getOrderPaymentObject()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
233 |
+
if (in_array(Mage::helper('amazonpayments')->getTransactionStatus($transaction), array(
|
234 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_DECLINED,
|
235 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_COMPLETED,
|
236 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_CANCELED,
|
237 |
+
Creativestyle_AmazonPayments_Model_Payment_Abstract::TRANSACTION_STATE_CLOSED
|
238 |
+
))) {
|
239 |
$transaction->setIsClosed(true);
|
|
|
|
|
240 |
}
|
241 |
}
|
242 |
} catch (Exception $e) {
|
250 |
$transaction = $observer->getEvent()->getOrderPaymentTransaction();
|
251 |
if ($transaction->getId() && in_array($transaction->getOrderPaymentObject()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
252 |
$this->_updateParentTransaction($transaction);
|
|
|
253 |
}
|
254 |
} catch (Exception $e) {
|
255 |
Creativestyle_AmazonPayments_Model_Logger::logException($e);
|
258 |
}
|
259 |
|
260 |
public function setSecureUrls($observer) {
|
261 |
+
try {
|
262 |
+
$secureUrlsConfigNode = Mage::getConfig()->getNode('frontend/secure_url');
|
263 |
+
if ($this->_getConfig()->isActive() & Creativestyle_AmazonPayments_Model_Config::LOGIN_WITH_AMAZON_ACTIVE
|
264 |
+
&& $this->_getConfig()->isPopupAuthenticationExperience())
|
265 |
+
{
|
266 |
+
$secureUrlsConfigNode->addChild('amazonpayments_cart', '/checkout/cart');
|
267 |
+
}
|
268 |
+
if ($this->_getConfig()->isSandbox()) {
|
269 |
+
unset($secureUrlsConfigNode->amazonpayments_ipn);
|
270 |
+
}
|
271 |
+
} catch (Exception $e) {
|
272 |
+
Creativestyle_AmazonPayments_Model_Logger::logException($e);
|
273 |
}
|
274 |
return $this;
|
275 |
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Payment/Abstract.php
CHANGED
@@ -10,23 +10,792 @@
|
|
10 |
*
|
11 |
* @category Creativestyle
|
12 |
* @package Creativestyle_AmazonPayments
|
13 |
-
* @copyright Copyright (c) 2014 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
-
class Creativestyle_AmazonPayments_Model_Payment_Abstract extends Mage_Payment_Model_Method_Abstract {
|
17 |
-
|
18 |
-
const ACTION_MANUAL
|
19 |
-
const ACTION_AUTHORIZE
|
20 |
-
const ACTION_AUTHORIZE_CAPTURE
|
21 |
-
const ACTION_ERP
|
22 |
-
|
23 |
-
const
|
24 |
-
const
|
25 |
-
const
|
26 |
-
const
|
27 |
-
const
|
28 |
-
const
|
29 |
-
const
|
30 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
}
|
10 |
*
|
11 |
* @category Creativestyle
|
12 |
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2014 - 2015 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
+
abstract class Creativestyle_AmazonPayments_Model_Payment_Abstract extends Mage_Payment_Model_Method_Abstract {
|
17 |
+
|
18 |
+
const ACTION_MANUAL = 'manual';
|
19 |
+
const ACTION_AUTHORIZE = 'authorize';
|
20 |
+
const ACTION_AUTHORIZE_CAPTURE = 'authorize_capture';
|
21 |
+
const ACTION_ERP = 'erp';
|
22 |
+
|
23 |
+
const TRANSACTION_STATE_DRAFT = 'Draft';
|
24 |
+
const TRANSACTION_STATE_PENDING = 'Pending';
|
25 |
+
const TRANSACTION_STATE_OPEN = 'Open';
|
26 |
+
const TRANSACTION_STATE_SUSPENDED = 'Suspended';
|
27 |
+
const TRANSACTION_STATE_DECLINED = 'Declined';
|
28 |
+
const TRANSACTION_STATE_COMPLETED = 'Completed';
|
29 |
+
const TRANSACTION_STATE_CANCELED = 'Canceled';
|
30 |
+
const TRANSACTION_STATE_CLOSED = 'Closed';
|
31 |
+
|
32 |
+
const TRANSACTION_REASON_INVALID_PAYMENT = 'InvalidPaymentMethod';
|
33 |
+
const TRANSACTION_REASON_TIMEOUT = 'TransactionTimedOut';
|
34 |
+
const TRANSACTION_REASON_AMAZON_REJECTED = 'AmazonRejected';
|
35 |
+
|
36 |
+
const TRANSACTION_STATE_KEY = 'State';
|
37 |
+
const TRANSACTION_REASON_KEY = 'ReasonCode';
|
38 |
+
|
39 |
+
const CHECK_USE_FOR_COUNTRY = 1;
|
40 |
+
const CHECK_USE_FOR_CURRENCY = 2;
|
41 |
+
const CHECK_USE_CHECKOUT = 4;
|
42 |
+
const CHECK_USE_FOR_MULTISHIPPING = 8;
|
43 |
+
const CHECK_USE_INTERNAL = 16;
|
44 |
+
const CHECK_ORDER_TOTAL_MIN_MAX = 32;
|
45 |
+
const CHECK_RECURRING_PROFILES = 64;
|
46 |
+
const CHECK_ZERO_TOTAL = 128;
|
47 |
+
|
48 |
+
protected $_code = 'amazonpayments_abstract';
|
49 |
+
protected $_infoBlockType = 'amazonpayments/payment_info';
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Pay with Amazon method features
|
53 |
+
*
|
54 |
+
* @var bool
|
55 |
+
*/
|
56 |
+
protected $_isGateway = false;
|
57 |
+
protected $_canOrder = true;
|
58 |
+
protected $_canAuthorize = true;
|
59 |
+
protected $_canCapture = true;
|
60 |
+
protected $_canCapturePartial = false;
|
61 |
+
protected $_canCaptureOnce = true;
|
62 |
+
protected $_canRefund = true;
|
63 |
+
protected $_canRefundInvoicePartial = true;
|
64 |
+
protected $_canVoid = true;
|
65 |
+
protected $_canUseInternal = false;
|
66 |
+
protected $_canUseCheckout = false;
|
67 |
+
protected $_canUseForMultishipping = false;
|
68 |
+
protected $_isInitializeNeeded = true;
|
69 |
+
protected $_canFetchTransactionInfo = true;
|
70 |
+
protected $_canReviewPayment = false;
|
71 |
+
protected $_canCreateBillingAgreement = false;
|
72 |
+
protected $_canManageRecurringProfiles = true;
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Return Amazon Payments config model instance
|
76 |
+
*
|
77 |
+
* @return Creativestyle_AmazonPayments_Model_Config
|
78 |
+
*/
|
79 |
+
protected function _getConfig() {
|
80 |
+
return Mage::getSingleton('amazonpayments/config');
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Return Amazon Payments processor instance
|
85 |
+
*
|
86 |
+
* @return Creativestyle_AmazonPayments_Model_Processor
|
87 |
+
*/
|
88 |
+
protected function _getPaymentProcessor() {
|
89 |
+
return Mage::getSingleton('amazonpayments/processor');
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @param Varien_Object $payment
|
94 |
+
*
|
95 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
96 |
+
*/
|
97 |
+
protected function _initInfoInstance($payment) {
|
98 |
+
if (!$this->hasInfoInstance()) {
|
99 |
+
$this->setInfoInstance($payment);
|
100 |
+
}
|
101 |
+
if ($payment->getOrder() && null === $this->getStore()) {
|
102 |
+
$this->setStore($payment->getOrder()->getStoreId());
|
103 |
+
}
|
104 |
+
return $this;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* @param Varien_Object $stateObject
|
109 |
+
* @param Varien_Object $order
|
110 |
+
*
|
111 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
112 |
+
*/
|
113 |
+
protected function _initStateObject(&$stateObject = null, $order = null) {
|
114 |
+
if (null === $stateObject) {
|
115 |
+
$stateObject = new Varien_Object();
|
116 |
+
}
|
117 |
+
$stateObject->setData(array(
|
118 |
+
'state' => $order ? $order->getState() : Mage_Sales_Model_Order::STATE_NEW,
|
119 |
+
'status' => $order ? $order->getStatus() : $this->_getConfig()->getNewOrderStatus($this->getStore()),
|
120 |
+
'is_notified' => Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE
|
121 |
+
));
|
122 |
+
return $this;
|
123 |
+
}
|
124 |
+
|
125 |
+
protected function _getPaymentSequenceId() {
|
126 |
+
$sequenceNumber = $this->getInfoInstance()->getAdditionalInformation('amazon_sequence_number');
|
127 |
+
$sequenceNumber = is_null($sequenceNumber) ? 1 : ++$sequenceNumber;
|
128 |
+
$this->getInfoInstance()->setAdditionalInformation('amazon_sequence_number', $sequenceNumber);
|
129 |
+
return sprintf('%s-%s', $this->getInfoInstance()->getOrder()->getExtOrderId(), $sequenceNumber);
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @param array $transactionStatus
|
134 |
+
* @param array $allowedTransactionStates
|
135 |
+
*
|
136 |
+
* @return bool|array
|
137 |
+
*/
|
138 |
+
protected function _validateTransactionStatus($transactionStatus, $allowedTransactionStates) {
|
139 |
+
if (!is_array($transactionStatus)) return false;
|
140 |
+
if (!array_key_exists(self::TRANSACTION_STATE_KEY, $transactionStatus)) return false;
|
141 |
+
if (!in_array($transactionStatus[self::TRANSACTION_STATE_KEY], $allowedTransactionStates)) {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
return $transactionStatus;
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
149 |
+
* @param array $transactionStatus
|
150 |
+
* @param Varien_Object $stateObject
|
151 |
+
* @param float $amount
|
152 |
+
* @param bool $initialRequest
|
153 |
+
*
|
154 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
155 |
+
*/
|
156 |
+
protected function _mapTransactionStatus($transaction, $transactionStatus, $stateObject, $amount, $initialRequest = false) {
|
157 |
+
switch ($transaction->getTxnType()) {
|
158 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER:
|
159 |
+
switch ($transactionStatus[self::TRANSACTION_STATE_KEY]) {
|
160 |
+
case self::TRANSACTION_STATE_OPEN:
|
161 |
+
$this->_initStateObject($stateObject);
|
162 |
+
break; // self::TRANSACTION_STATE_OPEN
|
163 |
+
|
164 |
+
case self::TRANSACTION_STATE_CANCELED:
|
165 |
+
case self::TRANSACTION_STATE_CLOSED:
|
166 |
+
$this->getInfoInstance()->getOrder()->addRelatedObject($transaction->setIsClosed(true));
|
167 |
+
break; // self::TRANSACTION_STATE_CANCELED / self::TRANSACTION_STATE_CLOSED
|
168 |
+
}
|
169 |
+
$message = $initialRequest ?
|
170 |
+
'An order of %s has been sent to Amazon Payments (%s). The current status is %s.' :
|
171 |
+
'An order of %s has been processed by Amazon Payments (%s). The new status is %s.';
|
172 |
+
break; // Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER
|
173 |
+
|
174 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH:
|
175 |
+
switch ($transactionStatus[self::TRANSACTION_STATE_KEY]) {
|
176 |
+
case self::TRANSACTION_STATE_OPEN:
|
177 |
+
$stateObject->setData(array(
|
178 |
+
'state' => Mage_Sales_Model_Order::STATE_PROCESSING,
|
179 |
+
'status' => $this->_getConfig()->getAuthorizedOrderStatus($this->getStore())
|
180 |
+
));
|
181 |
+
break; // self::TRANSACTION_STATE_OPEN
|
182 |
+
|
183 |
+
case self::TRANSACTION_STATE_DECLINED:
|
184 |
+
$stateObject->setData(array(
|
185 |
+
'hold_before_state' => $stateObject->getState(),
|
186 |
+
'hold_before_status' => $stateObject->getStatus(),
|
187 |
+
'state' => Mage_Sales_Model_Order::STATE_HOLDED,
|
188 |
+
'status' => $this->_getConfig()->getHoldedOrderStatus($this->getStore())
|
189 |
+
));
|
190 |
+
break; // self::TRANSACTION_STATE_DECLINED
|
191 |
+
}
|
192 |
+
$message = $initialRequest ?
|
193 |
+
'An authorize request for %s has been submitted to Amazon Payments (%s). The current status is %s.' :
|
194 |
+
'An authorization of %s has been processed by Amazon Payments (%s). The new status is %s.';
|
195 |
+
break; // Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH
|
196 |
+
|
197 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE:
|
198 |
+
switch ($transactionStatus[self::TRANSACTION_STATE_KEY]) {
|
199 |
+
case self::TRANSACTION_STATE_DECLINED:
|
200 |
+
$stateObject->setData(array(
|
201 |
+
'hold_before_state' => $stateObject->getState(),
|
202 |
+
'hold_before_status' => $stateObject->getStatus(),
|
203 |
+
'state' => Mage_Sales_Model_Order::STATE_HOLDED,
|
204 |
+
'status' => $this->_getConfig()->getHoldedOrderStatus($this->getStore())
|
205 |
+
));
|
206 |
+
break; // self::TRANSACTION_STATE_DECLINED
|
207 |
+
case self::TRANSACTION_STATE_COMPLETED:
|
208 |
+
$this->getInfoInstance()->getOrder()->addRelatedObject($transaction->setIsClosed(true));
|
209 |
+
break; // self::TRANSACTION_STATE_COMPLETED
|
210 |
+
}
|
211 |
+
$message = $initialRequest ?
|
212 |
+
'A capture request for %s has been submitted to Amazon Payments (%s). The current status is %s.' :
|
213 |
+
'A capture of %s has been processed by Amazon Payments (%s). The new status is %s.';
|
214 |
+
break; // Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE
|
215 |
+
|
216 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND:
|
217 |
+
$message = $initialRequest ?
|
218 |
+
'A refund request for %s has been submitted to Amazon Payments (%s). The current status is %s.' :
|
219 |
+
'A refund of %s has been processed by Amazon Payments (%s). The new status is %s.';
|
220 |
+
break; // Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND
|
221 |
+
|
222 |
+
default:
|
223 |
+
return $this;
|
224 |
+
}
|
225 |
+
|
226 |
+
$stateObject->setMessage(Mage::helper('amazonpayments')->__($message,
|
227 |
+
$this->getInfoInstance()->getOrder()->getBaseCurrency()->formatTxt($amount),
|
228 |
+
$transaction->getTxnId(),
|
229 |
+
sprintf('<strong>%s</strong>', strtoupper($transactionStatus[self::TRANSACTION_STATE_KEY]))
|
230 |
+
));
|
231 |
+
|
232 |
+
return $this;
|
233 |
+
}
|
234 |
+
|
235 |
+
/**
|
236 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
237 |
+
* @param array $transactionStatus
|
238 |
+
* @param Varien_Object $stateObject
|
239 |
+
*
|
240 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
241 |
+
*/
|
242 |
+
protected function _sendTransactionEmails($transaction, $transactionStatus, $stateObject) {
|
243 |
+
switch ($transaction->getTxnType()) {
|
244 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH:
|
245 |
+
switch ($transactionStatus[self::TRANSACTION_STATE_KEY]) {
|
246 |
+
case self::TRANSACTION_STATE_OPEN:
|
247 |
+
if ($this->getInfoInstance()->getOrder() && !$this->getInfoInstance()->getOrder()->getEmailSent() && $this->_getConfig()->sendEmailConfirmation($this->getStore())) {
|
248 |
+
$this->getInfoInstance()->getOrder()->sendNewOrderEmail();
|
249 |
+
$stateObject->setIsNotified(true);
|
250 |
+
}
|
251 |
+
break;
|
252 |
+
case self::TRANSACTION_STATE_DECLINED:
|
253 |
+
if ($this->getInfoInstance()->getOrder() && $transactionStatus[self::TRANSACTION_REASON_KEY] == 'InvalidPaymentMethod') {
|
254 |
+
Mage::helper('amazonpayments')->sendAuthorizationDeclinedEmail($this->getInfoInstance());
|
255 |
+
$stateObject->setIsNotified(true);
|
256 |
+
}
|
257 |
+
break;
|
258 |
+
}
|
259 |
+
break; // Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH
|
260 |
+
|
261 |
+
default:
|
262 |
+
return $this;
|
263 |
+
}
|
264 |
+
|
265 |
+
return $this;
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* @param Varien_Object $stateObject
|
270 |
+
*
|
271 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
272 |
+
*/
|
273 |
+
protected function _updateOrderStatus($stateObject) {
|
274 |
+
$this->getInfoInstance()->getOrder()
|
275 |
+
->setHoldBeforeState($stateObject->getHoldBeforeState() ? $stateObject->getHoldBeforeState() : null)
|
276 |
+
->setHoldBeforeStatus($stateObject->getHoldBeforeStatus() ? $stateObject->getHoldBeforeStatus() : null)
|
277 |
+
->setState(
|
278 |
+
$stateObject->getState(),
|
279 |
+
$stateObject->getStatus(),
|
280 |
+
$stateObject->getMessage(),
|
281 |
+
$stateObject->getIsNotified()
|
282 |
+
);
|
283 |
+
return $this;
|
284 |
+
}
|
285 |
+
|
286 |
+
public function saveOrder($order) {
|
287 |
+
if ($order->hasDataChanges()) {
|
288 |
+
$order->save();
|
289 |
+
}
|
290 |
+
return $this;
|
291 |
+
}
|
292 |
+
|
293 |
+
/**
|
294 |
+
* Check authorise availability
|
295 |
+
*
|
296 |
+
* @return bool
|
297 |
+
*/
|
298 |
+
public function canAuthorize() {
|
299 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
300 |
+
return false;
|
301 |
+
}
|
302 |
+
return parent::canAuthorize();
|
303 |
+
}
|
304 |
+
|
305 |
+
/**
|
306 |
+
* Check capture availability
|
307 |
+
*
|
308 |
+
* @return bool
|
309 |
+
*/
|
310 |
+
public function canCapture() {
|
311 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
312 |
+
return false;
|
313 |
+
}
|
314 |
+
return parent::canCapture();
|
315 |
+
}
|
316 |
+
|
317 |
+
/**
|
318 |
+
* Check partial capture availability
|
319 |
+
*
|
320 |
+
* @return bool
|
321 |
+
*/
|
322 |
+
public function canCapturePartial() {
|
323 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
324 |
+
return false;
|
325 |
+
}
|
326 |
+
return parent::canCapturePartial();
|
327 |
+
}
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Check whether capture can be performed once and no further capture possible
|
331 |
+
*
|
332 |
+
* @return bool
|
333 |
+
*/
|
334 |
+
public function canCaptureOnce() {
|
335 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
336 |
+
return false;
|
337 |
+
}
|
338 |
+
return parent::canCaptureOnce();
|
339 |
+
}
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Check refund availability
|
343 |
+
*
|
344 |
+
* @return bool
|
345 |
+
*/
|
346 |
+
public function canRefund() {
|
347 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
348 |
+
return false;
|
349 |
+
}
|
350 |
+
return parent::canRefund();
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Check partial refund availability for invoice
|
355 |
+
*
|
356 |
+
* @return bool
|
357 |
+
*/
|
358 |
+
public function canRefundPartialPerInvoice() {
|
359 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
360 |
+
return false;
|
361 |
+
}
|
362 |
+
return parent::canRefundPartialPerInvoice();
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Check void availability
|
367 |
+
*
|
368 |
+
* @param Varien_Object $payment
|
369 |
+
* @return bool
|
370 |
+
*/
|
371 |
+
public function canVoid(Varien_Object $payment) {
|
372 |
+
$this->_initInfoInstance($payment);
|
373 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
374 |
+
return false;
|
375 |
+
}
|
376 |
+
return parent::canVoid($payment);
|
377 |
+
}
|
378 |
+
|
379 |
+
/**
|
380 |
+
* Can be edit order (renew order)
|
381 |
+
*
|
382 |
+
* @return bool
|
383 |
+
*/
|
384 |
+
public function canEdit() {
|
385 |
+
return false;
|
386 |
+
}
|
387 |
+
|
388 |
+
/**
|
389 |
+
* Check fetch transaction info availability
|
390 |
+
*
|
391 |
+
* @return bool
|
392 |
+
*/
|
393 |
+
public function canFetchTransactionInfo() {
|
394 |
+
if (!$this->_getConfig()->isPaymentProcessingAllowed($this->getStore())) {
|
395 |
+
return false;
|
396 |
+
}
|
397 |
+
return parent::canFetchTransactionInfo();
|
398 |
+
}
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Fetch transaction info
|
402 |
+
*
|
403 |
+
* @param Mage_Payment_Model_Info $payment
|
404 |
+
* @param string $transactionId
|
405 |
+
* @param bool $saveOrder
|
406 |
+
*
|
407 |
+
* @return array
|
408 |
+
*/
|
409 |
+
public function fetchTransactionInfo(Mage_Payment_Model_Info $payment, $transactionId, $shouldSave = true) {
|
410 |
+
$this->_initInfoInstance($payment);
|
411 |
+
if ($transaction = $payment->lookupTransaction($transactionId)) {
|
412 |
+
$transactionInfo = $this->_getPaymentProcessor()->importTransactionDetails($payment, $transaction);
|
413 |
+
if ($transactionInfo) {
|
414 |
+
$this->_initStateObject($stateObject, $payment->getOrder())
|
415 |
+
->_mapTransactionStatus($transaction, $transactionInfo, $stateObject, $payment->getOrder()->getBaseTotalDue())
|
416 |
+
->_sendTransactionEmails($transaction, $transactionInfo, $stateObject)
|
417 |
+
->_updateOrderStatus($stateObject);
|
418 |
+
if ($shouldSave) $this->saveOrder($payment->getOrder());
|
419 |
+
}
|
420 |
+
return $transactionInfo;
|
421 |
+
}
|
422 |
+
throw new Creativestyle_AmazonPayments_Exception('Transaction not found');
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Check method for processing with base currency
|
427 |
+
*
|
428 |
+
* @param string $currencyCode
|
429 |
+
* @return boolean
|
430 |
+
*/
|
431 |
+
public function canUseForCurrency($currencyCode) {
|
432 |
+
return true;
|
433 |
+
}
|
434 |
+
|
435 |
+
/**
|
436 |
+
* Payment order
|
437 |
+
*
|
438 |
+
* @param float $amount
|
439 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
440 |
+
*
|
441 |
+
* @return array|null
|
442 |
+
*/
|
443 |
+
protected function _order($amount, &$transaction = null) {
|
444 |
+
if (!$this->canOrder()) {
|
445 |
+
throw new Creativestyle_AmazonPayments_Exception('Order action is not available');
|
446 |
+
}
|
447 |
+
if ($this->getInfoInstance()->getSkipOrderReferenceProcessing()) {
|
448 |
+
$this->_getPaymentProcessor()->orderConfirm($this->getInfoInstance(), $this->getInfoInstance()->getTransactionId());
|
449 |
+
} else {
|
450 |
+
$this->_getPaymentProcessor()->order($this->getInfoInstance(), $amount, $this->getInfoInstance()->getTransactionId());
|
451 |
+
}
|
452 |
+
$transaction = $this->getInfoInstance()->setIsTransactionClosed(false)
|
453 |
+
->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER);
|
454 |
+
return $this->_getPaymentProcessor()->importTransactionDetails($this->getInfoInstance(), $transaction);
|
455 |
+
}
|
456 |
+
|
457 |
+
/**
|
458 |
+
* Payment authorize
|
459 |
+
*
|
460 |
+
* @param float $amount
|
461 |
+
* @param string $parentTransactionId
|
462 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
463 |
+
* @param bool $captureNow
|
464 |
+
*
|
465 |
+
* @return array|null
|
466 |
+
*/
|
467 |
+
protected function _authorize($amount, $parentTransactionId, &$transaction = null, $captureNow = false) {
|
468 |
+
if (!$this->canAuthorize()) {
|
469 |
+
throw new Creativestyle_AmazonPayments_Exception('Authorize action is not available');
|
470 |
+
}
|
471 |
+
$authorizationDetails = $this->_getPaymentProcessor()->authorize(
|
472 |
+
$this->getInfoInstance(),
|
473 |
+
$amount,
|
474 |
+
$this->_getPaymentSequenceId(),
|
475 |
+
$parentTransactionId,
|
476 |
+
$captureNow
|
477 |
+
);
|
478 |
+
$transaction = $this->getInfoInstance()->setIsTransactionClosed(false)
|
479 |
+
->setTransactionId($authorizationDetails->getAmazonAuthorizationId())
|
480 |
+
->setParentTransactionId($parentTransactionId)
|
481 |
+
->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
482 |
+
return $this->_getPaymentProcessor()->importTransactionDetails($this->getInfoInstance(), $transaction);
|
483 |
+
}
|
484 |
+
|
485 |
+
/**
|
486 |
+
* Payment capture
|
487 |
+
*
|
488 |
+
* @param float $amount
|
489 |
+
* @param string $parentTransactionId
|
490 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
491 |
+
*
|
492 |
+
* @return array|null
|
493 |
+
*/
|
494 |
+
protected function _capture($amount, $parentTransactionId, &$transaction = null) {
|
495 |
+
if (!$this->canCapture()) {
|
496 |
+
throw new Creativestyle_AmazonPayments_Exception('Capture action is not available');
|
497 |
+
}
|
498 |
+
$captureDetails = $this->_getPaymentProcessor()->capture(
|
499 |
+
$this->getInfoInstance(),
|
500 |
+
$amount,
|
501 |
+
$this->_getPaymentSequenceId(),
|
502 |
+
$parentTransactionId
|
503 |
+
);
|
504 |
+
$transaction = $this->getInfoInstance()->setIsTransactionClosed(false)
|
505 |
+
->setTransactionId($captureDetails->getAmazonCaptureId())
|
506 |
+
->setParentTransactionId($parentTransactionId)
|
507 |
+
->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE);
|
508 |
+
return $this->_getPaymentProcessor()->importTransactionDetails($this->getInfoInstance(), $transaction, $captureDetails);
|
509 |
+
}
|
510 |
+
|
511 |
+
/**
|
512 |
+
* Public wrapper for payment order
|
513 |
+
*
|
514 |
+
* @param Varien_Object $payment
|
515 |
+
* @param float $amount
|
516 |
+
*
|
517 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
518 |
+
*/
|
519 |
+
public function order(Varien_Object $payment, $amount) {
|
520 |
+
$this->_initInfoInstance($payment);
|
521 |
+
|
522 |
+
$orderReferenceStatus = $this->_validateTransactionStatus(
|
523 |
+
$this->_order($amount, $orderReferenceTransaction),
|
524 |
+
array(self::TRANSACTION_STATE_OPEN)
|
525 |
+
);
|
526 |
+
if (!$orderReferenceStatus) {
|
527 |
+
throw new Creativestyle_AmazonPayments_Exception('Invalid OrderReference status returned by Amazon Payments API.');
|
528 |
+
}
|
529 |
+
|
530 |
+
$this->_initStateObject($stateObject)
|
531 |
+
->_mapTransactionStatus($orderReferenceTransaction, $orderReferenceStatus, $stateObject, $amount, true)
|
532 |
+
->_sendTransactionEmails($orderReferenceTransaction, $orderReferenceStatus, $stateObject)
|
533 |
+
->_updateOrderStatus($stateObject);
|
534 |
+
|
535 |
+
return $this;
|
536 |
+
}
|
537 |
+
|
538 |
+
/**
|
539 |
+
* Payment authorization public method
|
540 |
+
*
|
541 |
+
* @param Varien_Object $payment
|
542 |
+
* @param float $amount
|
543 |
+
*
|
544 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
545 |
+
*/
|
546 |
+
public function authorize(Varien_Object $payment, $amount) {
|
547 |
+
$this->_initInfoInstance($payment);
|
548 |
+
|
549 |
+
if ($orderReferenceTransaction = $payment->lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER)) {
|
550 |
+
$authorizationStatus = $this->_authorize($amount, $orderReferenceTransaction->getTxnId(), $authorizationTransaction, $this->getConfigData('payment_action') == self::ACTION_AUTHORIZE_CAPTURE);
|
551 |
+
if (!$this->_validateTransactionStatus($authorizationStatus, array(self::TRANSACTION_STATE_PENDING, self::TRANSACTION_STATE_OPEN))) {
|
552 |
+
if (is_array($authorizationStatus) && array_key_exists(self::TRANSACTION_STATE_KEY, $authorizationStatus)
|
553 |
+
&& $authorizationStatus[self::TRANSACTION_STATE_KEY] == self::TRANSACTION_STATE_DECLINED
|
554 |
+
&& array_key_exists(self::TRANSACTION_REASON_KEY, $authorizationStatus))
|
555 |
+
{
|
556 |
+
switch ($authorizationStatus[self::TRANSACTION_REASON_KEY]) {
|
557 |
+
case self::TRANSACTION_REASON_INVALID_PAYMENT:
|
558 |
+
throw new Creativestyle_AmazonPayments_Exception_InvalidStatus_Recoverable('Invalid Authorization status returned by Amazon Payments API.');
|
559 |
+
case self::TRANSACTION_REASON_AMAZON_REJECTED:
|
560 |
+
case self::TRANSACTION_REASON_TIMEOUT:
|
561 |
+
throw new Creativestyle_AmazonPayments_Exception_InvalidStatus('Invalid Authorization status returned by Amazon Payments API.');
|
562 |
+
}
|
563 |
+
|
564 |
+
}
|
565 |
+
throw new Creativestyle_AmazonPayments_Exception('Invalid Authorization status returned by Amazon Payments API.');
|
566 |
+
}
|
567 |
+
|
568 |
+
$this->_initStateObject($stateObject, $payment->getOrder())
|
569 |
+
->_mapTransactionStatus($authorizationTransaction, $authorizationStatus, $stateObject, $amount, true)
|
570 |
+
->_sendTransactionEmails($authorizationTransaction, $authorizationStatus, $stateObject)
|
571 |
+
->_updateOrderStatus($stateObject);
|
572 |
+
}
|
573 |
+
|
574 |
+
return $this;
|
575 |
+
}
|
576 |
+
|
577 |
+
/**
|
578 |
+
* Payment capture public method
|
579 |
+
*
|
580 |
+
* @param Varien_Object $payment
|
581 |
+
* @param float $amount
|
582 |
+
*
|
583 |
+
* @return Mage_Payment_Model_Abstract
|
584 |
+
*/
|
585 |
+
public function capture(Varien_Object $payment, $amount) {
|
586 |
+
$this->_initInfoInstance($payment);
|
587 |
+
|
588 |
+
if ($authorizationTransaction = $payment->lookupTransaction(false, Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH)) {
|
589 |
+
$captureStatus = $this->_validateTransactionStatus(
|
590 |
+
$this->_capture($amount, $authorizationTransaction->getTxnId(), $captureTransaction),
|
591 |
+
array(self::TRANSACTION_STATE_COMPLETED)
|
592 |
+
);
|
593 |
+
if (!$captureStatus) {
|
594 |
+
throw new Creativestyle_AmazonPayments_Exception('Amazon Payments API returned such a Capture status that further payment processing is not allowed.');
|
595 |
+
}
|
596 |
+
$this->_initStateObject($stateObject, $payment->getOrder())
|
597 |
+
->_mapTransactionStatus($captureTransaction, $captureStatus, $stateObject, $amount, true)
|
598 |
+
->_sendTransactionEmails($captureTransaction, $captureStatus, $stateObject)
|
599 |
+
->_updateOrderStatus($stateObject)
|
600 |
+
->saveOrder($payment->getOrder());
|
601 |
+
|
602 |
+
// avoid transaction duplicates
|
603 |
+
$payment->setSkipTransactionCreation(true);
|
604 |
+
}
|
605 |
+
|
606 |
+
return $this;
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
* @todo
|
611 |
+
* Set capture transaction ID to invoice for informational purposes
|
612 |
+
* @param Mage_Sales_Model_Order_Invoice $invoice
|
613 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
614 |
+
* @return Mage_Payment_Model_Method_Abstract
|
615 |
+
*/
|
616 |
+
public function processInvoice($invoice, $payment) {
|
617 |
+
$invoice->setTransactionId($payment->getLastTransId());
|
618 |
+
return $this;
|
619 |
+
}
|
620 |
+
|
621 |
+
/**
|
622 |
+
* @todo
|
623 |
+
* Refund specified amount for payment
|
624 |
+
*
|
625 |
+
* @param Varien_Object $payment
|
626 |
+
* @param float $amount
|
627 |
+
*
|
628 |
+
* @return Mage_Payment_Model_Abstract
|
629 |
+
*/
|
630 |
+
public function refund(Varien_Object $payment, $amount) {
|
631 |
+
$this->_initInfoInstance($payment);
|
632 |
+
if (!$this->canRefund()) {
|
633 |
+
throw new Creativestyle_AmazonPayments_Exception('Refund action is not available');
|
634 |
+
}
|
635 |
+
return $this;
|
636 |
+
}
|
637 |
+
|
638 |
+
/**
|
639 |
+
* @todo
|
640 |
+
* Set transaction ID into creditmemo for informational purposes
|
641 |
+
* @param Mage_Sales_Model_Order_Creditmemo $creditmemo
|
642 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
643 |
+
* @return Mage_Payment_Model_Method_Abstract
|
644 |
+
*/
|
645 |
+
public function processCreditmemo($creditmemo, $payment) {
|
646 |
+
$creditmemo->setTransactionId($payment->getLastTransId());
|
647 |
+
return $this;
|
648 |
+
}
|
649 |
+
|
650 |
+
/**
|
651 |
+
* @todo
|
652 |
+
* Cancel payment abstract method
|
653 |
+
*
|
654 |
+
* @param Varien_Object $payment
|
655 |
+
*
|
656 |
+
* @return Mage_Payment_Model_Abstract
|
657 |
+
*/
|
658 |
+
public function cancel(Varien_Object $payment) {
|
659 |
+
$this->_initInfoInstance($payment);
|
660 |
+
return $this;
|
661 |
+
}
|
662 |
+
|
663 |
+
/**
|
664 |
+
* @todo
|
665 |
+
* Void payment abstract method
|
666 |
+
*
|
667 |
+
* @param Varien_Object $payment
|
668 |
+
*
|
669 |
+
* @return Mage_Payment_Model_Abstract
|
670 |
+
*/
|
671 |
+
public function void(Varien_Object $payment) {
|
672 |
+
$this->_initInfoInstance($payment);
|
673 |
+
if (!$this->canVoid($payment)) {
|
674 |
+
throw new Creativestyle_AmazonPayments_Exception('Void action is not available');
|
675 |
+
}
|
676 |
+
return $this;
|
677 |
+
}
|
678 |
+
|
679 |
+
/**
|
680 |
+
* Modified payment configuration retriever
|
681 |
+
*
|
682 |
+
* @param string $field
|
683 |
+
* @param int|string|null|Mage_Core_Model_Store $storeId
|
684 |
+
*
|
685 |
+
* @return mixed
|
686 |
+
*/
|
687 |
+
public function getConfigData($field, $storeId = null) {
|
688 |
+
if (null === $storeId) {
|
689 |
+
$storeId = $this->getStore();
|
690 |
+
}
|
691 |
+
switch ($field) {
|
692 |
+
case 'payment_action':
|
693 |
+
return $this->_getConfig()->getPaymentAction($storeId);
|
694 |
+
default:
|
695 |
+
return parent::getConfigData($field, $storeId);
|
696 |
+
}
|
697 |
+
}
|
698 |
+
|
699 |
+
/**
|
700 |
+
* Method that will be executed instead of authorize or capture
|
701 |
+
* if flag isInitializeNeeded set to true
|
702 |
+
*
|
703 |
+
* @param string $paymentAction
|
704 |
+
* @param object $stateObject
|
705 |
+
*
|
706 |
+
* @return Creativestyle_AmazonPayments_Model_Payment_Abstract
|
707 |
+
*/
|
708 |
+
public function initialize($paymentAction, $stateObject) {
|
709 |
+
$payment = $this->getInfoInstance();
|
710 |
+
$this->setStore($payment->getOrder()->getStoreId());
|
711 |
+
$this->_initStateObject($stateObject);
|
712 |
+
switch ($paymentAction) {
|
713 |
+
case self::ACTION_MANUAL:
|
714 |
+
|
715 |
+
// OrderReference confirm, throw an exception for invalid statuses
|
716 |
+
$orderReferenceStatus = $this->_validateTransactionStatus(
|
717 |
+
$this->_order($this->getInfoInstance()->getOrder()->getBaseTotalDue(), $orderReferenceTransaction),
|
718 |
+
array(self::TRANSACTION_STATE_OPEN)
|
719 |
+
);
|
720 |
+
if (!$orderReferenceStatus) {
|
721 |
+
throw new Creativestyle_AmazonPayments_Exception('Invalid Order Reference status returned by Amazon Payments API.');
|
722 |
+
}
|
723 |
+
|
724 |
+
$this->_mapTransactionStatus($orderReferenceTransaction, $orderReferenceStatus, $stateObject, $this->getInfoInstance()->getOrder()->getBaseTotalDue(), true)
|
725 |
+
->_sendTransactionEmails($orderReferenceTransaction, $orderReferenceStatus, $stateObject)
|
726 |
+
->_updateOrderStatus($stateObject);
|
727 |
+
|
728 |
+
break;
|
729 |
+
|
730 |
+
case self::ACTION_AUTHORIZE:
|
731 |
+
case self::ACTION_AUTHORIZE_CAPTURE:
|
732 |
+
|
733 |
+
// OrderReference confirm, throw an exception if invalid status is returned
|
734 |
+
$orderReferenceStatus = $this->_validateTransactionStatus(
|
735 |
+
$this->_order($this->getInfoInstance()->getOrder()->getBaseTotalDue(), $orderReferenceTransaction),
|
736 |
+
array(self::TRANSACTION_STATE_OPEN)
|
737 |
+
);
|
738 |
+
if (!$orderReferenceStatus) {
|
739 |
+
throw new Creativestyle_AmazonPayments_Exception('Invalid Order Reference status returned by Amazon Payments API.');
|
740 |
+
}
|
741 |
+
|
742 |
+
$this->_mapTransactionStatus($orderReferenceTransaction, $orderReferenceStatus, $stateObject, $this->getInfoInstance()->getOrder()->getBaseTotalDue(), true)
|
743 |
+
->_sendTransactionEmails($orderReferenceTransaction, $orderReferenceStatus, $stateObject)
|
744 |
+
->_updateOrderStatus($stateObject);
|
745 |
+
|
746 |
+
// Authorization request, throw an exception if invalid status is returned
|
747 |
+
$authorizationStatus = $this->_authorize($this->getInfoInstance()->getOrder()->getBaseTotalDue(), $orderReferenceTransaction->getTxnId(), $authorizationTransaction, $paymentAction == self::ACTION_AUTHORIZE_CAPTURE);
|
748 |
+
if (!$this->_validateTransactionStatus($authorizationStatus, array(self::TRANSACTION_STATE_PENDING, self::TRANSACTION_STATE_OPEN))) {
|
749 |
+
if (is_array($authorizationStatus) && array_key_exists(self::TRANSACTION_STATE_KEY, $authorizationStatus)
|
750 |
+
&& $authorizationStatus[self::TRANSACTION_STATE_KEY] == self::TRANSACTION_STATE_DECLINED
|
751 |
+
&& array_key_exists(self::TRANSACTION_REASON_KEY, $authorizationStatus))
|
752 |
+
{
|
753 |
+
switch ($authorizationStatus[self::TRANSACTION_REASON_KEY]) {
|
754 |
+
case self::TRANSACTION_REASON_INVALID_PAYMENT:
|
755 |
+
throw new Creativestyle_AmazonPayments_Exception_InvalidStatus_Recoverable('1. Invalid Authorization status returned by Amazon Payments API.');
|
756 |
+
case self::TRANSACTION_REASON_AMAZON_REJECTED:
|
757 |
+
case self::TRANSACTION_REASON_TIMEOUT:
|
758 |
+
throw new Creativestyle_AmazonPayments_Exception_InvalidStatus('2. Invalid Authorization status returned by Amazon Payments API.');
|
759 |
+
}
|
760 |
+
}
|
761 |
+
throw new Creativestyle_AmazonPayments_Exception('3. Invalid Authorization status returned by Amazon Payments API.');
|
762 |
+
}
|
763 |
+
|
764 |
+
$this->getInfoInstance()->setAmountAuthorized($this->getInfoInstance()->getOrder()->getTotalDue())
|
765 |
+
->setBaseAmountAuthorized($this->getInfoInstance()->getOrder()->getBaseTotalDue());
|
766 |
+
|
767 |
+
$this->_mapTransactionStatus($authorizationTransaction, $authorizationStatus, $stateObject, $this->getInfoInstance()->getOrder()->getBaseTotalDue(), true)
|
768 |
+
->_sendTransactionEmails($authorizationTransaction, $authorizationStatus, $stateObject)
|
769 |
+
->_updateOrderStatus($stateObject);
|
770 |
+
|
771 |
+
// TODO: next steps depending on the transaction status
|
772 |
+
|
773 |
+
break;
|
774 |
+
|
775 |
+
}
|
776 |
+
return $this;
|
777 |
+
}
|
778 |
+
|
779 |
+
/**
|
780 |
+
* Check whether Pay with Amazon is available
|
781 |
+
*
|
782 |
+
* @param Mage_Sales_Model_Quote
|
783 |
+
* @return bool
|
784 |
+
*/
|
785 |
+
public function isAvailable($quote = null) {
|
786 |
+
$checkResult = new StdClass;
|
787 |
+
$isActive = $this->_getConfig()->isActive($quote ? $quote->getStoreId() : null) & Creativestyle_AmazonPayments_Model_Config::PAY_WITH_AMAZON_ACTIVE;
|
788 |
+
if ($quote && !$quote->validateMinimumAmount()) {
|
789 |
+
$isActive = false;
|
790 |
+
}
|
791 |
+
$checkResult->isAvailable = $isActive;
|
792 |
+
$checkResult->isDeniedInConfig = !$isActive;
|
793 |
+
Mage::dispatchEvent('payment_method_is_active', array(
|
794 |
+
'result' => $checkResult,
|
795 |
+
'method_instance' => $this,
|
796 |
+
'quote' => $quote,
|
797 |
+
));
|
798 |
+
return $checkResult->isAvailable;
|
799 |
+
}
|
800 |
|
801 |
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Payment/Advanced.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
* @copyright Copyright (c) 2014 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
-
class Creativestyle_AmazonPayments_Model_Payment_Advanced extends
|
17 |
|
18 |
protected $_code = 'amazonpayments_advanced';
|
19 |
|
13 |
* @copyright Copyright (c) 2014 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
+
class Creativestyle_AmazonPayments_Model_Payment_Advanced extends Creativestyle_AmazonPayments_Model_Payment_Abstract {
|
17 |
|
18 |
protected $_code = 'amazonpayments_advanced';
|
19 |
|
app/code/community/Creativestyle/AmazonPayments/Model/Payment/Advanced/Sandbox.php
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
* @copyright Copyright (c) 2014 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
-
class Creativestyle_AmazonPayments_Model_Payment_Advanced_Sandbox extends
|
17 |
|
18 |
protected $_code = 'amazonpayments_advanced_sandbox';
|
19 |
|
13 |
* @copyright Copyright (c) 2014 creativestyle GmbH
|
14 |
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
*/
|
16 |
+
class Creativestyle_AmazonPayments_Model_Payment_Advanced_Sandbox extends Creativestyle_AmazonPayments_Model_Payment_Abstract {
|
17 |
|
18 |
protected $_code = 'amazonpayments_advanced_sandbox';
|
19 |
|
app/code/community/Creativestyle/AmazonPayments/Model/Processor.php
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file is part of the official Amazon Payments Advanced extension
|
5 |
+
* for Magento (c) creativestyle GmbH <amazon@creativestyle.de>
|
6 |
+
* All rights reserved
|
7 |
+
*
|
8 |
+
* Reuse or modification of this source code is not allowed
|
9 |
+
* without written permission from creativestyle GmbH
|
10 |
+
*
|
11 |
+
* @category Creativestyle
|
12 |
+
* @package Creativestyle_AmazonPayments
|
13 |
+
* @copyright Copyright (c) 2015 creativestyle GmbH
|
14 |
+
* @author Marek Zabrowarny / creativestyle GmbH <amazon@creativestyle.de>
|
15 |
+
*/
|
16 |
+
class Creativestyle_AmazonPayments_Model_Processor {
|
17 |
+
|
18 |
+
protected function _getApi($store = null) {
|
19 |
+
return Mage::getSingleton('amazonpayments/api_advanced')->setStore($store);
|
20 |
+
}
|
21 |
+
|
22 |
+
protected function _getConfig() {
|
23 |
+
return Mage::getSingleton('amazonpayments/config');
|
24 |
+
}
|
25 |
+
|
26 |
+
protected function _getDataMapper() {
|
27 |
+
return Mage::getSingleton('amazonpayments/mapper');
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Return Amazon transaction name for provided Magento transaction object
|
32 |
+
*
|
33 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
34 |
+
*
|
35 |
+
* @return string|null
|
36 |
+
*/
|
37 |
+
protected function _getAmazonTransactionType($transaction) {
|
38 |
+
switch ($transaction->getTxnType()) {
|
39 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_ORDER:
|
40 |
+
return 'OrderReference';
|
41 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH:
|
42 |
+
return 'Authorization';
|
43 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_CAPTURE:
|
44 |
+
return 'Capture';
|
45 |
+
case Mage_Sales_Model_Order_Payment_Transaction::TYPE_REFUND:
|
46 |
+
return 'Refund';
|
47 |
+
}
|
48 |
+
return null;
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Get transaction details from Amazon Payments API
|
53 |
+
*
|
54 |
+
* @param string $transactionId
|
55 |
+
* @param string $transactionType
|
56 |
+
* @param int $store
|
57 |
+
*
|
58 |
+
* @return OffAmazonPaymentsService_Model
|
59 |
+
*/
|
60 |
+
protected function _getTransactionDetails($transactionId, $transactionType, $store = null) {
|
61 |
+
return call_user_func(array($this->_getApi($store), 'get' . $transactionType . 'Details'), $transactionId);
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Extract transaction status from the transaction details,
|
66 |
+
* fetch transaction details if not provided in the arguments
|
67 |
+
*
|
68 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
69 |
+
* @param int $store
|
70 |
+
* @param OffAmazonPaymentsService_Model|OffAmazonPayments_Model $transactionDetails
|
71 |
+
*
|
72 |
+
* @return array|null
|
73 |
+
*/
|
74 |
+
protected function _fetchTransactionStatus($transaction, $store = null, $transactionDetails = null) {
|
75 |
+
$transactionType = $this->_getAmazonTransactionType($transaction);
|
76 |
+
if (null === $transactionDetails) {
|
77 |
+
$transactionDetails = $this->_getTransactionDetails($transaction->getTxnId(), $transactionType, $store);
|
78 |
+
}
|
79 |
+
if (call_user_func(array($transactionDetails, 'isSet' . $transactionType . 'Status'))) {
|
80 |
+
return $this->_getTransactionNewStatus(
|
81 |
+
$transaction,
|
82 |
+
call_user_func(array($transactionDetails, 'get' . $transactionType . 'Status'))
|
83 |
+
);
|
84 |
+
}
|
85 |
+
return null;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Import transaction details to the Magento order and its related objects
|
90 |
+
*
|
91 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
92 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
93 |
+
* @param OffAmazonPaymentsService_Model|OffAmazonPayments_Model $transactionDetails
|
94 |
+
*
|
95 |
+
* @return array|null
|
96 |
+
*/
|
97 |
+
protected function _importTransactionDetails($payment, $transaction, $transactionDetails = null) {
|
98 |
+
$transactionType = $this->_getAmazonTransactionType($transaction);
|
99 |
+
if (null === $transactionDetails) {
|
100 |
+
$transactionDetails = $this->_getTransactionDetails($transaction->getTxnId(), $transactionType, $payment->getOrder()->getStoreId());
|
101 |
+
}
|
102 |
+
$newStatus = $this->_fetchTransactionStatus($transaction, $payment->getOrder()->getStoreId(), $transactionDetails);
|
103 |
+
if ($newStatus) {
|
104 |
+
// $transactionAmountObject = call_user_func(array($transactionDetails, $transactionType == 'OrderReference' ? 'getOrderTotal' : 'get' . $transactionType . 'Amount'));
|
105 |
+
// $transactionAmountObject->getAmount()
|
106 |
+
$this->updateTransactionStatus($transaction, $newStatus);
|
107 |
+
$this->updateOrderData($payment->getOrder(), $transactionDetails);
|
108 |
+
}
|
109 |
+
return $newStatus;
|
110 |
+
}
|
111 |
+
|
112 |
+
/**
|
113 |
+
* Check if the transaction status changed, if so return new status array,
|
114 |
+
* null otherwise
|
115 |
+
*
|
116 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
117 |
+
* @param OffAmazonPaymentsService_Model_Status|OffAmazonPaymentsNotifications_Model_Status $recentTransactionStatus
|
118 |
+
*
|
119 |
+
* @return array|null
|
120 |
+
*/
|
121 |
+
protected function _getTransactionNewStatus($transaction, $recentTransactionStatus) {
|
122 |
+
if ($recentTransactionStatus->isSetState()) {
|
123 |
+
if (Mage::helper('amazonpayments')->getTransactionStatus($transaction) != $recentTransactionStatus->getState()) {
|
124 |
+
$status = array('State' => $recentTransactionStatus->getState());
|
125 |
+
if ($recentTransactionStatus->isSetReasonCode()) {
|
126 |
+
$status['ReasonCode'] = $recentTransactionStatus->getReasonCode();
|
127 |
+
}
|
128 |
+
if ($recentTransactionStatus->isSetReasonDescription()) {
|
129 |
+
$status['ReasonDescription'] = $recentTransactionStatus->getReasonDescription();
|
130 |
+
}
|
131 |
+
return $status;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
return null;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* @param Mage_Customer_Model_Address_Abstract $addressObject
|
139 |
+
* @param Varien_Object $addressData
|
140 |
+
*/
|
141 |
+
protected function _updateAddress($addressObject, $addressData) {
|
142 |
+
if ($addressObject->getFirstname() != $addressData->getFirstname()) {
|
143 |
+
$addressObject->setFirstname($addressData->getFirstname());
|
144 |
+
}
|
145 |
+
if ($addressObject->getLastname() != $addressData->getLastname()) {
|
146 |
+
$addressObject->setLastname($addressData->getLastname());
|
147 |
+
}
|
148 |
+
if ($addressObject->getCompany() != $addressData->getCompany()) {
|
149 |
+
$addressObject->setCompany($addressData->getCompany());
|
150 |
+
}
|
151 |
+
if ($addressObject->getCity() != $addressData->getCity()) {
|
152 |
+
$addressObject->setCity($addressData->getCity());
|
153 |
+
}
|
154 |
+
if ($addressObject->getPostcode() != $addressData->getPostcode()) {
|
155 |
+
$addressObject->setPostcode($addressData->getPostcode());
|
156 |
+
}
|
157 |
+
if ($addressObject->getCountryId() != $addressData->getCountryId()) {
|
158 |
+
$addressObject->setCountryId($addressData->getCountryId());
|
159 |
+
}
|
160 |
+
if ($addressObject->getTelephone() != $addressData->getTelephone()) {
|
161 |
+
$addressObject->setTelephone($addressData->getTelephone());
|
162 |
+
}
|
163 |
+
$streetDiff = array_diff($addressObject->getStreet(), $addressData->getStreet());
|
164 |
+
if (!empty($streetDiff)) {
|
165 |
+
$addressObject->setStreet($addressData->getStreet());
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Transfer order to Amazon Payments gateway
|
171 |
+
*
|
172 |
+
* @param Varien_Object $payment
|
173 |
+
* @param float $amount
|
174 |
+
* @param string $transactionSequenceId
|
175 |
+
*/
|
176 |
+
public function order(Varien_Object $payment, $amount, $transactionSequenceId) {
|
177 |
+
$this->_getApi($payment->getOrder()->getStoreId())->setOrderReferenceDetails(
|
178 |
+
$transactionSequenceId,
|
179 |
+
$amount,
|
180 |
+
$payment->getOrder()->getBaseCurrencyCode(),
|
181 |
+
$payment->getOrder()->getIncrementId()
|
182 |
+
);
|
183 |
+
$this->orderConfirm($payment, $transactionSequenceId);
|
184 |
+
}
|
185 |
+
|
186 |
+
public function orderConfirm(Varien_Object $payment, $transactionSequenceId) {
|
187 |
+
$this->_getApi($payment->getOrder()->getStoreId())->confirmOrderReference($transactionSequenceId);
|
188 |
+
Creativestyle_AmazonPayments_Model_Simulator::simulate($payment, 'OrderReference');
|
189 |
+
}
|
190 |
+
|
191 |
+
/**
|
192 |
+
* Authorize order amount on Amazon Payments gateway
|
193 |
+
*
|
194 |
+
* @param Varien_Object $payment
|
195 |
+
* @param float $amount
|
196 |
+
* @param string $transactionSequenceId
|
197 |
+
* @param string $parentTransactionId
|
198 |
+
* @param bool $captureNow
|
199 |
+
*
|
200 |
+
* @return OffAmazonPaymentsService_Model_AuthorizationDetails
|
201 |
+
*/
|
202 |
+
public function authorize(Varien_Object $payment, $amount, $transactionSequenceId, $parentTransactionId, $captureNow = false) {
|
203 |
+
return $this->_getApi($payment->getOrder()->getStoreId())->authorize(
|
204 |
+
$parentTransactionId,
|
205 |
+
$transactionSequenceId,
|
206 |
+
$amount,
|
207 |
+
$payment->getOrder()->getBaseCurrencyCode(),
|
208 |
+
Creativestyle_AmazonPayments_Model_Simulator::simulate($payment, 'Authorization'),
|
209 |
+
$captureNow,
|
210 |
+
$this->_getConfig()->isAuthorizationSynchronous($payment->getOrder()->getStoreId()) ? 0 : null
|
211 |
+
);
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Capture order amount on Amazon Payments gateway
|
216 |
+
*
|
217 |
+
* @param Varien_Object $payment
|
218 |
+
* @param float $amount
|
219 |
+
* @param string $transactionSequenceId
|
220 |
+
* @param string $parentTransactionId
|
221 |
+
*
|
222 |
+
* @return OffAmazonPaymentsService_Model_AuthorizationDetails
|
223 |
+
*/
|
224 |
+
public function capture(Varien_Object $payment, $amount, $transactionSequenceId, $parentTransactionId) {
|
225 |
+
return $this->_getApi($payment->getOrder()->getStoreId())->capture(
|
226 |
+
$parentTransactionId,
|
227 |
+
$transactionSequenceId,
|
228 |
+
$amount,
|
229 |
+
$payment->getOrder()->getBaseCurrencyCode(),
|
230 |
+
Creativestyle_AmazonPayments_Model_Simulator::simulate($payment, 'Capture')
|
231 |
+
);
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* Return payment transaction status info array
|
236 |
+
*
|
237 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
238 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
239 |
+
*
|
240 |
+
* @return array|null
|
241 |
+
*/
|
242 |
+
public function fetchTransactionDetails($payment, $transaction) {
|
243 |
+
return $this->_fetchTransactionStatus($transaction, $payment->getOrder()->getStoreId());
|
244 |
+
}
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Import payment transaction info and return transaction status info array
|
248 |
+
*
|
249 |
+
* @param Mage_Sales_Model_Order_Payment $payment
|
250 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
251 |
+
* @param OffAmazonPaymentsService_Model|OffAmazonPayments_Model $transactionDetails
|
252 |
+
*
|
253 |
+
* @return array|null
|
254 |
+
*/
|
255 |
+
public function importTransactionDetails($payment, $transaction, $transactionDetails = null) {
|
256 |
+
return $this->_importTransactionDetails($payment, $transaction, $transactionDetails);
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Update order data based using payment transaction details
|
261 |
+
*
|
262 |
+
* @param Mage_Sales_Model_Order $order
|
263 |
+
* @param OffAmazonPaymentsService_Model|OffAmazonPayments_Model $transactionDetails
|
264 |
+
*/
|
265 |
+
public function updateOrderData($order, $transactionDetails) {
|
266 |
+
$orderData = $this->_getDataMapper()->mapTransactionInfo($transactionDetails);
|
267 |
+
// check which order data should be updated
|
268 |
+
if ($orderData->hasCustomerEmail() && $order->getCustomerEmail() != $orderData->getCustomerEmail()) {
|
269 |
+
$order->setCustomerEmail($orderData->getCustomerEmail());
|
270 |
+
}
|
271 |
+
if ($orderData->hasCustomerFirstname() && $order->getCustomerFirstname() != $orderData->getCustomerFirstname()) {
|
272 |
+
$order->setCustomerFirstname($orderData->getCustomerFirstname());
|
273 |
+
}
|
274 |
+
if ($orderData->hasCustomerLastname() && $order->getCustomerLastname() != $orderData->getCustomerLastname()) {
|
275 |
+
$order->setCustomerLastname($orderData->getCustomerLastname());
|
276 |
+
}
|
277 |
+
if ($orderData->hasBillingAddress()) {
|
278 |
+
$this->_updateAddress($order->getBillingAddress(), $orderData->getBillingAddress());
|
279 |
+
}
|
280 |
+
if ($orderData->hasShippingAddress()) {
|
281 |
+
$this->_updateAddress($order->getShippingAddress(), $orderData->getShippingAddress());
|
282 |
+
}
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Update payment transaction status stored in additional_information field
|
287 |
+
*
|
288 |
+
* @param Mage_Sales_Model_Order_Payment_Transaction $transaction
|
289 |
+
* @param array $transactionStatus
|
290 |
+
*
|
291 |
+
* @return Mage_Sales_Model_Order_Payment_Transaction
|
292 |
+
*/
|
293 |
+
public function updateTransactionStatus($transaction, $transactionStatus) {
|
294 |
+
return $transaction->setAdditionalInformation(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $transactionStatus);
|
295 |
+
}
|
296 |
+
|
297 |
+
}
|
app/code/community/Creativestyle/AmazonPayments/Model/Service/Quote.php
CHANGED
@@ -76,6 +76,12 @@ class Creativestyle_AmazonPayments_Model_Service_Quote extends Mage_Sales_Model_
|
|
76 |
if ($quote->getPayment()->getSimulationData()) {
|
77 |
$order->getPayment()->setAdditionalInformation('_simulation_data', $quote->getPayment()->getSimulationData());
|
78 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
foreach ($this->_orderData as $key => $value) {
|
81 |
$order->setData($key, $value);
|
76 |
if ($quote->getPayment()->getSimulationData()) {
|
77 |
$order->getPayment()->setAdditionalInformation('_simulation_data', $quote->getPayment()->getSimulationData());
|
78 |
}
|
79 |
+
if ($quote->getPayment()->getAmazonSequenceNumber()) {
|
80 |
+
$order->getPayment()->setAdditionalInformation('amazon_sequence_number', $quote->getPayment()->getAmazonSequenceNumber());
|
81 |
+
}
|
82 |
+
if ($quote->getPayment()->getSkipOrderReferenceProcessing()) {
|
83 |
+
$order->getPayment()->setSkipOrderReferenceProcessing(true);
|
84 |
+
}
|
85 |
|
86 |
foreach ($this->_orderData as $key => $value) {
|
87 |
$order->setData($key, $value);
|
app/code/community/Creativestyle/AmazonPayments/controllers/Adminhtml/OrderController.php
CHANGED
@@ -36,7 +36,10 @@ class Creativestyle_AmazonPayments_Adminhtml_OrderController extends Mage_Adminh
|
|
36 |
$order = Mage::getModel('sales/order')->load($orderId);
|
37 |
if ($order->getId()) {
|
38 |
if (in_array($order->getPayment()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
39 |
-
$order->getPayment()
|
|
|
|
|
|
|
40 |
}
|
41 |
}
|
42 |
} catch (OffAmazonPaymentsService_Exception $e) {
|
36 |
$order = Mage::getModel('sales/order')->load($orderId);
|
37 |
if ($order->getId()) {
|
38 |
if (in_array($order->getPayment()->getMethod(), Mage::helper('amazonpayments')->getAvailablePaymentMethods())) {
|
39 |
+
$order->getPayment()
|
40 |
+
->setAmountAuthorized($order->getTotalDue())
|
41 |
+
->setBaseAmountAuthorized($order->getBaseTotalDue())
|
42 |
+
->getMethodInstance()->authorize($order->getPayment(), $order->getBaseTotalDue())->saveOrder($order);
|
43 |
}
|
44 |
}
|
45 |
} catch (OffAmazonPaymentsService_Exception $e) {
|
app/code/community/Creativestyle/AmazonPayments/controllers/Advanced/CheckoutController.php
CHANGED
@@ -78,12 +78,11 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
78 |
return true;
|
79 |
}
|
80 |
|
81 |
-
protected function
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
}
|
87 |
}
|
88 |
|
89 |
/**
|
@@ -122,16 +121,9 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
122 |
|
123 |
public function preDispatch() {
|
124 |
parent::preDispatch();
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
// check session data for OrderReference's ID if not provided as parameter
|
129 |
-
if (null === $this->_orderReferenceId) {
|
130 |
-
$this->_orderReferenceId = $this->_getCheckoutSession()->getOrderReferenceId();
|
131 |
-
}
|
132 |
-
if (null === $this->_accessToken) {
|
133 |
-
$this->_accessToken = $this->getRequest()->getParam('accessToken', null);
|
134 |
-
}
|
135 |
}
|
136 |
|
137 |
public function indexAction() {
|
@@ -157,8 +149,6 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
157 |
|
158 |
$this->_getCheckoutSession()->setCartWasUpdated(false);
|
159 |
|
160 |
-
$this->_saveOrderReferenceInSessionData();
|
161 |
-
|
162 |
$this->loadLayout();
|
163 |
$this->getLayout()->getBlock('head')->setTitle($this->__('Pay with Amazon'));
|
164 |
$this->renderLayout();
|
@@ -177,10 +167,11 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
177 |
return;
|
178 |
}
|
179 |
|
180 |
-
|
|
|
181 |
|
|
|
182 |
$orderReference = $this->_getApi()->getOrderReferenceDetails($this->_getOrderReferenceId());
|
183 |
-
// save billing data in the checkout model
|
184 |
$result = $this->_getCheckout()->saveShipping(array(
|
185 |
'city' => $orderReference->getDestination()->getPhysicalDestination()->getCity(),
|
186 |
'postcode' => $orderReference->getDestination()->getPhysicalDestination()->getPostalCode(),
|
@@ -217,8 +208,6 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
217 |
return;
|
218 |
}
|
219 |
|
220 |
-
$this->_saveOrderReferenceInSessionData();
|
221 |
-
|
222 |
$data = $this->getRequest()->getPost('shipping_method', '');
|
223 |
$result = $this->_getCheckout()->saveShippingMethod($data);
|
224 |
|
@@ -283,6 +272,20 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
283 |
$this->_getCheckout()->savePayment(null);
|
284 |
|
285 |
$this->_getQuote()->getPayment()->setTransactionId($this->_getOrderReferenceId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
$simulation = $this->getRequest()->getPost('simulation', array());
|
287 |
if (!empty($simulation)) {
|
288 |
$simulationData = array(
|
@@ -293,19 +296,36 @@ class Creativestyle_AmazonPayments_Advanced_CheckoutController extends Mage_Core
|
|
293 |
$simulationData['options'] = Creativestyle_AmazonPayments_Model_Simulator::getSimulationOptions($simulationData['object'], $simulationData['state'], $simulationData['reason_code']);
|
294 |
$this->_getQuote()->getPayment()->setSimulationData($simulationData);
|
295 |
}
|
|
|
296 |
$this->_getCheckout()->saveOrder();
|
297 |
$this->_getQuote()->save();
|
298 |
$result['success'] = true;
|
299 |
$result['error'] = false;
|
300 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
} catch (Exception $e) {
|
302 |
Creativestyle_AmazonPayments_Model_Logger::logException($e);
|
303 |
Mage::helper('checkout')->sendPaymentFailedEmail($this->_getQuote(), $e->getMessage());
|
|
|
304 |
$this->_getCheckoutSession()->addError($this->__('There was an error processing your order. Please contact us or try again later.'));
|
305 |
-
$
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
}
|
310 |
}
|
311 |
|
78 |
return true;
|
79 |
}
|
80 |
|
81 |
+
protected function _shiftOrderReferenceId() {
|
82 |
+
$orderReferenceId = $this->_orderReferenceId;
|
83 |
+
$this->_orderReferenceId = null;
|
84 |
+
$this->_getCheckoutSession()->setOrderReferenceId($this->_orderReferenceId);
|
85 |
+
return $orderReferenceId;
|
|
|
86 |
}
|
87 |
|
88 |
/**
|
121 |
|
122 |
public function preDispatch() {
|
123 |
parent::preDispatch();
|
124 |
+
$this->_orderReferenceId = $this->getRequest()->getParam('orderReferenceId', $this->_getCheckoutSession()->getOrderReferenceId());
|
125 |
+
$this->_accessToken = $this->getRequest()->getParam('accessToken', null);
|
126 |
+
$this->_getCheckoutSession()->setOrderReferenceId($this->_orderReferenceId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
|
129 |
public function indexAction() {
|
149 |
|
150 |
$this->_getCheckoutSession()->setCartWasUpdated(false);
|
151 |
|
|
|
|
|
152 |
$this->loadLayout();
|
153 |
$this->getLayout()->getBlock('head')->setTitle($this->__('Pay with Amazon'));
|
154 |
$this->renderLayout();
|
167 |
return;
|
168 |
}
|
169 |
|
170 |
+
// submit draft data of order reference to Amazon gateway
|
171 |
+
$this->_getApi()->setOrderReferenceDetails($this->_getOrderReferenceId(), $this->_getQuote()->getBaseGrandTotal(), $this->_getQuote()->getBaseCurrencyCode());
|
172 |
|
173 |
+
// fetch address data from Amazon gateway and save it as a billing address
|
174 |
$orderReference = $this->_getApi()->getOrderReferenceDetails($this->_getOrderReferenceId());
|
|
|
175 |
$result = $this->_getCheckout()->saveShipping(array(
|
176 |
'city' => $orderReference->getDestination()->getPhysicalDestination()->getCity(),
|
177 |
'postcode' => $orderReference->getDestination()->getPhysicalDestination()->getPostalCode(),
|
208 |
return;
|
209 |
}
|
210 |
|
|
|
|
|
211 |
$data = $this->getRequest()->getPost('shipping_method', '');
|
212 |
$result = $this->_getCheckout()->saveShippingMethod($data);
|
213 |
|
272 |
$this->_getCheckout()->savePayment(null);
|
273 |
|
274 |
$this->_getQuote()->getPayment()->setTransactionId($this->_getOrderReferenceId());
|
275 |
+
|
276 |
+
if ($this->getRequest()->getPost('reloaded', false)) {
|
277 |
+
$sequenceNumber = (int)$this->_getCheckoutSession()->getAmazonSequenceNumber();
|
278 |
+
$this->_getQuote()->getPayment()
|
279 |
+
->setAmazonSequenceNumber(++$sequenceNumber)
|
280 |
+
->setSkipOrderReferenceProcessing(true);
|
281 |
+
$this->_getCheckoutSession()->setAmazonSequenceNumber($sequenceNumber);
|
282 |
+
} else {
|
283 |
+
$this->_getQuote()->getPayment()
|
284 |
+
->setAmazonSequenceNumber(null)
|
285 |
+
->setSkipOrderReferenceProcessing(false);
|
286 |
+
$this->_getCheckoutSession()->setAmazonSequenceNumber(null);
|
287 |
+
}
|
288 |
+
|
289 |
$simulation = $this->getRequest()->getPost('simulation', array());
|
290 |
if (!empty($simulation)) {
|
291 |
$simulationData = array(
|
296 |
$simulationData['options'] = Creativestyle_AmazonPayments_Model_Simulator::getSimulationOptions($simulationData['object'], $simulationData['state'], $simulationData['reason_code']);
|
297 |
$this->_getQuote()->getPayment()->setSimulationData($simulationData);
|
298 |
}
|
299 |
+
|
300 |
$this->_getCheckout()->saveOrder();
|
301 |
$this->_getQuote()->save();
|
302 |
$result['success'] = true;
|
303 |
$result['error'] = false;
|
304 |
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
|
305 |
+
} catch (Creativestyle_AmazonPayments_Exception_InvalidStatus_Recoverable $e) {
|
306 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array(
|
307 |
+
'success' => false,
|
308 |
+
'error' => true,
|
309 |
+
'error_messages' => $this->__('There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one.'),
|
310 |
+
'reload_wallet' => true
|
311 |
+
)));
|
312 |
+
} catch (Creativestyle_AmazonPayments_Exception_InvalidStatus $e) {
|
313 |
+
$this->_getApi()->cancelOrderReference($this->_shiftOrderReferenceId());
|
314 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array(
|
315 |
+
'success' => false,
|
316 |
+
'error' => true,
|
317 |
+
'error_messages' => $this->__('There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method.'),
|
318 |
+
'reload' => true
|
319 |
+
)));
|
320 |
} catch (Exception $e) {
|
321 |
Creativestyle_AmazonPayments_Model_Logger::logException($e);
|
322 |
Mage::helper('checkout')->sendPaymentFailedEmail($this->_getQuote(), $e->getMessage());
|
323 |
+
$this->_getApi()->cancelOrderReference($this->_shiftOrderReferenceId());
|
324 |
$this->_getCheckoutSession()->addError($this->__('There was an error processing your order. Please contact us or try again later.'));
|
325 |
+
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array(
|
326 |
+
'success' => false,
|
327 |
+
'redirect' => Mage::getUrl('checkout/cart')
|
328 |
+
)));
|
329 |
}
|
330 |
}
|
331 |
|
app/code/community/Creativestyle/AmazonPayments/etc/config.xml
CHANGED
@@ -17,7 +17,7 @@
|
|
17 |
<config>
|
18 |
<modules>
|
19 |
<Creativestyle_AmazonPayments>
|
20 |
-
<version>1.
|
21 |
</Creativestyle_AmazonPayments>
|
22 |
</modules>
|
23 |
<global>
|
@@ -430,6 +430,8 @@
|
|
430 |
<sandbox_toolbox>0</sandbox_toolbox>
|
431 |
<ipn_active>1</ipn_active>
|
432 |
<payment_action>authorize</payment_action>
|
|
|
|
|
433 |
<authorized_order_status>processing</authorized_order_status>
|
434 |
</general>
|
435 |
<login>
|
17 |
<config>
|
18 |
<modules>
|
19 |
<Creativestyle_AmazonPayments>
|
20 |
+
<version>1.6.0</version>
|
21 |
</Creativestyle_AmazonPayments>
|
22 |
</modules>
|
23 |
<global>
|
430 |
<sandbox_toolbox>0</sandbox_toolbox>
|
431 |
<ipn_active>1</ipn_active>
|
432 |
<payment_action>authorize</payment_action>
|
433 |
+
<authorization_mode>asynchronous</authorization_mode>
|
434 |
+
<new_order_status>pending</new_order_status>
|
435 |
<authorized_order_status>processing</authorized_order_status>
|
436 |
</general>
|
437 |
<login>
|
app/code/community/Creativestyle/AmazonPayments/etc/system.xml
CHANGED
@@ -140,6 +140,16 @@
|
|
140 |
<show_in_store>1</show_in_store>
|
141 |
<depends><active>1</active></depends>
|
142 |
</payment_action>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
<ipn_active translate="label">
|
144 |
<label>Enable Instant Payment Notifications</label>
|
145 |
<comment>This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.</comment>
|
@@ -186,6 +196,16 @@
|
|
186 |
<show_in_website>0</show_in_website>
|
187 |
<show_in_store>0</show_in_store>
|
188 |
</recent_polled_transaction>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
<authorized_order_status translate="label">
|
190 |
<label>Order status on authorization</label>
|
191 |
<frontend_type>select</frontend_type>
|
140 |
<show_in_store>1</show_in_store>
|
141 |
<depends><active>1</active></depends>
|
142 |
</payment_action>
|
143 |
+
<authorization_mode translate="label">
|
144 |
+
<label>Authorization Processing Mode</label>
|
145 |
+
<frontend_type>select</frontend_type>
|
146 |
+
<source_model>amazonpayments/lookup_authorizationMode</source_model>
|
147 |
+
<sort_order>45</sort_order>
|
148 |
+
<show_in_default>1</show_in_default>
|
149 |
+
<show_in_website>1</show_in_website>
|
150 |
+
<show_in_store>1</show_in_store>
|
151 |
+
<depends><active>1</active></depends>
|
152 |
+
</authorization_mode>
|
153 |
<ipn_active translate="label">
|
154 |
<label>Enable Instant Payment Notifications</label>
|
155 |
<comment>This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.</comment>
|
196 |
<show_in_website>0</show_in_website>
|
197 |
<show_in_store>0</show_in_store>
|
198 |
</recent_polled_transaction>
|
199 |
+
<new_order_status translate="label">
|
200 |
+
<label>New order status</label>
|
201 |
+
<frontend_type>select</frontend_type>
|
202 |
+
<source_model>adminhtml/system_config_source_order_status_new</source_model>
|
203 |
+
<sort_order>78</sort_order>
|
204 |
+
<show_in_default>1</show_in_default>
|
205 |
+
<show_in_website>1</show_in_website>
|
206 |
+
<show_in_store>1</show_in_store>
|
207 |
+
<depends><active>1</active></depends>
|
208 |
+
</new_order_status>
|
209 |
<authorized_order_status translate="label">
|
210 |
<label>Order status on authorization</label>
|
211 |
<frontend_type>select</frontend_type>
|
app/locale/de_DE/Creativestyle_AmazonPayments.csv
CHANGED
@@ -130,6 +130,8 @@
|
|
130 |
"Small","Klein"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Beige"
|
|
|
|
|
133 |
"There was an error processing your order. Please contact us or try again later.","Bei der Verarbeitung Ihrer Bestellung ist ein Fehler aufgetreten. Kontaktieren Sie uns oder probieren Sie es bitte später erneut."
|
134 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","Die Erweiterun integriert den ""Login und Bezahlen mit Amazon"" Service in ihren Magento Shop."
|
135 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","Diese Funktion erfordert die Installation eines gültigen SSL-Zertifikats auf Ihrem Server. Achten Sie darauf, dass das SSL-Zertifikat von einer vertrauenswürdigen Zertifizierungsstelle ausgestellt wird. Selbst signierte Zertifikate sind nicht gestattet."
|
130 |
"Small","Klein"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Beige"
|
133 |
+
"There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method.","Es gab ein Problem mit der ausgewählten Zahlungsart aus ihrem Amazon Konto. Bitte wählen Sie eine andere Zahlungsart aus Ihrem Amazon Konto oder wählen Sie einen anderen Checkout im Warenkorb."
|
134 |
+
"There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one.","Es gab ein Problem mit der ausgewählten Zahlungsart aus ihrem Amazon Konto. Bitte ändern Sie die gewünschte Zahlungsart oder legen Sie eine neue Zahlungsart an."
|
135 |
"There was an error processing your order. Please contact us or try again later.","Bei der Verarbeitung Ihrer Bestellung ist ein Fehler aufgetreten. Kontaktieren Sie uns oder probieren Sie es bitte später erneut."
|
136 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","Die Erweiterun integriert den ""Login und Bezahlen mit Amazon"" Service in ihren Magento Shop."
|
137 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","Diese Funktion erfordert die Installation eines gültigen SSL-Zertifikats auf Ihrem Server. Achten Sie darauf, dass das SSL-Zertifikat von einer vertrauenswürdigen Zertifizierungsstelle ausgestellt wird. Selbst signierte Zertifikate sind nicht gestattet."
|
app/locale/en_GB/Creativestyle_AmazonPayments.csv
CHANGED
@@ -130,6 +130,8 @@
|
|
130 |
"Small","Small"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Tan"
|
|
|
|
|
133 |
"There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later."
|
134 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","This extension integrates easily your Magento shop with Pay with Amazon service."
|
135 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted."
|
130 |
"Small","Small"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Tan"
|
133 |
+
"There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method.","There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method."
|
134 |
+
"There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one.","There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one."
|
135 |
"There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later."
|
136 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","This extension integrates easily your Magento shop with Pay with Amazon service."
|
137 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted."
|
app/locale/en_US/Creativestyle_AmazonPayments.csv
CHANGED
@@ -130,6 +130,8 @@
|
|
130 |
"Small","Small"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Tan"
|
|
|
|
|
133 |
"There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later."
|
134 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","This extension integrates easily your Magento shop with Pay with Amazon service."
|
135 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted."
|
130 |
"Small","Small"
|
131 |
"Stores","Stores"
|
132 |
"Tan","Tan"
|
133 |
+
"There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method.","There has been a problem with the selected payment method from your Amazon account, please choose another payment method from you Amazon account or return to the cart to choose another checkout method."
|
134 |
+
"There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one.","There has been a problem with the selected payment method from your Amazon account, please update the payment method or choose another one."
|
135 |
"There was an error processing your order. Please contact us or try again later.","There was an error processing your order. Please contact us or try again later."
|
136 |
"This extension integrates easily your Magento shop with Pay with Amazon service.","This extension integrates easily your Magento shop with Pay with Amazon service."
|
137 |
"This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted.","This feature requires valid SSL certificate to be installed on this server. Pay attention that the SSL certificate must be issued by a trusted Certificate Authority, self-signed certificates are not permitted."
|
js/creativestyle/apa_checkout.js
CHANGED
@@ -19,6 +19,7 @@ var APA = {
|
|
19 |
|
20 |
submitAllowed: false,
|
21 |
paymentSelected: false,
|
|
|
22 |
|
23 |
Widgets: {
|
24 |
ShippingMethod: Class.create({
|
@@ -86,12 +87,9 @@ var APA = {
|
|
86 |
Element.show(loader);
|
87 |
}
|
88 |
}
|
89 |
-
|
90 |
-
$('checkoutSteps').insert({
|
91 |
-
top: new Element('div', {'class': 'amazon-widget-overlay'})
|
92 |
-
});
|
93 |
-
}
|
94 |
this.disableSubmit();
|
|
|
95 |
},
|
96 |
|
97 |
unsetOrderSaveWaiting: function() {
|
@@ -101,10 +99,25 @@ var APA = {
|
|
101 |
Element.hide(loader);
|
102 |
}
|
103 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
if ($('checkoutSteps') && $('checkoutSteps').down('.amazon-widget-overlay')) {
|
105 |
$('checkoutSteps').down('.amazon-widget-overlay').remove();
|
106 |
}
|
107 |
this.toggleSubmit();
|
|
|
108 |
},
|
109 |
|
110 |
initCheckout: function() {
|
@@ -220,6 +233,17 @@ var APA = {
|
|
220 |
return this;
|
221 |
},
|
222 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
orderReferenceCreateCallback: function(orderReference) {
|
224 |
if (!APA.orderReferenceId) {
|
225 |
APA.orderReferenceId = orderReference.getAmazonOrderReferenceId();
|
@@ -283,6 +307,11 @@ var APA = {
|
|
283 |
APA.selectPayment(true);
|
284 |
},
|
285 |
|
|
|
|
|
|
|
|
|
|
|
286 |
renderReviewWidget: function(html) {
|
287 |
new APA.Widgets.Review({
|
288 |
onError: APA.magentoErrorCallback
|
@@ -324,6 +353,15 @@ var APA = {
|
|
324 |
if (response.error) {
|
325 |
APA.unsetOrderSaveWaiting();
|
326 |
APA.magentoErrorCallback(response.error_messages);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
};
|
328 |
},
|
329 |
|
@@ -336,7 +374,7 @@ var APA = {
|
|
336 |
console.trace();
|
337 |
alert(error.getErrorMessage());
|
338 |
}
|
339 |
-
var redirectErrors = ['BuyerNotAssociated', 'BuyerSessionExpired', 'StaleOrderReference'];
|
340 |
if (redirectErrors.any(function(errorCode) { return errorCode == error.getErrorCode() })) {
|
341 |
window.location.href = APA.urls.failure;
|
342 |
}
|
@@ -424,6 +462,9 @@ var APA = {
|
|
424 |
params += '&' + Form.serialize($('checkout-agreements'));
|
425 |
}
|
426 |
}
|
|
|
|
|
|
|
427 |
params.save = true;
|
428 |
return params;
|
429 |
},
|
19 |
|
20 |
submitAllowed: false,
|
21 |
paymentSelected: false,
|
22 |
+
reloaded: false,
|
23 |
|
24 |
Widgets: {
|
25 |
ShippingMethod: Class.create({
|
87 |
Element.show(loader);
|
88 |
}
|
89 |
}
|
90 |
+
this.showOverlay();
|
|
|
|
|
|
|
|
|
91 |
this.disableSubmit();
|
92 |
+
return this;
|
93 |
},
|
94 |
|
95 |
unsetOrderSaveWaiting: function() {
|
99 |
Element.hide(loader);
|
100 |
}
|
101 |
}
|
102 |
+
this.hideOverlay();
|
103 |
+
return this;
|
104 |
+
},
|
105 |
+
|
106 |
+
showOverlay: function() {
|
107 |
+
if ($('checkoutSteps')) {
|
108 |
+
$('checkoutSteps').insert({
|
109 |
+
top: new Element('div', {'class': 'amazon-widget-overlay'})
|
110 |
+
});
|
111 |
+
}
|
112 |
+
return this;
|
113 |
+
},
|
114 |
+
|
115 |
+
hideOverlay: function() {
|
116 |
if ($('checkoutSteps') && $('checkoutSteps').down('.amazon-widget-overlay')) {
|
117 |
$('checkoutSteps').down('.amazon-widget-overlay').remove();
|
118 |
}
|
119 |
this.toggleSubmit();
|
120 |
+
return this;
|
121 |
},
|
122 |
|
123 |
initCheckout: function() {
|
233 |
return this;
|
234 |
},
|
235 |
|
236 |
+
renderReadOnlyAddressBookWidget: function() {
|
237 |
+
new OffAmazonPayments.Widgets.AddressBook({
|
238 |
+
sellerId: APA.sellerId,
|
239 |
+
amazonOrderReferenceId: APA.orderReferenceId,
|
240 |
+
design: (APA.design.responsive ? {designMode: 'responsive'} : APA.design.addressBook),
|
241 |
+
onError: APA.amazonErrorCallback,
|
242 |
+
displayMode: 'Read'
|
243 |
+
}).bind(APA.layers.addressBook);
|
244 |
+
return this;
|
245 |
+
},
|
246 |
+
|
247 |
orderReferenceCreateCallback: function(orderReference) {
|
248 |
if (!APA.orderReferenceId) {
|
249 |
APA.orderReferenceId = orderReference.getAmazonOrderReferenceId();
|
307 |
APA.selectPayment(true);
|
308 |
},
|
309 |
|
310 |
+
reloadWallet: function() {
|
311 |
+
this.renderReadOnlyAddressBookWidget().renderWalletWidget();
|
312 |
+
return this;
|
313 |
+
},
|
314 |
+
|
315 |
renderReviewWidget: function(html) {
|
316 |
new APA.Widgets.Review({
|
317 |
onError: APA.magentoErrorCallback
|
353 |
if (response.error) {
|
354 |
APA.unsetOrderSaveWaiting();
|
355 |
APA.magentoErrorCallback(response.error_messages);
|
356 |
+
if (response.reload) {
|
357 |
+
APA.reloaded = false;
|
358 |
+
APA.orderReferenceId = null;
|
359 |
+
APA.initCheckout();
|
360 |
+
};
|
361 |
+
if (response.reload_wallet) {
|
362 |
+
APA.reloaded = true;
|
363 |
+
APA.disableSubmit().reloadWallet();
|
364 |
+
};
|
365 |
};
|
366 |
},
|
367 |
|
374 |
console.trace();
|
375 |
alert(error.getErrorMessage());
|
376 |
}
|
377 |
+
var redirectErrors = ['BuyerNotAssociated', 'BuyerSessionExpired', 'StaleOrderReference', 'InvalidOrderReferenceId'];
|
378 |
if (redirectErrors.any(function(errorCode) { return errorCode == error.getErrorCode() })) {
|
379 |
window.location.href = APA.urls.failure;
|
380 |
}
|
462 |
params += '&' + Form.serialize($('checkout-agreements'));
|
463 |
}
|
464 |
}
|
465 |
+
if (APA.reloaded) {
|
466 |
+
params += '&' + Object.toQueryString({reloaded: 1});
|
467 |
+
}
|
468 |
params.save = true;
|
469 |
return params;
|
470 |
},
|
js/creativestyle/apa_checkout.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
if(!window.Review){var Review=function(){}}var APA={submitAllowed:false,paymentSelected:false,Widgets:{ShippingMethod:Class.create({initialize:function(a){this.layer=$(APA.layers.shippingMethod);Object.extend(this,a);Event.stopObserving(this.layer,"widget:update").observe("widget:update",this.onUpdate.bindAsEventListener(this))},update:function(b){try{Element.update(this.layer,b);if(!this.layer.down("input[type=radio]:checked")){var a=this.layer.down("input[type=radio]");if(a){a.checked=true}}Event.stopObserving(this.layer,"change").observe("change",this.onShippingMethodSelect.bindAsEventListener(this));Event.stopObserving(this.layer,"widget:checked").observe("widget:checked",this.onShippingMethodSelect.bindAsEventListener(this));Event.fire(this.layer,"widget:update")}catch(c){this.onError(c)}}}),Review:Class.create({initialize:function(a){this.layer=$(APA.layers.review);Object.extend(this,a)},update:function(a){try{Element.update(this.layer,a)}catch(b){this.onError(b)}}})},setLoadWaiting:function(){for(var b=0;b<arguments.length;b++){if($(arguments[b])){var a=$(arguments[b]).up("li");a.addClassName("loading")}}return this},unsetLoadWaiting:function(){for(var b=0;b<arguments.length;b++){if($(arguments[b])){var a=$(arguments[b]).up("li");a.removeClassName("loading")}}return this},setOrderSaveWaiting:function(){if($(APA.layers.review)){var a=$(APA.layers.review).down(".please-wait");if(a){Element.show(a)}}if($("checkoutSteps")){$("checkoutSteps").insert({top:new Element("div",{"class":"amazon-widget-overlay"})})}this.disableSubmit()},unsetOrderSaveWaiting:function(){if($(APA.layers.review)){var a=$(APA.layers.review).down(".please-wait");if(a){Element.hide(a)}}if($("checkoutSteps")&&$("checkoutSteps").down(".amazon-widget-overlay")){$("checkoutSteps").down(".amazon-widget-overlay").remove()}this.toggleSubmit()},initCheckout:function(){this.disableSubmit().scaffoldPaymentWidget();if(this.virtual){return this.setLoadWaiting(APA.layers.wallet).renderWalletWidget().allowSubmit(true)}if(!this.orderReferenceId){return this.setLoadWaiting(APA.layers.shippingMethod,APA.layers.wallet,APA.layers.review).renderAddressBookWidget()}return this.setLoadWaiting(APA.layers.shippingMethod,APA.layers.wallet,APA.layers.review).renderAddressBookWidget().renderWalletWidget()},scaffoldPaymentWidget:function(){if(typeof APA.design.wallet.size!="undefined"&&!APA.design.responsive){if(APA.design.wallet.size.width){$(APA.layers.wallet).up().setStyle({width:APA.design.wallet.size.width})}if(APA.design.wallet.size.height){$(APA.layers.wallet).up().setStyle({height:APA.design.wallet.size.height})}}return this},renderButtonWidget:function(c){if(APA.urls.login!=null){$$(APA.layers.payButtons).each(function(d){new OffAmazonPayments.Button(d.identify(),APA.sellerId,{type:d.buttonType||APA.design.payButton.type||"PwA",size:d.buttonSize||APA.design.payButton.size,color:d.buttonColor||APA.design.payButton.color,authorization:function(){amazon.Login.authorize({scope:"profile payments:widget payments:shipping_address",popup:APA.popup},APA.urls.pay)},onError:APA.amazonErrorCallback})});$$(APA.layers.loginButtons).each(function(d){new OffAmazonPayments.Button(d.identify(),APA.sellerId,{type:d.buttonType||APA.design.loginButton.type||"LwA",size:d.buttonSize||APA.design.loginButton.size,color:d.buttonColor||APA.design.loginButton.color,authorization:function(){amazon.Login.authorize({scope:"profile payments:widget payments:shipping_address",popup:APA.popup},APA.urls.login)},onError:APA.amazonErrorCallback})})}else{$$(APA.layers.payButtons).each(function(d){new OffAmazonPayments.Widgets.Button({sellerId:APA.sellerId,useAmazonAddressBook:!APA.virtual,onSignIn:APA.signInCallback,onError:APA.amazonErrorCallback}).bind(d.identify())})}if(c&&typeof Tooltip!="undefined"){var b=$$(APA.layers.payButtons+","+APA.layers.loginButtons).findAll(function(d){return d.hasClassName("with-tooltip")});if(b.length){var a=document.createElement("div");a.setAttribute("id","pay-with-amazon-tooltip");a.addClassName("pay-with-amazon-tooltip");a.setStyle({display:"none",zIndex:10});a.update(c);document.body.appendChild(a);b.each(function(d){var e=d.down("img");if(e){new Tooltip(e,a)}})}}},signInCallback:function(a){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name","orderReferenceId");c.setAttribute("value",a.getAmazonOrderReferenceId());var b=document.createElement("form");b.setAttribute("method","post");b.setAttribute("action",APA.urls.checkout);b.appendChild(c);document.body.appendChild(b);b.submit();return},renderAddressBookWidget:function(){APA.setLoadWaiting(APA.layers.shippingMethod,APA.layers.review);new OffAmazonPayments.Widgets.AddressBook({sellerId:APA.sellerId,onOrderReferenceCreate:APA.orderReferenceCreateCallback,amazonOrderReferenceId:APA.orderReferenceId,design:(APA.design.responsive?{designMode:"responsive"}:APA.design.addressBook),onAddressSelect:APA.addressSelectCallback,onError:APA.amazonErrorCallback}).bind(APA.layers.addressBook);return this},orderReferenceCreateCallback:function(a){if(!APA.orderReferenceId){APA.orderReferenceId=a.getAmazonOrderReferenceId();if(!APA.virtual){APA.renderWalletWidget()}}},addressSelectCallback:function(){APA.selectPayment(false);APA.setLoadWaiting(APA.layers.shippingMethod,APA.layers.review);new Ajax.Request(APA.urls.saveShipping,{method:"post",parameters:{orderReferenceId:APA.orderReferenceId},evalScripts:true,onSuccess:APA.successCallback,onFailure:APA.ajaxFailureCallback})},renderShippingMethodWidget:function(a){APA.setLoadWaiting(APA.layers.review);new APA.Widgets.ShippingMethod({onShippingMethodSelect:APA.shippingMethodSelectCallback,onUpdate:APA.shippingMethodUpdateCallback,onError:APA.magentoErrorCallback}).update(a);return this},shippingMethodSelectCallback:function(a){APA.setLoadWaiting(APA.layers.review);new Ajax.Request(APA.urls.saveShippingMethod,{method:"post",parameters:Form.serialize($("co-shipping-method-form")),evalScripts:true,onSuccess:APA.successCallback,onFailure:APA.ajaxFailureCallback})},shippingMethodUpdateCallback:function(b){var a=Event.element(b);Event.fire(a,"widget:checked")},renderWalletWidget:function(){new OffAmazonPayments.Widgets.Wallet({sellerId:APA.sellerId,onOrderReferenceCreate:APA.orderReferenceCreateCallback,amazonOrderReferenceId:APA.orderReferenceId,design:(APA.design.responsive?{designMode:"responsive"}:APA.design.wallet),onPaymentSelect:APA.paymentSelectCallback,onError:APA.amazonErrorCallback}).bind(APA.layers.wallet);return this},paymentSelectCallback:function(){APA.selectPayment(true)},renderReviewWidget:function(a){new APA.Widgets.Review({onError:APA.magentoErrorCallback}).update(a);this.toggleSubmit();return this},successCallback:function(transport){response=eval("("+transport.responseText+")");if(response.error){APA.magentoErrorCallback(response.error_messages)}if(response.render_widget){$H(response.render_widget).each(function(pair){APA["render"+pair.key.capitalize().camelize()+"Widget"](pair.value);if(pair.value){APA.unsetLoadWaiting(APA.layers[pair.key.camelize()])}})}if(response.allow_submit){APA.allowSubmit(true)}else{APA.allowSubmit(false)}},saveOrderCallback:function(transport){response=eval("("+transport.responseText+")");if(response.success){window.location=APA.urls.success}if(response.redirect){window.location=response.redirect}if(response.error){APA.unsetOrderSaveWaiting();APA.magentoErrorCallback(response.error_messages)}},ajaxFailureCallback:function(){window.location.href=APA.urls.failure},amazonErrorCallback:function(a){if(!APA.live){console.trace();alert(a.getErrorMessage())}var b=["BuyerNotAssociated","BuyerSessionExpired","StaleOrderReference"];if(b.any(function(c){return c==a.getErrorCode()})){window.location.href=APA.urls.failure}},magentoErrorCallback:function(a){if(!APA.live){console.trace()}if(typeof(a)=="object"){a=a.join("\n")}if(a){alert(a)}},allowSubmit:function(a){this.submitAllowed=a;return this.toggleSubmit()},selectPayment:function(a){this.paymentSelected=a;return this.toggleSubmit()},toggleSubmit:function(){if(this.submitAllowed&&this.paymentSelected){return this.enableSubmit()}return this.disableSubmit()},disableSubmit:function(){var a=$(this.layers.review).select("div.buttons-set");if(a){a.each(function(b){b.addClassName("disabled");var c=b.down("button[type=submit].button");if(c){c.disabled=true}})}return this},enableSubmit:function(){if(this.submitAllowed&&this.paymentSelected){var a=$(this.layers.review).select("div.buttons-set");if(a){a.each(function(b){b.removeClassName("disabled");var c=b.down("button[type=submit].button");if(c){c.disabled=false}})}}return this},saveOrder:function(){APA.setOrderSaveWaiting();new Ajax.Request(APA.urls.saveOrder,{method:"post",parameters:APA.getSaveOrderParams(),onSuccess:APA.saveOrderCallback,onFailure:APA.ajaxFailureCallback})},getSaveOrderParams:function(){var a="";if(APA.virtual){a+=Object.toQueryString({orderReferenceId:APA.orderReferenceId});if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}else{a=Form.serialize($("co-shipping-method-form"));if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}a.save=true;return a},initialize:function(c,a,d,g,f,e,b){return Object.extend(APA,{sellerId:c,orderReferenceId:a,live:d,virtual:g,urls:Object.extend({login:null,pay:null,checkout:null,saveShipping:null,saveShippingMethod:null,saveOrder:null,success:null,failure:null},f),layers:Object.extend({payButtons:".payButtonWidget",loginButtons:".loginButtonWidget",addressBook:"addressBookWidgetDiv",wallet:"walletWidgetDiv",shippingMethod:"shippingMethodWidgetDiv",review:"reviewWidgetDiv"},e),design:Object.extend({addressBook:{size:{width:"440px",height:"260px"}},wallet:{size:{width:"440px",height:"260px"}},payButton:{type:"PwA"},loginButton:{type:"LwA"}},b)})},setup:function(b,a){return Object.extend(APA,{sellerId:b,orderReferenceId:typeof a.orderReferenceId=="undefined"?null:a.orderReferenceId,live:typeof a.live=="undefined"?true:a.live,popup:typeof a.popup=="undefined"?true:a.popup,virtual:typeof a.virtual=="undefined"?false:a.virtual,layers:Object.extend({payButtons:".payButtonWidget",loginButtons:".loginButtonWidget",addressBook:"addressBookWidgetDiv",wallet:"walletWidgetDiv",shippingMethod:"shippingMethodWidgetDiv",review:"reviewWidgetDiv"},a.layers),urls:Object.extend({login:null,pay:null,checkout:null,saveShipping:null,saveShippingMethod:null,saveOrder:null,success:null,failure:null},a.urls),design:Object.extend({responsive:true,addressBook:{size:{width:"440px",height:"260px"}},wallet:{size:{width:"440px",height:"260px"}},payButton:{type:"PwA"},loginButton:{type:"LwA"}},a.design)})}};
|
1 |
+
if(!window.Review){var Review=function(){}}var APA={submitAllowed:false,paymentSelected:false,reloaded:false,Widgets:{ShippingMethod:Class.create({initialize:function(a){this.layer=$(APA.layers.shippingMethod);Object.extend(this,a);Event.stopObserving(this.layer,"widget:update").observe("widget:update",this.onUpdate.bindAsEventListener(this))},update:function(b){try{Element.update(this.layer,b);if(!this.layer.down("input[type=radio]:checked")){var a=this.layer.down("input[type=radio]");if(a){a.checked=true}}Event.stopObserving(this.layer,"change").observe("change",this.onShippingMethodSelect.bindAsEventListener(this));Event.stopObserving(this.layer,"widget:checked").observe("widget:checked",this.onShippingMethodSelect.bindAsEventListener(this));Event.fire(this.layer,"widget:update")}catch(c){this.onError(c)}}}),Review:Class.create({initialize:function(a){this.layer=$(APA.layers.review);Object.extend(this,a)},update:function(a){try{Element.update(this.layer,a)}catch(b){this.onError(b)}}})},setLoadWaiting:function(){for(var b=0;b<arguments.length;b++){if($(arguments[b])){var a=$(arguments[b]).up("li");a.addClassName("loading")}}return this},unsetLoadWaiting:function(){for(var b=0;b<arguments.length;b++){if($(arguments[b])){var a=$(arguments[b]).up("li");a.removeClassName("loading")}}return this},setOrderSaveWaiting:function(){if($(APA.layers.review)){var a=$(APA.layers.review).down(".please-wait");if(a){Element.show(a)}}this.showOverlay();this.disableSubmit();return this},unsetOrderSaveWaiting:function(){if($(APA.layers.review)){var a=$(APA.layers.review).down(".please-wait");if(a){Element.hide(a)}}this.hideOverlay();return this},showOverlay:function(){if($("checkoutSteps")){$("checkoutSteps").insert({top:new Element("div",{"class":"amazon-widget-overlay"})})}return this},hideOverlay:function(){if($("checkoutSteps")&&$("checkoutSteps").down(".amazon-widget-overlay")){$("checkoutSteps").down(".amazon-widget-overlay").remove()}this.toggleSubmit();return this},initCheckout:function(){this.disableSubmit().scaffoldPaymentWidget();if(this.virtual){return this.setLoadWaiting(APA.layers.wallet).renderWalletWidget().allowSubmit(true)}if(!this.orderReferenceId){return this.setLoadWaiting(APA.layers.shippingMethod,APA.layers.wallet,APA.layers.review).renderAddressBookWidget()}return this.setLoadWaiting(APA.layers.shippingMethod,APA.layers.wallet,APA.layers.review).renderAddressBookWidget().renderWalletWidget()},scaffoldPaymentWidget:function(){if(typeof APA.design.wallet.size!="undefined"&&!APA.design.responsive){if(APA.design.wallet.size.width){$(APA.layers.wallet).up().setStyle({width:APA.design.wallet.size.width})}if(APA.design.wallet.size.height){$(APA.layers.wallet).up().setStyle({height:APA.design.wallet.size.height})}}return this},renderButtonWidget:function(c){if(APA.urls.login!=null){$$(APA.layers.payButtons).each(function(d){new OffAmazonPayments.Button(d.identify(),APA.sellerId,{type:d.buttonType||APA.design.payButton.type||"PwA",size:d.buttonSize||APA.design.payButton.size,color:d.buttonColor||APA.design.payButton.color,authorization:function(){amazon.Login.authorize({scope:"profile payments:widget payments:shipping_address",popup:APA.popup},APA.urls.pay)},onError:APA.amazonErrorCallback})});$$(APA.layers.loginButtons).each(function(d){new OffAmazonPayments.Button(d.identify(),APA.sellerId,{type:d.buttonType||APA.design.loginButton.type||"LwA",size:d.buttonSize||APA.design.loginButton.size,color:d.buttonColor||APA.design.loginButton.color,authorization:function(){amazon.Login.authorize({scope:"profile payments:widget payments:shipping_address",popup:APA.popup},APA.urls.login)},onError:APA.amazonErrorCallback})})}else{$$(APA.layers.payButtons).each(function(d){new OffAmazonPayments.Widgets.Button({sellerId:APA.sellerId,useAmazonAddressBook:!APA.virtual,onSignIn:APA.signInCallback,onError:APA.amazonErrorCallback}).bind(d.identify())})}if(c&&typeof Tooltip!="undefined"){var b=$$(APA.layers.payButtons+","+APA.layers.loginButtons).findAll(function(d){return d.hasClassName("with-tooltip")});if(b.length){var a=document.createElement("div");a.setAttribute("id","pay-with-amazon-tooltip");a.addClassName("pay-with-amazon-tooltip");a.setStyle({display:"none",zIndex:10});a.update(c);document.body.appendChild(a);b.each(function(d){var e=d.down("img");if(e){new Tooltip(e,a)}})}}},signInCallback:function(a){var c=document.createElement("input");c.setAttribute("type","hidden");c.setAttribute("name","orderReferenceId");c.setAttribute("value",a.getAmazonOrderReferenceId());var b=document.createElement("form");b.setAttribute("method","post");b.setAttribute("action",APA.urls.checkout);b.appendChild(c);document.body.appendChild(b);b.submit();return},renderAddressBookWidget:function(){APA.setLoadWaiting(APA.layers.shippingMethod,APA.layers.review);new OffAmazonPayments.Widgets.AddressBook({sellerId:APA.sellerId,onOrderReferenceCreate:APA.orderReferenceCreateCallback,amazonOrderReferenceId:APA.orderReferenceId,design:(APA.design.responsive?{designMode:"responsive"}:APA.design.addressBook),onAddressSelect:APA.addressSelectCallback,onError:APA.amazonErrorCallback}).bind(APA.layers.addressBook);return this},renderReadOnlyAddressBookWidget:function(){new OffAmazonPayments.Widgets.AddressBook({sellerId:APA.sellerId,amazonOrderReferenceId:APA.orderReferenceId,design:(APA.design.responsive?{designMode:"responsive"}:APA.design.addressBook),onError:APA.amazonErrorCallback,displayMode:"Read"}).bind(APA.layers.addressBook);return this},orderReferenceCreateCallback:function(a){if(!APA.orderReferenceId){APA.orderReferenceId=a.getAmazonOrderReferenceId();if(!APA.virtual){APA.renderWalletWidget()}}},addressSelectCallback:function(){APA.selectPayment(false);APA.setLoadWaiting(APA.layers.shippingMethod,APA.layers.review);new Ajax.Request(APA.urls.saveShipping,{method:"post",parameters:{orderReferenceId:APA.orderReferenceId},evalScripts:true,onSuccess:APA.successCallback,onFailure:APA.ajaxFailureCallback})},renderShippingMethodWidget:function(a){APA.setLoadWaiting(APA.layers.review);new APA.Widgets.ShippingMethod({onShippingMethodSelect:APA.shippingMethodSelectCallback,onUpdate:APA.shippingMethodUpdateCallback,onError:APA.magentoErrorCallback}).update(a);return this},shippingMethodSelectCallback:function(a){APA.setLoadWaiting(APA.layers.review);new Ajax.Request(APA.urls.saveShippingMethod,{method:"post",parameters:Form.serialize($("co-shipping-method-form")),evalScripts:true,onSuccess:APA.successCallback,onFailure:APA.ajaxFailureCallback})},shippingMethodUpdateCallback:function(b){var a=Event.element(b);Event.fire(a,"widget:checked")},renderWalletWidget:function(){new OffAmazonPayments.Widgets.Wallet({sellerId:APA.sellerId,onOrderReferenceCreate:APA.orderReferenceCreateCallback,amazonOrderReferenceId:APA.orderReferenceId,design:(APA.design.responsive?{designMode:"responsive"}:APA.design.wallet),onPaymentSelect:APA.paymentSelectCallback,onError:APA.amazonErrorCallback}).bind(APA.layers.wallet);return this},paymentSelectCallback:function(){APA.selectPayment(true)},reloadWallet:function(){this.renderReadOnlyAddressBookWidget().renderWalletWidget();return this},renderReviewWidget:function(a){new APA.Widgets.Review({onError:APA.magentoErrorCallback}).update(a);this.toggleSubmit();return this},successCallback:function(transport){response=eval("("+transport.responseText+")");if(response.error){APA.magentoErrorCallback(response.error_messages)}if(response.render_widget){$H(response.render_widget).each(function(pair){APA["render"+pair.key.capitalize().camelize()+"Widget"](pair.value);if(pair.value){APA.unsetLoadWaiting(APA.layers[pair.key.camelize()])}})}if(response.allow_submit){APA.allowSubmit(true)}else{APA.allowSubmit(false)}},saveOrderCallback:function(transport){response=eval("("+transport.responseText+")");if(response.success){window.location=APA.urls.success}if(response.redirect){window.location=response.redirect}if(response.error){APA.unsetOrderSaveWaiting();APA.magentoErrorCallback(response.error_messages);if(response.reload){APA.reloaded=false;APA.orderReferenceId=null;APA.initCheckout()}if(response.reload_wallet){APA.reloaded=true;APA.disableSubmit().reloadWallet()}}},ajaxFailureCallback:function(){window.location.href=APA.urls.failure},amazonErrorCallback:function(a){if(!APA.live){console.trace();alert(a.getErrorMessage())}var b=["BuyerNotAssociated","BuyerSessionExpired","StaleOrderReference","InvalidOrderReferenceId"];if(b.any(function(c){return c==a.getErrorCode()})){window.location.href=APA.urls.failure}},magentoErrorCallback:function(a){if(!APA.live){console.trace()}if(typeof(a)=="object"){a=a.join("\n")}if(a){alert(a)}},allowSubmit:function(a){this.submitAllowed=a;return this.toggleSubmit()},selectPayment:function(a){this.paymentSelected=a;return this.toggleSubmit()},toggleSubmit:function(){if(this.submitAllowed&&this.paymentSelected){return this.enableSubmit()}return this.disableSubmit()},disableSubmit:function(){var a=$(this.layers.review).select("div.buttons-set");if(a){a.each(function(b){b.addClassName("disabled");var c=b.down("button[type=submit].button");if(c){c.disabled=true}})}return this},enableSubmit:function(){if(this.submitAllowed&&this.paymentSelected){var a=$(this.layers.review).select("div.buttons-set");if(a){a.each(function(b){b.removeClassName("disabled");var c=b.down("button[type=submit].button");if(c){c.disabled=false}})}}return this},saveOrder:function(){APA.setOrderSaveWaiting();new Ajax.Request(APA.urls.saveOrder,{method:"post",parameters:APA.getSaveOrderParams(),onSuccess:APA.saveOrderCallback,onFailure:APA.ajaxFailureCallback})},getSaveOrderParams:function(){var a="";if(APA.virtual){a+=Object.toQueryString({orderReferenceId:APA.orderReferenceId});if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}else{a=Form.serialize($("co-shipping-method-form"));if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}if(APA.reloaded){a+="&"+Object.toQueryString({reloaded:1})}a.save=true;return a},initialize:function(c,a,d,g,f,e,b){return Object.extend(APA,{sellerId:c,orderReferenceId:a,live:d,virtual:g,urls:Object.extend({login:null,pay:null,checkout:null,saveShipping:null,saveShippingMethod:null,saveOrder:null,success:null,failure:null},f),layers:Object.extend({payButtons:".payButtonWidget",loginButtons:".loginButtonWidget",addressBook:"addressBookWidgetDiv",wallet:"walletWidgetDiv",shippingMethod:"shippingMethodWidgetDiv",review:"reviewWidgetDiv"},e),design:Object.extend({addressBook:{size:{width:"440px",height:"260px"}},wallet:{size:{width:"440px",height:"260px"}},payButton:{type:"PwA"},loginButton:{type:"LwA"}},b)})},setup:function(b,a){return Object.extend(APA,{sellerId:b,orderReferenceId:typeof a.orderReferenceId=="undefined"?null:a.orderReferenceId,live:typeof a.live=="undefined"?true:a.live,popup:typeof a.popup=="undefined"?true:a.popup,virtual:typeof a.virtual=="undefined"?false:a.virtual,layers:Object.extend({payButtons:".payButtonWidget",loginButtons:".loginButtonWidget",addressBook:"addressBookWidgetDiv",wallet:"walletWidgetDiv",shippingMethod:"shippingMethodWidgetDiv",review:"reviewWidgetDiv"},a.layers),urls:Object.extend({login:null,pay:null,checkout:null,saveShipping:null,saveShippingMethod:null,saveOrder:null,success:null,failure:null},a.urls),design:Object.extend({responsive:true,addressBook:{size:{width:"440px",height:"260px"}},wallet:{size:{width:"440px",height:"260px"}},payButton:{type:"PwA"},loginButton:{type:"LwA"}},a.design)})}};
|
js/creativestyle/apa_sandbox_toolbox.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
if(typeof APA=="undefined"){var APA={}}APA.Toolbox={clearSimulationObjects:function(){APA.Toolbox.objectSelect.descendants().each(Element.remove);APA.Toolbox.objectSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.object))},clearSimulationStates:function(){APA.Toolbox.stateSelect.descendants().each(Element.remove);APA.Toolbox.stateSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.state))},clearSimulationReasons:function(){APA.Toolbox.reasonSelect.descendants().each(Element.remove);APA.Toolbox.reasonSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.reason))},fillSimulationObjects:function(){APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates();APA.Toolbox.clearSimulationObjects();$H(APA.Toolbox.availableSimulations).each(function(a){APA.Toolbox.objectSelect.insert(new Element("option",{value:a.key}).update(a.key))});APA.Toolbox.objectSelect.enable().show();APA.Toolbox.objectSelect.observe("change",function(b){var a=APA.Toolbox.objectSelect.getValue();if(a&&typeof APA.Toolbox.availableSimulations[a]!="undefined"&&typeof APA.Toolbox.availableSimulations[a]["states"]!="undefined"){APA.Toolbox.fillSimulationStates(APA.Toolbox.availableSimulations[a]["states"])}else{APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates()}})},fillSimulationStates:function(a){APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates();$H(a).each(function(b){APA.Toolbox.stateSelect.insert(new Element("option",{value:b.key}).update(b.key))});APA.Toolbox.stateSelect.enable().show();APA.Toolbox.stateSelect.observe("change",function(c){var b=APA.Toolbox.stateSelect.getValue();if(b&&typeof a[b]!="undefined"&&typeof a[b]["reasons"]!="undefined"){APA.Toolbox.fillSimulationReasons(a[b]["reasons"])}else{APA.Toolbox.clearSimulationReasons()}})},fillSimulationReasons:function(a){APA.Toolbox.clearSimulationReasons();$H(a).each(function(b){APA.Toolbox.reasonSelect.insert(new Element("option",{value:b.key}).update(b.key))});APA.Toolbox.reasonSelect.enable().show()},initialize:function(a,b,c){document.observe("dom:loaded",Object.extend(APA.Toolbox,{availableSimulations:a,objectSelect:$(b.object),stateSelect:$(b.state),reasonSelect:$(b.reason),labels:c}).fillSimulationObjects)}};APA.getSaveOrderParams=function(){var a="";if(APA.virtual){if($("checkout-agreements")){a+=Form.serialize($("checkout-agreements"))}}else{a=Form.serialize($("co-shipping-method-form"));if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}if($("sandbox-simulation")&&$("simulation_object").getValue()){a+="&"+Form.serialize($("sandbox-simulation"))}a.save=true;return a};
|
1 |
+
if(typeof APA=="undefined"){var APA={}}APA.Toolbox={clearSimulationObjects:function(){APA.Toolbox.objectSelect.descendants().each(Element.remove);APA.Toolbox.objectSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.object))},clearSimulationStates:function(){APA.Toolbox.stateSelect.descendants().each(Element.remove);APA.Toolbox.stateSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.state))},clearSimulationReasons:function(){APA.Toolbox.reasonSelect.descendants().each(Element.remove);APA.Toolbox.reasonSelect.hide().disable().insert(new Element("option",{value:""}).update(APA.Toolbox.labels.reason))},fillSimulationObjects:function(){APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates();APA.Toolbox.clearSimulationObjects();$H(APA.Toolbox.availableSimulations).each(function(a){APA.Toolbox.objectSelect.insert(new Element("option",{value:a.key}).update(a.key))});APA.Toolbox.objectSelect.enable().show();APA.Toolbox.objectSelect.observe("change",function(b){var a=APA.Toolbox.objectSelect.getValue();if(a&&typeof APA.Toolbox.availableSimulations[a]!="undefined"&&typeof APA.Toolbox.availableSimulations[a]["states"]!="undefined"){APA.Toolbox.fillSimulationStates(APA.Toolbox.availableSimulations[a]["states"])}else{APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates()}})},fillSimulationStates:function(a){APA.Toolbox.clearSimulationReasons();APA.Toolbox.clearSimulationStates();$H(a).each(function(b){APA.Toolbox.stateSelect.insert(new Element("option",{value:b.key}).update(b.key))});APA.Toolbox.stateSelect.enable().show();APA.Toolbox.stateSelect.observe("change",function(c){var b=APA.Toolbox.stateSelect.getValue();if(b&&typeof a[b]!="undefined"&&typeof a[b]["reasons"]!="undefined"){APA.Toolbox.fillSimulationReasons(a[b]["reasons"])}else{APA.Toolbox.clearSimulationReasons()}})},fillSimulationReasons:function(a){APA.Toolbox.clearSimulationReasons();$H(a).each(function(b){APA.Toolbox.reasonSelect.insert(new Element("option",{value:b.key}).update(b.key))});APA.Toolbox.reasonSelect.enable().show()},initialize:function(a,b,c){document.observe("dom:loaded",Object.extend(APA.Toolbox,{availableSimulations:a,objectSelect:$(b.object),stateSelect:$(b.state),reasonSelect:$(b.reason),labels:c}).fillSimulationObjects)}};APA.getSaveOrderParams=function(){var a="";if(APA.virtual){if($("checkout-agreements")){a+=Form.serialize($("checkout-agreements"))}}else{a=Form.serialize($("co-shipping-method-form"));if($("checkout-agreements")){a+="&"+Form.serialize($("checkout-agreements"))}}if(APA.reloaded){a+="&"+Object.toQueryString({reloaded:1})}if($("sandbox-simulation")&&$("simulation_object").getValue()){a+="&"+Form.serialize($("sandbox-simulation"))}a.save=true;return a};
|
package.xml
CHANGED
@@ -1,22 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Creativestyle_AmazonPayments</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Integration of your Magento shop with Login and Pay with Amazon service</summary>
|
10 |
<description>This extension provides an official integration of your Magento store with Login and Pay with Amazon service. It helps your customers shop quickly, safely and securely. Your customers can pay on your website without re-entering their payment and address details. All Amazon transactions are protected by Amazon's A-to-z Guarantee.</description>
|
11 |
-
<notes>ADDED:
|
12 |
-
|
13 |
-
FIXED: missing order item's original_price and base_original_price fields
|
14 |
-
FIXED: enabled "Place order" button issue when payment method is not selected
|
15 |
-
FIXED: disabled "Place order" button issue for virtual orders</notes>
|
16 |
<authors><author><name>creativestyle GmbH</name><user>creativestyle</user><email>amazon@creativestyle.de</email></author></authors>
|
17 |
-
<date>2015-
|
18 |
-
<time>
|
19 |
-
<contents><target name="magecommunity"><dir name="Creativestyle"><dir name="AmazonPayments"><dir name="Block"><file name="Abstract.php" hash="ce9a49bde52db0195d94bf409029b8c6"/><dir name="Adminhtml"><file name="CredentialsValidator.php" hash="bb62c178c7bba1dd30fa16f22394ec85"/><dir name="Debug"><dir name="Section"><file name="Table.php" hash="f6947e99e982164a220e3d82fa0f988f"/></dir><file name="Section.php" hash="a249d2fedeaa5e485e40ffaeeb0335c6"/></dir><file name="Debug.php" hash="cc798f2987cc0dffc755a88988b74912"/><file name="Info.php" hash="be764b1856eccc2b3070a1ea4cfe57f7"/><file name="IpnUrl.php" hash="f9a516356c4c9b98e02eb3761ad5bf90"/><dir name="Log"><file name="Abstract.php" hash="02887066c2d6973141dff769b385d8fa"/><dir name="Api"><file name="Grid.php" hash="8d072ba9ce4be99222c03a26680d51eb"/><file name="View.php" hash="eb30544643fa9571a454a763111d0113"/></dir><file name="Api.php" hash="5ea0736c83de5feb01df0a3ec4db4d80"/><dir name="Exception"><file name="Grid.php" hash="3c3decb0a90638d5e2b1617426ec9437"/><file name="View.php" hash="cae17d2a2d5716e8dde1c6662397131e"/></dir><file name="Exception.php" hash="c35dafcaf89ca709394341394862f4cf"/><dir name="Ipn"><file name="Grid.php" hash="74bb51ab562b09d42bd9ced6d6609ae1"/><file name="View.php" hash="6ab63414642658e95258a73a143e6955"/></dir><file name="Ipn.php" hash="a2225b081ccb354bfe94b4a646b0d521"/><dir name="View"><file name="Abstract.php" hash="0a4c977a1f89622148bdc6acc037fc1f"/></dir></dir><dir name="Renderer"><file name="Timestamp.php" hash="190325613c20e2cf97adc28950658e99"/></dir><dir name="Sales"><file name="Order.php" hash="45a5ee919501a2bf26160d38dafccd44"/></dir></dir><dir name="Button"><file name="Js.php" hash="29f5907c8898af60bdc78d957998da3f"/></dir><dir name="Checkout"><file name="Abstract.php" hash="db5cf0b3d9dd37ad4552987b9df5e09c"/><file name="Js.php" hash="0e5ba9b3f4ae06139a084816c04a05a3"/><file name="Notice.php" hash="3bd2869322fac80a80436f8e2daa8d70"/><file name="SandboxToolbox.php" hash="047b1bfde3f5469195b9a7ccfee3f16d"/></dir><file name="Checkout.php" hash="6620fc17c1c86deac47709664d6a93f7"/><dir name="Js"><file name="Interface.php" hash="11827746ff821b4cbda1ad041e30321e"/></dir><file name="Js.php" hash="8610dddee84cda450c4874e0fd93b5f5"/><dir name="Login"><file name="Abstract.php" hash="b84dfbbe66bbee39a547d33e856b4a8d"/><dir name="Account"><file name="Confirm.php" hash="ae8123a65a717a0046aaf1d9dc21f878"/><file name="Update.php" hash="8fdadae9294b17fbb0989f8d0e2016a4"/></dir><file name="Button.php" hash="bad55de20f480d53a15ddedd551ff6dd"/><file name="Js.php" hash="2d144b27681c48f2adfa8cd0fdd5d31e"/><file name="Redirect.php" hash="8634cf4f6bf792006e4ab7674b758e5c"/></dir><dir name="Onepage"><file name="Button.php" hash="b122db0163e8580f42679f13a3a45726"/></dir><dir name="Pay"><file name="Abstract.php" hash="2e96e1d4a1a0e2c74cee40a46a75241c"/><file name="Button.php" hash="b76cbc47c91b88ceb9fc1fde609fa2dc"/></dir><dir name="Payment"><file name="Info.php" hash="c6285a5688834b456765317d3471bf2a"/></dir></dir><file name="Exception.php" hash="ca655a29842b38dd2ebf438208a6c70c"/><dir name="Helper"><file name="Data.php" hash="450a80b5ff9ea28b201e16a1001ce3bb"/><file name="Debug.php" hash="782ae864f43f5bb85b439cf1a4c35334"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="1814fcd0d61599f15d808d9c2990ebe4"/><file name="Advanced.php" hash="f07d08dc5ca8fa80d2684a7726496a6e"/><file name="Ipn.php" hash="7796776a38fe90b9805cbd88094a773d"/><file name="Login.php" hash="d9297e66749c6930a1010a5babdfde14"/></dir><file name="Checkout.php" hash="0168673c83b49ad241f3ce52b31b487a"/><file name="Config.php" hash="e2cbdef344465a38aa5531d3c96964ea"/><dir name="Log"><file name="Collection.php" hash="13d71847c4e164af18636a3fe5bf975b"/></dir><file name="Logger.php" hash="0821a7d8ddeea993fe3ad9495ef6f9d9"/><dir name="Lookup"><file name="Abstract.php" hash="443bbef12f4e7c896e54cf0b7463e04e"/><file name="Authentication.php" hash="56e12ebde89bb29b59ac1153be4b10cc"/><dir name="Design"><dir name="Button"><dir name="Color"><file name="LoginPay.php" hash="e9a469e82c7805782cf7694c4d50af7a"/></dir><file name="Color.php" hash="81a33471dfefb27897f7b1ff19749671"/><dir name="Size"><file name="LoginPay.php" hash="6cdf3d3633617994783a38f30add86fe"/></dir><file name="Size.php" hash="7c73a97a0fa3f4c6a73b838c0594ad5c"/><dir name="Type"><file name="Login.php" hash="44e852189b0305bbe4cc38848316d4e6"/><file name="Pay.php" hash="5e6f65d1e355ed265787b28b12c6e7a6"/></dir></dir></dir><file name="Frequency.php" hash="5115fb39b48781e5e97f9b62414a72cc"/><file name="IpnActive.php" hash="b73000f5bfc1e26b80911e125e9eec46"/><file name="PaymentAction.php" hash="6d0c15996ec3caf112d88e07ea703bb4"/><file name="Region.php" hash="8f5cc8ab970aa165e16085368b320f89"/></dir><file name="Manager.php" hash="feac7709c9d079d0aaef8ffe9a2dc105"/><file name="Observer.php" hash="6e2bbef0df6a0fee9cdea222744f33aa"/><dir name="Payment"><file name="Abstract.php" hash="5667d8b7b4eae1f3b29e8fc6c043b9ce"/><dir name="Advanced"><file name="Abstract.php" hash="9b4709b93da48f60769899838b1230ee"/><file name="Sandbox.php" hash="a1509cd32ad92e6e6d3a8f348be1d3bb"/></dir><file name="Advanced.php" hash="72006ba9aaa96486f6d7505814ffaf54"/></dir><dir name="Service"><file name="Login.php" hash="99f99ff273e0cb6dea7b2053702bf323"/><file name="Quote.php" hash="3f83d1e1b1c6e19e0e23cb1a8c8b41f5"/></dir><file name="Simulator.php" hash="553bb0c0ca3c74202083b366f4c33e9a"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="DataPolling"><file name="Cron.php" hash="c3d3009775702bee14da3695f0d41f68"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="28e0ddedf23912140158d100339bdbe8"/><file name="DocumentationController.php" hash="4e214386e032b2e513dda5a26344fd87"/><dir name="Log"><file name="ApiController.php" hash="e0a9181f57223d3ba722982572c1d003"/><file name="ExceptionController.php" hash="5daaa04ec6479396edfb1f62910f4ad3"/><file name="IpnController.php" hash="f00870c68a6b18d460c59d0b76d4a67d"/></dir><file name="OrderController.php" hash="1293b8aa3851f09b7559306e37a6a6ea"/><file name="SystemController.php" hash="52c60fa39dba8582b4ca81c2f065dbc5"/></dir><dir name="Advanced"><file name="CheckoutController.php" hash="96d513f865adf67c980fbc2f3fb2ad29"/><file name="IpnController.php" hash="0d8a52a891d493870dd1081f9a407170"/><file name="LoginController.php" hash="284a5be104f8dccf36528824c7233df8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2dc1b70997469f8f0cd6a80eff845842"/><file name="config.xml" hash="dc297d5c2df24876bcffdb011c19fd51"/><file name="system.xml" hash="af68d1a5cc4f270c09385c0efde6c6fb"/></dir><dir name="sql"><dir name="amazonpayments_setup"><file name="mysql4-install-1.0.0.php" hash="d4681b9a39905cc9e9dcc660688dea85"/><file name="mysql4-upgrade-1.1.6-1.2.0.php" hash="27f8e108bac4268d3c17e812b413dbbc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="amazonpayments.xml" hash="4bc12228bba39bd925ed129d7cf64258"/></dir><dir name="template"><dir name="creativestyle"><dir name="amazonpayments"><dir name="advanced"><file name="documentation.phtml" hash="af3ae6ebce4712dd8fb972bef508ca55"/><dir name="log"><dir name="api"><file name="view.phtml" hash="92e2a91aa6f25e20fe8e89bad751e8cf"/></dir><dir name="exception"><file name="view.phtml" hash="c5d01f6de86e47d4da5dfabd60b1b382"/></dir><file name="js.phtml" hash="eb1d2098440a0bac2a6f5b959afa3693"/><dir name="notification"><file name="view.phtml" hash="31d893106f7c7c7f94f05d5cafa36440"/></dir></dir></dir><dir name="debug"><dir name="section"><file name="table.phtml" hash="f4bb8e35b3608cf0639407a3461c3717"/></dir><file name="section.phtml" hash="1472da0e9f07b5583a02e327483d4d75"/></dir><file name="debug.phtml" hash="9748d4fe92986f36ad47ae5b61fc4883"/><file name="info.phtml" hash="8f58e70d3d5974c60d182450b424e521"/><file name="init.phtml" hash="ba9d53045077e63b4e6c25c6b7bb685c"/><dir name="payment"><file name="info.phtml" hash="200af8569ab7792e7f16c5f4a93c6897"/><dir name="pdf"><file name="info.phtml" hash="1fb213f3fcc3aeecaa6305c07cff3b73"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="amazonpayments.xml" hash="7c1c1fc8f1476bb000c6b5cd60a46814"/></dir><dir name="template"><dir name="creativestyle"><dir name="amazonpayments"><dir name="button"><file name="js.phtml" hash="4eb92ecb1032a8f57c6b0230a333f88e"/></dir><dir name="checkout"><file name="capture_notice.phtml" hash="f9c75cd05a596d0a16c55f0169b4ee6c"/><file name="js.phtml" hash="71f1e2eb29af46959f268b7f0bc5e416"/><dir name="review"><file name="button.phtml" hash="1312572385c9ff653d283bb0c3f47b1b"/></dir><file name="sandbox_toolbox.phtml" hash="ff639266f99827e3ec3a9e8305bd7eb7"/><file name="shipping_method.phtml" hash="852008f89fc32c7af6c250cafdde5f51"/></dir><file name="checkout.phtml" hash="6873b347a7e10b3b5c35fda1b48345b1"/><file name="js.phtml" hash="13581f0bcdf7c39da46be530892e8183"/><dir name="login"><dir name="button"><file name="account_login.phtml" hash="0ce9b9d891af3f6c5b1c83a17d311e6b"/></dir><file name="button.phtml" hash="b5d66280337ecc895ae9a2bc48c469e4"/><dir name="form"><file name="account_confirm.phtml" hash="cff4c9f656b2e790bd65723d4e2042b9"/><file name="account_update.phtml" hash="64fdc50df3b3c49384d5d50a1da82d4d"/></dir><file name="js.phtml" hash="9d542e726fe51739b72fc2e509edadd8"/><file name="logout.phtml" hash="e8b6f4d39047903e4ee8d481ba59543b"/><file name="redirect.phtml" hash="8d395ab25504c0cdb928cf93e684b868"/></dir><dir name="onepage"><file name="button.phtml" hash="95e053ca57f36df23180af93b77a6557"/></dir><dir name="pay"><file name="button.phtml" hash="dfcccab45794c81d2d3ca52f709019d4"/></dir><dir name="payment"><file name="info.phtml" hash="3631896707e596d9675f526a7d021617"/><dir name="pdf"><file name="info.phtml" hash="69549bf3340c19d62f42a556f13e8a1e"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creativestyle_AmazonPayments.xml" hash="3d30f68b24829494a2a66164eba0e5f7"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Creativestyle_AmazonPayments.csv" hash="0ccc1deed1b65403353df371ce4856d2"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="ad694ba24051f779698d483bc32d9b75"/></dir></dir></dir><dir name="en_GB"><file name="Creativestyle_AmazonPayments.csv" hash="c686d95415778cc30a1e952fab6be4b7"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="1a933579acb1fbb3d78ae47ca990521b"/></dir></dir></dir><dir name="de_DE"><file name="Creativestyle_AmazonPayments.csv" hash="360b9295a2b7cc4848c1fd7f23f6c38d"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="4879ccbfbea101548700da52b058bd0b"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="creativestyle"><file name="apa_checkout.min.js" hash="6b5e1622447a83a19cda19d0f972a1f1"/><file name="apa_sandbox_toolbox.min.js" hash="43db69188712b5b4665b586fc70f39de"/><dir name="vendors"><file name="prism.js" hash="c700de3d980f7ef1e056dc5400acfd44"/></dir><file name="apa_checkout.js" hash="8aed5f631d0ce5dc269334cab236fc77"/></dir></dir></target><target name="magelib"><dir name="OffAmazonPayments"><file name="Model.php" hash="36434820209eb10952abc8e41259d96c"/></dir><dir name="OffAmazonPaymentsNotifications"><file name="Client.php" hash="3b2d2c969c03e774ff86fa876e12b278"/><dir name="Impl"><file name="Certificate.php" hash="3b49f95f652daa628a586c5d57a1b96f"/><file name="IpnNotificationParser.php" hash="41c7c75dfb26e2df9071263a464f4810"/><file name="Message.php" hash="d6a798d889d4fa1c6938b1493932925d"/><file name="OpenSslVerifySignature.php" hash="41ebc72238ef3eebe7741e21e18a9788"/><file name="SnsMessageParser.php" hash="7ebf58afecd5d3a3c859f6daf60b19c4"/><file name="SnsMessageValidator.php" hash="4d4a2452b4587d622926b6cfbfb4b179"/><file name="VerifySignature.php" hash="b03c485451a27ada7e67497988093e47"/><file name="XmlNotificationParser.php" hash="17ee03585854ed24eb4add7834e9f02d"/></dir><file name="Interface.php" hash="2c527d58c518632f8cc1b6a973c08e05"/><file name="InvalidCertificateException.php" hash="5412d2fc7ca03ac822bcb4066d558b50"/><file name="InvalidMessageException.php" hash="5fc7cb16c37c4cde49d87744c5a583c0"/><dir name="Model"><file name="AuthorizationDetails.php" hash="fccb851dc730850b8d185016dbca2590"/><file name="AuthorizationNotification.php" hash="80250048069681142a95cac51e3fa21c"/><file name="BillingAgreement.php" hash="087f904ec04b8c63a0120940f177c698"/><file name="BillingAgreementLimits.php" hash="801a01b85a09eababfa08b2186c44cd4"/><file name="BillingAgreementNotification.php" hash="dd8af8bd716a907f507c0dd885b3ed4c"/><file name="BillingAgreementStatus.php" hash="788a292faf04486d93b1f70b14cf156c"/><file name="CaptureDetails.php" hash="326a26f5b981710e4c6328cf1ea91459"/><file name="CaptureNotification.php" hash="50aaaf110b451b3a95e08a1525ec29c4"/><file name="IdList.php" hash="5c4b01c197bd17841dbba5ad37bd7b10"/><file name="IpnNotificationMetadata.php" hash="5e894a2584bbf0469ec73f32d7059ac6"/><file name="MerchantRegistrationDetails.php" hash="d4de7689d8e216567abd710dde7ef4ed"/><file name="NotificationImpl.php" hash="717df190c76f9d3b9a95999dbd962cd4"/><file name="NotificationMetadataImpl.php" hash="045d988afb0c21179d22e086e263a84d"/><file name="OrderItemCategories.php" hash="143c9a7a5d0e048fd8f3d35d7193699c"/><file name="OrderReference.php" hash="aa46198885e00b987c4b19c316920b9a"/><file name="OrderReferenceNotification.php" hash="5757807850c3afa08dd17a49803f317a"/><file name="OrderReferenceStatus.php" hash="91332f4bb02b984d57a6c519df3f90ed"/><file name="OrderTotal.php" hash="9414289b9477ffe27d3dfd0511aa0729"/><file name="Price.php" hash="f8c2a436b7244bc026078fd02887da82"/><file name="ProviderCreditDetails.php" hash="d355185842eb0816de151fb535b14edc"/><file name="ProviderCreditNotification.php" hash="833ef1e2383d6a97a28b1d61d352e824"/><file name="ProviderCreditReversalDetails.php" hash="a789bbf3c7074bc800053967e64286c7"/><file name="ProviderCreditReversalNotification.php" hash="84a36f2d6157424a571ddada073b2be5"/><file name="ProviderCreditReversalSummary.php" hash="1f9cd50005ade77d793a15e029b3cf69"/><file name="ProviderCreditReversalSummaryList.php" hash="6d3a3913ea433fa54ac34197825354ff"/><file name="ProviderCreditSummary.php" hash="4403e12b73867b58021655df3fcf6720"/><file name="ProviderCreditSummaryList.php" hash="8a5a83e94ce75fc3992f98525d47765d"/><file name="RefundDetails.php" hash="4b2dacdc4ce32db6b6dff7613e5b6098"/><file name="RefundNotification.php" hash="55225faad22f6a5b9b44603239488ebb"/><file name="SellerBillingAgreementAttributes.php" hash="c772791d5522be53415d339e169c6a12"/><file name="SellerOrderAttributes.php" hash="116f00df52e1cc7d9b0a23c58dc0c93d"/><file name="SnsNotificationMetadata.php" hash="79a8aacd35588ce20daea2d8ded574ac"/><file name="SolutionProviderMerchantNotification.php" hash="d5829f16e032db871798f1ba45732f39"/><file name="SolutionProviderOption.php" hash="df8fbbb1ad2fef1796e3b42a9a417a64"/><file name="SolutionProviderOptions.php" hash="8f5f0e7415bb9dfc5dfafaab236d91df"/><file name="Status.php" hash="5ac5d81fafbb7a45c7ef67b7d61e3ccf"/></dir><file name="Notification.php" hash="f14f5fded3845499c03ed011ff115b13"/><file name="NotificationMetadata.php" hash="fcbdda900353d35a850ab518c24506ca"/></dir><dir name="OffAmazonPaymentsService"><file name="Client.php" hash="bba604078e0d7491ee6dbcce80258aea"/><file name="Environments.php" hash="5c469c72e7e1fc24eeda2b6a22917d77"/><file name="Exception.php" hash="965ca3466457e04d79ee9250fc946803"/><file name="Interface.php" hash="822113682cd65aa8b02f61f18ab07984"/><file name="MerchantValues.php" hash="ef10d79a38b3ae5ded1c2ed9d55e1f6c"/><dir name="Model"><file name="Address.php" hash="2cac12c7465df053c1fbfebd7c0c3e4b"/><file name="AuthorizationDetails.php" hash="9ef03efd7eb35c2f1c764e60a7492be6"/><file name="AuthorizeOnBillingAgreementRequest.php" hash="08084c850ebbc53f1a691fec0db5d011"/><file name="AuthorizeOnBillingAgreementResponse.php" hash="c2bc2dab6950c7a6be5ec3c55b71b4f9"/><file name="AuthorizeOnBillingAgreementResult.php" hash="b52d0c0ad908617cbd39345aba54882b"/><file name="AuthorizeRequest.php" hash="d01f4a32ec8e57a44a0804ba7350bfef"/><file name="AuthorizeResponse.php" hash="ccbb769ef3012724c48b1d76acd6e0ef"/><file name="AuthorizeResult.php" hash="a90eaf3bb2a12a6945407c01a0f967d0"/><file name="BillingAddress.php" hash="9d3881a26603f1392f9b93b55a8a8a5a"/><file name="BillingAgreementAttributes.php" hash="30046b148b8a7b4cd6026ebd0fc482b5"/><file name="BillingAgreementDetails.php" hash="9b9d0d8722afa825d45f98b9c5cece6e"/><file name="BillingAgreementLimits.php" hash="9984271b285397d7e08322c91d9ccd08"/><file name="BillingAgreementStatus.php" hash="f3a6ac460a66e62a4e5cff1f966e1a4a"/><file name="Buyer.php" hash="10df01a4c7815bf4760e56308957351a"/><file name="CancelOrderReferenceRequest.php" hash="2a1aea8fad7cf8a87d2a9f6ff6fcea78"/><file name="CancelOrderReferenceResponse.php" hash="c3f81641827af137bf4a6010e58bb62c"/><file name="CancelOrderReferenceResult.php" hash="504557ccf47b0b5b6a071f138ba962f0"/><file name="CaptureDetails.php" hash="f907d38d2148b1c1703d6f1a3d958f34"/><file name="CaptureRequest.php" hash="f2ddfd0218c81f234b0ba05c74efe1dd"/><file name="CaptureResponse.php" hash="6faf1938d380ebaeb6fcf1ff6e865624"/><file name="CaptureResult.php" hash="f174ee46f021bd40751e0d63245bd850"/><file name="CloseAuthorizationRequest.php" hash="07191ba72e4eee57553ecd41e15f779d"/><file name="CloseAuthorizationResponse.php" hash="70e8e86c4edbfb2f96ec139560636494"/><file name="CloseAuthorizationResult.php" hash="2c406dd340ef5b838a37a75aabb4f149"/><file name="CloseBillingAgreementRequest.php" hash="c80b8e3cb690595dc72c3924f5e7a13f"/><file name="CloseBillingAgreementResponse.php" hash="8994fb56dc5f487302937c1395d0963d"/><file name="CloseBillingAgreementResult.php" hash="10517589598754b0e58be29c5082c3ce"/><file name="CloseOrderReferenceRequest.php" hash="523c2061c026540e0189872e87ed1af1"/><file name="CloseOrderReferenceResponse.php" hash="fd13d871e69eb5413526c19cf5f66de8"/><file name="CloseOrderReferenceResult.php" hash="0e5afd3aa795bf82684c0f40744e2e04"/><file name="ConfirmBillingAgreementRequest.php" hash="098e7fd225da377b14799a0957991d0a"/><file name="ConfirmBillingAgreementResponse.php" hash="54327b4909053fc3fc65197e796c5d59"/><file name="ConfirmBillingAgreementResult.php" hash="f1ab41657391d37de4148fa07b0849da"/><file name="ConfirmOrderReferenceRequest.php" hash="c0667576d46907f0965c89a36e5dc1aa"/><file name="ConfirmOrderReferenceResponse.php" hash="497d3a7f3710ece7bd1a25fd5261707f"/><file name="Constraint.php" hash="5dfaa3ce9fb9c0fe8a1f20e24a053f6e"/><file name="Constraints.php" hash="e831530f17d7df39cc03bceaafed0216"/><file name="CreateOrderReferenceForIdRequest.php" hash="84a50944a1e0d58bd1e77306f1f7ada7"/><file name="CreateOrderReferenceForIdResponse.php" hash="3b9d3020b2e874f191e0083203d46723"/><file name="CreateOrderReferenceForIdResult.php" hash="46f720aea9c58694b2ca4b81142abcfa"/><file name="Destination.php" hash="4da36642b21ab96ab6bdee10781d8d07"/><file name="Error.php" hash="a0b83f2bc8edc3e503efae6d98ecb464"/><file name="ErrorResponse.php" hash="00391c711283b2fd5a6859f6a341cbbf"/><file name="GetAuthorizationDetailsRequest.php" hash="fdfeafa306e64b92325972b67bb12f92"/><file name="GetAuthorizationDetailsResponse.php" hash="eae478e879b021b30e22188af50c2e2c"/><file name="GetAuthorizationDetailsResult.php" hash="270d0ebb53cf595593a72ba29ca3d1f0"/><file name="GetBillingAgreementDetailsRequest.php" hash="e8124ac8d748b26642456c090a86463b"/><file name="GetBillingAgreementDetailsResponse.php" hash="5e05dd77c3b176b303af9711eeea97fd"/><file name="GetBillingAgreementDetailsResult.php" hash="b320ede4586359d2b5f1f1d7333b2743"/><file name="GetCaptureDetailsRequest.php" hash="b4d9e5414e63840b87c97a1d5f8ec9bb"/><file name="GetCaptureDetailsResponse.php" hash="049306e3f85755114fb033732111c613"/><file name="GetCaptureDetailsResult.php" hash="ab7ccba1bfaf183205a2a5a7c495fd19"/><file name="GetOrderReferenceDetailsRequest.php" hash="21d60f781305cf963ea2a40099decdf7"/><file name="GetOrderReferenceDetailsResponse.php" hash="eebbc1b4482d78a0d3d57bbf8d1c5a66"/><file name="GetOrderReferenceDetailsResult.php" hash="f4425bd39c8279e66f4c9052d452925d"/><file name="GetProviderCreditDetailsRequest.php" hash="1b613acafc8f66e0385379705bcf664c"/><file name="GetProviderCreditDetailsResponse.php" hash="9fcdbd8af985e96579c93378259c5e4a"/><file name="GetProviderCreditDetailsResult.php" hash="3a660d2ad0f6528e16f554987caf9a51"/><file name="GetProviderCreditReversalDetailsRequest.php" hash="592caa40f517ed1cfc66dd9a12e9bac3"/><file name="GetProviderCreditReversalDetailsResponse.php" hash="85d1fb8584f14d443cf7e4956c3dd03f"/><file name="GetProviderCreditReversalDetailsResult.php" hash="06effa515f870d1bd5fff7bc62a1d752"/><file name="GetRefundDetailsRequest.php" hash="a433b45ba3dc2894042d2e8072286bd1"/><file name="GetRefundDetailsResponse.php" hash="58771173d1a1c43f2a8a9f5515f4823b"/><file name="GetRefundDetailsResult.php" hash="0d51a779b95371ad425a4c9bc0aa6f82"/><file name="IdList.php" hash="a7a531e733a67f5a320bdb77c6ebd1a6"/><file name="OrderItemCategories.php" hash="1ed3edbf18fda5819ace2284bff49c15"/><file name="OrderReferenceAttributes.php" hash="d3d2d00f6626ab2116553cf2d266bb38"/><file name="OrderReferenceDetails.php" hash="a3ae5a3c4a6d5b8b3fa4f84593d1c33a"/><file name="OrderReferenceStatus.php" hash="5605fd30208a09dedea1aab688d92f49"/><file name="OrderTotal.php" hash="3ba85975c17821e7b72710b713f48f93"/><file name="ParentDetails.php" hash="b0d8bc8245fc4f8e75842e7c48e5b174"/><file name="Price.php" hash="ebd5fe74f1840f7804b3f869ce25384b"/><file name="ProviderCredit.php" hash="331663826ea8f444d5b0c05c59d69874"/><file name="ProviderCreditDetails.php" hash="0b916937d2397ad51d0dc1b0cf86777b"/><file name="ProviderCreditList.php" hash="3467cfe1dc096d07c33e2fadb3cb90d1"/><file name="ProviderCreditReversal.php" hash="b965141481deddd3b8e1c48a68d8c292"/><file name="ProviderCreditReversalDetails.php" hash="aaf5a41e7d6aba6758b5c24de2affe4d"/><file name="ProviderCreditReversalList.php" hash="47ff9cee9313ea98b23cec3257fdd704"/><file name="ProviderCreditReversalSummary.php" hash="decb86a0305f061206625dea1c8aacdb"/><file name="ProviderCreditReversalSummaryList.php" hash="4948d8e2034b7e60fc7157d7be149ea1"/><file name="ProviderCreditSummary.php" hash="06f9ad261e09b3709107d074604a1227"/><file name="ProviderCreditSummaryList.php" hash="28652df460f09e5d907d0c07f98b1b8f"/><file name="RefundDetails.php" hash="e12c1a6a49bda599d628e382de6f8874"/><file name="RefundRequest.php" hash="1e6f8500871cbae8b1d57a7a853cd298"/><file name="RefundResponse.php" hash="f2af68623a6f37a0f0227ea9e648603f"/><file name="RefundResult.php" hash="2b73f810b388d8ea30ded964bb1d1644"/><file name="ResponseHeaderMetadata.php" hash="4305e32c733bf48b2e34b2de0f0eee7f"/><file name="ResponseMetadata.php" hash="c5efe1da81e4a9fa3c76b9901c90f9fe"/><file name="ReverseProviderCreditRequest.php" hash="51af6c8b7e31efd4fffafd83994fbc63"/><file name="ReverseProviderCreditResponse.php" hash="3a959a1b22156ddb81e2eed9e02a0da4"/><file name="ReverseProviderCreditResult.php" hash="6dc02bb8141e136a55d28034add4b101"/><file name="SellerBillingAgreementAttributes.php" hash="0c1c845a25dbcd724d0c6ca2a8e07ab4"/><file name="SellerOrderAttributes.php" hash="326ac3910572ddfcc88d467e837283af"/><file name="SetBillingAgreementDetailsRequest.php" hash="19522c9d1290c1ae63e22902cd1655d9"/><file name="SetBillingAgreementDetailsResponse.php" hash="029e631097cb557f2a44ccc0f108aeae"/><file name="SetBillingAgreementDetailsResult.php" hash="4006851ac3799e4ee89fe6665e78be66"/><file name="SetOrderReferenceDetailsRequest.php" hash="61de911c937a20dc795727ca66a90b89"/><file name="SetOrderReferenceDetailsResponse.php" hash="e2bcd0495e0249c654a3cfedc0e3697e"/><file name="SetOrderReferenceDetailsResult.php" hash="ad903a104466558226f58e790a2bb061"/><file name="Status.php" hash="92253830c1eeb08094f5eca6506a0b0f"/><file name="ValidateBillingAgreementRequest.php" hash="b3a0ae148f92a2b0132af201f49c98d4"/><file name="ValidateBillingAgreementResponse.php" hash="c3866b3ffa85037b5c070ffed2d6cf06"/><file name="ValidateBillingAgreementResult.php" hash="2c96a303ad608eb9c840971c374125f4"/></dir><file name="Model.php" hash="7452a81d314d6212937d79e71b040e01"/><file name="RegionSpecificProperties.php" hash="4cad5116fb2608d5000c0e9aed5bace9"/><file name="Regions.php" hash="849549c7834fac2fb94749276eabeb97"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments.css" hash="a1f07a48b8de6d1fa9391a4eed2f12be"/><file name="amazonpayments-highlight.css" hash="f6daf03c989ac56ad436300b5520f0df"/></dir><dir name="images"><file name="amazon-payments-advanced-creativestyle-logo.png" hash="bb507d0085dab135ac313b8068515620"/><file name="amazon-payments-advanced-creativestyle-header-logo.png" hash="1f17fc7a61f8aaf929000d1d87f7d943"/><file name="amazon-payments-advanced-creativestyle-header-logo-white.png" hash="4ce4ba0d8d210a26caa380217804e200"/><file name="amazon-payments-advanced-header.png" hash="60f587870fbdb1242368c8c3b553bd8c"/><file name="amazon-payments-advanced-section.png" hash="8bc620f345eb46c920c51875d4cfad7c"/><file name="logo_a-glyph_16.png" hash="44a3f5f0013cab34d26653eb48b989fc"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments.css" hash="98669e803a468cc7e01d481ce1647a0e"/><file name="amazonpayments-widgets.css" hash="35704192aaeb204e407e8b853c118d16"/><file name="amazonpayments-responsive-widgets.css" hash="ffca5cdc8a4e0585946c78258044c471"/></dir><dir name="images"><file name="amazon-loading-large.gif" hash="5f6d83bf2b69ab73c7e48ec9b66d54db"/><file name="logo_a-glyph_1x.png" hash="5d44ca86985afbb2a47b9265053a456e"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments-responsive-widgets.css" hash="389d23ee96bb5305f7ba5b616d930846"/></dir></dir></dir></dir></dir></target></contents>
|
20 |
<compatible/>
|
21 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>dom</name><min/><max/></extension><extension><name>curl</name><min/><max/></extension></required></dependencies>
|
22 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Creativestyle_AmazonPayments</name>
|
4 |
+
<version>1.6.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Integration of your Magento shop with Login and Pay with Amazon service</summary>
|
10 |
<description>This extension provides an official integration of your Magento store with Login and Pay with Amazon service. It helps your customers shop quickly, safely and securely. Your customers can pay on your website without re-entering their payment and address details. All Amazon transactions are protected by Amazon's A-to-z Guarantee.</description>
|
11 |
+
<notes>ADDED: synchronous authorization
|
12 |
+
ADDED: initial order status config option</notes>
|
|
|
|
|
|
|
13 |
<authors><author><name>creativestyle GmbH</name><user>creativestyle</user><email>amazon@creativestyle.de</email></author></authors>
|
14 |
+
<date>2015-03-19</date>
|
15 |
+
<time>01:08:41</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Creativestyle"><dir name="AmazonPayments"><dir name="Block"><file name="Abstract.php" hash="ce9a49bde52db0195d94bf409029b8c6"/><dir name="Adminhtml"><file name="CredentialsValidator.php" hash="bb62c178c7bba1dd30fa16f22394ec85"/><dir name="Debug"><dir name="Section"><file name="Table.php" hash="f6947e99e982164a220e3d82fa0f988f"/></dir><file name="Section.php" hash="a249d2fedeaa5e485e40ffaeeb0335c6"/></dir><file name="Debug.php" hash="cc798f2987cc0dffc755a88988b74912"/><file name="Info.php" hash="be764b1856eccc2b3070a1ea4cfe57f7"/><file name="IpnUrl.php" hash="f9a516356c4c9b98e02eb3761ad5bf90"/><dir name="Log"><file name="Abstract.php" hash="02887066c2d6973141dff769b385d8fa"/><dir name="Api"><file name="Grid.php" hash="8d072ba9ce4be99222c03a26680d51eb"/><file name="View.php" hash="eb30544643fa9571a454a763111d0113"/></dir><file name="Api.php" hash="5ea0736c83de5feb01df0a3ec4db4d80"/><dir name="Exception"><file name="Grid.php" hash="3c3decb0a90638d5e2b1617426ec9437"/><file name="View.php" hash="cae17d2a2d5716e8dde1c6662397131e"/></dir><file name="Exception.php" hash="c35dafcaf89ca709394341394862f4cf"/><dir name="Ipn"><file name="Grid.php" hash="74bb51ab562b09d42bd9ced6d6609ae1"/><file name="View.php" hash="6ab63414642658e95258a73a143e6955"/></dir><file name="Ipn.php" hash="a2225b081ccb354bfe94b4a646b0d521"/><dir name="View"><file name="Abstract.php" hash="0a4c977a1f89622148bdc6acc037fc1f"/></dir></dir><dir name="Renderer"><file name="Timestamp.php" hash="190325613c20e2cf97adc28950658e99"/></dir><dir name="Sales"><file name="Order.php" hash="45a5ee919501a2bf26160d38dafccd44"/></dir></dir><dir name="Button"><file name="Js.php" hash="29f5907c8898af60bdc78d957998da3f"/></dir><dir name="Checkout"><file name="Abstract.php" hash="db5cf0b3d9dd37ad4552987b9df5e09c"/><file name="Js.php" hash="0e5ba9b3f4ae06139a084816c04a05a3"/><file name="Notice.php" hash="3bd2869322fac80a80436f8e2daa8d70"/><file name="SandboxToolbox.php" hash="047b1bfde3f5469195b9a7ccfee3f16d"/></dir><file name="Checkout.php" hash="6620fc17c1c86deac47709664d6a93f7"/><dir name="Js"><file name="Interface.php" hash="11827746ff821b4cbda1ad041e30321e"/></dir><file name="Js.php" hash="8610dddee84cda450c4874e0fd93b5f5"/><dir name="Login"><file name="Abstract.php" hash="b84dfbbe66bbee39a547d33e856b4a8d"/><dir name="Account"><file name="Confirm.php" hash="ae8123a65a717a0046aaf1d9dc21f878"/><file name="Update.php" hash="8fdadae9294b17fbb0989f8d0e2016a4"/></dir><file name="Button.php" hash="bad55de20f480d53a15ddedd551ff6dd"/><file name="Js.php" hash="2d144b27681c48f2adfa8cd0fdd5d31e"/><file name="Redirect.php" hash="8634cf4f6bf792006e4ab7674b758e5c"/></dir><dir name="Onepage"><file name="Button.php" hash="b122db0163e8580f42679f13a3a45726"/></dir><dir name="Pay"><file name="Abstract.php" hash="2e96e1d4a1a0e2c74cee40a46a75241c"/><file name="Button.php" hash="b76cbc47c91b88ceb9fc1fde609fa2dc"/></dir><dir name="Payment"><file name="Info.php" hash="c6285a5688834b456765317d3471bf2a"/></dir></dir><dir name="Exception"><dir name="InvalidStatus"><file name="Recoverable.php" hash="dc4d8857cf1841bb56f6da11cf92e99e"/></dir><file name="InvalidStatus.php" hash="614d45747601dea035ff2a3faadd7e18"/></dir><file name="Exception.php" hash="ca655a29842b38dd2ebf438208a6c70c"/><dir name="Helper"><file name="Data.php" hash="65a72f769e4c95f196eff518d4bd0d82"/><file name="Debug.php" hash="782ae864f43f5bb85b439cf1a4c35334"/></dir><dir name="Model"><dir name="Api"><file name="Abstract.php" hash="1814fcd0d61599f15d808d9c2990ebe4"/><file name="Advanced.php" hash="2c2359c3969f43a7e7024325d0fdbce8"/><file name="Ipn.php" hash="7796776a38fe90b9805cbd88094a773d"/><file name="Login.php" hash="d9297e66749c6930a1010a5babdfde14"/></dir><file name="Checkout.php" hash="593935995a788c113d14fbba9bce9dc5"/><file name="Config.php" hash="9ea3d65a08e6c2024bca16e1f38a2634"/><dir name="Log"><file name="Collection.php" hash="13d71847c4e164af18636a3fe5bf975b"/></dir><file name="Logger.php" hash="0821a7d8ddeea993fe3ad9495ef6f9d9"/><dir name="Lookup"><file name="Abstract.php" hash="443bbef12f4e7c896e54cf0b7463e04e"/><file name="Authentication.php" hash="56e12ebde89bb29b59ac1153be4b10cc"/><file name="AuthorizationMode.php" hash="b26806dc71de6b55bc37b20a1b804364"/><dir name="Design"><dir name="Button"><dir name="Color"><file name="LoginPay.php" hash="e9a469e82c7805782cf7694c4d50af7a"/></dir><file name="Color.php" hash="81a33471dfefb27897f7b1ff19749671"/><dir name="Size"><file name="LoginPay.php" hash="6cdf3d3633617994783a38f30add86fe"/></dir><file name="Size.php" hash="7c73a97a0fa3f4c6a73b838c0594ad5c"/><dir name="Type"><file name="Login.php" hash="44e852189b0305bbe4cc38848316d4e6"/><file name="Pay.php" hash="5e6f65d1e355ed265787b28b12c6e7a6"/></dir></dir></dir><file name="Frequency.php" hash="5115fb39b48781e5e97f9b62414a72cc"/><file name="IpnActive.php" hash="b73000f5bfc1e26b80911e125e9eec46"/><file name="PaymentAction.php" hash="6d0c15996ec3caf112d88e07ea703bb4"/><file name="Region.php" hash="8f5cc8ab970aa165e16085368b320f89"/></dir><file name="Manager.php" hash="feac7709c9d079d0aaef8ffe9a2dc105"/><file name="Mapper.php" hash="df64a034c955111ea4295ad83043fdb7"/><file name="Observer.php" hash="9f2a3aa15381483624ed4027112572db"/><dir name="Payment"><file name="Abstract.php" hash="52233ddb29cb3ef23e33364d5c4713f3"/><dir name="Advanced"><file name="Abstract.php" hash="9b4709b93da48f60769899838b1230ee"/><file name="Sandbox.php" hash="10e80bd587f2d27fc97bb6e595936b82"/></dir><file name="Advanced.php" hash="15c5dde1d3a82a9bdf01e1681c47ec3b"/></dir><file name="Processor.php" hash="7187d35e41489c357e0d853cb726ad4d"/><dir name="Service"><file name="Login.php" hash="99f99ff273e0cb6dea7b2053702bf323"/><file name="Quote.php" hash="d566370281e690ca31f3ddd47c21ef1d"/></dir><file name="Simulator.php" hash="553bb0c0ca3c74202083b366f4c33e9a"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="DataPolling"><file name="Cron.php" hash="c3d3009775702bee14da3695f0d41f68"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="28e0ddedf23912140158d100339bdbe8"/><file name="DocumentationController.php" hash="4e214386e032b2e513dda5a26344fd87"/><dir name="Log"><file name="ApiController.php" hash="e0a9181f57223d3ba722982572c1d003"/><file name="ExceptionController.php" hash="5daaa04ec6479396edfb1f62910f4ad3"/><file name="IpnController.php" hash="f00870c68a6b18d460c59d0b76d4a67d"/></dir><file name="OrderController.php" hash="b8def9d164db295d0c5536c194237d84"/><file name="SystemController.php" hash="52c60fa39dba8582b4ca81c2f065dbc5"/></dir><dir name="Advanced"><file name="CheckoutController.php" hash="2f80227774f7fac74b545ef47030423d"/><file name="IpnController.php" hash="0d8a52a891d493870dd1081f9a407170"/><file name="LoginController.php" hash="284a5be104f8dccf36528824c7233df8"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2dc1b70997469f8f0cd6a80eff845842"/><file name="config.xml" hash="e78d96a109b9a682fb5359e2bd1dd6be"/><file name="system.xml" hash="46a57e809ec61cb902e0926789e988c7"/></dir><dir name="sql"><dir name="amazonpayments_setup"><file name="mysql4-install-1.0.0.php" hash="d4681b9a39905cc9e9dcc660688dea85"/><file name="mysql4-upgrade-1.1.6-1.2.0.php" hash="27f8e108bac4268d3c17e812b413dbbc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="amazonpayments.xml" hash="4bc12228bba39bd925ed129d7cf64258"/></dir><dir name="template"><dir name="creativestyle"><dir name="amazonpayments"><dir name="advanced"><file name="documentation.phtml" hash="af3ae6ebce4712dd8fb972bef508ca55"/><dir name="log"><dir name="api"><file name="view.phtml" hash="92e2a91aa6f25e20fe8e89bad751e8cf"/></dir><dir name="exception"><file name="view.phtml" hash="c5d01f6de86e47d4da5dfabd60b1b382"/></dir><file name="js.phtml" hash="eb1d2098440a0bac2a6f5b959afa3693"/><dir name="notification"><file name="view.phtml" hash="31d893106f7c7c7f94f05d5cafa36440"/></dir></dir></dir><dir name="debug"><dir name="section"><file name="table.phtml" hash="f4bb8e35b3608cf0639407a3461c3717"/></dir><file name="section.phtml" hash="1472da0e9f07b5583a02e327483d4d75"/></dir><file name="debug.phtml" hash="9748d4fe92986f36ad47ae5b61fc4883"/><file name="info.phtml" hash="8f58e70d3d5974c60d182450b424e521"/><file name="init.phtml" hash="ba9d53045077e63b4e6c25c6b7bb685c"/><dir name="payment"><file name="info.phtml" hash="200af8569ab7792e7f16c5f4a93c6897"/><dir name="pdf"><file name="info.phtml" hash="1fb213f3fcc3aeecaa6305c07cff3b73"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="amazonpayments.xml" hash="7c1c1fc8f1476bb000c6b5cd60a46814"/></dir><dir name="template"><dir name="creativestyle"><dir name="amazonpayments"><dir name="button"><file name="js.phtml" hash="4eb92ecb1032a8f57c6b0230a333f88e"/></dir><dir name="checkout"><file name="capture_notice.phtml" hash="f9c75cd05a596d0a16c55f0169b4ee6c"/><file name="js.phtml" hash="71f1e2eb29af46959f268b7f0bc5e416"/><dir name="review"><file name="button.phtml" hash="1312572385c9ff653d283bb0c3f47b1b"/></dir><file name="sandbox_toolbox.phtml" hash="ff639266f99827e3ec3a9e8305bd7eb7"/><file name="shipping_method.phtml" hash="852008f89fc32c7af6c250cafdde5f51"/></dir><file name="checkout.phtml" hash="6873b347a7e10b3b5c35fda1b48345b1"/><file name="js.phtml" hash="13581f0bcdf7c39da46be530892e8183"/><dir name="login"><dir name="button"><file name="account_login.phtml" hash="0ce9b9d891af3f6c5b1c83a17d311e6b"/></dir><file name="button.phtml" hash="b5d66280337ecc895ae9a2bc48c469e4"/><dir name="form"><file name="account_confirm.phtml" hash="cff4c9f656b2e790bd65723d4e2042b9"/><file name="account_update.phtml" hash="64fdc50df3b3c49384d5d50a1da82d4d"/></dir><file name="js.phtml" hash="9d542e726fe51739b72fc2e509edadd8"/><file name="logout.phtml" hash="e8b6f4d39047903e4ee8d481ba59543b"/><file name="redirect.phtml" hash="8d395ab25504c0cdb928cf93e684b868"/></dir><dir name="onepage"><file name="button.phtml" hash="95e053ca57f36df23180af93b77a6557"/></dir><dir name="pay"><file name="button.phtml" hash="dfcccab45794c81d2d3ca52f709019d4"/></dir><dir name="payment"><file name="info.phtml" hash="3631896707e596d9675f526a7d021617"/><dir name="pdf"><file name="info.phtml" hash="69549bf3340c19d62f42a556f13e8a1e"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creativestyle_AmazonPayments.xml" hash="3d30f68b24829494a2a66164eba0e5f7"/></dir></target><target name="magelocale"><dir name="en_US"><file name="Creativestyle_AmazonPayments.csv" hash="85bdadb798a0fb92e9423fab4bffb5ee"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="ad694ba24051f779698d483bc32d9b75"/></dir></dir></dir><dir name="en_GB"><file name="Creativestyle_AmazonPayments.csv" hash="d6246a04524c0b4bb038ad3d75fd023e"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="1a933579acb1fbb3d78ae47ca990521b"/></dir></dir></dir><dir name="de_DE"><file name="Creativestyle_AmazonPayments.csv" hash="dd65389283b888d868afb7a2fd9a3c12"/><dir name="template"><dir name="email"><file name="amazon_payments_failed.html" hash="4879ccbfbea101548700da52b058bd0b"/></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="creativestyle"><file name="apa_checkout.min.js" hash="5cc918fcd6b6858f9f1bdcd2936a9332"/><file name="apa_sandbox_toolbox.min.js" hash="9c04a2cae7d749b99e70036676e57019"/><dir name="vendors"><file name="prism.js" hash="c700de3d980f7ef1e056dc5400acfd44"/></dir><file name="apa_checkout.js" hash="897599282955169727aa8673324b0beb"/></dir></dir></target><target name="magelib"><dir name="OffAmazonPayments"><file name="Model.php" hash="36434820209eb10952abc8e41259d96c"/></dir><dir name="OffAmazonPaymentsNotifications"><file name="Client.php" hash="3b2d2c969c03e774ff86fa876e12b278"/><dir name="Impl"><file name="Certificate.php" hash="3b49f95f652daa628a586c5d57a1b96f"/><file name="IpnNotificationParser.php" hash="41c7c75dfb26e2df9071263a464f4810"/><file name="Message.php" hash="d6a798d889d4fa1c6938b1493932925d"/><file name="OpenSslVerifySignature.php" hash="41ebc72238ef3eebe7741e21e18a9788"/><file name="SnsMessageParser.php" hash="7ebf58afecd5d3a3c859f6daf60b19c4"/><file name="SnsMessageValidator.php" hash="4d4a2452b4587d622926b6cfbfb4b179"/><file name="VerifySignature.php" hash="b03c485451a27ada7e67497988093e47"/><file name="XmlNotificationParser.php" hash="17ee03585854ed24eb4add7834e9f02d"/></dir><file name="Interface.php" hash="2c527d58c518632f8cc1b6a973c08e05"/><file name="InvalidCertificateException.php" hash="5412d2fc7ca03ac822bcb4066d558b50"/><file name="InvalidMessageException.php" hash="5fc7cb16c37c4cde49d87744c5a583c0"/><dir name="Model"><file name="AuthorizationDetails.php" hash="fccb851dc730850b8d185016dbca2590"/><file name="AuthorizationNotification.php" hash="80250048069681142a95cac51e3fa21c"/><file name="BillingAgreement.php" hash="087f904ec04b8c63a0120940f177c698"/><file name="BillingAgreementLimits.php" hash="801a01b85a09eababfa08b2186c44cd4"/><file name="BillingAgreementNotification.php" hash="dd8af8bd716a907f507c0dd885b3ed4c"/><file name="BillingAgreementStatus.php" hash="788a292faf04486d93b1f70b14cf156c"/><file name="CaptureDetails.php" hash="326a26f5b981710e4c6328cf1ea91459"/><file name="CaptureNotification.php" hash="50aaaf110b451b3a95e08a1525ec29c4"/><file name="IdList.php" hash="5c4b01c197bd17841dbba5ad37bd7b10"/><file name="IpnNotificationMetadata.php" hash="5e894a2584bbf0469ec73f32d7059ac6"/><file name="MerchantRegistrationDetails.php" hash="d4de7689d8e216567abd710dde7ef4ed"/><file name="NotificationImpl.php" hash="717df190c76f9d3b9a95999dbd962cd4"/><file name="NotificationMetadataImpl.php" hash="045d988afb0c21179d22e086e263a84d"/><file name="OrderItemCategories.php" hash="143c9a7a5d0e048fd8f3d35d7193699c"/><file name="OrderReference.php" hash="aa46198885e00b987c4b19c316920b9a"/><file name="OrderReferenceNotification.php" hash="5757807850c3afa08dd17a49803f317a"/><file name="OrderReferenceStatus.php" hash="91332f4bb02b984d57a6c519df3f90ed"/><file name="OrderTotal.php" hash="9414289b9477ffe27d3dfd0511aa0729"/><file name="Price.php" hash="f8c2a436b7244bc026078fd02887da82"/><file name="ProviderCreditDetails.php" hash="d355185842eb0816de151fb535b14edc"/><file name="ProviderCreditNotification.php" hash="833ef1e2383d6a97a28b1d61d352e824"/><file name="ProviderCreditReversalDetails.php" hash="a789bbf3c7074bc800053967e64286c7"/><file name="ProviderCreditReversalNotification.php" hash="84a36f2d6157424a571ddada073b2be5"/><file name="ProviderCreditReversalSummary.php" hash="1f9cd50005ade77d793a15e029b3cf69"/><file name="ProviderCreditReversalSummaryList.php" hash="6d3a3913ea433fa54ac34197825354ff"/><file name="ProviderCreditSummary.php" hash="4403e12b73867b58021655df3fcf6720"/><file name="ProviderCreditSummaryList.php" hash="8a5a83e94ce75fc3992f98525d47765d"/><file name="RefundDetails.php" hash="4b2dacdc4ce32db6b6dff7613e5b6098"/><file name="RefundNotification.php" hash="55225faad22f6a5b9b44603239488ebb"/><file name="SellerBillingAgreementAttributes.php" hash="c772791d5522be53415d339e169c6a12"/><file name="SellerOrderAttributes.php" hash="116f00df52e1cc7d9b0a23c58dc0c93d"/><file name="SnsNotificationMetadata.php" hash="79a8aacd35588ce20daea2d8ded574ac"/><file name="SolutionProviderMerchantNotification.php" hash="d5829f16e032db871798f1ba45732f39"/><file name="SolutionProviderOption.php" hash="df8fbbb1ad2fef1796e3b42a9a417a64"/><file name="SolutionProviderOptions.php" hash="8f5f0e7415bb9dfc5dfafaab236d91df"/><file name="Status.php" hash="5ac5d81fafbb7a45c7ef67b7d61e3ccf"/></dir><file name="Notification.php" hash="f14f5fded3845499c03ed011ff115b13"/><file name="NotificationMetadata.php" hash="fcbdda900353d35a850ab518c24506ca"/></dir><dir name="OffAmazonPaymentsService"><file name="Client.php" hash="bba604078e0d7491ee6dbcce80258aea"/><file name="Environments.php" hash="5c469c72e7e1fc24eeda2b6a22917d77"/><file name="Exception.php" hash="965ca3466457e04d79ee9250fc946803"/><file name="Interface.php" hash="822113682cd65aa8b02f61f18ab07984"/><file name="MerchantValues.php" hash="ef10d79a38b3ae5ded1c2ed9d55e1f6c"/><dir name="Model"><file name="Address.php" hash="2cac12c7465df053c1fbfebd7c0c3e4b"/><file name="AuthorizationDetails.php" hash="9ef03efd7eb35c2f1c764e60a7492be6"/><file name="AuthorizeOnBillingAgreementRequest.php" hash="08084c850ebbc53f1a691fec0db5d011"/><file name="AuthorizeOnBillingAgreementResponse.php" hash="c2bc2dab6950c7a6be5ec3c55b71b4f9"/><file name="AuthorizeOnBillingAgreementResult.php" hash="b52d0c0ad908617cbd39345aba54882b"/><file name="AuthorizeRequest.php" hash="d01f4a32ec8e57a44a0804ba7350bfef"/><file name="AuthorizeResponse.php" hash="ccbb769ef3012724c48b1d76acd6e0ef"/><file name="AuthorizeResult.php" hash="a90eaf3bb2a12a6945407c01a0f967d0"/><file name="BillingAddress.php" hash="9d3881a26603f1392f9b93b55a8a8a5a"/><file name="BillingAgreementAttributes.php" hash="30046b148b8a7b4cd6026ebd0fc482b5"/><file name="BillingAgreementDetails.php" hash="9b9d0d8722afa825d45f98b9c5cece6e"/><file name="BillingAgreementLimits.php" hash="9984271b285397d7e08322c91d9ccd08"/><file name="BillingAgreementStatus.php" hash="f3a6ac460a66e62a4e5cff1f966e1a4a"/><file name="Buyer.php" hash="10df01a4c7815bf4760e56308957351a"/><file name="CancelOrderReferenceRequest.php" hash="2a1aea8fad7cf8a87d2a9f6ff6fcea78"/><file name="CancelOrderReferenceResponse.php" hash="c3f81641827af137bf4a6010e58bb62c"/><file name="CancelOrderReferenceResult.php" hash="504557ccf47b0b5b6a071f138ba962f0"/><file name="CaptureDetails.php" hash="f907d38d2148b1c1703d6f1a3d958f34"/><file name="CaptureRequest.php" hash="f2ddfd0218c81f234b0ba05c74efe1dd"/><file name="CaptureResponse.php" hash="6faf1938d380ebaeb6fcf1ff6e865624"/><file name="CaptureResult.php" hash="f174ee46f021bd40751e0d63245bd850"/><file name="CloseAuthorizationRequest.php" hash="07191ba72e4eee57553ecd41e15f779d"/><file name="CloseAuthorizationResponse.php" hash="70e8e86c4edbfb2f96ec139560636494"/><file name="CloseAuthorizationResult.php" hash="2c406dd340ef5b838a37a75aabb4f149"/><file name="CloseBillingAgreementRequest.php" hash="c80b8e3cb690595dc72c3924f5e7a13f"/><file name="CloseBillingAgreementResponse.php" hash="8994fb56dc5f487302937c1395d0963d"/><file name="CloseBillingAgreementResult.php" hash="10517589598754b0e58be29c5082c3ce"/><file name="CloseOrderReferenceRequest.php" hash="523c2061c026540e0189872e87ed1af1"/><file name="CloseOrderReferenceResponse.php" hash="fd13d871e69eb5413526c19cf5f66de8"/><file name="CloseOrderReferenceResult.php" hash="0e5afd3aa795bf82684c0f40744e2e04"/><file name="ConfirmBillingAgreementRequest.php" hash="098e7fd225da377b14799a0957991d0a"/><file name="ConfirmBillingAgreementResponse.php" hash="54327b4909053fc3fc65197e796c5d59"/><file name="ConfirmBillingAgreementResult.php" hash="f1ab41657391d37de4148fa07b0849da"/><file name="ConfirmOrderReferenceRequest.php" hash="c0667576d46907f0965c89a36e5dc1aa"/><file name="ConfirmOrderReferenceResponse.php" hash="497d3a7f3710ece7bd1a25fd5261707f"/><file name="Constraint.php" hash="5dfaa3ce9fb9c0fe8a1f20e24a053f6e"/><file name="Constraints.php" hash="e831530f17d7df39cc03bceaafed0216"/><file name="CreateOrderReferenceForIdRequest.php" hash="84a50944a1e0d58bd1e77306f1f7ada7"/><file name="CreateOrderReferenceForIdResponse.php" hash="3b9d3020b2e874f191e0083203d46723"/><file name="CreateOrderReferenceForIdResult.php" hash="46f720aea9c58694b2ca4b81142abcfa"/><file name="Destination.php" hash="4da36642b21ab96ab6bdee10781d8d07"/><file name="Error.php" hash="a0b83f2bc8edc3e503efae6d98ecb464"/><file name="ErrorResponse.php" hash="00391c711283b2fd5a6859f6a341cbbf"/><file name="GetAuthorizationDetailsRequest.php" hash="fdfeafa306e64b92325972b67bb12f92"/><file name="GetAuthorizationDetailsResponse.php" hash="eae478e879b021b30e22188af50c2e2c"/><file name="GetAuthorizationDetailsResult.php" hash="270d0ebb53cf595593a72ba29ca3d1f0"/><file name="GetBillingAgreementDetailsRequest.php" hash="e8124ac8d748b26642456c090a86463b"/><file name="GetBillingAgreementDetailsResponse.php" hash="5e05dd77c3b176b303af9711eeea97fd"/><file name="GetBillingAgreementDetailsResult.php" hash="b320ede4586359d2b5f1f1d7333b2743"/><file name="GetCaptureDetailsRequest.php" hash="b4d9e5414e63840b87c97a1d5f8ec9bb"/><file name="GetCaptureDetailsResponse.php" hash="049306e3f85755114fb033732111c613"/><file name="GetCaptureDetailsResult.php" hash="ab7ccba1bfaf183205a2a5a7c495fd19"/><file name="GetOrderReferenceDetailsRequest.php" hash="21d60f781305cf963ea2a40099decdf7"/><file name="GetOrderReferenceDetailsResponse.php" hash="eebbc1b4482d78a0d3d57bbf8d1c5a66"/><file name="GetOrderReferenceDetailsResult.php" hash="f4425bd39c8279e66f4c9052d452925d"/><file name="GetProviderCreditDetailsRequest.php" hash="1b613acafc8f66e0385379705bcf664c"/><file name="GetProviderCreditDetailsResponse.php" hash="9fcdbd8af985e96579c93378259c5e4a"/><file name="GetProviderCreditDetailsResult.php" hash="3a660d2ad0f6528e16f554987caf9a51"/><file name="GetProviderCreditReversalDetailsRequest.php" hash="592caa40f517ed1cfc66dd9a12e9bac3"/><file name="GetProviderCreditReversalDetailsResponse.php" hash="85d1fb8584f14d443cf7e4956c3dd03f"/><file name="GetProviderCreditReversalDetailsResult.php" hash="06effa515f870d1bd5fff7bc62a1d752"/><file name="GetRefundDetailsRequest.php" hash="a433b45ba3dc2894042d2e8072286bd1"/><file name="GetRefundDetailsResponse.php" hash="58771173d1a1c43f2a8a9f5515f4823b"/><file name="GetRefundDetailsResult.php" hash="0d51a779b95371ad425a4c9bc0aa6f82"/><file name="IdList.php" hash="a7a531e733a67f5a320bdb77c6ebd1a6"/><file name="OrderItemCategories.php" hash="1ed3edbf18fda5819ace2284bff49c15"/><file name="OrderReferenceAttributes.php" hash="d3d2d00f6626ab2116553cf2d266bb38"/><file name="OrderReferenceDetails.php" hash="a3ae5a3c4a6d5b8b3fa4f84593d1c33a"/><file name="OrderReferenceStatus.php" hash="5605fd30208a09dedea1aab688d92f49"/><file name="OrderTotal.php" hash="3ba85975c17821e7b72710b713f48f93"/><file name="ParentDetails.php" hash="b0d8bc8245fc4f8e75842e7c48e5b174"/><file name="Price.php" hash="ebd5fe74f1840f7804b3f869ce25384b"/><file name="ProviderCredit.php" hash="331663826ea8f444d5b0c05c59d69874"/><file name="ProviderCreditDetails.php" hash="0b916937d2397ad51d0dc1b0cf86777b"/><file name="ProviderCreditList.php" hash="3467cfe1dc096d07c33e2fadb3cb90d1"/><file name="ProviderCreditReversal.php" hash="b965141481deddd3b8e1c48a68d8c292"/><file name="ProviderCreditReversalDetails.php" hash="aaf5a41e7d6aba6758b5c24de2affe4d"/><file name="ProviderCreditReversalList.php" hash="47ff9cee9313ea98b23cec3257fdd704"/><file name="ProviderCreditReversalSummary.php" hash="decb86a0305f061206625dea1c8aacdb"/><file name="ProviderCreditReversalSummaryList.php" hash="4948d8e2034b7e60fc7157d7be149ea1"/><file name="ProviderCreditSummary.php" hash="06f9ad261e09b3709107d074604a1227"/><file name="ProviderCreditSummaryList.php" hash="28652df460f09e5d907d0c07f98b1b8f"/><file name="RefundDetails.php" hash="e12c1a6a49bda599d628e382de6f8874"/><file name="RefundRequest.php" hash="1e6f8500871cbae8b1d57a7a853cd298"/><file name="RefundResponse.php" hash="f2af68623a6f37a0f0227ea9e648603f"/><file name="RefundResult.php" hash="2b73f810b388d8ea30ded964bb1d1644"/><file name="ResponseHeaderMetadata.php" hash="4305e32c733bf48b2e34b2de0f0eee7f"/><file name="ResponseMetadata.php" hash="c5efe1da81e4a9fa3c76b9901c90f9fe"/><file name="ReverseProviderCreditRequest.php" hash="51af6c8b7e31efd4fffafd83994fbc63"/><file name="ReverseProviderCreditResponse.php" hash="3a959a1b22156ddb81e2eed9e02a0da4"/><file name="ReverseProviderCreditResult.php" hash="6dc02bb8141e136a55d28034add4b101"/><file name="SellerBillingAgreementAttributes.php" hash="0c1c845a25dbcd724d0c6ca2a8e07ab4"/><file name="SellerOrderAttributes.php" hash="326ac3910572ddfcc88d467e837283af"/><file name="SetBillingAgreementDetailsRequest.php" hash="19522c9d1290c1ae63e22902cd1655d9"/><file name="SetBillingAgreementDetailsResponse.php" hash="029e631097cb557f2a44ccc0f108aeae"/><file name="SetBillingAgreementDetailsResult.php" hash="4006851ac3799e4ee89fe6665e78be66"/><file name="SetOrderReferenceDetailsRequest.php" hash="61de911c937a20dc795727ca66a90b89"/><file name="SetOrderReferenceDetailsResponse.php" hash="e2bcd0495e0249c654a3cfedc0e3697e"/><file name="SetOrderReferenceDetailsResult.php" hash="ad903a104466558226f58e790a2bb061"/><file name="Status.php" hash="92253830c1eeb08094f5eca6506a0b0f"/><file name="ValidateBillingAgreementRequest.php" hash="b3a0ae148f92a2b0132af201f49c98d4"/><file name="ValidateBillingAgreementResponse.php" hash="c3866b3ffa85037b5c070ffed2d6cf06"/><file name="ValidateBillingAgreementResult.php" hash="2c96a303ad608eb9c840971c374125f4"/></dir><file name="Model.php" hash="7452a81d314d6212937d79e71b040e01"/><file name="RegionSpecificProperties.php" hash="4cad5116fb2608d5000c0e9aed5bace9"/><file name="Regions.php" hash="849549c7834fac2fb94749276eabeb97"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments.css" hash="a1f07a48b8de6d1fa9391a4eed2f12be"/><file name="amazonpayments-highlight.css" hash="f6daf03c989ac56ad436300b5520f0df"/></dir><dir name="images"><file name="amazon-payments-advanced-creativestyle-logo.png" hash="bb507d0085dab135ac313b8068515620"/><file name="amazon-payments-advanced-creativestyle-header-logo.png" hash="1f17fc7a61f8aaf929000d1d87f7d943"/><file name="amazon-payments-advanced-creativestyle-header-logo-white.png" hash="4ce4ba0d8d210a26caa380217804e200"/><file name="amazon-payments-advanced-header.png" hash="60f587870fbdb1242368c8c3b553bd8c"/><file name="amazon-payments-advanced-section.png" hash="8bc620f345eb46c920c51875d4cfad7c"/><file name="logo_a-glyph_16.png" hash="44a3f5f0013cab34d26653eb48b989fc"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments.css" hash="98669e803a468cc7e01d481ce1647a0e"/><file name="amazonpayments-widgets.css" hash="35704192aaeb204e407e8b853c118d16"/><file name="amazonpayments-responsive-widgets.css" hash="ffca5cdc8a4e0585946c78258044c471"/></dir><dir name="images"><file name="amazon-loading-large.gif" hash="5f6d83bf2b69ab73c7e48ec9b66d54db"/><file name="logo_a-glyph_1x.png" hash="5d44ca86985afbb2a47b9265053a456e"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="creativestyle"><dir name="css"><file name="amazonpayments-responsive-widgets.css" hash="389d23ee96bb5305f7ba5b616d930846"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>dom</name><min/><max/></extension><extension><name>curl</name><min/><max/></extension></required></dependencies>
|
19 |
</package>
|