uawdijnntqw1x1x1
IP : 216.73.216.136
Hostname : dhandapanilive
Kernel : Linux dhandapanilive 5.15.0-139-generic #149~20.04.1-Ubuntu SMP Wed Apr 16 08:29:56 UTC 2025 x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
OS : Linux
PATH:
/
var
/
www
/
html
/
dhandapani
/
a8fc6
/
..
/
ebd7e
/
..
/
9da53
/
amzn.tar
/
/
login-with-amazon-module/Domain/LayoutConfig.php000077700000003255151323541140015731 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Domain; use Magento\Framework\Model\AbstractModel; use Amazon\Core\Helper\Data as CoreHelper; /** * Used for accessing Amazon Login layout configuration * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class LayoutConfig { /** * @var CoreHelper */ private $coreHelper; /** * LayoutConfig constructor. * @param CoreHelper $coreHelper */ public function __construct( CoreHelper $coreHelper ) { $this->coreHelper = $coreHelper; } /** * Returns true if Login-related layout overrides should be disabled * * @return bool */ public function isLwaLayoutDisabled() { return !$this->coreHelper->isLwaEnabled(); } } login-with-amazon-module/Domain/ValidationCredentials.php000077700000003360151323541140017573 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ValidationCredentials { /** * @var integer */ private $customerId; /** * @var string */ private $amazonId; /** * ValidationCredentials constructor. * * @param integer $customerId * @param string $amazonId */ public function __construct($customerId, $amazonId) { $this->customerId = $customerId; $this->amazonId = $amazonId; } /** * Get customer id * * @return integer */ public function getCustomerId() { return $this->customerId; } /** * Get amazon id * * @return string */ public function getAmazonId() { return $this->amazonId; } } login-with-amazon-module/Domain/.htaccess000077700000000177151323541140014413 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Controller/Login/Validate.php000077700000003570151323541140017043 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Login; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\View\Result\PageFactory; /** * Class Validate * Validates login behaviors with Amazon Pay * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Validate extends Action { /** * @var PageFactory */ private $pageFactory; /** * Validate constructor. * * @param Context $context * @param PageFactory $pageFactory */ public function __construct( Context $context, PageFactory $pageFactory ) { parent::__construct($context); $this->pageFactory = $pageFactory; } /** * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Page */ public function execute() { return $this->pageFactory->create(); } } login-with-amazon-module/Controller/Login/Guest.php000077700000011052151323541140016373 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Login; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Core\Helper\Data as AmazonCoreHelper; use Amazon\Login\Model\Validator\AccessTokenRequestValidator; use Magento\Checkout\Model\Session; use Magento\Customer\Model\Url; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Guest extends Action { /** * @var AmazonCoreHelper */ private $amazonCoreHelper; /** * @var Url */ private $customerUrl; /** * @var AccessTokenRequestValidator */ private $accessTokenRequestValidator; /** * @var Session */ private $session; /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var LoggerInterface */ private $logger; private $quoteRepository; /** * Guest constructor. * @param Context $context * @param AmazonCoreHelper $amazonCoreHelper * @param Url $customerUrl * @param AccessTokenRequestValidator $accessTokenRequestValidator * @param Session $session * @param ClientFactoryInterface $clientFactory * @param LoggerInterface $logger */ public function __construct( Context $context, AmazonCoreHelper $amazonCoreHelper, Url $customerUrl, AccessTokenRequestValidator $accessTokenRequestValidator, Session $session, ClientFactoryInterface $clientFactory, LoggerInterface $logger ) { $this->amazonCoreHelper = $amazonCoreHelper; $this->customerUrl = $customerUrl; $this->accessTokenRequestValidator = $accessTokenRequestValidator; $this->session = $session; $this->clientFactory = $clientFactory; $this->logger = $logger; parent::__construct($context); } /** * {@inheritdoc} */ public function execute() { if (!$this->isValidToken()) { return $this->getRedirectLogin(); } $customerData = $this->getAmazonCustomer(); if ($customerData && isset($customerData['email'])) { $quote = $this->session->getQuote(); if ($quote) { $quote->setCustomerEmail($customerData['email']); $quote->save(); } } return $this->_redirect('checkout'); } /** * @return string */ private function getRedirectLogin() { return $this->_redirect($this->customerUrl->getLoginUrl()); } /** * @return bool */ private function isValidToken() { $isValid = false; try { $isValid = $this->accessTokenRequestValidator->isValid($this->getRequest()); } catch (\Zend_Validate_Exception $e) { $this->logger->error($e); } return $isValid; } /** * @return array */ private function getAmazonCustomer() { try { $userInfo = $this->clientFactory ->create() ->getUserInfo($this->getRequest()->getParam('access_token')); if (is_array($userInfo) && isset($userInfo['user_id'])) { $data = [ 'id' => $userInfo['user_id'], 'email' => $userInfo['email'], 'name' => $userInfo['name'], 'country' => $this->amazonCoreHelper->getRegion(), ]; return $data; } } catch (\Exception $e) { $this->logger->error($e); } return []; } } login-with-amazon-module/Controller/Login/ProcessAuthHash.php000077700000003141151323541140020350 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Login; use Magento\Framework\App\Action\Context; use Magento\Framework\View\Result\PageFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ProcessAuthHash extends \Magento\Framework\App\Action\Action { /** * @var PageFactory */ private $pageFactory; /** * @param Context $context * @param PageFactory $pageFactory */ public function __construct(Context $context, PageFactory $pageFactory) { parent::__construct($context); $this->pageFactory = $pageFactory; } public function execute() { return $this->pageFactory->create(); } } login-with-amazon-module/Controller/Login/Authorize.php000077700000007773151323541140017275 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Login; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Domain\ValidationCredentials; use Magento\Framework\Exception\ValidatorException; use Magento\Framework\Exception\NotFoundException; use Zend_Validate; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Authorize extends \Amazon\Login\Controller\Login { /** * {@inheritdoc} */ public function execute() { if (!$this->amazonCoreHelper->isLwaEnabled()) { throw new NotFoundException(__('Action is not available')); } if (!$this->isValidToken()) { return $this->getRedirectLogin(); } try { $amazonCustomer = $this->getAmazonCustomer(); if ($amazonCustomer) { $processed = $this->processAmazonCustomer($amazonCustomer); if ($processed instanceof ValidationCredentials) { $this->session->setValidationCredentials($processed); $this->session->setAmazonCustomer($amazonCustomer); return $this->_redirect($this->_url->getRouteUrl('*/*/validate')); } else { $this->session->login($processed); } } } catch (ValidatorException $e) { $this->logger->error($e); $this->messageManager->addErrorMessage($e->getMessage()); $this->_eventManager->dispatch('amazon_login_authorize_validation_error', ['exception' => $e]); $this->_eventManager->dispatch('amazon_login_authorize_error', ['exception' => $e]); } catch (\Exception $e) { $this->logger->error($e); $this->messageManager->addErrorMessage(__('Error processing Amazon Login')); $this->_eventManager->dispatch('amazon_login_authorize_error', ['exception' => $e]); } return $this->getRedirectAccount(); } protected function processAmazonCustomer(AmazonCustomerInterface $amazonCustomer) { $customerData = $this->matcher->match($amazonCustomer); if (null === $customerData) { return $this->createCustomer($amazonCustomer); } if ($amazonCustomer->getId() != $customerData->getExtensionAttributes()->getAmazonId()) { if (! $this->session->isLoggedIn()) { return new ValidationCredentials($customerData->getId(), $amazonCustomer->getId()); } $this->customerLinkManagement->updateLink($customerData->getId(), $amazonCustomer->getId()); } return $customerData; } protected function createCustomer(AmazonCustomerInterface $amazonCustomer) { if (! Zend_Validate::is($amazonCustomer->getEmail(), 'EmailAddress')) { throw new ValidatorException(__('the email address for your Amazon account is invalid')); } $customerData = $this->customerLinkManagement->create($amazonCustomer); $this->customerLinkManagement->updateLink($customerData->getId(), $amazonCustomer->getId()); return $customerData; } } login-with-amazon-module/Controller/Login/ValidatePost.php000077700000007232151323541140017710 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Login; use Amazon\Login\Api\CustomerLinkManagementInterface; use Amazon\Login\Domain\ValidationCredentials; use Amazon\Login\Helper\Session; use Amazon\Login\Model\Customer\Account\Redirect as AccountRedirect; use Magento\Customer\Model\CustomerRegistry; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\Encryption\Encryptor; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ValidatePost extends Action { /** * @var Session */ private $session; /** * @var AccountRedirect */ private $accountRedirect; /** * @var CustomerRegistry */ private $customerRegistry; /** * @var Encryptor */ private $encryptor; /** * @var CustomerLinkManagement */ private $customerLinkManagement; /** * ValidatePost constructor. * * @param Context $context * @param Session $session * @param AccountRedirect $accountRedirect * @param CustomerRegistry $customerRegistry * @param Encryptor $encryptor * @param customerLinkManagement $customerLinkManagement */ public function __construct( Context $context, Session $session, AccountRedirect $accountRedirect, CustomerRegistry $customerRegistry, Encryptor $encryptor, CustomerLinkManagementInterface $customerLinkManagement ) { parent::__construct($context); $this->session = $session; $this->accountRedirect = $accountRedirect; $this->customerRegistry = $customerRegistry; $this->encryptor = $encryptor; $this->customerLinkManagement = $customerLinkManagement; } public function execute() { $credentials = $this->session->getValidationCredentials(); if (null !== $credentials && $credentials instanceof ValidationCredentials) { $password = $this->getRequest()->getParam('password'); $hash = $this->customerRegistry->retrieveSecureData($credentials->getCustomerId())->getPasswordHash(); if ($this->encryptor->validateHash($password, $hash)) { $this->customerLinkManagement->updateLink($credentials->getCustomerId(), $credentials->getAmazonId()); $this->session->loginById($credentials->getCustomerId()); } else { $this->messageManager->addErrorMessage('The password supplied was incorrect'); return $this->_redirect($this->_url->getRouteUrl('*/*/validate')); } } return $this->accountRedirect->getRedirect(); } } login-with-amazon-module/Controller/Login/.htaccess000077700000000177151323541140016377 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Controller/Login.php000077700000014077151323541140015316 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Core\Domain\AmazonCustomerFactory; use Amazon\Core\Helper\Data as AmazonCoreHelper; use Amazon\Login\Model\Validator\AccessTokenRequestValidator; use Amazon\Login\Model\Customer\Account\Redirect as AccountRedirect; use Amazon\Login\Helper\Session; use Magento\Customer\Model\Session as CustomerSession; use Magento\Customer\Model\Url; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Psr\Log\LoggerInterface; use Amazon\Login\Model\Customer\MatcherInterface; use Amazon\Login\Api\CustomerLinkManagementInterface; /** * Login with token controller * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class Login extends Action { /** * @var AmazonCustomerFactory */ protected $amazonCustomerFactory; /** * @var ClientFactoryInterface */ protected $clientFactory; /** * @var AmazonCoreHelper */ protected $amazonCoreHelper; /** * @var Url */ protected $customerUrl; /** * @var AccessTokenRequestValidator */ protected $accessTokenRequestValidator; /** * @var AccountRedirect */ protected $accountRedirect; /** * @var MatcherInterface */ protected $matcher; /** * @var CustomerLinkManagementInterface */ protected $customerLinkManagement; /** * @var CustomerSession */ protected $customerSession; /** * @var Session */ protected $session; /** * @var LoggerInterface */ protected $logger; /** * Login constructor. * @param Context $context * @param AmazonCustomerFactory $amazonCustomerFactory * @param ClientFactoryInterface $clientFactory * @param LoggerInterface $logger * @param AmazonCoreHelper $amazonCoreHelper * @param Url $customerUrl * @param AccessTokenRequestValidator $accessTokenRequestValidator * @param AccountRedirect $accountRedirect * @param MatcherInterface $matcher * @param CustomerLinkManagementInterface $customerLinkManagement * @param CustomerSession $customerSession * @param Session $session * @param LoggerInterface $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( Context $context, AmazonCustomerFactory $amazonCustomerFactory, ClientFactoryInterface $clientFactory, AmazonCoreHelper $amazonCoreHelper, Url $customerUrl, AccessTokenRequestValidator $accessTokenRequestValidator, AccountRedirect $accountRedirect, MatcherInterface $matcher, CustomerLinkManagementInterface $customerLinkManagement, CustomerSession $customerSession, Session $session, LoggerInterface $logger ) { $this->amazonCustomerFactory = $amazonCustomerFactory; $this->clientFactory = $clientFactory; $this->amazonCoreHelper = $amazonCoreHelper; $this->customerUrl = $customerUrl; $this->accessTokenRequestValidator = $accessTokenRequestValidator; $this->accountRedirect = $accountRedirect; $this->matcher = $matcher; $this->customerLinkManagement = $customerLinkManagement; $this->customerSession = $customerSession; $this->session = $session; $this->logger = $logger; parent::__construct($context); } /** * Load userinfo from access token * * @return AmazonCustomerInterface */ protected function getAmazonCustomer() { try { $userInfo = $this->clientFactory ->create() ->getUserInfo($this->getRequest()->getParam('access_token')); if (is_array($userInfo) && isset($userInfo['user_id'])) { $data = [ 'id' => $userInfo['user_id'], 'email' => $userInfo['email'], 'name' => $userInfo['name'], 'country' => $this->amazonCoreHelper->getRegion(), ]; $amazonCustomer = $this->amazonCustomerFactory->create($data); return $amazonCustomer; } } catch (\Exception $e) { $this->logger->error($e); $this->messageManager->addErrorMessage(__('Error processing Amazon Login')); } return false; } /** * @return bool */ protected function isValidToken() { return $this->accessTokenRequestValidator->isValid($this->getRequest()); } /** * @return string */ protected function getRedirectLogin() { return $this->_redirect($this->customerUrl->getLoginUrl()); } /** * @return string */ protected function getRedirectAccount() { return $this->accountRedirect->getRedirect(); } } login-with-amazon-module/Controller/Logout/Index.php000077700000003554151323541140016564 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Controller\Logout; use Magento\Framework\App\Action\Context; use Magento\Framework\Controller\Result\JsonFactory; use Amazon\Login\Helper\Session; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Index extends \Magento\Framework\App\Action\Action { /** * @var JsonFactory */ private $jsonFactory; /** * @var Session */ private $sessionHelper; /** * @param Context $context * @param JsonFactory $jsonFactory * @param Session $sessionHelper */ public function __construct(Context $context, JsonFactory $jsonFactory, Session $sessionHelper) { parent::__construct($context); $this->jsonFactory = $jsonFactory; $this->sessionHelper = $sessionHelper; } public function execute() { $this->sessionHelper->setIsAmazonLoggedIn(false); return $this->jsonFactory->create(); } } login-with-amazon-module/Controller/Logout/.htaccess000077700000000177151323541140016600 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Controller/.htaccess000077700000000177151323541140015327 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Test/Unit/Model/LayoutConfigTest.php000077700000003657151323541140020266 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Test\Unit\Helper; use \Amazon\Login\Domain\LayoutConfig; use \Amazon\Core\Model\AmazonConfig; /** * Class LayoutConfigTest * * @see \Amazon\Login\Domain\LayoutConfig * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class LayoutConfigTest extends \PHPUnit\Framework\TestCase { public function setUp() { $this->mockAmazonConfig = $this->getMockBuilder(AmazonConfig::class) ->disableOriginalConstructor() ->getMock(); } /** * @dataProvider lwaLayoutDataProvider */ public function testIsLwaLayoutDisabled($expected, $isLwaEnabled) { $this->mockAmazonConfig->method('isLwaEnabled')->willReturn($isLwaEnabled); $layoutConfig = new LayoutConfig($this->mockAmazonConfig); $this->assertEquals($expected, $layoutConfig->isLwaLayoutDisabled()); } public function lwaLayoutDataProvider() { return [ [true, false], [false, true] ]; } } login-with-amazon-module/Test/Unit/Model/.htaccess000077700000000177151323541140016102 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Test/Unit/.htaccess000077700000000177151323541140015042 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Test/.htaccess000077700000000177151323541140014123 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Api/Data/CustomerLinkSearchResultsInterface.php000077700000002115151323541140022443 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Api\Data; /** * @api */ interface CustomerLinkSearchResultsInterface extends \Magento\Framework\Api\SearchResultsInterface { /** * Gets collection items. * * @return \Amazon\Login\Api\Data\CustomerLinkInterface[] Array of collection items. */ public function getItems(); /** * Sets collection items. * * @param \Amazon\Login\Api\Data\CustomerLinkInterface[] $items * @return $this */ public function setItems(array $items); } login-with-amazon-module/Api/Data/.htaccess000077700000000177151323541140014566 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Api/Data/CustomerLinkInterface.php000077700000002570151323541140017740 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Api\Data; /** * @api */ interface CustomerLinkInterface { /* * Entity ID. */ const ENTITY_ID = 'entity_id'; /* * Customer ID. */ const CUSTOMER_ID = 'customer_id'; /* * Amazon ID. */ const AMAZON_ID = 'amazon_id'; /** * Set amazon id * * @param integer $amazonId * * @return $this */ public function setAmazonId($amazonId); /** * Get amazon id * * @return string */ public function getAmazonId(); /** * Set customer id * * @param integer $customerId * * @return $this */ public function setCustomerId($customerId); /** * Get customer id * * @return integer */ public function getCustomerId(); } login-with-amazon-module/Api/CustomerManagementInterface.php000077700000001627151323541140020250 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Api; /** * @api */ interface CustomerManagementInterface { /** * Add amazon id extension attribute to customer * * @param CustomerInterface $customer * @return void */ public function setAmazonIdExtensionAttribute(\Magento\Customer\Api\Data\CustomerInterface $customer); } login-with-amazon-module/Api/CustomerLinkManagementInterface.php000077700000003025151323541140021060 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Api; use Amazon\Login\Api\Data\CustomerLinkInterface; use Magento\Customer\Api\Data\CustomerInterface; /** * CustomerLink (Amazon Customer <=> Magento Customer) Management interface. * * @api */ interface CustomerLinkManagementInterface { /** * Load CustomerLink by Customer ID. * * @param int $customerId * @return CustomerLinkInterface Customer link interface. */ public function getByCustomerId($customerId); /** * Create magento customer using amazon customer details * * @param AmazonCustomerInterface $amazonCustomer * @return CustomerInterface|null */ public function create(\Amazon\Core\Api\Data\AmazonCustomerInterface $amazonCustomer); /** * Create or update magento/amazon customer link entity * * @param integer $customerId * @param string $amazonId * @return void */ public function updateLink($customerId, $amazonId); } login-with-amazon-module/Api/CustomerLinkRepositoryInterface.php000077700000004772151323541140021175 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Api; use Magento\Framework\Exception\CouldNotSaveException; use Magento\Framework\Exception\CouldNotDeleteException; use Magento\Framework\Exception\NoSuchEntityException; /** * CustomerLink (Amazon Customer <=> Magento Customer) CRUD interface. * * @api */ interface CustomerLinkRepositoryInterface { /** * Lists payment tokens that match specified search criteria. * * @param \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria The search criteria. * @return \Amazon\Login\Api\Data\CustomerLinkSearchResultsInterface search result interface. */ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria); /** * Loads by Customer ID. * * @param int $customerId The customer ID. * @return \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface. */ public function get($customerId); /** * Loads by Entity ID. * * @param int $entityId The customer link entity ID. * @return \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface. */ public function getById($entityId); /** * Delete customer link. * * @param \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface. * @return bool * @throws CouldNotDeleteException */ public function delete(Data\CustomerLinkInterface $customerLink); /** * Delete customer link by entity id * * @param string $entityId * @return bool * @throws CouldNotDeleteException * @throws NoSuchEntityException */ public function deleteById($entityId); /** * Save customer link * * @param \Amazon\Login\Api\Data\CustomerLinkInterface Customer link interface. * @return \Amazon\Login\Api\Data\CustomerLinkInterface * @throws CouldNotSaveException */ public function save(Data\CustomerLinkInterface $customerLink); } login-with-amazon-module/Api/.htaccess000077700000000177151323541140013715 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/registration.php000077700000001521151323541140014623 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ use Magento\Framework\Component\ComponentRegistrar; $registrar = new ComponentRegistrar(); if ($registrar->getPath(ComponentRegistrar::MODULE, 'Amazon_Login') === null) { ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Amazon_Login', __DIR__); } login-with-amazon-module/README.md000077700000001477151323541140012671 0ustar00# Amazon_Login Module The Amazon_Login module allows customers to sign in with their Amazon account. ## About Amazon Pay and Login Amazon Pay and Login provides integration of your Magento 2 store with Amazon Pay and Login with Amazon services. This 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 Pay transactions are protected by Amazon's A-to-z Guarantee. ## Dependencies You can find a list of modules in the require section of the `composer.json` file located in the same directory as this `README.md` file. ## Extension Points Amazon Pay does not provide any specific extension points. ## Additional Information [View the Complete User Guide](https://amzn.github.io/amazon-payments-magento-2-plugin/)login-with-amazon-module/Model/CheckoutConfigProvider.php000077700000004745151323541140017572 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model; use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Customer\Model\Session as CustomerSession; use Magento\Checkout\Model\Session as CheckoutSession; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CheckoutConfigProvider implements ConfigProviderInterface { /** * @var CustomerSession */ private $customerSession; /** * @var CheckoutSession */ private $checkoutSession; /** * CheckoutConfigProvider constructor. * @param CustomerSession $customerSession * @param CheckoutSession $checkoutSession */ public function __construct( CustomerSession $customerSession, CheckoutSession $checkoutSession ) { $this->customerSession = $customerSession; $this->checkoutSession = $checkoutSession; } /** * {@inheritdoc} */ public function getConfig() { $config = []; /** @var \Amazon\Core\Api\Data\AmazonCustomerInterface $amazonCustomer */ if ($amazonCustomer = $this->customerSession->getAmazonCustomer()) { $config['amazon_customer_email'] = $amazonCustomer->getEmail(); } if (!isset($config['amazon_customer_email'])) { $quote = $this->checkoutSession->getQuote(); $config['amazon_customer_email'] = $quote->getCustomerEmail(); } // return a stdClass so that the resulting JSON is an empty object, not an empty array return ['amazonLogin' => empty($config) ? new \stdClass : $config]; } } login-with-amazon-module/Model/CustomerLink.php000077700000003655151323541140015602 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model; use Amazon\Login\Api\Data\CustomerLinkInterface; use Amazon\Login\Model\ResourceModel\CustomerLink as CustomerLinkResourceModel; use Magento\Framework\Model\AbstractModel; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerLink extends AbstractModel implements CustomerLinkInterface { protected function _construct() { $this->_init(CustomerLinkResourceModel::class); } /** * {@inheritDoc} */ public function setAmazonId($amazonId) { return $this->setData('amazon_id', $amazonId); } /** * {@inheritDoc} */ public function getAmazonId() { return $this->getData('amazon_id'); } /** * {@inheritDoc} */ public function setCustomerId($customerId) { return $this->setData('customer_id', $customerId); } /** * {@inheritDoc} */ public function getCustomerId() { return $this->getData('customer_id'); } } login-with-amazon-module/Model/CustomerLinkManagement.php000077700000010253151323541140017567 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Model\CustomerLinkRepositryFactory; use Amazon\Login\Api\CustomerLinkRepositoryInterface; use Amazon\Login\Api\Data\CustomerLinkInterfaceFactory; use Magento\Customer\Api\AccountManagementInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Session; use Magento\Framework\Math\Random; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerLinkManagement implements \Amazon\Login\Api\CustomerLinkManagementInterface { /** * @var CustomerLinkRepositoryInterface */ private $customerLinkRepository; /** * @var CustomerLinkFactory */ private $customerLinkFactory; /** * @var CustomerInterface */ private $customerInterface; /** * @var CustomerInterfaceFactory */ private $customerDataFactory; /** * @var AccountManagementInterface */ private $accountManagement; /** * @var Random */ private $random; /** * @param CustomerLinkRepositoryInterface $customerLinkRepository * @param CustomerLinkFactory $customerLinkFactory * @param CustomerInterface $customerInterface * @param CustomerInterfaceFactory $customerDataFactory * @param AccountManagementInterface $accountManagement * @param Random $random */ public function __construct( CustomerLinkRepositoryInterface $customerLinkRepository, CustomerLinkFactory $customerLinkFactory, CustomerInterface $customerInterface, CustomerInterfaceFactory $customerDataFactory, AccountManagementInterface $accountManagement, Random $random ) { $this->customerLinkRepository = $customerLinkRepository; $this->customerLinkFactory = $customerLinkFactory; $this->customerInterface = $customerInterface; $this->customerDataFactory = $customerDataFactory; $this->accountManagement = $accountManagement; $this->random = $random; } /** * {@inheritdoc} */ public function getByCustomerId($customerId) { return $this->customerLinkRepository->get($customerId); } /** * {@inheritdoc} */ public function create(AmazonCustomerInterface $amazonCustomer) { $customerData = $this->customerDataFactory->create(); $customerData->setFirstname($amazonCustomer->getFirstName()); $customerData->setLastname($amazonCustomer->getLastName()); $customerData->setEmail($amazonCustomer->getEmail()); $password = "4mZ!" . $this->random->getRandomString(60); $customer = $this->accountManagement->createAccount($customerData, $password); return $customer; } /** * {@inheritdoc} */ public function updateLink($customerId, $amazonId) { $customerLink = $this->customerLinkFactory->create(); $customerLink ->load($customerId, 'customer_id') ->setAmazonId($amazonId) ->setCustomerId($customerId); $this->customerLinkRepository->save($customerLink); } } login-with-amazon-module/Model/CustomerManagement.php000077700000005162151323541140016754 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model; use Amazon\Login\Api\CustomerLinkManagementInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Api\Data\CustomerExtensionFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerManagement implements \Amazon\Login\Api\CustomerManagementInterface { /** * @var CustomerLinkManagement */ private $customerLinkManagement; /** * @var CustomerExtensionFactory */ private $customerExtensionFactory; /** * @var string */ private $amazonId; /** * @param CustomerLinkRepositoryInterface $customerLinkRepository * @param CustomerExtensionFactory $customerExtensionFactory */ public function __construct( CustomerLinkManagementInterface $customerLinkManagement, CustomerExtensionFactory $customerExtensionFactory ) { $this->customerLinkManagement = $customerLinkManagement; $this->customerExtensionFactory = $customerExtensionFactory; } /** * {@inheritdoc} */ public function setAmazonIdExtensionAttribute(CustomerInterface $customer) { $customerExtension = ($customer->getExtensionAttributes()) ?: $this->customerExtensionFactory->create(); if (null === $this->amazonId) { $amazonCustomer = $this->customerLinkManagement->getByCustomerId($customer->getId()); if ($amazonCustomer->getId()) { $this->amazonId = $amazonCustomer->getAmazonId(); } } if ($this->amazonId) { $customerExtension->setAmazonId($this->amazonId); } $customer->setExtensionAttributes($customerExtension); } } login-with-amazon-module/Model/Validator/AccessTokenRequestValidator.php000077700000004270151323541140022523 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Validator; use Magento\Framework\App\RequestInterface; use Magento\Framework\Validator\AbstractValidator; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AccessTokenRequestValidator extends AbstractValidator { /** * {@inheritdoc} */ public function isValid($request) { if (!$request instanceof RequestInterface) { throw new \InvalidArgumentException('Provided value must be of type ' . RequestInterface::class); } return $this->hasAccessToken($request) && !$this->hasError($request); } /** * @param RequestInterface $request * * @return bool */ public function hasError(RequestInterface $request) { return !empty($request->getParam('error')); } /** * @param RequestInterface $request * * @return bool */ public function hasAccessToken(RequestInterface $request) { return !empty($request->getParam('access_token')); } /** * @param RequestInterface $request * * @return bool */ public function isDeniedAccessError(RequestInterface $request) { return $this->hasError($request) && $request->getParam('error') === 'access_denied'; } } login-with-amazon-module/Model/Validator/.htaccess000077700000000177151323541140016171 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Model/CustomerLinkRepository.php000077700000012767151323541140017706 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model; use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\Search\FilterGroup; use Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Amazon\Login\Api\CustomerLinkRepositoryInterface; use Amazon\Login\Api\Data; use Amazon\Login\Api\Data\CustomerLinkInterface; use Amazon\Login\Api\Data\CustomerLinkSearchResultsInterfaceFactory; use Amazon\Login\Model\ResourceModel\CustomerLink as CustomerLinkResourceModel; use Amazon\Login\Model\ResourceModel\CustomerLink\CollectionFactory; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerLinkRepository implements CustomerLinkRepositoryInterface { /** * @var CustomerLinkResourceModel */ private $resourceModel; /** * @var CustomerLinkFactory */ private $customerLinkFactory; /** * @var PaymentTokenSearchResultsInterfaceFactory */ private $searchResultsFactory; /** * @var \Magento\Framework\Api\FilterBuilder */ private $filterBuilder; /** * @var \Magento\Framework\Api\SearchCriteriaBuilder */ private $searchCriteriaBuilder; /** * @var CollectionFactory */ private $collectionFactory; /** * @var \Magento\Framework\Api\SearchCriteria\CollectionProcessorInterface */ private $collectionProcessor; /** * @param CustomerLinkResourceModel $customerLinkFactory * @param CustomerLinkFactory $resourceModel * @param FilterBuilder $filterBuilder * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param PaymentTokenSearchResultsInterfaceFactory $searchResultsFactory * @param CollectionFactory $collectionFactory * @param CollectionProcessorInterface | null $collectionProcessor */ public function __construct( CustomerLinkResourceModel $resourceModel, CustomerLinkFactory $customerLinkFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, CustomerLinkSearchResultsInterfaceFactory $searchResultsFactory, CollectionFactory $collectionFactory, CollectionProcessorInterface $collectionProcessor ) { $this->resourceModel = $resourceModel; $this->customerLinkFactory = $customerLinkFactory; $this->filterBuilder = $filterBuilder; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->searchResultsFactory = $searchResultsFactory; $this->collectionFactory = $collectionFactory; $this->collectionProcessor = $collectionProcessor; } /** * {@inheritdoc} */ public function get($customerId) { $customerLink = $this->customerLinkFactory->create(); $this->resourceModel->load($customerLink, $customerId, 'customer_id'); return $customerLink; } /** * {@inheritdoc} */ public function getById($entityId) { $customerLink = $this->customerLinkFactory->create(); $this->resourceModel->load($customerLink, $entityId); return $customerLink; } /** * {@inheritdoc} */ public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria) { $collection = $this->collectionFactory->create(); $this->collectionProcessor->process($searchCriteria, $collection); $searchResults = $this->searchResultsFactory->create(); $searchResults->setSearchCriteria($searchCriteria); $searchResults->setItems($collection->getItems()); return $searchResults; } /** * {@inheritdoc} */ public function delete(CustomerLinkInterface $customerLink) { try { $this->resourceModel->delete($customerLink); } catch (\Exception $exception) { throw new \Magento\Framework\Exception\CouldNotDeleteException(__($exception->getMessage())); } return true; } /** * {@inheritdoc} */ public function deleteById($entityId) { return $this->delete($this->getById($entityId)); } /** * {@inheritdoc} */ public function save(CustomerLinkInterface $customerLink) { try { $this->resourceModel->save($customerLink); } catch (\Exception $exception) { throw new \Magento\Framework\Exception\CouldNotSaveException( __('Could not save Amazon customer link: %1', $exception->getMessage()), $exception ); } return $customerLink; } } login-with-amazon-module/Model/Customer/IdMatcher.php000077700000004740151323541140016620 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Model\Customer\MatcherInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IdMatcher implements MatcherInterface { /** * @var CustomerRepositoryInterface */ private $customerRepository; /** * @var SearchCriteriaBuilder */ private $searchCriteriaBuilder; /** * IdMatcher constructor. * * @param CustomerRepositoryInterface $customerRepository * @param SearchCriteriaBuilder $searchCriteriaBuilder */ public function __construct( CustomerRepositoryInterface $customerRepository, SearchCriteriaBuilder $searchCriteriaBuilder ) { $this->customerRepository = $customerRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; } /** * {@inheritDoc} */ public function match(AmazonCustomerInterface $amazonCustomer) { $this->searchCriteriaBuilder->addFilter( 'amazon_id', $amazonCustomer->getId() ); $searchCriteria = $this->searchCriteriaBuilder ->setPageSize(1) ->setCurrentPage(1) ->create(); $customerList = $this->customerRepository->getList($searchCriteria); if (count($items = $customerList->getItems())) { return current($items); } return null; } } login-with-amazon-module/Model/Customer/MatcherInterface.php000077700000001770151323541140020164 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Magento\Customer\Api\Data\CustomerInterface; /** * @api */ interface MatcherInterface { /** * Match magento customer using amazon customer * * @param AmazonCustomerInterface $amazonCustomer * * @return CustomerInterface|null */ public function match(AmazonCustomerInterface $amazonCustomer); } login-with-amazon-module/Model/Customer/EmailMatcher.php000077700000004075151323541140017314 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Model\Customer\MatcherInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Framework\Exception\NoSuchEntityException; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class EmailMatcher implements MatcherInterface { /** * @var CustomerRepositoryInterface */ private $customerRepository; /** * EmailMatcher constructor. * * @param CustomerRepositoryInterface $customerRepository */ public function __construct( CustomerRepositoryInterface $customerRepository ) { $this->customerRepository = $customerRepository; } /** * {@inheritDoc} */ public function match(AmazonCustomerInterface $amazonCustomer) { try { $customerData = $this->customerRepository->get($amazonCustomer->getEmail()); if ($customerData->getId()) { return $customerData; } } catch (NoSuchEntityException $exception) { return null; } return null; } } login-with-amazon-module/Model/Customer/CompositeMatcher.php000077700000003373151323541140020227 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Model\Customer\MatcherInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CompositeMatcher implements MatcherInterface { /** * @var MatcherInterface[] */ private $matchers; /** * CompositeMatcher constructor. * * @param array $matchers */ public function __construct(array $matchers) { $this->matchers = $matchers; } /** * {@inheritDoc} */ public function match(AmazonCustomerInterface $amazonCustomer) { foreach ($this->matchers as $matcher) { if ($customerData = $matcher->match($amazonCustomer)) { return $customerData; } } return null; } } login-with-amazon-module/Model/Customer/Account/Redirect.php000077700000006315151323541140020115 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer\Account; use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Customer\Model\Account\Redirect as BaseRedirect; use Magento\Customer\Model\Session as CustomerSession; use Magento\Customer\Model\Url as CustomerUrl; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\Controller\ResultFactory; use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; use Magento\Framework\Url\DecoderInterface; use Magento\Framework\UrlInterface; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Redirect extends BaseRedirect { /** * @var CheckoutSession */ private $checkoutSession; /** * @var CustomerSession */ private $customerSession; public function __construct( RequestInterface $request, CustomerSession $customerSession, ScopeConfigInterface $scopeConfig, StoreManagerInterface $storeManager, UrlInterface $url, DecoderInterface $urlDecoder, CustomerUrl $customerUrl, ResultFactory $resultFactory, CookieMetadataFactory $cookieMetadataFactory, CheckoutSession $checkoutSession ) { parent::__construct( $request, $customerSession, $scopeConfig, $storeManager, $url, $urlDecoder, $customerUrl, $resultFactory, $cookieMetadataFactory ); $this->customerSession = $customerSession; $this->checkoutSession = $checkoutSession; } public function getRedirect() { $this->updateLastCustomerId(); $result = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT); $afterAmazonAuthUrl = $this->customerUrl->getAccountUrl(); if ($this->checkoutSession->getQuote() && (int)$this->checkoutSession->getQuote()->getItemsCount() > 0) { $afterAmazonAuthUrl = $this->url->getUrl('checkout'); } elseif ($this->customerSession->getAfterAmazonAuthUrl()) { $afterAmazonAuthUrl = $this->customerSession->getAfterAmazonAuthUrl(); } $result->setUrl($afterAmazonAuthUrl); return $result; } } login-with-amazon-module/Model/Customer/Account/.htaccess000077700000000177151323541140017441 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Model/Customer/SessionMatcher.php000077700000003172151323541140017705 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\Customer; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Model\Customer\MatcherInterface; use Magento\Customer\Model\Session; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SessionMatcher implements MatcherInterface { /** * @var Session */ private $session; public function __construct( Session $session ) { $this->session = $session; } /** * {@inheritDoc} */ public function match(AmazonCustomerInterface $amazonCustomer) { if ($this->session->isLoggedIn()) { return $this->session->getCustomerData(); } return null; } } login-with-amazon-module/Model/Customer/.htaccess000077700000000177151323541140016045 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Model/ResourceModel/CustomerLink.php000077700000002432151323541140020342 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\ResourceModel; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerLink extends AbstractDb { const TABLE_NAME = 'amazon_customer'; protected function _construct() { $this->_init(static::TABLE_NAME, 'entity_id'); } } login-with-amazon-module/Model/ResourceModel/CustomerLink/Collection.php000077700000002474151323541140022443 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Model\ResourceModel\CustomerLink; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection { protected function _construct() { $this->_init(\Amazon\Login\Model\CustomerLink::class, \Amazon\Login\Model\ResourceModel\CustomerLink::class); } } login-with-amazon-module/Model/ResourceModel/CustomerLink/.htaccess000077700000000177151323541140021433 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Model/ResourceModel/.htaccess000077700000000177151323541140017014 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Model/.htaccess000077700000000177151323541140014244 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/templates/logout.phtml000077700000001255151323541140020552 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <div class="amazon-logout-widget" data-mage-init='{"amazonLogout": {"onInit": "true"}}'></div> login-with-amazon-module/view/frontend/templates/login.phtml000077700000005075151323541140020355 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <?php /** @var \Amazon\Login\Block\Login $block */?> <div class="block block-amazon-login"> <div class="block-title"> <strong id="block-amazon-login-heading" role="heading" aria-level="2"> <?= $block->escapeHtml(__('Login with Amazon')) ?> </strong> </div> <div class="block-content" aria-labelledby="block-amazon-login-heading"> <p><?= $block->escapeHtml(__('With Amazon Pay and Login with Amazon, you can easily sign-in and use the ' . 'shipping and payment information stored in your Amazon account to place an order on this shop. ')) ?> </p> <div class="actions-toolbar"> <div class="primary"> <div class="amazon-button-container"> <div class="amazon-button-container__cell"> <div id="LoginWithAmazon-<?= /* @noEscape */ $block->getJsId() ?>" class="login-with-amazon" data-mage-init='{"amazonButton": {"buttonType": "LwA"}}'> </div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-mage-init='{"dropdown": {"activeClass": "_active"}}' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> </span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true"> <?= $block->escapeHtml(__('Securely login into our website using your ' . 'existing Amazon details.')); ?> </div> </div> </div> </div> </div> </div> </div> </div> login-with-amazon-module/view/frontend/templates/oAuthRedirect.phtml000077700000002074151323541140022003 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <?php /** @var $block \Amazon\Login\Block\OAuthRedirect */ ?> <div> <?= $block->escapeHtml(__('You will be redirected shortly...')); ?><br/> <?= $block->escapeHtml(__( 'If you are not redirected automatically, try refreshing the page,' . ' or return to your cart and use another payment method.' )); ?> </div> <script> require([ 'jquery', 'Amazon_Login/js/amazon-redirect' ], function ($) { 'use strict'; $.amazon.AmazonRedirect(); }); </script> login-with-amazon-module/view/frontend/templates/form/validate.phtml000077700000006510151323541140021774 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <div class="amazon-validate-container"> <div class="block block-amazon-validate"> <div class="block-title"> <strong id="block-amazon-login-heading" role="heading" aria-level="2"> <?= $block->escapeHtml(__('Welcome back!')) ?> </strong> </div> <div class="block-content" aria-labelledby="block-amazon-login-heading"> <p><?= $block->escapeHtml(__('A shop account for this email address already exists. Please enter your ' . 'shop accounts password to log in without leaving the shop.')) ?> </p> <form class="form password validate" action="<?= $block->escapeUrl($block->getUrl('*/*/validatepost')) ?>" method="post" id="form-validate" data-mage-init='{"validation":{}}'> <fieldset class="fieldset" data-hasrequired="<?= $block->escapeHtml(__('* Required Fields')) ?>"> <div class="field email required"> <label for="password" class="label"> <span><?= $block->escapeHtml(__('Password')) ?></span> </label> <div class="control"> <input type="password" name="password" alt="password" id="password" class="input-text" value="" data-validate="{required:true}"> </div> </div> <div class="actions-toolbar"> <div class="primary"> <button type="submit" class="action submit primary"> <span><?= $block->escapeHtml(__('Ok')) ?></span> </button> </div> <div class="secondary continue-as-guest"> <a class="action secondary" href="<?= $block->escapeUrl($block->getContinueAsGuestUrl())?>"> <span><?= $block->escapeHtml(__('Continue as Guest')) ?></span> </a> </div> <div class="secondary forgot-password"> <a class="action secondary" href="<?= $block->escapeUrl($block->getForgotPasswordUrl()) ?>"> <span><?= $block->escapeHtml(__('Forgot Your Password?')) ?></span> </a> </div> </div> </fieldset> </form> </div> </div> </div> login-with-amazon-module/view/frontend/templates/form/.htaccess000077700000000177151323541140020736 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/templates/.htaccess000077700000000177151323541140017773 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/layout/default.xml000077700000004307151323541140017661 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="authentication-popup"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="authenticationPopup" xsi:type="array"> <item name="children" xsi:type="array"> <item name="amazon-button" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Login/js/view/login-button-wrapper</item> <item name="sortOrder" xsi:type="string">0</item> <item name="displayArea" xsi:type="string">additional-login-form-fields</item> <item name="config" xsi:type="array"> <item name="tooltip" xsi:type="string" translate="true">Securely login into our website using your existing Amazon details.</item> <item name="componentDisabled" xsi:type="helper" helper="Amazon\Login\Domain\LayoutConfig::isLwaLayoutDisabled"/> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> </page> login-with-amazon-module/view/frontend/layout/customer_account_login.xml000077700000002016151323541140022775 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="customer.login.container"> <block class="Amazon\Login\Block\Login" name="amazon_login" after="customer.new" template="Amazon_Login::login.phtml" /> </referenceContainer> </body> </page> login-with-amazon-module/view/frontend/layout/customer_account_create.xml000077700000002010151323541140023122 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Amazon\Login\Block\Login" name="amazon_login" before="customer_form_register" template="Amazon_Login::login.phtml" /> </referenceContainer> </body> </page> login-with-amazon-module/view/frontend/layout/customer_account_logoutsuccess.xml000077700000002000151323541140024560 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Magento\Framework\View\Element\Template" name="amazon_logout" after="customer_logout" template="Amazon_Login::logout.phtml" /> </referenceContainer> </body> </page> login-with-amazon-module/view/frontend/layout/amazon_login_login_processauthhash.xml000077700000002271151323541140025364 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="page.main.title" display="false"/> <referenceContainer name="content"> <block class="Amazon\Core\Block\Config" name="amazon_config" template="Amazon_Core::config.phtml" /> <block class="Amazon\Login\Block\OAuthRedirect" name="amazon_login_oauth_redirect" template="Amazon_Login::oAuthRedirect.phtml" /> </referenceContainer> </body> </page> login-with-amazon-module/view/frontend/layout/amazon_login_login_validate.xml000077700000002175151323541140023754 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <title>Validate Amazon Account</title> </head> <body> <referenceBlock name="page.main.title" display="false"/> <referenceContainer name="content"> <block class="Amazon\Login\Block\Validate" name="validateAccount" template="Amazon_Login::form/validate.phtml" /> </referenceContainer> </body> </page> login-with-amazon-module/view/frontend/layout/.htaccess000077700000000177151323541140017312 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/requirejs-config.js000077700000001467151323541140020014 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ var config = { map: { '*': { amazonLogout: 'Amazon_Login/js/amazon-logout', amazonOAuthRedirect: 'Amazon_Login/js/amazon-redirect', amazonCsrf: 'Amazon_Login/js/amazon-csrf' } } }; login-with-amazon-module/view/frontend/web/js/amazon-csrf.js000077700000003250151323541140020141 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'sjcl', 'jquery', 'mage/cookies' ], function (sjcl, $) { 'use strict'; return { options: { wordsLength: 8, cookieName: 'amazon-csrf-state' }, /** * Create random string for Amazon CSRF cookie */ generateNewValue: function () { var randomString = sjcl.codec.base64.fromBits(sjcl.random.randomWords(this.options.wordsLength)); $.mage.cookies.set(this.options.cookieName, randomString); return randomString; }, /** * Check if Amazon CSRF cookie is valid and clear cookie * @param {String} stateString * @returns {Boolean} */ isValid: function (stateString) { var isValid = $.mage.cookies.get(this.options.cookieName) === stateString; this.clear(); // always clear nonce when validating return isValid; }, /** * Clear Amazon CSRF cookie */ clear: function () { $.mage.cookies.clear(this.options.cookieName); } }; }); login-with-amazon-module/view/frontend/web/js/view/login-button-wrapper.js000077700000001615151323541140022775 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define(['uiRegistry', 'Amazon_Login/js/view/login-button', 'uiComponent'], function(registry, login, component) { 'use strict'; var amazonPayment = registry.get('amazonPayment'); if (amazonPayment !== undefined && amazonPayment.allowAmLoginLoading === true) { return login; } return component; }); login-with-amazon-module/view/frontend/web/js/view/login-button.js000077700000002655151323541140021324 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( [ 'jquery', 'uiComponent', 'ko', 'Magento_Customer/js/model/customer', 'Amazon_Payment/js/model/storage', 'amazonPaymentConfig' ], function ( $, Component, ko, customer, amazonStorage, amazonPaymentConfig ) { 'use strict'; return Component.extend({ defaults: { template: 'Amazon_Login/login-button' }, isCustomerLoggedIn: customer.isLoggedIn, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isLwaVisible: ko.observable(amazonPaymentConfig.getValue('isLwaEnabled')), /** * Initialize login button */ initialize: function () { this._super(); } }); } ); login-with-amazon-module/view/frontend/web/js/view/.htaccess000077700000000177151323541140020140 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/js/amazon-redirect.js000077700000006426151323541140021015 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'jquery', 'amazonCore', 'amazonPaymentConfig', 'amazonCsrf', 'Magento_Customer/js/customer-data', 'mage/loader', 'mage/cookies' ], function ($, amazonCore, amazonPaymentConfig, amazonCsrf, customerData) { 'use strict'; var self; $.widget('amazon.AmazonRedirect', { /** * @private */ _create: function () { self = this; // start the loading animation. WIll en on redirect, no explicit stop here $('body').trigger('processStart'); //verify nonce first this.redirectOnInvalidState(); // we don't have the customer's consent or invalid request this.redirectOnRequestWithError(); this.setAuthStateCookies(); self.redirect(); }, /** * getURLParamater from URL for access OAuth Token * @param {String} name * @param {String} source * @returns {String|Null} */ getURLParameter: function (name, source) { return decodeURIComponent((new RegExp('[?|&|#]' + name + '=' + '([^&]+?)(&|#|;|$)').exec(source) || [,''])[1].replace( /\+/g, '%20' )) || null; }, /** * Set State Cache Auth Cookies if they aren't already set * @returns {Boolean} */ setAuthStateCookies: function () { var token = this.getURLParameter('access_token', location.hash); if (typeof token === 'string' && token.match(/^Atza/)) { $.mage.cookies.set('amazon_Login_accessToken', token); } return true; }, /** * Redirect user to correct controller which logs them into M2 via Amazon hash */ redirect: function () { window.location = amazonPaymentConfig.getValue('redirectUrl') + '?access_token=' + this.getURLParameter('access_token', location.hash); }, /** * Redirect user on invalid state */ redirectOnInvalidState: function () { var state = this.getURLParameter('state', location.hash); if (!state || !amazonCsrf.isValid(state)) { window.location = amazonPaymentConfig.getValue('customerLoginPageUrl'); } }, /** * Redirect user on request error */ redirectOnRequestWithError: function () { if (this.getURLParameter('error', window.location)) { window.location = amazonPaymentConfig.getValue('customerLoginPageUrl'); } } }); return $.amazon.AmazonRedirect; }); login-with-amazon-module/view/frontend/web/js/amazon-logout.js000077700000002536151323541140020523 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'jquery', 'amazonCore', 'mage/cookies' ], function ($, core) { 'use strict'; $.widget('amazon.AmazonLogout', { options: { onInit: false }, /** * Create Amazon Logout Widget * @private */ _create: function () { if (this.options.onInit) { core.AmazonLogout(); //logout amazon user on init $.mage.cookies.clear('amazon_Login_accessToken'); } }, /** * Logs out a user if called directly * @private */ _logoutAmazonUser: function () { core.AmazonLogout(); $.mage.cookies.clear('amazon_Login_accessToken'); } }); return $.amazon.AmazonLogout; }); login-with-amazon-module/view/frontend/web/js/.htaccess000077700000000177151323541140017166 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/template/login-button.html000077700000003031151323541140022066 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko foreach: getRegion('before-amazon-button') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> <div class="amazon-button-container" data-bind="visible: !isAmazonAccountLoggedIn() && isLwaVisible()"> <div class="amazon-button-container__cell"> <div id="LoginWithAmazon" class="login-with-amazon" data-bind="mageInit: {'amazonButton':{'buttonType': 'LwA'}}"></div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true" data-bind="text: tooltip"></div> </div> </div> </div> <!-- ko foreach: getRegion('after-amazon-button') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> login-with-amazon-module/view/frontend/web/template/.htaccess000077700000000177151323541140020365 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/css/source/_module.less000077700000005072151323541140021357 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ @import 'module/_vars.less'; & when (@media-common = true) { .amazon-button-container { display: table; margin: 0 0 22px; &__cell { display: table-cell; min-width: 45px; position: relative; } img { display: block; } .field-tooltip { display: none; margin: -12px 0 0; right: 5px; top: 50%; } .checkout-shipping-address & { margin: 22px 0; } } .login-container { .block { &-amazon-login { .actions-toolbar { margin-top: 25px; } } } } .amazon-validate-container { .block { .block-title { &:extend(.abs-login-block-title all); .lib-font-size(18); } } .fieldset { .lib-form-hasrequired(bottom); &:after { margin-top: 35px; } } } } @media all and (max-width: @screen__m) { .amazon-button-container { width: 100%; } } // // Desktop // --------------------------------------------- .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .login-container { .block { &-amazon-login { clear: none; float: right; .actions-toolbar { margin-top: 25px; } } &:nth-child(2) + .block-amazon-login { clear: none; } } } .amazon-validate-container { margin: 40px auto 0 auto; width: 500px; .primary { width: 190px; } .continue-as-guest { width: 130px; } .forgot-password { text-align: right; width: 175px; } } } .amazon-logout-widget { display: none; } login-with-amazon-module/view/frontend/web/css/source/module/_vars.less000077700000001364151323541140022332 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /** * Amazon Pay variables **/ @amazon-tooltip-background: #999; @amazon-tooltip-border: #999; @amazon-tooltip-background__hover: #333; @amazon-tooltip-border__hover: #333; login-with-amazon-module/view/frontend/web/css/source/module/.htaccess000077700000000177151323541140022127 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/css/source/.htaccess000077700000000177151323541140020642 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/css/.htaccess000077700000000177151323541140017342 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/web/.htaccess000077700000000177151323541140016552 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/frontend/.htaccess000077700000000177151323541140015775 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/view/.htaccess000077700000000177151323541140014156 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/i18n/es_AR.csv000077700000003711151323541140013670 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago."login-with-amazon-module/i18n/es_CL.csv000077700000003712151323541140013665 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/es_PA.csv000077700000003712151323541140013667 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/it_IT.csv000077700000003607151323541140013713 0ustar00"Action is not available","Azione non disponibile" "Error processing Amazon Login","Errore durante l'elaborazione dell'accesso Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Esiste già un account negozio per questo indirizzo e-mail. Immetti la password del tuo account negozio per accedere senza uscire dal negozio." "Login with Amazon","Accedi con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay e Accedi con Amazon, puoi usare le informazioni su pagamento e spedizione registrate nel tuo account Amazon per effettuare un ordine su questo sito web. <br />È un modo pratico e affidabile di effettuare i pagamenti, utilizzato da milioni di utenti. Selezionando Amazon Pay, ti verrà chiesto di accedere in modo sicuro al tuo account Amazon senza uscire dal sito." "Securely login into our website using your existing Amazon details.","Accedi in modo sicuro al nostro sito web utilizzando i dati Amazon di cui già disponi." "Welcome back!","Bentornato!" "Continue as Guest","Prosegui come ospite" "the email address for your Amazon account is invalid","L'indirizzo e-mail del tuo account Amazon non è valido." "* Required Fields","* Campi obbligatori" "Password","Password" "Ok","OK" "Forgot Your Password?","Hai dimenticato la password?" "Login with Amazon available in authentication popup","Accedi con Amazon disponibile nel pop-up di autenticazione" "You will be redirected shortly...","Verrai reindirizzato a breve..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Se non vieni reindirizzato automaticamente, prova a ricaricare la pagina o torna al carrello e utilizza un altro metodo di pagamento." login-with-amazon-module/i18n/es_MX.csv000077700000003712151323541140013713 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/de_CH.csv000077700000003400151323541140013634 0ustar00"Action is not available","Aktion ist nicht verfügbar" "Error processing Amazon Login","Fehler bei der Amazon-Anmeldung" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Für diese E-Mail-Adresse ist bereits ein Shopkonto vorhanden. Geben Sie das Passwort Ihres Shopkontos ein, um sich anzumelden, ohne den Shop zu verlassen." "Login with Amazon","Melden Sie sich bei Amazon an" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Mit Amazon Pay und Login mit Amazon können Sie sich auf einfache Weise anmelden und die Liefer- und Zahlungsdaten aus Ihrem Amazon-Kundenkonto verwenden, um auf dieser Website eine Bestellung aufzugeben." "Securely login into our website using your existing Amazon details.","Verwenden Sie Ihre Amazon-Anmeldedaten, um sich sicher bei unserer Website anzumelden." "Welcome back!","Willkommen zurück!" "Continue as Guest","Als Gast fortfahren" "the email address for your Amazon account is invalid","Die E-Mail-Adresse für Ihr Amazon-Kundenkonto ist nicht gültig." "* Required Fields","* Pflichtfelder" "Password","Passwort" "Ok","OK" "Forgot Your Password?","Passwort vergessen?" "Login with Amazon available in authentication popup","Login mit Amazon im Anmelde-Popup anzeigen" "You will be redirected shortly...","Sie werden in Kürze weitergeleitet..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Falls Sie nicht weitergeleitet werden, versuchen Sie bitte die Seite neu zu laden, oder gehen Sie zurück zum Warenkorb um ggf. eine andere Zahlungsmethode zu verwenden." login-with-amazon-module/i18n/fr_CA.csv000077700000004074151323541140013654 0ustar00"Action is not available","Action non disponible" "Error processing Amazon Login","Erreur lors du traitement de l'identifiant Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Un compte pour cette boutique existe déjà avec cette adresse e-mail. Saisissez le mot de passe du compte de cette boutique afin de vous connecter sans quitter la boutique." "Login with Amazon","Connectez-vous avec Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Amazon Pay et Connectez-vous avec Amazon vous permet d'utiliser les informations de paiement et d'expédition stockées dans votre compte Amazon pour passer une commande sur ce site Web. <br />Des millions d'utilisateurs bénéficient déjà de ce mode de paiement simple et éprouvé. En sélectionnant Amazon Pay, vous serez invité à vous connecter de manière sécurisée à votre compte Amazon sans quitter le site." "Securely login into our website using your existing Amazon details.","Connectez-vous en toute sécurité à notre site Web à l'aide de vos identifiants Amazon existants." "Welcome back!","Bienvenue !" "Continue as Guest","Continuer en tant qu'invité" "the email address for your Amazon account is invalid","L'adresse e-mail de votre compte Amazon n'est pas valide." "* Required Fields","* Champs requis" "Password","Mot de passe" "Ok","OK" "Forgot Your Password?","Vous avez oublié votre mot de passe ?" "Login with Amazon available in authentication popup","Connectez-vous avec Amazon disponible dans la fenêtre pop-up d'authentification" "You will be redirected shortly...","Vous allez être automatiquement redirigé..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si vous n’êtes pas automatiquement redirigé, veuillez rafraîchir la page ou veuillez retourner à votre panier et sélectionner une autre méthode de paiement." login-with-amazon-module/i18n/es_PE.csv000077700000003712151323541140013673 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/es_CR.csv000077700000003712151323541140013673 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/en_US.csv000077700000022041151323541140013705 0ustar00"--","--" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station." "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","A store account for this email address already exists. Please enter your store account password to log in without leaving the store." "Access Key Id","Access Key Id" "Action is not available","Action is not available" "Advanced","Advanced" "Allowed IPs","Allowed IPs" "Allowed Javascript Origins","Allowed Javascript Origins" "Allowed Return URLs","Allowed Return URLs" "Amazon authorize invalid state : %1 with reason %2","Unexpected state for the Amazon Pay authoriziation. State: %1, Reason code: %2" "Amazon capture declined : %1","Amazon Pay declined the capture. Reason code: %1" "Amazon capture invalid state : %1 with reason %2","Unexpected state for the Amazon Pay capture. State: %1, Reason code: %2" "Amazon could not process your request.","Amazon Pay could not process your request. Please try again." "Amazon refund invalid state : %1 with reason %2","Unexpected state for the Amazon Pay refund. State: %1, Reason code: %2" "Amazon Pay","Amazon Pay" "Amazon Pay button in minicart","Amazon Pay button in minicart" "Amazon Pay button is visible on Product Page","Amazon Pay button is visible on Product Page" "Amazon Pay Logo","Amazon Pay Logo" "Amazon Pay refund successful.","Amazon Pay refund successful." "An unsupported currency is currently selected. Please review our configuration guide.","An unsupported currency is currently selected. Please review our configuration guide." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account." "Asynchronous","Asynchronous" "Authorization Mode","Authorization Mode" "Authorization soft decline","Authorization soft decline" "Authorization hard decline","Authorization hard decline" "Authorization timed out","Authorization timed out" "Button Color","Button Color" "Button Display Language","Button Display Language" "Button Size","Button Size" "Capture declined","Capture declined" "Capture pending","Capture pending" "Captured amount of %1 online","Captured amount of %1 online." "Capture declined for Order <a href=""%2"">#%1</a>","Capture declined for Order <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Capture pending approval from the payment gateway. Please check back later." "Charge on Order","Charge on Order" "Charge on Shipment","Charge on Shipment" "click here to display the categories","click here to display the categories" "Client Id","Client Id" "Client Secret","Client Secret" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients." "Continue as Guest","Continue as Guest" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Could not find the ""multiline_count"" config of the ""street"" Customer address attribute." "Credentials,Credentials" "Credentials JSON","Credentials JSON" "Dark Gray","Dark Gray" "Data Polling via Cron Job","Data Polling via Cron Job" "Declined amount of %1 online","Online Capture of amount %1 was declined." "Developer Options","Developer Options" "Enable Amazon Pay","Enable Amazon Pay" "Enable Login with Amazon","Enable Login with Amazon" "Euro Region","Euro Region" "Error processing Amazon Login","Error processing Amazon Login" "Excluded Categories","Excluded Categories" "Extra Large","Extra Large" "Forgot Your Password?","Forgot Your Password?" "Frontend","Frontend" "General","General" "Get started with account registration","Get started with account registration" "Gold","Gold" "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin." "Instant Payment Notifications","Instant Payment Notifications" "Is Packing Stations Terms Validation Enabled","Is Packing Stations Terms Validation Enabled" "I've already setup Pay with Amazon, I want to edit my settings","I've already setup Amazon Pay, I want to edit my settings" "Japan","Japan" "Large","Large" "Light Gray","Light Gray" "Logging","Logging" "Login / Pay","Login / Pay" "Login with Amazon","Login with Amazon" "Login with Amazon / Amazon Pay","Login with Amazon / Amazon Pay" "Login with Amazon available in authentication popup","Login with Amazon available in authentication popup" "Medium","Medium" "Merchant Id","Merchant Id" "Module version","Module version" "My account is ready, I need to connect it to Magento","My account is ready, I need to connect it to Magento" "New Order Status","New Order Status" "No Simulation","No Simulation" "Ok","Ok" "Options","Options" "or","or" "Packing Stations Terms","Packing Stations Terms" "Password","Password" "Paste JSON credentials here","Paste JSON credentials here" "Payment Action","Payment Action" "Payment Region","Payment Region" "Please select a payment method.","Please select a payment method." "Refund declined","Refund declined" "* Required Fields","* Required Fields" "Return to standard checkout","Return to standard checkout" "Sales Exclusions","Sales Exclusions" "Sales Options","Sales Options" "Sandbox","Sandbox" "Save Credentials","Save Credentials" "Secret Access Key","Secret Access Key" "Securely login into our website using your existing Amazon details.","Securely login to our website using your existing Amazon details." "Simulate Payment Scenarios","Simulate Payment Scenarios" "Small","Small" "Successfully cancelled Amazon Pay","Successfully cancelled Amazon Pay" "Synchronous","Synchronous" "Synchronous if Possible","Synchronous if Possible" "The ""Amazon Pay"" button will not be available for products of the selected categories.","The ""Amazon Pay"" button will not be available for products of the selected categories." "the country for your address is not allowed for this store","The country associated with your address is not allowed for this store." "The currency selected is not supported by Amazon Pay","The currency selected is not supported by Amazon Pay on this store." "the email address for your Amazon account is invalid","The email address for your Amazon account is invalid." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","There has been a problem with the selected payment method on your Amazon account. Please choose another one." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Unfortunately it is not possible to Pay with Amazon Pay for this order. Please choose another payment method." "United Kingdom","United Kingdom" "United States","United States" "Update Mechanism","Update Mechanism" "Updating your config with new keys, please wait...","Updating your config with new keys, please wait..." "Valid JSON credentials are required.","Valid JSON credentials are required." "Welcome back!","Welcome back!" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop." "You will be registering for a %1 account based on the base currency of your shop (%2).","You will be registering for a %1 account based on the base currency of your shop (%2)." "Your session has expired, please reload the page and try again.","Your session has expired, please reload the page and try again." "You will be redirected shortly...","You will be redirected shortly..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method." login-with-amazon-module/i18n/de_AT.csv000077700000003400151323541140013646 0ustar00"Action is not available","Aktion ist nicht verfügbar" "Error processing Amazon Login","Fehler bei der Amazon-Anmeldung" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Für diese E-Mail-Adresse ist bereits ein Shopkonto vorhanden. Geben Sie das Passwort Ihres Shopkontos ein, um sich anzumelden, ohne den Shop zu verlassen." "Login with Amazon","Melden Sie sich bei Amazon an" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Mit Amazon Pay und Login mit Amazon können Sie sich auf einfache Weise anmelden und die Liefer- und Zahlungsdaten aus Ihrem Amazon-Kundenkonto verwenden, um auf dieser Website eine Bestellung aufzugeben." "Securely login into our website using your existing Amazon details.","Verwenden Sie Ihre Amazon-Anmeldedaten, um sich sicher bei unserer Website anzumelden." "Welcome back!","Willkommen zurück!" "Continue as Guest","Als Gast fortfahren" "the email address for your Amazon account is invalid","Die E-Mail-Adresse für Ihr Amazon-Kundenkonto ist nicht gültig." "* Required Fields","* Pflichtfelder" "Password","Passwort" "Ok","OK" "Forgot Your Password?","Passwort vergessen?" "Login with Amazon available in authentication popup","Login mit Amazon im Anmelde-Popup anzeigen" "You will be redirected shortly...","Sie werden in Kürze weitergeleitet..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Falls Sie nicht weitergeleitet werden, versuchen Sie bitte die Seite neu zu laden, oder gehen Sie zurück zum Warenkorb um ggf. eine andere Zahlungsmethode zu verwenden." login-with-amazon-module/i18n/es_CO.csv000077700000003712151323541140013670 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/fr_FR.csv000077700000004074151323541140013700 0ustar00"Action is not available","Action non disponible" "Error processing Amazon Login","Erreur lors du traitement de l'identifiant Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Un compte pour cette boutique existe déjà avec cette adresse e-mail. Saisissez le mot de passe du compte de cette boutique afin de vous connecter sans quitter la boutique." "Login with Amazon","Connectez-vous avec Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Amazon Pay et Connectez-vous avec Amazon vous permet d'utiliser les informations de paiement et d'expédition stockées dans votre compte Amazon pour passer une commande sur ce site Web. <br />Des millions d'utilisateurs bénéficient déjà de ce mode de paiement simple et éprouvé. En sélectionnant Amazon Pay, vous serez invité à vous connecter de manière sécurisée à votre compte Amazon sans quitter le site." "Securely login into our website using your existing Amazon details.","Connectez-vous en toute sécurité à notre site Web à l'aide de vos identifiants Amazon existants." "Welcome back!","Bienvenue !" "Continue as Guest","Continuer en tant qu'invité" "the email address for your Amazon account is invalid","L'adresse e-mail de votre compte Amazon n'est pas valide." "* Required Fields","* Champs requis" "Password","Mot de passe" "Ok","OK" "Forgot Your Password?","Vous avez oublié votre mot de passe ?" "Login with Amazon available in authentication popup","Connectez-vous avec Amazon disponible dans la fenêtre pop-up d'authentification" "You will be redirected shortly...","Vous allez être automatiquement redirigé..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si vous n’êtes pas automatiquement redirigé, veuillez rafraîchir la page ou veuillez retourner à votre panier et sélectionner une autre méthode de paiement." login-with-amazon-module/i18n/en_GB.csv000077700000003141151323541140013646 0ustar00"Action is not available","Action is not available" "Error processing Amazon Login","Error processing Amazon Login" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","A store account for this email address already exists. Please enter your store account password to log in without leaving the store." "Login with Amazon","Login with Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop." "Securely login into our website using your existing Amazon details.","Securely login to our website using your existing Amazon details." "Welcome back!","Welcome back!" "Continue as Guest","Continue as Guest" "the email address for your Amazon account is invalid","The email address for your Amazon account is invalid." "* Required Fields","* Required Fields" "Password","Password" "Ok","Ok" "Forgot Your Password?","Forgot Your Password?" "Login with Amazon available in authentication popup","Login with Amazon available in authentication popup" "You will be redirected shortly...","You will be redirected shortly..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method." login-with-amazon-module/i18n/.htaccess000077700000000177151323541140013763 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/i18n/es_VE.csv000077700000003712151323541140013701 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/de_DE.csv000077700000003400151323541140013632 0ustar00"Action is not available","Aktion ist nicht verfügbar" "Error processing Amazon Login","Fehler bei der Amazon-Anmeldung" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Für diese E-Mail-Adresse ist bereits ein Shopkonto vorhanden. Geben Sie das Passwort Ihres Shopkontos ein, um sich anzumelden, ohne den Shop zu verlassen." "Login with Amazon","Melden Sie sich bei Amazon an" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Mit Amazon Pay und Login mit Amazon können Sie sich auf einfache Weise anmelden und die Liefer- und Zahlungsdaten aus Ihrem Amazon-Kundenkonto verwenden, um auf dieser Website eine Bestellung aufzugeben." "Securely login into our website using your existing Amazon details.","Verwenden Sie Ihre Amazon-Anmeldedaten, um sich sicher bei unserer Website anzumelden." "Welcome back!","Willkommen zurück!" "Continue as Guest","Als Gast fortfahren" "the email address for your Amazon account is invalid","Die E-Mail-Adresse für Ihr Amazon-Kundenkonto ist nicht gültig." "* Required Fields","* Pflichtfelder" "Password","Passwort" "Ok","OK" "Forgot Your Password?","Passwort vergessen?" "Login with Amazon available in authentication popup","Login mit Amazon im Anmelde-Popup anzeigen" "You will be redirected shortly...","Sie werden in Kürze weitergeleitet..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Falls Sie nicht weitergeleitet werden, versuchen Sie bitte die Seite neu zu laden, oder gehen Sie zurück zum Warenkorb um ggf. eine andere Zahlungsmethode zu verwenden." login-with-amazon-module/i18n/es_ES.csv000077700000003712151323541140013676 0ustar00"Action is not available","Esta acción no está disponible" "Error processing Amazon Login","Error al procesar inicio de sesión de Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Ya existe una cuenta de tienda para esta dirección de correo. Introduce la contraseña de tu cuenta de tienda para iniciar sesión sin salir de la tienda." "Login with Amazon","Login con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay y Login con Amazon podrás utilizar la información de envío y pago almacenada en tu cuenta de Amazon para realizar pedidos en la página web. <br />Supone una forma de pago conveniente y fiable que ya disfrutan millones de compradores. Al seleccionar Amazon Pay, tendrás que iniciar sesión con seguridad en tu cuenta de Amazon sin salir del sitio web." "Securely login into our website using your existing Amazon details.","Inicia sesión con seguridad en tu sitio web utilizando tus credenciales de Amazon." "Welcome back!","¡Hola de nuevo!" "Continue as Guest","Continuar como invitado" "the email address for your Amazon account is invalid","La dirección de correo electrónico de tu cuenta de Amazon no es válida." "* Required Fields","* Campos obligatorios" "Password","Contraseña" "Ok","Aceptar" "Forgot Your Password?","¿Has olvidado la contraseña?" "Login with Amazon available in authentication popup","Login con Amazon disponible en la ventana emergente de iniciar sesión" "You will be redirected shortly...","En breve serás redirigido a una nueva página..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Si no fueses redirigido automáticamente, intenta refrescar la página o vuelve al carro de compra y utiliza otro medio de pago." login-with-amazon-module/i18n/it_CH.csv000077700000003607151323541140013671 0ustar00"Action is not available","Azione non disponibile" "Error processing Amazon Login","Errore durante l'elaborazione dell'accesso Amazon" "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","Esiste già un account negozio per questo indirizzo e-mail. Immetti la password del tuo account negozio per accedere senza uscire dal negozio." "Login with Amazon","Accedi con Amazon" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","Con Amazon Pay e Accedi con Amazon, puoi usare le informazioni su pagamento e spedizione registrate nel tuo account Amazon per effettuare un ordine su questo sito web. <br />È un modo pratico e affidabile di effettuare i pagamenti, utilizzato da milioni di utenti. Selezionando Amazon Pay, ti verrà chiesto di accedere in modo sicuro al tuo account Amazon senza uscire dal sito." "Securely login into our website using your existing Amazon details.","Accedi in modo sicuro al nostro sito web utilizzando i dati Amazon di cui già disponi." "Welcome back!","Bentornato!" "Continue as Guest","Prosegui come ospite" "the email address for your Amazon account is invalid","L'indirizzo e-mail del tuo account Amazon non è valido." "* Required Fields","* Campi obbligatori" "Password","Password" "Ok","OK" "Forgot Your Password?","Hai dimenticato la password?" "Login with Amazon available in authentication popup","Accedi con Amazon disponibile nel pop-up di autenticazione" "You will be redirected shortly...","Verrai reindirizzato a breve..." "If you are not redirected automatically, try refreshing the page, or return to your cart and use another payment method.","Se non vieni reindirizzato automaticamente, prova a ricaricare la pagina o torna al carrello e utilizza un altro metodo di pagamento." login-with-amazon-module/etc/adminhtml/system.xml000077700000003175151323541140016205 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment"> <group id="amazon_payment"> <group id="advanced"> <group id="frontend"> <field id="amazon_login_in_popup" translate="label comment" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Login with Amazon in authentication popup</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/amazon_login_in_popup</config_path> <comment><![CDATA[Displays Login with Amazon Pay option in Magento's account login popup.]]></comment> </field> </group> </group> </group> </section> </system> </config> login-with-amazon-module/etc/adminhtml/.htaccess000077700000000177151323541140015734 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/etc/events.xml000077700000002414151323541140014203 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="amazon_customer_authenticated"> <observer name="amazon_login_customer_authenticated" instance="Amazon\Login\Observer\AmazonCustomerAuthenticated" /> </event> <event name="amazon_login_authorize_error"> <observer name="amazon_login_set_cookie_on_authorize_error" instance="Amazon\Login\Observer\SetAuthorizeErrorCookie" /> </event> <event name="customer_logout"> <observer name="amazon_login_set_logout_cookie" instance="Amazon\Login\Observer\SetLogoutCookie" /> </event> </config> login-with-amazon-module/etc/frontend/events.xml000077700000001664151323541140016030 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="amazon_customer_authenticated"> <observer name="amazon_login_persistent" instance="Magento\Persistent\Observer\CustomerAuthenticatedEventObserver" /> </event> </config> login-with-amazon-module/etc/frontend/routes.xml000077700000001620151323541140016035 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="amazon_login" frontName="amazon"> <module name="Amazon_Login" /> </route> </router> </config> login-with-amazon-module/etc/frontend/di.xml000077700000002131151323541140015106 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\Model\CompositeConfigProvider"> <arguments> <argument name="configProviders" xsi:type="array"> <item name="amazon_login_checkout_config_provider" xsi:type="object">Amazon\Login\Model\CheckoutConfigProvider\Proxy</item> </argument> </arguments> </type> </config> login-with-amazon-module/etc/frontend/.htaccess000077700000000177151323541140015576 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/etc/module.xml000077700000001616151323541140014167 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Amazon_Login" setup_version="4.2.0"> <sequence> <module name="Amazon_Core"/> </sequence> </module> </config> login-with-amazon-module/etc/extension_attributes.xml000077700000002137151323541140017163 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface"> <attribute code="amazon_id" type="string"> <join reference_table="amazon_customer" reference_field="customer_id" join_on_field="entity_id"> <field>amazon_id</field> </join> </attribute> </extension_attributes> </config> login-with-amazon-module/etc/di.xml000077700000007652151323541140013304 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Amazon\Login\Api\CustomerLinkRepositoryInterface" type="Amazon\Login\Model\CustomerLinkRepository" /> <preference for="Amazon\Login\Api\CustomerLinkManagementInterface" type="Amazon\Login\Model\CustomerLinkManagement" /> <preference for="Amazon\Login\Api\CustomerManagementInterface" type="Amazon\Login\Model\CustomerManagement" /> <preference for="Amazon\Login\Api\Data\CustomerLinkInterface" type="Amazon\Login\Model\ResourceModel\CustomerLink" /> <preference for="Amazon\Login\Api\Data\CustomerLinkSearchResultsInterface" type="Magento\Framework\Api\SearchResults" /> <type name="Amazon\Login\Model\Customer\MatcherInterface"> <arguments> <argument name="matchers" xsi:type="array"> <item name="sessionmatcher" xsi:type="object">Amazon\Login\Model\Customer\SessionMatcher</item> <item name="idmatcher" xsi:type="object">Amazon\Login\Model\Customer\IdMatcher</item> <item name="emailmatcher" xsi:type="object">Amazon\Login\Model\Customer\EmailMatcher</item> </argument> </arguments> </type> <type name="Magento\Customer\Api\CustomerRepositoryInterface"> <plugin name="amazon_login_customer_repository" type="Amazon\Login\Plugin\CustomerRepository" sortOrder="1" /> </type> <type name="Magento\Customer\Model\ResourceModel\Customer\Collection"> <plugin name="amazon_login_customer_collection" type="Amazon\Login\Plugin\CustomerCollection" sortOrder="1" /> </type> <type name="Magento\Checkout\Controller\Cart\Index"> <plugin name="amazon_login_cart_controller" type="Amazon\Login\Plugin\CartController" sortOrder="1" /> </type> <type name="Magento\Checkout\Controller\Index\Index"> <plugin name="amazon_login_checkout_controller" type="Amazon\Login\Plugin\CheckoutController" sortOrder="1" /> </type> <type name="Magento\Customer\Controller\Account\Login"> <plugin name="amazon_login_login_controller" type="Amazon\Login\Plugin\LoginController" sortOrder="1" /> </type> <type name="Magento\Customer\Controller\Account\Create"> <plugin name="amazon_login_create_controller" type="Amazon\Login\Plugin\CreateController" sortOrder="1" /> </type> <type name="Amazon\Login\Controller\Login\Authorize"> <arguments> <argument name="matcher" xsi:type="object">Amazon\Login\Model\Customer\CompositeMatcher</argument> </arguments> </type> <type name="Amazon\Login\Helper\Session"> <arguments> <argument name="session" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> </arguments> </type> <type name="Magento\Sales\Api\OrderCustomerManagementInterface"> <plugin name="amazon_login_order_customer_service" type="Amazon\Login\Plugin\OrderCustomerManagement" sortOrder="1" /> </type> <type name="Amazon\Login\Model\Customer\Account\Redirect"> <arguments> <argument name="checkoutSession" xsi:type="object">Magento\Checkout\Model\Session\Proxy</argument> <argument name="customerSession" xsi:type="object">Magento\Customer\Model\Session\Proxy</argument> </arguments> </type> </config> login-with-amazon-module/etc/.htaccess000077700000000177151323541140013757 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/etc/config.xml000077700000001673151323541140014152 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <amazon_payment> <amazon_login_in_popup>1</amazon_login_in_popup> </amazon_payment> </payment> </default> </config> login-with-amazon-module/LICENSE000077700000026136151323541140012416 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. login-with-amazon-module/Plugin/LoginController.php000077700000003317151323541140016470 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Magento\Customer\Controller\Account\Login; use Magento\Customer\Model\Session; use Magento\Customer\Model\Url; use Magento\Framework\Controller\ResultInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class LoginController { /** * @var Session */ private $session; /** * @var Url */ private $url; public function __construct(Session $session, Url $url) { $this->session = $session; $this->url = $url; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterExecute(Login $login, ResultInterface $result) { $this->session->setAfterAmazonAuthUrl($this->url->getAccountUrl()); return $result; } } login-with-amazon-module/Plugin/CheckoutController.php000077700000003351151323541140017163 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Magento\Checkout\Controller\Index\Index; use Magento\Customer\Model\Session; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\UrlInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CheckoutController { /** * @var Session */ private $session; /** * @var UrlInterface */ private $url; public function __construct(Session $session, UrlInterface $url) { $this->session = $session; $this->url = $url; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterExecute(Index $index, ResultInterface $result) { $this->session->setAfterAmazonAuthUrl($this->url->getUrl('checkout')); return $result; } } login-with-amazon-module/Plugin/CustomerCollection.php000077700000005704151323541140017173 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Closure; use Amazon\Core\Helper\Data as AmazonHelper; use Magento\Customer\Model\ResourceModel\Customer\Collection; use Magento\Eav\Model\Entity\Attribute\AttributeInterface; use Magento\Framework\DB\Select; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerCollection { /** * @var AmazonHelper */ private $amazonHelper; /** * @param AmazonHelper $amazonHelper */ public function __construct( AmazonHelper $amazonHelper ) { $this->amazonHelper = $amazonHelper; } /** * Resolve issue with core magento not allowing extension attributes to be applied as filter * * @param Collection $collection * @param Closure $proceed * @param AttributeInterface|integer|string|array $attribute * @param array|string|null $condition * @param string $joinType * * @return Collection */ public function aroundAddAttributeToFilter( Collection $collection, Closure $proceed, $attribute, $condition = null, $joinType = 'inner' ) { if ($this->amazonHelper->isLwaEnabled() && is_array($attribute)) { $attribute = $this->addAmazonIdFilter($attribute, $collection); if (0 === count($attribute)) { return $collection; } } return $proceed($attribute, $condition, $joinType); } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ private function addAmazonIdFilter(array $attribute, Collection $collection) { foreach ($attribute as $key => $condition) { if ('amazon_id' == $condition['attribute']) { $collection->getSelect()->where('extension_attribute_amazon_id.amazon_id = ?', $condition['eq']); unset($attribute[$key]); } } return $attribute; } } login-with-amazon-module/Plugin/OrderCustomerManagement.php000077700000006314151323541140020146 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Amazon\Core\Helper\Data; use Amazon\Login\Api\CustomerLinkManagementInterface; use Amazon\Login\Helper\Session as LoginSessionHelper; use Amazon\Payment\Gateway\Config\Config; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Sales\Api\OrderCustomerManagementInterface; use Magento\Sales\Api\OrderRepositoryInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderCustomerManagement { /** * @var LoginSessionHelper */ private $loginSessionHelper; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var CustomerLinkManagementInterface */ private $customerLinkManagement; /** * @var Data */ private $coreHelper; /** * @param LoginSessionHelper $loginSessionHelper * @param OrderRepositoryInterface $orderRepository * @param CustomerLinkManagementInterface $customerLinkManagement * @param Data $coreHelper */ public function __construct( LoginSessionHelper $loginSessionHelper, OrderRepositoryInterface $orderRepository, CustomerLinkManagementInterface $customerLinkManagement, Data $coreHelper ) { $this->loginSessionHelper = $loginSessionHelper; $this->orderRepository = $orderRepository; $this->customerLinkManagement = $customerLinkManagement; $this->coreHelper = $coreHelper; } /** * @param OrderCustomerManagementInterface $subject * @param CustomerInterface $result * @param int $orderId * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterCreate(OrderCustomerManagementInterface $subject, $result, $orderId) { if ($this->coreHelper->isLwaEnabled()) { $paymentMethodName = $this->orderRepository->get($orderId)->getPayment()->getMethod(); $isAmazonPayment = $paymentMethodName === Config::CODE; $amazonCustomer = $this->loginSessionHelper->getAmazonCustomer(); if ($isAmazonPayment && $amazonCustomer) { $this->customerLinkManagement->updateLink($result->getId(), $amazonCustomer->getId()); } } return $result; } } login-with-amazon-module/Plugin/CreateController.php000077700000003323151323541140016620 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Magento\Customer\Controller\Account\Create; use Magento\Customer\Model\Session; use Magento\Customer\Model\Url; use Magento\Framework\Controller\ResultInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CreateController { /** * @var Session */ private $session; /** * @var Url */ private $url; public function __construct(Session $session, Url $url) { $this->session = $session; $this->url = $url; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterExecute(Create $create, ResultInterface $result) { $this->session->setAfterAmazonAuthUrl($this->url->getAccountUrl()); return $result; } } login-with-amazon-module/Plugin/.htaccess000077700000000177151323541140014442 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Plugin/CustomerRepository.php000077700000005673151323541140017264 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Amazon\Core\Helper\Data as AmazonHelper; use Amazon\Login\Api\CustomerManagementInterface; use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CustomerRepository { /** * @var CustomerManagementInterface */ private $customerManagement; /** * @var AmazonHelper */ private $amazonHelper; /** * CustomerRepository constructor. * * @param CustomerManagementInterface $customerManagement * @param AmazonHelper $amazonHelper */ public function __construct( CustomerManagementInterface $customerManagement, AmazonHelper $amazonHelper ) { $this->customerManagement = $customerManagement; $this->amazonHelper = $amazonHelper; } /** * Add amazon id extension attribute to customer * * @param CustomerRepositoryInterface $customerRepository * @param CustomerInterface $customer * * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetById(CustomerRepositoryInterface $customerRepository, CustomerInterface $customer) { if ($this->amazonHelper->isEnabled()) { $this->customerManagement->setAmazonIdExtensionAttribute($customer); } return $customer; } /** * Add amazon id extension attribute to customer * * @param CustomerRepositoryInterface $customerRepository * @param CustomerInterface $customer * * @return CustomerInterface * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGet(CustomerRepositoryInterface $customerRepository, CustomerInterface $customer) { if ($this->amazonHelper->isEnabled()) { $this->customerManagement->setAmazonIdExtensionAttribute($customer); } return $customer; } } login-with-amazon-module/Plugin/CartController.php000077700000003344151323541140016311 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Plugin; use Magento\Checkout\Controller\Cart\Index; use Magento\Customer\Model\Session; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\UrlInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CartController { /** * @var Session */ private $session; /** * @var UrlInterface */ private $url; public function __construct(Session $session, UrlInterface $url) { $this->session = $session; $this->url = $url; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterExecute(Index $index, ResultInterface $result) { $this->session->setAfterAmazonAuthUrl($this->url->getUrl('checkout')); return $result; } } login-with-amazon-module/Block/Validate.php000077700000002701151323541140014675 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Block; use Magento\Framework\UrlInterface; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Validate extends Template { public function getForgotPasswordUrl() { return $this->_urlBuilder->getUrl('customer/account/forgotpassword'); } public function getContinueAsGuestUrl() { return $this->_urlBuilder->getUrl('checkout'); } } login-with-amazon-module/Block/Login.php000077700000003327151323541140014221 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Block; use Amazon\Core\Helper\Data; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Login extends Template { /** * @var Data */ private $coreHelper; /** * Login constructor. * @param Context $context * @param Data $coreHelper */ public function __construct(Context $context, Data $coreHelper) { $this->coreHelper = $coreHelper; parent::__construct($context); } /** * @return string */ protected function _toHtml() { if (!$this->coreHelper->isLoginButtonEnabled()) { return ''; } return parent::_toHtml(); } } login-with-amazon-module/Block/OAuthRedirect.php000077700000003246151323541140015653 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Block; use Amazon\Core\Helper\Data; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OAuthRedirect extends Template { /** * @var Data */ private $amazonCoreHelper; /** * @param Context $context * @param Data $amazonCoreHelper */ public function __construct(Context $context, Data $amazonCoreHelper) { parent::__construct($context); $this->amazonCoreHelper = $amazonCoreHelper; } /** * @return string */ public function getRedirectUrl() { return $this->amazonCoreHelper->getRedirectUrl(); } } login-with-amazon-module/Block/.htaccess000077700000000177151323541140014236 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Observer/SetLogoutCookie.php000077700000005007151323541140016762 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Observer; use Amazon\Core\Helper\Data; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; use Magento\Framework\Stdlib\CookieManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SetLogoutCookie implements ObserverInterface { const LOGGEDOUT_COOKIE = 'amz_auth_logout'; /** * @var CookieManagerInterface */ private $cookieManager; /** * @var CookieMetadataFactory */ private $cookieMetadataFactory; /** * @var Data */ private $coreHelper; /** * @param CookieManagerInterface $cookieManager * @param CookieMetadataFactory $cookieMetadataFactory * @param Data $coreHelper */ public function __construct( CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory, Data $coreHelper ) { $this->cookieManager = $cookieManager; $this->cookieMetadataFactory = $cookieMetadataFactory; $this->coreHelper = $coreHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { if ($this->coreHelper->isLwaEnabled()) { $cookieMeta = $this->cookieMetadataFactory ->createPublicCookieMetadata() ->setDuration(86400) ->setPath('/') ->setHttpOnly(false); $this->cookieManager->setPublicCookie(self::LOGGEDOUT_COOKIE, '1', $cookieMeta); } } } login-with-amazon-module/Observer/SetAuthorizeErrorCookie.php000077700000005162151323541140020477 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Observer; use Amazon\Core\Helper\Data; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Stdlib\Cookie\CookieMetadataFactory; use Magento\Framework\Stdlib\CookieManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SetAuthorizeErrorCookie implements ObserverInterface { const LOGIN_AUTHORIZE_ERROR_COOKIE = 'amz_auth_err'; /** * @var CookieManagerInterface */ private $cookieManager; /** * @var CookieMetadataFactory */ private $cookieMetadataFactory; /** * @var Data */ private $coreHelper; /** * @param CookieManagerInterface $cookieManager * @param CookieMetadataFactory $cookieMetadataFactory * @param Data $coreHelper */ public function __construct( CookieManagerInterface $cookieManager, CookieMetadataFactory $cookieMetadataFactory, Data $coreHelper ) { $this->cookieManager = $cookieManager; $this->cookieMetadataFactory = $cookieMetadataFactory; $this->coreHelper = $coreHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { if ($this->coreHelper->isLwaEnabled()) { $cookieMeta = $this->cookieMetadataFactory ->createPublicCookieMetadata() ->setDurationOneYear() ->setPath('/') ->setHttpOnly(false); // JS-accessible $this->cookieManager->setPublicCookie(self::LOGIN_AUTHORIZE_ERROR_COOKIE, '1', $cookieMeta); } } } login-with-amazon-module/Observer/AmazonCustomerAuthenticated.php000077700000003257151323541140021362 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Observer; use Amazon\Login\Helper\Session as SessionHelper; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCustomerAuthenticated implements ObserverInterface { /** * @var SessionHelper */ private $sessionHelper; /** * @param SessionHelper $sessionHelper */ public function __construct(SessionHelper $sessionHelper) { $this->sessionHelper = $sessionHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { $this->sessionHelper->setIsAmazonLoggedIn(true); $this->sessionHelper->clearAmazonCustomer(); } } login-with-amazon-module/Observer/.htaccess000077700000000177151323541140014773 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Setup/InstallSchema.php000077700000005453151323541140015750 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Setup; use Amazon\Login\Model\ResourceModel\CustomerLink; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Setup\InstallSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class InstallSchema implements InstallSchemaInterface { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function install(SchemaSetupInterface $setup, ModuleContextInterface $context) { $table = $setup->getConnection()->newTable($setup->getTable(CustomerLink::TABLE_NAME)); $table ->addColumn( 'entity_id', Table::TYPE_INTEGER, null, [ 'identity' => true, 'unsigned' => true, 'primary' => true, 'nullable' => false ] ) ->addColumn( 'customer_id', Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false ] ) ->addColumn( 'amazon_id', Table::TYPE_TEXT, 255, [ 'nullable' => false ] ) ->addIndex( $setup->getIdxName( CustomerLink::TABLE_NAME, ['customer_id', 'amazon_id'], AdapterInterface::INDEX_TYPE_UNIQUE ), ['customer_id', 'amazon_id'], ['type' => AdapterInterface::INDEX_TYPE_UNIQUE] ); $setup->getConnection()->createTable($table); } } login-with-amazon-module/Setup/UpgradeSchema.php000077700000004530151323541140015724 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Setup; use Amazon\Login\Model\ResourceModel\CustomerLink; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\UpgradeSchemaInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class UpgradeSchema implements UpgradeSchemaInterface { public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { if (version_compare($context->getVersion(), '1.1.0', '<')) { $table = $setup->getTable('customer_entity'); $setup->getConnection()->addForeignKey( $setup->getFkName(CustomerLink::TABLE_NAME, 'customer_id', $table, 'entity_id'), $setup->getTable(CustomerLink::TABLE_NAME), 'customer_id', $setup->getTable('customer_entity'), 'entity_id', AdapterInterface::FK_ACTION_CASCADE ); } if (version_compare($context->getVersion(), '1.2.0', '<')) { $setup->getConnection()->addIndex( $setup->getTable(CustomerLink::TABLE_NAME), $setup->getIdxName(CustomerLink::TABLE_NAME, ['customer_id'], AdapterInterface::INDEX_TYPE_UNIQUE), ['customer_id'], AdapterInterface::INDEX_TYPE_UNIQUE ); } } } login-with-amazon-module/Setup/.htaccess000077700000000177151323541140014304 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/Helper/Session.php000077700000012105151323541140014753 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Login\Helper; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Login\Domain\ValidationCredentials; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Model\Session as CustomerSession; use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Framework\Event\ManagerInterface as EventManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Session { /** * @var CustomerSession */ private $session; /** * @var CheckoutSession */ private $checkoutSession; /** * @var EventManagerInterface */ private $eventManager; /** * Session constructor. * @param CustomerSession $session * @param EventManagerInterface $eventManager * @param CheckoutSession $checkoutSession */ public function __construct( CustomerSession $session, EventManagerInterface $eventManager, CheckoutSession $checkoutSession ) { $this->session = $session; $this->checkoutSession = $checkoutSession; $this->eventManager = $eventManager; } /** * Login customer by data * * @param CustomerInterface $customerData */ public function login(CustomerInterface $customerData) { $this->dispatchAuthenticationEvent(); if ($customerData->getId() != $this->session->getId() || !$this->session->isLoggedIn()) { $this->session->setCustomerDataAsLoggedIn($customerData); $this->session->regenerateId(); $this->checkoutSession->loadCustomerQuote(); } } /** * Login customer by id * * @param integer $customerId */ public function loginById($customerId) { $this->dispatchAuthenticationEvent(); $this->session->loginById($customerId); $this->session->regenerateId(); } /** * For compatibility with customer_customer_authenticated event dispatched from standard login controller. * The observers are also attached to this with the exception of password related ones. */ protected function dispatchAuthenticationEvent() { $this->eventManager->dispatch('amazon_customer_authenticated'); } /** * Set validation credentials in session * * @param ValidationCredentials $credentials */ public function setValidationCredentials(ValidationCredentials $credentials) { $this->session->setAmazonValidationCredentials($credentials); } /** * Get validation credentials from session * * @return ValidationCredentials|null */ public function getValidationCredentials() { $credentials = $this->session->getAmazonValidationCredentials(); return ($credentials) ?: null; } /** * Check if Magento account is logged in * * @return bool */ public function isLoggedIn() { return $this->session->isLoggedIn(); } /** * Check if user is logged in to Amazon * * @return bool */ public function isAmazonLoggedIn() { return $this->session->getIsAmazonLoggedIn(); } /** * @return void */ public function setIsAmazonLoggedIn($isLoggedIn) { if ($isLoggedIn) { $this->session->setIsAmazonLoggedIn(true); } else { $this->session->unsIsAmazonLoggedIn(); } } /** * @param AmazonCustomerInterface $amazonCustomer * @return void */ public function setAmazonCustomer(AmazonCustomerInterface $amazonCustomer) { $this->session->setAmazonCustomer($amazonCustomer); } /** * @return void */ public function clearAmazonCustomer() { $this->session->unsAmazonCustomer(); } /** * @return AmazonCustomerInterface|null */ public function getAmazonCustomer() { $amazonCustomer = $this->session->getAmazonCustomer(); if ($amazonCustomer && (!$amazonCustomer instanceof AmazonCustomerInterface)) { $this->clearAmazonCustomer(); $amazonCustomer = null; } return $amazonCustomer; } } login-with-amazon-module/Helper/.htaccess000077700000000177151323541140014423 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>login-with-amazon-module/composer.json000077700000001317151323541140014125 0ustar00{ "name": "amzn/login-with-amazon-module", "description": "Login with Amazon module", "type": "magento2-module", "version": "4.2.0", "abandoned": "amzn/amazon-pay-v2-magento-2-module", "license": [ "Apache-2.0" ], "require": { "php": "~7.3.0||~7.4.0", "amzn/amazon-pay-and-login-with-amazon-core-module": "^4.2.0", "magento/framework": "*", "magento/module-customer": "*", "magento/module-store": "*", "magento/module-eav": "*", "magento/module-checkout": "*", "magento/module-checkout-agreements": "*" }, "suggest": { "magento/module-sales": "*" }, "autoload": { "files": ["registration.php"], "psr-4": { "Amazon\\Login\\": "" } } } login-with-amazon-module/.htaccess000077700000000177151323541140013204 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/CONTRIBUTING.md000077700000007003151323541140012423 0ustar00# Contributing Guidelines Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community. Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution. ## Reporting Bugs/Feature Requests We welcome you to use the GitHub issue tracker to report bugs or suggest features. When filing an issue, please check [existing open](https://github.com/amzn/amazon-pay-sdk-php/issues), or [recently closed](https://github.com/amzn/amazon-pay-sdk-php/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: * A reproducible test case or series of steps * The version of our code being used * Any modifications you've made relevant to the bug * Anything unusual about your environment or deployment ## Contributing via Pull Requests Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 1. You are working against the latest source on the *master* branch. 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. To send us a pull request, please: 1. Fork the repository. 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 3. Ensure local tests pass. 4. Commit to your fork using clear commit messages. 5. Send us a pull request, answering any default questions in the pull request interface. 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). ## Finding contributions to work on Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/amzn/amazon-pay-sdk-php/labels/help%20wanted) issues is a great place to start. ## Code of Conduct This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact opensource-codeofconduct@amazon.com with any additional questions or comments. ## Security issue notifications If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. ## Licensing See the [LICENSE](https://github.com/amzn/amazon-pay-sdk-php/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. amazon-pay-sdk-php/LICENSE.txt000077700000026136151323541140012025 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. amazon-pay-sdk-php/Psr/Log/LoggerInterface.php000077700000005737151323541140015244 0ustar00<?php namespace Psr\Log; /** * Describes a logger instance. * * The message MUST be a string or object implementing __toString(). * * The message MAY contain placeholders in the form: {foo} where foo * will be replaced by the context data in key "foo". * * The context array can contain arbitrary data. The only assumption that * can be made by implementors is that if an Exception instance is given * to produce a stack trace, it MUST be in a key named "exception". * * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md * for the full interface specification. */ interface LoggerInterface { /** * System is unusable. * * @param string $message * @param array $context * * @return null */ public function emergency($message, array $context = array()); /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * * @return null */ public function alert($message, array $context = array()); /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * * @return null */ public function critical($message, array $context = array()); /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * * @return null */ public function error($message, array $context = array()); /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * * @return null */ public function warning($message, array $context = array()); /** * Normal but significant events. * * @param string $message * @param array $context * * @return null */ public function notice($message, array $context = array()); /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * * @return null */ public function info($message, array $context = array()); /** * Detailed debug information. * * @param string $message * @param array $context * * @return null */ public function debug($message, array $context = array()); /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * * @return null */ public function log($level, $message, array $context = array()); } amazon-pay-sdk-php/Psr/Log/LoggerAwareInterface.php000077700000000451151323541140016210 0ustar00<?php namespace Psr\Log; /** * Describes a logger-aware instance. */ interface LoggerAwareInterface { /** * Sets a logger instance on the object. * * @param LoggerInterface $logger * * @return null */ public function setLogger(LoggerInterface $logger); } amazon-pay-sdk-php/Psr/Log/LogLevel.php000077700000000520151323541140013676 0ustar00<?php namespace Psr\Log; /** * Describes log levels. */ class LogLevel { const EMERGENCY = 'emergency'; const ALERT = 'alert'; const CRITICAL = 'critical'; const ERROR = 'error'; const WARNING = 'warning'; const NOTICE = 'notice'; const INFO = 'info'; const DEBUG = 'debug'; } amazon-pay-sdk-php/Psr/Log/Test/LoggerInterfaceTest.php000077700000010422151323541140017006 0ustar00<?php namespace Psr\Log\Test; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; /** * Provides a base test class for ensuring compliance with the LoggerInterface. * * Implementors can extend the class and implement abstract methods to run this * as part of their test suite. */ abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase { /** * @return LoggerInterface */ abstract public function getLogger(); /** * This must return the log messages in order. * * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>". * * Example ->error('Foo') would yield "error Foo". * * @return string[] */ abstract public function getLogs(); public function testImplements() { $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger()); } /** * @dataProvider provideLevelsAndMessages */ public function testLogsAtAllLevels($level, $message) { $logger = $this->getLogger(); $logger->{$level}($message, array('user' => 'Bob')); $logger->log($level, $message, array('user' => 'Bob')); $expected = array( $level.' message of level '.$level.' with context: Bob', $level.' message of level '.$level.' with context: Bob', ); $this->assertEquals($expected, $this->getLogs()); } public function provideLevelsAndMessages() { return array( LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'), LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'), LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'), LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'), LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'), LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'), LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'), LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'), ); } /** * @expectedException \Psr\Log\InvalidArgumentException */ public function testThrowsOnInvalidLevel() { $logger = $this->getLogger(); $logger->log('invalid level', 'Foo'); } public function testContextReplacement() { $logger = $this->getLogger(); $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar')); $expected = array('info {Message {nothing} Bob Bar a}'); $this->assertEquals($expected, $this->getLogs()); } public function testObjectCastToString() { $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); $dummy->expects($this->once()) ->method('__toString') ->will($this->returnValue('DUMMY')); $this->getLogger()->warning($dummy); $expected = array('warning DUMMY'); $this->assertEquals($expected, $this->getLogs()); } public function testContextCanContainAnything() { $context = array( 'bool' => true, 'null' => null, 'string' => 'Foo', 'int' => 0, 'float' => 0.5, 'nested' => array('with object' => new DummyTest), 'object' => new \DateTime, 'resource' => fopen('php://memory', 'r'), ); $this->getLogger()->warning('Crazy context data', $context); $expected = array('warning Crazy context data'); $this->assertEquals($expected, $this->getLogs()); } public function testContextExceptionKeyCanBeExceptionOrOtherValues() { $logger = $this->getLogger(); $logger->warning('Random message', array('exception' => 'oops')); $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); $expected = array( 'warning Random message', 'critical Uncaught Exception!' ); $this->assertEquals($expected, $this->getLogs()); } } class DummyTest { } amazon-pay-sdk-php/Psr/Log/Test/.htaccess000077700000000177151323541140014201 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/Psr/Log/LoggerTrait.php000077700000006437151323541140014425 0ustar00<?php namespace Psr\Log; /** * This is a simple Logger trait that classes unable to extend AbstractLogger * (because they extend another class, etc) can include. * * It simply delegates all log-level-specific methods to the `log` method to * reduce boilerplate code that a simple Logger that does the same thing with * messages regardless of the error level has to implement. */ trait LoggerTrait { /** * System is unusable. * * @param string $message * @param array $context * * @return null */ public function emergency($message, array $context = array()) { $this->log(LogLevel::EMERGENCY, $message, $context); } /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * * @return null */ public function alert($message, array $context = array()) { $this->log(LogLevel::ALERT, $message, $context); } /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * * @return null */ public function critical($message, array $context = array()) { $this->log(LogLevel::CRITICAL, $message, $context); } /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * * @return null */ public function error($message, array $context = array()) { $this->log(LogLevel::ERROR, $message, $context); } /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * * @return null */ public function warning($message, array $context = array()) { $this->log(LogLevel::WARNING, $message, $context); } /** * Normal but significant events. * * @param string $message * @param array $context * * @return null */ public function notice($message, array $context = array()) { $this->log(LogLevel::NOTICE, $message, $context); } /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * * @return null */ public function info($message, array $context = array()) { $this->log(LogLevel::INFO, $message, $context); } /** * Detailed debug information. * * @param string $message * @param array $context * * @return null */ public function debug($message, array $context = array()) { $this->log(LogLevel::DEBUG, $message, $context); } /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * * @return null */ abstract public function log($level, $message, array $context = array()); } amazon-pay-sdk-php/Psr/Log/LoggerAwareTrait.php000077700000000615151323541140015375 0ustar00<?php namespace Psr\Log; /** * Basic Implementation of LoggerAwareInterface. */ trait LoggerAwareTrait { /** * The logger instance. * * @var LoggerInterface */ protected $logger; /** * Sets a logger. * * @param LoggerInterface $logger */ public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } } amazon-pay-sdk-php/Psr/Log/InvalidArgumentException.php000077700000000140151323541140017133 0ustar00<?php namespace Psr\Log; class InvalidArgumentException extends \InvalidArgumentException { } amazon-pay-sdk-php/Psr/Log/NullLogger.php000077700000001213151323541140014237 0ustar00<?php namespace Psr\Log; /** * This Logger can be used to avoid conditional log calls. * * Logging should always be optional, and if no logger is provided to your * library creating a NullLogger instance to have something to throw logs at * is a good way to avoid littering your code with `if ($this->logger) { }` * blocks. */ class NullLogger extends AbstractLogger { /** * Logs with an arbitrary level. * * @param mixed $level * @param string $message * @param array $context * * @return null */ public function log($level, $message, array $context = array()) { // noop } } amazon-pay-sdk-php/Psr/Log/AbstractLogger.php000077700000006020151323541140015071 0ustar00<?php namespace Psr\Log; /** * This is a simple Logger implementation that other Loggers can inherit from. * * It simply delegates all log-level-specific methods to the `log` method to * reduce boilerplate code that a simple Logger that does the same thing with * messages regardless of the error level has to implement. */ abstract class AbstractLogger implements LoggerInterface { /** * System is unusable. * * @param string $message * @param array $context * * @return null */ public function emergency($message, array $context = array()) { $this->log(LogLevel::EMERGENCY, $message, $context); } /** * Action must be taken immediately. * * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * * @param string $message * @param array $context * * @return null */ public function alert($message, array $context = array()) { $this->log(LogLevel::ALERT, $message, $context); } /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * * @param string $message * @param array $context * * @return null */ public function critical($message, array $context = array()) { $this->log(LogLevel::CRITICAL, $message, $context); } /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * * @param string $message * @param array $context * * @return null */ public function error($message, array $context = array()) { $this->log(LogLevel::ERROR, $message, $context); } /** * Exceptional occurrences that are not errors. * * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * * @param string $message * @param array $context * * @return null */ public function warning($message, array $context = array()) { $this->log(LogLevel::WARNING, $message, $context); } /** * Normal but significant events. * * @param string $message * @param array $context * * @return null */ public function notice($message, array $context = array()) { $this->log(LogLevel::NOTICE, $message, $context); } /** * Interesting events. * * Example: User logs in, SQL logs. * * @param string $message * @param array $context * * @return null */ public function info($message, array $context = array()) { $this->log(LogLevel::INFO, $message, $context); } /** * Detailed debug information. * * @param string $message * @param array $context * * @return null */ public function debug($message, array $context = array()) { $this->log(LogLevel::DEBUG, $message, $context); } } amazon-pay-sdk-php/Psr/Log/.htaccess000077700000000177151323541140013262 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/Psr/.htaccess000077700000000177151323541140012541 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/CODE_OF_CONDUCT.md000077700000000467151323541140013000 0ustar00## Code of Conduct This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact opensource-codeofconduct@amazon.com with any additional questions or comments. amazon-pay-sdk-php/CHANGES.txt000077700000016707151323541140012016 0ustar003.6.0 - November 2019 - Add GetMerchantNotificationConfiguration API call - Add SetMerchantNotificationConfiguration API call 3.5.0 - August 2019 - Added additional attributes (success_url, failure_url) to ConfirmBillingAgreement and (subscription_amount, currency_code) to SetBillingAgreement Details.. See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information. - Synced missing changes in ClientInterface.php 3.4.1 - February 2019 - Fix undefined index message in ConfirmOrderReference 3.4.0 - January 2019 - Added new supplementary_data attribute for AuthorizeOnBillingAgreement and CreateOrderReferenceForId. - Added additional attributes (success_url, failure_url, authorization_amount, currency_code) to ConfirmOrderReference. See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information. 3.3.2 - August 2018 - Added method for listOrderReference API call - Added method for listOrderReferenceByNextToken API call - Added new supplementary_data attribute for SetOrderAttributes and SetOrderReferenceDetails. 3.3.1 - April 2018 - Add GetMerchantAccountStatus API call 3.2.0 - November 2017 - Add SetOrderAttributes API call 3.1.0 - May 2017 - Fix getUserInfo call (bearer token) issue impacted by 3.0.0's Curl fix - app_id can be passed in to Client constructor as optional configuration parameter Needed if your Mobile SDK application needs to call the PHP SDK getUserInfo call on the backend - access_token can be specified as a parameter to the getOrderReferenceDetails functions This provides access to the payment descriptor response needed for Mobile SDK implementations Your account must be whitelisted for Mobile SDK access to retrieve payment descriptor details - SDK was not consistently handling boolean input parameters: 'false' was sometimes treated as true because it was a non-empty string, 'true' was sometimes getting converted to '1' instead of true An Exception will be thrown if sandbox, capture_now, confirm_now, inherit_shipping_address attributes are not specified as booleans - Fix relative paths in Psr\Log interface files 3.0.0 - March 2017 - Pay with Amazon to Amazon Pay rebranding - PHP Archive (amazon-pay.phar) now bundled with release for convenience - User-Agent header modified to adhere to standards - Retry timing adjusted (1 second, 2 seconds, 7 seconds) - Disable Curl "Expect: 100-Continue" header 2.1.0 - October 2016 - Contains PSR logging feature 2.0.4 - October 2016 - Fixing Curl implementation - PHP 7 compatability 2.0.3 - June 2016 - Response parser fixed and added signature utility 2.0.2 - May 2016 - PSR-4 compliance changes 2.0.1 - January 2016 - Added verification for signing cert URL attribute of the IPN to ensure certificate is coming from an AWS SNS URL 2.0.0 - Rewrite of the 1.x SDK with much easier to use calling convention 1.0.16 - Added additional validation for IPN parsing. 1.0.15 - Added Soft Decline feature for Authorization Response 1.0.14 - May 2015 - Updated sample code and web server based examples for Order Reference object and Billing Agreement object containing orderLanguage parameter. - Updated library and added orderLanguage as an additional parameter in GetOrderReferenceDetails and GetBillingAgreementDetails response objects. 1.0.13 - March 2015 - Fix regression that prevented usage on PHP 5.3 and 5.4 1.0.12 - January 2015 - Fix for incorrect comparison operators in OffAmazonService/Client.php - Fix for incorrect exception variable in OpenSslVerifySignature.php - Add support for proxy usage in API requests - Modified Exception.php to check for parameter existence before assigning fields - Additional verification checks in place for IPN signature certificate validation - Change to OffAmazonPaymentsService.config.inc.php - new mandatory property cnName - Add support for MWSAuthToken field on all request objects 1.0.11 - September 2014 - Added 'Login & Pay with Amazon' flow for EU. - Unified US and EU code samples 1.0.10 -May 2014 - Updated sample code and webserver based examples for using the Fast Authorization option. (No Library change needed) - Updated library and added ProviderCreditList as an additional parameter in AuthorizationRequest and CaptureRequest. ProviderCreditReversalList as an additional parameter in RefundRequest. ProviderCreditSummaryList as an additional parameter in CaptureResponse and CaptureNotification. ProviderCreditReversalSummaryList as an additional parameter in RefundResponse and RefundNotification. - Updated library and added support for Solution Provider related operations (ReverseProviderCredit, GetProviderCreditDetails, GetProviderCreditReversalDetails) and notifications (ProviderCreditNotification, ProviderCreditReversalNotification) - Added sample code and webserver based examples for ProviderCheckout, ProviderRefund and ReverseProviderCredit. - Added support for SolutionProviderMerchantNotification. 1.0.8 - April 2014 - Updated library and added Billing Address as a whitelisted parameter in OrderReference details API - Updated library and Added AddressVerificationCode as an additional parameter in the Authorize Notification IPN. - Billing Address and AddressVerificationCode are available only to sellers pre-approved by Amazon. Contact Amazon Payments Support or your Account manager. 1.0.7 - March 2014 - Updated library and Added AddressVerificationCode as an additional parameter in the AuthorizationDetails object - Added IdList as an additional parameter to the OrderReferenceDetails object. - Added ParentDetails as an additional parameter to the OrderReferenceDetails object - Updated sample code and webserver based examples for Billing Address use case in Billing agreement details API 1.0.6 - March 2014 - Updated library and added support for Automatic Payments related operations - Added sample code and webserver based examples for billing agreement notifications - Fixed typos and bugs related to undefined variable notices in library package 1.0.5 - November 2013 - Added addressConsentToken field to getOrderReferenceDetailsRequest object to support Pay with Amazon use cases for US - Changed sample code for US to use the new Pay with Amazon widgets - Added new sample code for US to show usage of the address consent token - Updated product name strings for US & EU 1.0.4 - November 2013 - Add AuthorizationBillingAddress field to AuthorizationResponse service model object to support VAT invoicing in applicable countries (DE, UK). - Removed EU region, added DE & UK to support future configuration options. - Added US region in place of NA and updated sample docs to use new option - NA is deprecated but will still function to support existing merchants. - Modified SimpleCheckout example to show call to getAuthorizationDetails after receiving an authorization IPN. - Added additional property to setup cert folder so that additional certificates can be used during SSL verification check - Modified sample code for verifying refund is completed to accept a RefundDetails object in place of a GetRefundDetailsResponse object, so that it can be used from either the RefundResponse or getRefundDetailsResponse object references. 1.0.3 - October 2013 - Fixed issue with signature verification for windows platforms. 1.0.2 - October 2013 - Added EU endpoints to service code - Added platformID field to setOrderReferenceDetails object 1.0.1 - May 2013 - Added payment notification model objects - Added sample code and webserver based examples for payment notifications 1.0.0 - April 2013 - Initial release amazon-pay-sdk-php/.gitignore000077700000000053151323541140012160 0ustar00vendor composer.lock amazon-pay.phar build amazon-pay-sdk-php/README.md000077700000052357151323541140011465 0ustar00# Amazon Pay SDK (PHP) Amazon Pay API Integration ## Requirements * Amazon Pay account: * [US - Registration](https://pay.amazon.com/us/signup) * [UK - Registration](https://pay.amazon.com/uk/signup) * [DE - Registration](https://pay.amazon.com/de/signup) * [JP - Registration](https://pay.amazon.com/jp/contactsales) * PHP 5.5 or higher * Curl 7.18 or higher Support for PHP 5.3 and 5.4 is being deprecated. The SDK will work in these older environments, but future versions may not. We encourage merchants to move to a newer version of PHP at their earliest convenience. ## Documentation Integration steps can be found below: * [US](https://pay.amazon.com/us/developer/documentation) * [UK](https://pay.amazon.com/uk/developer/documentation) * [DE](https://pay.amazon.com/de/developer/documentation) * [JP](https://pay.amazon.com/jp/developer/documentation) ## Sample * View the [Amazon Pay SDK samples](https://amzn.github.io/amazon-pay-sdk-samples/) ## Quick Start The client takes in parameters in the following format: 1. Associative array 2. Path to the JSON file containing configuration information. ## Installing using Composer ``` composer require amzn/amazon-pay-sdk-php ``` ## Directory Tree ``` . ├── composer.json - Configuration for composer ├── LICENSE.txt ├── NOTICE.txt ├── AmazonPay │ ├── Client.php - Main class with the API calls │ ├── ClientInterface.php - Shows the public function definitions in Client.php │ ├── HttpCurl.php - Client class uses this file to execute the GET/POST │ ├── HttpCurlInterface.php - Shows the public function definitions in the HttpCurl.php │ ├── IpnHandler.php - Class handles verification of the IPN │ ├── IpnHandlerInterface.php - Shows the public function definitions in the IpnHandler.php │ ├── Regions.php - Defines the regions that is supported │ ├── ResponseParser.php - Parses the API call response │ └── ResponseInterface.php - Shows the public function definitions in the ResponseParser.php ├── README.md └── UnitTests ├── ClientTest.php ├── config.json ├── coverage.txt ├── IpnHandlerTest.php └── Signature.php ``` ## Parameters List #### Mandatory Parameters | Parameter | variable name | Values | |--------------|---------------|------------------------------------------------| | Merchant Id | `merchant_id` | Default : `null` | | Access Key | `access_key` | Default : `null` | | Secret Key | `secret_key` | Default : `null` | | Region | `region` | Default : `null`<br>Other: `us`,`de`,`uk`,`jp` | #### Optional Parameters | Parameter | Variable name | Values | |---------------------|-----------------------|----------------------------------------------------| | Currency Code | `currency_code` | Default : `null`<br>Other: `USD`,`EUR`,`GBP`,`JPY` | | Environment | `sandbox` | Default : `false`<br>Other: `true` | | Platform ID | `platform_id` | Default : `null` | | CA Bundle File | `cabundle_file` | Default : `null` | | Application Name | `application_name` | Default : `null` | | Application Version | `application_version` | Default : `null` | | Proxy Host | `proxy_host` | Default : `null` | | Proxy Port | `proxy_port` | Default : `-1` | | Proxy Username | `proxy_username` | Default : `null` | | Proxy Password | `proxy_password` | Default : `null` | | LWA Client ID | `client_id` | Default : `null` | | Handle Throttle | `handle_throttle` | Default : `true`<br>Other: `false` | ## Setting Configuration Your Amazon Pay keys are available in your Seller Central account Setting configuration while instantiating the Client object ```php <?php namespace AmazonPay; require_once 'Client.php'; // or, instead of using require_once, you can use the phar file instead // include 'amazon-pay.phar'; // PHP Associative array $config = array( 'merchant_id' => 'YOUR_MERCHANT_ID', 'access_key' => 'YOUR_ACCESS_KEY', 'secret_key' => 'YOUR_SECRET_KEY', 'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID', 'region' => 'REGION'); // or, instead of setting the array in the code, you can // initialze the Client by specifying a JSON file // $config = 'PATH_TO_JSON_FILE'; // Instantiate the client class with the config type $client = new Client($config); ``` ### Testing in Sandbox Mode The sandbox parameter is defaulted to false if not specified: ```php <?php namespace AmazonPay; $config = array( 'merchant_id' => 'YOUR_MERCHANT_ID', 'access_key' => 'YOUR_ACCESS_KEY', 'secret_key' => 'YOUR_SECRET_KEY', 'client_id' => 'YOUR_LOGIN_WITH_AMAZON_CLIENT_ID', 'region' => 'REGION', 'sandbox' => true); $client = new Client($config); // Also you can set the sandbox variable in the config() array of the Client class by $client->setSandbox(true); ``` ### Setting Proxy values Proxy parameters can be set after Instantiating the Client Object with the following setter ```php $proxy = array(); $proxy['proxy_user_host'] // Hostname for the proxy $proxy['proxy_user_port'] // Hostname for the proxy $proxy['proxy_user_name'] // If your proxy requires a username $proxy['proxy_user_password'] // If your proxy requires a password $client->setProxy($proxy); ``` ### Making an API Call Below is an example on how to make the GetOrderReferenceDetails API call: ```php <?php namespace AmazonPay; $requestParameters = array(); // AMAZON_ORDER_REFERENCE_ID is obtained from the Amazon Pay Address/Wallet widgets // ACCESS_TOKEN is obtained from the GET parameter from the URL. // Required Parameter $requestParameters['amazon_order_reference_id'] = 'AMAZON_ORDER_REFERENCE_ID'; // Optional Parameter $requestParameters['address_consent_token'] = 'ACCESS_TOKEN'; $requestParameters['mws_auth_token'] = 'MWS_AUTH_TOKEN'; $response = $client->getOrderReferenceDetails($requestParameters); ``` See the [API Response](https://github.com/amzn/amazon-pay-sdk-php#api-response) section for information on parsing the API response. Below is an example on how to make the GetMerchantAccountStatus API call: ```php $requestParameters = array(); // Optional Parameter $requestParameters['mws_auth_token'] = 'MWS_AUTH_TOKEN'; $response = $client->getMerchantAccountStatus($requestParameters); echo $response->toXml() . "\n"; // Sample Response <GetMerchantAccountStatusResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <GetMerchantAccountStatusResult> <AccountStatus>ACTIVE</AccountStatus> </GetMerchantAccountStatusResult> <ResponseMetadata> <RequestId>b0a141f7-712a-4830-8014-2aa0c446b04e</RequestId> </ResponseMetadata> </GetMerchantAccountStatusResponse> ``` See the [API Response](https://github.com/amzn/amazon-pay-sdk-php#api-response) section for information on parsing the API response. Below is an example on how to make the ListOrderReference API call: ```php $requestParameters = array(); // Required Parameter $configArray['query_id'] = 'SELLER_ORDER_ID'; $configArray['query_id_type'] = 'SellerOrderId'; // Optional Parameter $requestParameters['mws_auth_token'] = 'MWS_AUTH_TOKEN'; $configArray['page_size'] = "1"; $response = $client->listOrderReference($requestParameters); echo $response->toXml() . "\n"; // Sample Response <ListOrderReferenceResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <ListOrderReferenceResult> <OrderReferenceList> <OrderReference> <ReleaseEnvironment>Sandbox</ReleaseEnvironment> <OrderReferenceStatus> <LastUpdateTimestamp>2018-08-06T22:45:37.314Z</LastUpdateTimestamp> <State>Open</State> </OrderReferenceStatus> <AmazonOrderReferenceId>S01-6649662-0708590</AmazonOrderReferenceId> <CreationTimestamp>2018-08-06T22:45:28.203Z</CreationTimestamp> <SellerOrderAttributes> <StoreName>PHP SDK Test goGetOrderReferenceDetails</StoreName> <CustomInformation>PHP SDK Custom Information Testing</CustomInformation> <SellerOrderId>PHP SDK ID# 12345</SellerOrderId> </SellerOrderAttributes> <OrderTotal> <CurrencyCode>USD</CurrencyCode> <Amount>0.01</Amount> </OrderTotal> </OrderReference> </OrderReferenceList> <NextPageToken>eyJuZXh0UGFn...=</NextPageToken> </ListOrderReferenceResult> <ResponseMetadata> <RequestId>5749768d-307b-493b-90b0-8b5b9f2ea436</RequestId> </ResponseMetadata> </ListOrderReferenceResponse> ``` See the [API Response](https://github.com/amzn/amazon-pay-sdk-php#api-response) section for information on parsing the API response. Below is an example on how to make the ListOrderReferenceByNextToken API call: ```php $requestParameters = array(); // Required Parameter $configArray['next_page_token'] = "NEXT_PAGE_TOKEN"; $response = $client->listOrderReferenceByNextToken($requestParameters); echo $response->toXml() . "\n"; // Sample Response <ListOrderReferenceByNextTokenResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <ListOrderReferenceByNextTokenResult> <OrderReferenceList> <OrderReference> <ReleaseEnvironment>Sandbox</ReleaseEnvironment> <OrderReferenceStatus> <LastUpdateTimestamp>2018-08-06T22:42:50.191Z</LastUpdateTimestamp> <State>Open</State> </OrderReferenceStatus> <AmazonOrderReferenceId>S01-1662310-7599388</AmazonOrderReferenceId> <CreationTimestamp>2018-08-06T22:42:35.904Z</CreationTimestamp> <SellerOrderAttributes> <StoreName>PHP SDK Test goGetOrderReferenceDetails</StoreName> <CustomInformation>PHP SDK Custom Information Testing</CustomInformation> <SellerOrderId>PHP SDK ID# 12345</SellerOrderId> </SellerOrderAttributes> <OrderTotal> <CurrencyCode>USD</CurrencyCode> <Amount>0.01</Amount> </OrderTotal> </OrderReference> </OrderReferenceList> <NextPageToken>eyJuZXh0UGFnZVRva2VuIjoiQUFBQUFBQUFBQ...</NextPageToken> </ListOrderReferenceByNextTokenResult> <ResponseMetadata> <RequestId>8e06c852-4072-4cfb-99a3-060ec1ef7be8</RequestId> </ResponseMetadata> </ListOrderReferenceByNextTokenResponse> ``` See the [API Response](https://github.com/amzn/amazon-pay-sdk-php#api-response) section for information on parsing the API response. ### IPN Handling 1. To receive IPN's successfully you will need an valid SSL on your domain. 2. You can set up your Notification endpoints by either (a) using the Seller Central Integration Settings page Settings tab, or (b) by using the SetMerchantNotificationConfiguration API call. 3. IpnHandler.php class handles verification of the source and the data of the IPN Add the below code into any file and set the URL to the file location in Merchant/Integrator URL by accessing Integration Settings page in the Settings tab. ```php <?php namespace AmazonPay; require_once 'IpnHandler.php'; // Get the IPN headers and Message body $headers = getallheaders(); $body = file_get_contents('php://input'); // Create an object($ipnHandler) of the IpnHandler class $ipnHandler = new IpnHandler($headers, $body); ``` See the [IPN Response](https://github.com/amzn/amazon-pay-sdk-php#ipn-response) section for information on parsing the IPN response. #### Setting notification endpoints using SetMerchantNotificationConfiguration API ```php $client = new AmazonPay\Client($config); // possible array values: ALL, ORDER_REFERENCE, PAYMENT_AUTHORIZE, PAYMENT_CAPTURE, PAYMENT_REFUND, BILLING_AGREEMENT, CHARGEBACK_DETAILED $notificationConfiguration['https://dev.null/ipn/onetime'] = array('ORDER_REFERENCE', 'PAYMENT_AUTHORIZE', 'PAYMENT_CAPTURE'); $notificationConfiguration['https://dev.null/ipn/recurring'] = array('BILLING_AGREEMENT'); $notificationConfiguration['https://dev.null/ipn/refunds'] = array('PAYMENT_REFUND', 'CHARGEBACK_DETAILED'); $requestParameters['notification_configuration_list'] = $notificationConfiguration; // or, if you prefer all IPNs come to the same endpoint, do this one-liner instead: // $requestParameters['notification_configuration_list'] = array('https://dev.null/ipn' => array('ALL')); // if you are calling on behalf of another merhcant using delegated access, be sure to set the merchant ID and auth token: // $requestParameters['merchant_id'] = 'A3URCZVLDMDI45'; // $requestParameters['mws_auth_token'] = 'amzn.mws.d6ac8f2d-6a5f-b06a-bc12-1d0dbf4ca63d'; $response = $client->setMerchantNotificationConfiguration($requestParameters); if ($response->toArray()['ResponseStatus'] !== '200') { print "error occured calling API"; } // to troubleshoot, you can call GetMerchantNotificationConfiguration to view current IPN settings $response = $client->getMerchantNotificationConfiguration($requestParameters); print $response->toXml(); ``` ### Convenience Methods #### Charge Method The charge method combines the following API calls: **Standard Payments / Recurring Payments** 1. SetOrderReferenceDetails / SetBillingAgreementDetails 2. ConfirmOrderReference / ConfirmBillingAgreement 3. Authorize / AuthorizeOnBillingAgreement For **Standard payments** the first `charge` call will make the SetOrderReferenceDetails, ConfirmOrderReference, Authorize API calls. Subsequent call to `charge` method for the same Order Reference ID will make the call only to Authorize. For **Recurring payments** the first `charge` call will make the SetBillingAgreementDetails, ConfirmBillingAgreement, AuthorizeOnBillingAgreement API calls. Subsequent call to `charge` method for the same Billing Agreement ID will make the call only to AuthorizeOnBillingAgreement. > **Capture Now** can be set to `true` for digital goods . For Physical goods it's highly recommended to set the Capture Now to `false` and the amount captured by making the `capture` API call after the shipment is complete. | Parameter | Variable Name | Mandatory | Values | |----------------------------|------------------------------|-----------|-----------------------------------------------------------------------------------------------------------| | Amazon Reference ID | `amazon_reference_id` | yes | OrderReference ID (`starts with P01 or S01`) or <br>Billing Agreement ID (`starts with B01 or C01`) | | Amazon OrderReference ID | `amazon_order_reference_id` | no | OrderReference ID (`starts with P01 or S01`) if no Amazon Reference ID is provided | | Amazon Billing Agreement ID| `amazon_billing_agreement_id`| no | Billing Agreement ID (`starts with B01 or C01`) if no Amazon Reference ID is provided | | Merchant ID | `merchant_id` | no | Value taken from config array in Client.php | | Charge Amount | `charge_amount` | yes | Amount that needs to be captured.<br>Maps to API call variables `amount` , `authorization_amount` | | Currency code | `currency_code` | no | If no value is provided, value is taken from the config array in Client.php | | Authorization Reference ID | `authorization_reference_id` | yes | Unique string to be passed | | Transaction Timeout | `transaction_timeout` | no | Timeout for Authorization - Defaults to 1440 minutes | | Capture Now | `capture_now` | no | Will capture the payment automatically when set to `true`. Defaults to `false` | | Charge Note | `charge_note` | no | Note that is sent to the buyer. <br>Maps to API call variables `seller_note` , `seller_authorization_note`| | Charge Order ID | `charge_order_id` | no | Custom order ID provided <br>Maps to API call variables `seller_order_id` , `seller_billing_agreement_id` | | Store Name | `store_name` | no | Name of the store | | Platform ID | `platform_id` | no | Platform ID of the Solution provider | | Custom Information | `custom_information` | no | Any custom string | | MWS Auth Token | `mws_auth_token` | no | MWS Auth Token required if API call is made on behalf of the seller | ```php // Create an array that will contain the parameters for the charge API call $requestParameters = array(); // Adding the parameters values to the respective keys in the array $requestParameters['amazon_reference_id'] = 'AMAZON_REFERENCE_ID'; // Or // If $requestParameters['amazon_reference_id'] is not provided, // either one of the following ID input is needed $requestParameters['amazon_order_reference_id'] = 'AMAZON_ORDER_REFERENCE_ID'; $requestParameters['amazon_billing_agreement_id'] = 'AMAZON_BILLING_AGREEMENT_ID'; $requestParameters['seller_id'] = null; $requestParameters['charge_amount'] = '100.50'; $requestParameters['currency_code'] = 'USD'; $requestParameters['authorization_reference_id'] = 'UNIQUE STRING'; $requestParameters['transaction_timeout'] = 0; $requestParameters['capture_now'] = false; //true for Digital goods $requestParameters['charge_note'] = 'Example item note'; $requestParameters['charge_order_id'] = '1234-Example-Order'; $requestParameters['store_name'] = 'Example Store'; $requestParameters['platform_Id'] = null; $requestParameters['custom_information'] = 'Any_Custom_String'; $requestParameters['mws_auth_token'] = null; // Get the Authorization response from the charge method $response = $client->charge($requestParameters); ``` See the [API Response](https://github.com/amzn/amazon-pay-sdk-php#api-response) section for information on parsing the API response. #### Obtain profile information (getUserInfo method) 1. obtains the user's profile information from Amazon using the access token returned by the Button widget. 2. An access token is granted by the authorization server when a user logs in to a site. 3. An access token is specific to a client, a user, and an access scope. A client must use an access token to retrieve customer profile data. | Parameter | Variable Name | Mandatory | Values | |---------------------|-----------------------|-----------|------------------------------------------------------------------------------------------| | Access Token | `access_token` | yes | Retrieved as GET parameter from the URL | | Region | `region` | yes | Default :`null` <br>Other:`us`,`de`,`uk`,`jp`<br>Value is set in config['region'] array | | LWA Client ID | `client_id` | yes | Default: null<br>Value should be set in config array | ```php <?php namespace AmazonPay; // config array parameters that need to be instantiated $config = array( 'client_id' => 'YOUR_LWA_CLIENT_ID', 'region' => 'REGION'); $client = new Client($config); // Client ID can also be set using the setter function setClientId($client_id) $client->setClientId(‘YOUR_LWA_CLIENT_ID’); // Get the Access Token from the URL $access_token = 'ACCESS_TOKEN'; // Calling the function getUserInfo with the access token parameter returns object $userInfo = $client->getUserInfo($access_token); // Buyer name $userInfo['name']; // Buyer Email $userInfo['email']; // Buyer User Id $userInfo['user_id']; ``` ### Response Parsing Responses are provided in 3 formats 1. XML/Raw response 2. Associative array 3. JSON format #### API Response ```php // Returns an object($response) of the class ResponseParser.php $response = $client->getOrderReferenceDetails($requestParameters); // XML response $response->toXml(); // Associative array response $response->toArray(); // JSON response $response->toJson(); ``` #### IPN Response ```php $ipnHandler = new IpnHandler($headers, $body); // Raw message response $ipnHandler->returnMessage(); // Associative array response $ipnHandler->toArray(); // JSON response $ipnHandler->toJson(); ``` ### Logging SDK logging of sanitized requests and responses can work with any PSR-3 compliant logger such as Monolog. #### API Response ```php namespace AmazonPay; require 'vendor/autoload.php'; include 'amazon-pay.phar'; use Monolog\Logger; use Monolog\Handler\StreamHandler; date_default_timezone_set('America/Los_Angeles'); $log = new Logger('TestSDK'); $log->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG)); $client = new Client('us.config'); $client->setLogger($log); $response = $client->getServiceStatus(); ``` amazon-pay-sdk-php/create-amazon-pay-phar.php000077700000000727151323541140015156 0ustar00<?php $p = new Phar('amazon-pay.phar', FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::KEY_AS_FILENAME, 'amazon-pay.phar'); $p->startBuffering(); $p->setStub('<?php Phar::mapPhar(); require \'phar://amazon-pay.phar/AmazonPay/Client.php\'; require \'phar://amazon-pay.phar/AmazonPay/IpnHandler.php\'; __HALT_COMPILER(); ?>'); $p->buildFromDirectory('.', '$(.*)\.php$'); $p->stopBuffering(); echo "Phar created: amazon-pay.phar\n"; ?> amazon-pay-sdk-php/tst/unit/IpnHandlerTest.php000077700000011137151323541140015363 0ustar00<?php namespace AmazonPay; require_once 'AmazonPay/IpnHandler.php'; class IpnHandlertest extends \PHPUnit_Framework_TestCase { private $configParams = array( 'cabundle_file' => null, 'proxy_host' => null, 'proxy_port' => -1, 'proxy_username' => null, 'proxy_Password' => null ); public function testConstructor() { try { $headers = array(); $headers = array('ab'=>'abc'); $body = 'abctest'; $ipnHandler = new IpnHandler($headers,$body,$this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/Error with message - header./i', strval($expected)); } try { $headers['x-amz-sns-message-type'] = 'Notification'; $body = 'abctest'; $ipnHandler = new IpnHandler($headers,$body,$this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/Error with message - content is not in json format./i', strval($expected)); } try { $ConfigParams = array( 'a' => 'A', 'b' => 'B' ); $ipnHandler = new IpnHandler(array(),null,$ConfigParams); } catch (\Exception $expected) { $this->assertRegExp('/is either not part of the configuration or has incorrect Key name./i', strval($expected)); } } public function testValidateUrl() { $headers = array('x-amz-sns-message-type' => 'Notification'); try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"http://sns.us-east-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"https://sns.us-east-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.exe"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"https://sns.us-east-1.example.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"https://sni.us-east-1.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"https://sns.us.amazonaws.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } try { $body = '{"Type":"Notification", "Message":"Test", "MessageId":"Test", "Timestamp":"Test", "Subject":"Test", "TopicArn":"Test", "Signature":"Test", "SigningCertURL":"https://sns.us-east-1.amazonaws.com.com/SimpleNotificationService-bb750dd426d95ee9390147a5624348ee.pem"}'; $ipnHandler = new IpnHandler($headers, $body, $this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/The certificate is located on an invalid domain./i', strval($expected)); } } } amazon-pay-sdk-php/tst/unit/Signature.php000077700000014056151323541140014443 0ustar00<?php namespace AmazonPay; class Signature { const MWS_VERSION = '2013-01-01'; private $config = array(); private $signature = null; private $mwsEndpointPath = null; private $mwsEndpointUrl = null; private $modePath = null; private $mwsServiceUrl = null; private $mwsServiceUrls = array('eu' => 'mws-eu.amazonservices.com', 'na' => 'mws.amazonservices.com', 'jp' => 'mws.amazonservices.jp'); private $regionMappings = array('de' => 'eu', 'uk' => 'eu', 'us' => 'na', 'jp' => 'jp'); public function __construct($config = array(),$parameters = array()) { $config = array_change_key_case($config, CASE_LOWER); $this->config = $config; $this->signature = $this->calculateSignature($parameters); } public function getSignature() { return trim($this->signature); } /* Create an Array of required parameters, sort them * Calculate signature and invoke the POST them to the MWS Service URL * * @param AWSAccessKeyId [String] * @param Version [String] * @param SignatureMethod [String] * @param Timestamp [String] * @param Signature [String] */ private function calculateSignature($parameters) { $this->createServiceUrl(); $signature = $this->signParameters($parameters); return $signature; } /* Computes RFC 2104-compliant HMAC signature for request parameters * Implements AWS Signature, as per following spec: * * If Signature Version is 0, it signs concatenated Action and Timestamp * * If Signature Version is 1, it performs the following: * * Sorts all parameters (including SignatureVersion and excluding Signature, * the value of which is being created), ignoring case. * * Iterate over the sorted list and append the parameter name (in original case) * and then its value. It will not URL-encode the parameter values before * constructing this string. There are no separators. * * If Signature Version is 2, string to sign is based on following: * * 1. The HTTP Request Method followed by an ASCII newline (%0A) * 2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline. * 3. The URL encoded HTTP absolute path component of the URI * (up to but not including the query string parameters); * if this is empty use a forward '/'. This parameter is followed by an ASCII newline. * 4. The concatenation of all query string components (names and values) * as UTF-8 characters which are URL encoded as per RFC 3986 * (hex characters MUST be uppercase), sorted using lexicographic byte ordering. * Parameter names are separated from their values by the '=' character * (ASCII character 61), even if the value is empty. * Pairs of parameter and values are separated by the '&' character (ASCII code 38). * */ private function signParameters(array $parameters) { $signatureVersion = $parameters['SignatureVersion']; $algorithm = "HmacSHA1"; $stringToSign = null; if (2 === $signatureVersion) { $algorithm = "HmacSHA256"; $parameters['SignatureMethod'] = $algorithm; $stringToSign = $this->calculateStringToSignV2($parameters); } else { throw new \Exception("Invalid Signature Version specified"); } return $this->sign($stringToSign, $algorithm); } /* Calculate String to Sign for SignatureVersion 2 * @param array $parameters request parameters * @return String to Sign */ private function calculateStringToSignV2(array $parameters) { $data = 'POST'; $data .= "\n"; $data .= $this->mwsEndpointUrl; $data .= "\n"; $data .= $this->mwsEndpointPath; $data .= "\n"; $data .= $this->getParametersAsString($parameters); return $data; } /* Convert paremeters to Url encoded query string */ private function getParametersAsString(array $parameters) { $queryParameters = array(); foreach ($parameters as $key => $value) { $queryParameters[] = $key . '=' . $this->urlEncode($value); } return implode('&', $queryParameters); } private function urlEncode($value) { return str_replace('%7E', '~', rawurlencode($value)); } /* Computes RFC 2104-compliant HMAC signature.*/ private function sign($data, $algorithm) { if ($algorithm === 'HmacSHA1') { $hash = 'sha1'; } else if ($algorithm === 'HmacSHA256') { $hash = 'sha256'; } else { throw new \Exception("Non-supported signing method specified"); } return base64_encode(hash_hmac($hash, $data, $this->config['secret_key'], true)); } /* Formats date as ISO 8601 timestamp */ private function getFormattedTimestamp() { return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); } private function createServiceUrl() { $this->modePath = strtolower($this->config['sandbox']) ? 'OffAmazonPayments_Sandbox' : 'OffAmazonPayments'; if (!empty($this->config['region'])) { $region = strtolower($this->config['region']); if (array_key_exists($region, $this->regionMappings)) { $this->mwsEndpointUrl = $this->mwsServiceUrls[$this->regionMappings[$region]]; $this->mwsServiceUrl = 'https://' . $this->mwsEndpointUrl . '/' . $this->modePath . '/' . self::MWS_VERSION; $this->mwsEndpointPath = '/' . $this->modePath . '/' . self::MWS_VERSION; } else { throw new \Exception($region . ' is not a valid region'); } } else { throw new \Exception("config['region'] is a required parameter and is not set"); } } } amazon-pay-sdk-php/tst/unit/ClientTest.php000077700000155520151323541140014562 0ustar00<?php namespace AmazonPay; require_once 'AmazonPay/Client.php'; require_once 'AmazonPay/ResponseParser.php'; require_once 'Signature.php'; class ClientTest extends \PHPUnit_Framework_TestCase { private $configParams = array( 'merchant_id' => 'MERCHANT1234567', 'access_key' => 'ABCDEFGHI1JKLMN2O7', 'secret_key' => "abc123Def456gHi789jKLmpQ987rstu6vWxyz", 'currency_code' => 'usd', 'client_id' => 'amzn1.application-oa2-client.45789c45a8f34927830be1d9e029f480', 'region' => 'us', 'sandbox' => true, 'platform_id' => 'test', 'application_name' => 'sdk testing', 'application_version' => '1.0', 'proxy_host' => null, 'proxy_port' => -1, 'proxy_username' => null, 'proxy_Password' => null ); public function testConfigArray() { // Test that trimmimg isn't converting the Boolean to a string $client = new Client($this->configParams); $this->assertTrue((bool)$client->__get('sandbox')); // Test four cases in which sandbox is in constructor with an array $client = new Client(array('sandbox' => false)); $this->assertFalse((bool)$client->__get('sandbox')); try { $client = new Client(array('sandbox' => 'false')); } catch (\Exception $expected) { $this->assertRegExp('/should be a boolean value/i', strval($expected)); } $client = new Client(array('sandbox' => true)); $this->assertTrue((bool)$client->__get('sandbox')); try { $client = new Client(array('sandbox' => 'true')); } catch (\Exception $expected) { $this->assertRegExp('/should be a boolean value/i', strval($expected)); } // Test that string trimming is working as intended $client = new Client(array( 'region' => 'us ', // two spaces at end 'currency_code' => ' usd', // two spaces at beginning 'client_id' => ' A113 ' // two spaces and beginning and end )); $this->assertEquals('us', $client->__get('region')); $this->assertEquals('usd', $client->__get('currency_code')); $this->assertEquals('A113', $client->__get('client_id')); $this->assertFalse((bool)$client->__get('sandbox')); // Unclear what is is actually doing, exception doesn't get thrown, consider removing try { $client = new Client($this->configParams); } catch (\Exception $expected) { $this->assertRegExp('/is not a Json File or the Json File./i', strval($expected)); } // Test passing in invalid keys to constructor try { $configParams = array( 'a' => 'A', 'b' => 'B' ); $client = new Client($configParams); } catch (\Exception $expected) { $this->assertRegExp('/is either not part of the configuration or has incorrect Key name./i', strval($expected)); } // Test passing in override service URL for MWS API endpoint $client = new Client(array('override_service_url' => 'https://over.ride')); $this->assertEquals('https://over.ride', $client->__get('override_service_url')); // Test passing in an empty array to construtor try { $configParams = array(); $client = new Client($configParams); } catch (\Exception $expected) { $this->assertRegExp('/$config cannot be null./i', strval($expected)); } } public function testJsonFile() { $configParams = "tst/unit/config/sandbox_true_bool.json"; $client = new Client($configParams); $this->assertTrue((bool)$client->__get('sandbox')); $this->assertEquals('test_merchant_id', $client->__get('merchant_id')); $this->assertEquals('test_access_key', $client->__get('access_key')); $this->assertEquals('test_secret_key', $client->__get('secret_key')); $this->assertEquals('USD', $client->__get('currency_code')); $this->assertEquals('test_client_id', $client->__get('client_id')); $this->assertEquals('us', $client->__get('region')); $this->assertEquals('sdk testing', $client->__get('application_name')); $this->assertEquals('1.0', $client->__get('application_version')); try { $configParams = "tst/unit/config/sandbox_true_string.json"; $client = new Client($configParams); } catch (\Exception $expected) { $this->assertRegExp('/should be a boolean value/i', strval($expected)); } $configParams = "tst/unit/config/sandbox_false_bool.json"; $client = new Client($configParams); $this->assertFalse((bool)$client->__get('sandbox')); $configParams = "tst/unit/config/sandbox_none.json"; $client = new Client($configParams); $this->assertFalse((bool)$client->__get('sandbox')); try { $configParams = "tst/unit/config/sandbox_false_string.json"; $client = new Client($configParams); } catch (\Exception $expected) { $this->assertRegExp('/should be a boolean value/i', strval($expected)); } try { $configParams = "abc.json"; $client = new Client($configParams); } catch (\Exception $expected) { $this->assertRegExp('/is not a Json File path or the Json File./i', strval($expected)); } } public function testSandboxSetter() { $client = new Client($this->configParams); try { $client->setSandbox(true); } catch (\Exception $expected) { $this->assertRegExp('/and should be a boolean value./i', strval($expected)); } try { $client->setSandbox('string value'); } catch (\Exception $expected) { $this->assertRegExp('/and should be a boolean value./i', strval($expected)); } } public function testGetOrderReferenceDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'address_consent_token' => 'AddressConsentToken', 'access_token' => 'AccessToken', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetOrderReferenceDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getOrderReferenceDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testListOrderReference() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken', 'query_id' => 'QueryId', 'query_id_type' => 'QueryIdType', 'page_size' => 'PageSize', 'created_start_time' => 'CreatedTimeRange.StartTime', 'created_end_time' => 'CreatedTimeRange.EndTime', 'sort_order' => 'SortOrder', 'order_status_list' => array() ); $action = 'ListOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $expectedParameters['OrderReferenceStatusListFilter.OrderReferenceStatus.1'] = 'Open'; $expectedParameters['OrderReferenceStatusListFilter.OrderReferenceStatus.2'] = 'Closed'; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->listOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); // Hack to remove mismatched Signature (due to param mismatch), then remove Signature from both to eliminate mismatch $apiParametersString = preg_replace("/&PaymentDomain=[^&]*/", "", $apiParametersString); $apiParametersString = preg_replace("/&Signature=[^&]*/", "", $apiParametersString); $expectedStringParams = preg_replace("/&Signature=[^&]*/", "", $expectedStringParams); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testListOrderReferenceByNextToken() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken', 'next_page_token' => 'NextPageToken' ); $action = 'ListOrderReferenceByNextToken'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->listOrderReferenceByNextToken($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetOrderReferenceDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'Merchant_Id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderReferenceAttributes.PlatformId', 'seller_note' => 'OrderReferenceAttributes.SellerNote', 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', 'supplementary_data' => 'OrderReferenceAttributes.SellerOrderAttributes.SupplementaryData', 'request_payment_authorization' => 'OrderReferenceAttributes.RequestPaymentAuthorization', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetOrderReferenceDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setOrderReferenceDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetOrderAttributesBeforeConfirm() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'amount' => 'OrderAttributes.OrderTotal.Amount', 'currency_code' => 'OrderAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderAttributes.PlatformId', 'seller_note' => 'OrderAttributes.SellerNote', 'seller_order_id' => 'OrderAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderAttributes.SellerOrderAttributes.CustomInformation', 'supplementary_data' => 'OrderAttributes.SellerOrderAttributes.SupplementaryData', 'request_payment_authorization' => 'OrderAttributes.RequestPaymentAuthorization', 'payment_service_provider_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderId', 'payment_service_provider_order_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderOrderId', 'order_item_categories' => array(), 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetOrderAttributes'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $expectedParameters['OrderAttributes.SellerOrderAttributes.OrderItemCategories.OrderItemCategory.1'] = 'Antiques'; $expectedParameters['OrderAttributes.SellerOrderAttributes.OrderItemCategories.OrderItemCategory.2'] = 'Electronics'; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setOrderAttributes($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } /* Call is same as BeforeConfirm call except the amount and currency_code fields are omitted */ public function testSetOrderAttributesAfterConfirm() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'platform_id' => 'OrderAttributes.PlatformId', 'seller_note' => 'OrderAttributes.SellerNote', 'seller_order_id' => 'OrderAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderAttributes.SellerOrderAttributes.CustomInformation', 'request_payment_authorization' => 'OrderAttributes.RequestPaymentAuthorization', 'payment_service_provider_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderId', 'payment_service_provider_order_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderOrderId', 'order_item_categories' => array(), 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetOrderAttributes'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $expectedParameters['OrderAttributes.SellerOrderAttributes.OrderItemCategories.OrderItemCategory.1'] = 'Antiques'; $expectedParameters['OrderAttributes.SellerOrderAttributes.OrderItemCategories.OrderItemCategory.2'] = 'Electronics'; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setOrderAttributes($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmOrderReferenceWithAllSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'mws_auth_token' => 'MWSAuthToken', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode' ); $action = 'ConfirmOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmOrderReferenceWithAllButCurrencyCodeSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'mws_auth_token' => 'MWSAuthToken', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl', 'authorization_amount' => 'AuthorizationAmount.Amount' ); $action = 'ConfirmOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedParameters['AuthorizationAmount.CurrencyCode'] = 'USD'; # default from client $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmOrderReferenceWithUrlSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'mws_auth_token' => 'MWSAuthToken', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl' ); $action = 'ConfirmOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmOrderReferenceWithoutSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'ConfirmOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCancelOrderReference() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'cancelation_reason' => 'CancelationReason', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'CancelOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->cancelOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCloseOrderReference() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'CloseOrderReference'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->closeOrderReference($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCloseAuthorization() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'CloseAuthorization'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->closeAuthorization($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testAuthorize() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode', 'authorization_reference_id' => 'AuthorizationReferenceId', 'capture_now' => 'CaptureNow', 'seller_authorization_note' => 'SellerAuthorizationNote', 'transaction_timeout' => 'TransactionTimeout', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'Authorize'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->authorize($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetAuthorizationDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetAuthorizationDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getAuthorizationDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCapture() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'capture_amount' => 'CaptureAmount.Amount', 'currency_code' => 'CaptureAmount.CurrencyCode', 'capture_reference_id' => 'CaptureReferenceId', 'seller_capture_note' => 'SellerCaptureNote', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'Capture'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->capture($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetCaptureDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_capture_id' => 'AmazonCaptureId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetCaptureDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getCaptureDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testRefund() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_capture_id' => 'AmazonCaptureId', 'refund_reference_id' => 'RefundReferenceId', 'refund_amount' => 'RefundAmount.Amount', 'currency_code' => 'RefundAmount.CurrencyCode', 'seller_refund_note' => 'SellerRefundNote', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'Refund'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->refund($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetRefundDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_refund_id' => 'AmazonRefundId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetRefundDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getRefundDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetMerchantAccountStatus() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetMerchantAccountStatus'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getMerchantAccountStatus($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetServiceStatus() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetServiceStatus'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getServiceStatus($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCreateOrderReferenceForId() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'id' => 'Id', 'id_type' => 'IdType', 'inherit_shipping_address' => 'InheritShippingAddress', 'confirm_now' => 'ConfirmNow', 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderReferenceAttributes.PlatformId', 'seller_note' => 'OrderReferenceAttributes.SellerNote', 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'CreateOrderReferenceForId'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->createOrderReferenceForId($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetBillingAgreementDetails() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'address_consent_token' => 'AddressConsentToken', 'access_token' => 'AccessToken', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetBillingAgreementDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getBillingAgreementDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetBillingAgreementDetailsWithoutSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'platform_id' => 'BillingAgreementAttributes.PlatformId', 'seller_note' => 'BillingAgreementAttributes.SellerNote', 'seller_billing_agreement_id' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.SellerBillingAgreementId', 'custom_information' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformation', 'store_name' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetBillingAgreementDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setBillingAgreementDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetBillingAgreementDetailsWithSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'platform_id' => 'BillingAgreementAttributes.PlatformId', 'seller_note' => 'BillingAgreementAttributes.SellerNote', 'seller_billing_agreement_id' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.SellerBillingAgreementId', 'custom_information' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformation', 'store_name' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName', 'billing_agreement_type' => 'BillingAgreementAttributes.BillingAgreementType', 'subscription_amount' => 'BillingAgreementAttributes.SubscriptionAmount.Amount', 'currency_code' => 'BillingAgreementAttributes.SubscriptionAmount.CurrencyCode', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetBillingAgreementDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setBillingAgreementDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetBillingAgreementDetailsWithSCAExceptCurrencyCode() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'platform_id' => 'BillingAgreementAttributes.PlatformId', 'seller_note' => 'BillingAgreementAttributes.SellerNote', 'seller_billing_agreement_id' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.SellerBillingAgreementId', 'custom_information' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformation', 'store_name' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName', 'billing_agreement_type' => 'BillingAgreementAttributes.BillingAgreementType', 'subscription_amount' => 'BillingAgreementAttributes.SubscriptionAmount.Amount', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetBillingAgreementDetails'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedParameters['BillingAgreementAttributes.SubscriptionAmount.CurrencyCode'] = 'USD'; # default from client $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setBillingAgreementDetails($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmBillingAgreementWithoutSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'ConfirmBillingAgreement'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmBillingAgreement($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testConfirmBillingAgreementWithSCA() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'ConfirmBillingAgreement'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->confirmBillingAgreement($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testValidateBillingAgreement() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'ValidateBillingAgreement'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->validateBillingAgreement($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testAuthorizeOnBillingAgreement() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'authorization_reference_id' => 'AuthorizationReferenceId', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode', 'seller_authorization_note' => 'SellerAuthorizationNote', 'transaction_timeout' => 'TransactionTimeout', 'capture_now' => 'CaptureNow', 'soft_descriptor' => 'SoftDescriptor', 'seller_note' => 'SellerNote', 'platform_id' => 'PlatformId', 'custom_information' => 'SellerOrderAttributes.CustomInformation', 'seller_order_id' => 'SellerOrderAttributes.SellerOrderId', 'store_name' => 'SellerOrderAttributes.StoreName', 'inherit_shipping_address' => 'InheritShippingAddress', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'AuthorizeOnBillingAgreement'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->authorizeOnBillingAgreement($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCloseBillingAgreement() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'CloseBillingAgreement'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->closeBillingAgreement($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testGetMerchantNotificationConfiguration() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $action = 'GetMerchantNotificationConfiguration'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->getMerchantNotificationConfiguration($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testSetMerchantNotificationConfiguration() { $client = new Client($this->configParams); $fieldMappings = array( 'merchant_id' => 'SellerId', 'notification_configuration_list' => array(), 'mws_auth_token' => 'MWSAuthToken' ); $action = 'SetMerchantNotificationConfiguration'; $parameters = $this->setParametersAndPost($fieldMappings, $action); $expectedParameters = $parameters['expectedParameters']; $expectedParameters['NotificationConfigurationList.NotificationConfiguration.1.NotificationUrl'] = 'https://dev.null/one'; $expectedParameters['NotificationConfigurationList.NotificationConfiguration.2.NotificationUrl'] = 'https://dev.null/two'; $expectedParameters['NotificationConfigurationList.NotificationConfiguration.1.EventTypes.EventTypeList.1'] = 'ORDER_REFERENCE'; $expectedParameters['NotificationConfigurationList.NotificationConfiguration.1.EventTypes.EventTypeList.2'] = 'PAYMENT_AUTHORIZE'; $expectedParameters['NotificationConfigurationList.NotificationConfiguration.2.EventTypes.EventTypeList.1'] = 'ALL'; $apiCallParams = $parameters['apiCallParams']; $expectedStringParams = $this->callPrivateMethod($client, 'calculateSignatureAndParametersToString', $expectedParameters); $response = $client->setMerchantNotificationConfiguration($apiCallParams); $apiParametersString = $client->getParameters(); $this->assertEquals($apiParametersString, $expectedStringParams); } public function testCharge() { $client = new Client($this->configParams); $apiCallParams = array('amazon_reference_id' => 'S01-TEST'); try { $client = new Client($this->configParams); $apiCallParams = array('amazon_reference_id' => ''); $client->charge($apiCallParams); } catch (\Exception $expected) { $this->assertRegExp('/key amazon_order_reference_id or amazon_billing_agreement_id is null and is a required parameter./i', strval($expected)); } try { $client = new Client($this->configParams); $apiCallParams = array('amazon_reference_id' => 'T01'); $client->charge($apiCallParams); } catch (\Exception $expected) { $this->assertRegExp('/Invalid Amazon Reference ID./i', strval($expected)); } } public function testGetUserInfo() { try { $this->configParams['region'] = ''; $client = new Client($this->configParams); $client->getUserInfo('Atza'); } catch (\Exception $expected) { $this->assertRegExp('/is a required parameter./i', strval($expected)); } try { $this->configParams['region'] = 'us'; $client = new Client($this->configParams); $client->getUserInfo(null); } catch (\Exception $expected) { $this->assertRegExp('/Access Token is a required parameter and is not set./i', strval($expected)); } } public function testSignature() { $client = new Client($this->configParams); $parameters['SellerId'] = $this->configParams['merchant_id']; $parameters['AWSAccessKeyId'] = $this->configParams['access_key']; $parameters['Version'] = 'test'; $parameters['SignatureMethod'] = 'HmacSHA256'; $parameters['SignatureVersion'] = 2; $parameters['Timestamp'] = $this->getFormattedTimestamp(); uksort($parameters, 'strcmp'); $signatureObj = new Signature($this->configParams,$parameters); $expectedSignature = $signatureObj->getSignature(); $this->callPrivateMethod($client,'createServiceUrl', null); $signature = $this->callPrivateMethod($client,'signParameters', $parameters); $this->assertEquals($signature, $expectedSignature); } public function test500or503() { try { $client = new Client($this->configParams); $url = 'https://www.amazon.com/OffAmazonPayments_Sandbox/2013-01-01'; $client->setMwsServiceUrl($url); $this->callPrivateMethod($client, 'invokePost', null); } catch (\Exception $expected) { $this->assertRegExp('/Maximum number of retry attempts./i', strval($expected)); } } public function testXmlResponse() { $response = array(); $response['ResponseBody'] = '<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <AmazonOrderReferenceId>S01-5806490-2147504</AmazonOrderReferenceId> <ExpirationTimestamp>2015-09-27T02:18:33.408Z</ExpirationTimestamp> <SellerNote>This is testing API call</SellerNote> </GetOrderReferenceDetailsResponse>'; $responseObj = new ResponseParser($response); $xmlResponse = $responseObj->toXml(); $this->assertEquals($xmlResponse, $response['ResponseBody']); } public function testJsonResponse() { $response = array('Status' => '200'); $response['ResponseBody'] = '<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <AmazonOrderReferenceId>S01-5806490-2147504</AmazonOrderReferenceId> <ExpirationTimestamp>2015-09-27T02:18:33.408Z</ExpirationTimestamp> <SellerNote>This is testing API call</SellerNote> </GetOrderReferenceDetailsResponse>'; $json = '{"AmazonOrderReferenceId":"S01-5806490-2147504","ExpirationTimestamp":"2015-09-27T02:18:33.408Z","SellerNote":"This is testing API call","ResponseStatus":"200"}'; $responseObj = new ResponseParser($response); $jsonResponse = $responseObj->toJson(); $this->assertEquals($json, $jsonResponse); } public function testArrayResponse() { $response = array('Status' => '200'); $response['ResponseBody'] = '<GetOrderReferenceDetailsResponse xmlns="http://mws.amazonservices.com/schema/OffAmazonPayments/2013-01-01"> <AmazonOrderReferenceId>S01-5806490-2147504</AmazonOrderReferenceId> <ExpirationTimestamp>2015-09-27T02:18:33.408Z</ExpirationTimestamp> <SellerNote>This is testing API call</SellerNote> </GetOrderReferenceDetailsResponse>'; $array = array('AmazonOrderReferenceId' => 'S01-5806490-2147504', 'ExpirationTimestamp' => '2015-09-27T02:18:33.408Z', 'SellerNote' => 'This is testing API call', 'ResponseStatus' => '200'); $responseObj = new ResponseParser($response); $arrayResponse = $responseObj->toArray(); $this->assertEquals($array, $arrayResponse); } private function setParametersAndPost($fieldMappings, $action) { $expectedParameters = array(); $apiCallParams = array(); $parameters = $this->setDefaultValues($fieldMappings); $expectedParameters = $parameters['expectedParameters']; $apiCallParams = $parameters['apiCallParams']; $expectedParameters['Action'] = $action; foreach ($fieldMappings as $parm => $value) { if ($parm === 'capture_now' || $parm === 'confirm_now' || $parm === 'inherit_shipping_address' || $parm === 'request_payment_authorization') { $expectedParameters[$value] = true; $apiCallParams[$parm] = true; } elseif ($parm === 'order_item_categories') { $apiCallParams[$parm] = array('Antiques', 'Electronics'); } elseif ($parm === 'order_status_list') { $apiCallParams[$parm] = array('Open', 'Closed'); } elseif ($parm === 'notification_configuration_list') { $notificationConfiguration['https://dev.null/one'] = array('ORDER_REFERENCE', 'PAYMENT_AUTHORIZE'); $notificationConfiguration['https://dev.null/two'] = array('ALL'); $apiCallParams[$parm] = $notificationConfiguration; } elseif (!isset($expectedParameters[$value])) { $unique_id = uniqid(); $expectedParameters[$value] = $unique_id; $apiCallParams[$parm] = $unique_id; } } return array('expectedParameters' => $expectedParameters, 'apiCallParams' => $apiCallParams); } private function setDefaultValues($fieldMappings) { $expectedParameters = array(); $apiCallParams = array(); if (array_key_exists('platform_id', $fieldMappings)) { $expectedParameters[$fieldMappings['platform_id']] = $this->configParams['platform_id']; $apiCallParams['platform_id'] = $this->configParams['platform_id']; } if (array_key_exists('currency_code', $fieldMappings)) { $expectedParameters[$fieldMappings['currency_code']] = 'TEST'; $apiCallParams['currency_code'] = 'TEST'; } return array('expectedParameters' => $expectedParameters, 'apiCallParams' => $apiCallParams); } /* Formats date as ISO 8601 timestamp */ private function getFormattedTimestamp() { return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); } private function callPrivateMethod($client, $methodName, $parameters) { $reflectionClass = new \ReflectionClass("AmazonPay\Client"); $reflectionMethod = $reflectionClass->getMethod($methodName); $reflectionMethod->setAccessible(true); $expectedStringParams = $reflectionMethod->invoke($client, $parameters); return $expectedStringParams; } } amazon-pay-sdk-php/tst/unit/config/sandbox_false_string.json000077700000000601151323541140020316 0ustar00{ "merchant_id": "test_merchant_id", "access_key": "test_access_key", "secret_key": "test_secret_key", "currency_code": "USD", "client_id": "test_client_id", "region": "us", "sandbox": "false", "application_name": "sdk testing", "application_version": "1.0", "proxy_host": null, "proxy_port": -1, "proxy_username": null, "proxy_password": null } amazon-pay-sdk-php/tst/unit/config/sandbox_none.json000077700000000552151323541140016602 0ustar00{ "merchant_id": "test_merchant_id", "access_key": "test_access_key", "secret_key": "test_secret_key", "currency_code": "USD", "client_id": "test_client_id", "region": "us", "application_name": "sdk testing", "application_version": "1.0", "proxy_host": null, "proxy_port": -1, "proxy_username": null, "proxy_password": null } amazon-pay-sdk-php/tst/unit/config/sandbox_true_string.json000077700000000600151323541140020202 0ustar00{ "merchant_id": "test_merchant_id", "access_key": "test_access_key", "secret_key": "test_secret_key", "currency_code": "USD", "client_id": "test_client_id", "region": "us", "sandbox": "true", "application_name": "sdk testing", "application_version": "1.0", "proxy_host": null, "proxy_port": -1, "proxy_username": null, "proxy_password": null } amazon-pay-sdk-php/tst/unit/config/sandbox_false_bool.json000077700000000577151323541140017757 0ustar00{ "merchant_id": "test_merchant_id", "access_key": "test_access_key", "secret_key": "test_secret_key", "currency_code": "USD", "client_id": "test_client_id", "region": "us", "sandbox": false, "application_name": "sdk testing", "application_version": "1.0", "proxy_host": null, "proxy_port": -1, "proxy_username": null, "proxy_password": null } amazon-pay-sdk-php/tst/unit/config/sandbox_true_bool.json000077700000000576151323541140017643 0ustar00{ "merchant_id": "test_merchant_id", "access_key": "test_access_key", "secret_key": "test_secret_key", "currency_code": "USD", "client_id": "test_client_id", "region": "us", "sandbox": true, "application_name": "sdk testing", "application_version": "1.0", "proxy_host": null, "proxy_port": -1, "proxy_username": null, "proxy_password": null } amazon-pay-sdk-php/tst/unit/config/.htaccess000077700000000177151323541140015033 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/tst/unit/.htaccess000077700000000177151323541140013566 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/tst/.htaccess000077700000000177151323541140012607 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/.github/PULL_REQUEST_TEMPLATE.md000077700000000251151323541140015331 0ustar00*Issue #, if available:* *Description of changes:* By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. amazon-pay-sdk-php/.github/.htaccess000077700000000177151323541140013335 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/composer.json000077700000001273151323541140012717 0ustar00{ "name": "amzn/amazon-pay-sdk-php", "type": "library", "description": "Amazon Pay SDK (PHP)", "version": "3.6.0", "keywords": [ "amazon", "pay", "payment", "payments", "pay with amazon", "amazon payments", "amazon pay" ], "homepage": "https://github.com/amzn/amazon-pay-sdk-php", "license": "Apache-2.0", "authors": [ { "name": "Amazon Pay SDK", "email": "amazon-pay-sdk@amazon.com" } ], "autoload": { "psr-4": { "AmazonPay\\": "AmazonPay/" } }, "require": { "ext-curl": "*", "php": ">=5.5.0" }, "require-dev": { "phpunit/phpunit": "^4" } } amazon-pay-sdk-php/AmazonPay/ClientInterface.php000077700000054722151323541140015653 0ustar00<?php namespace AmazonPay; /* Interface class to showcase the public API methods for Amazon Pay */ interface ClientInterface { /* Setter for sandbox * Sets the boolean value for config['sandbox'] variable */ public function setSandbox($value); /* Setter for config['client_id'] * Sets the value for config['client_id'] variable */ public function setClientId($value); /* Setter for config['app_id'] * Sets the value for config['app_id'] variable */ public function setAppId($value); /* Setter for Proxy * input $proxy [array] * @param $proxy['proxy_user_host'] - hostname for the proxy * @param $proxy['proxy_user_port'] - hostname for the proxy * @param $proxy['proxy_user_name'] - if your proxy required a username * @param $proxy['proxy_user_password'] - if your proxy required a passowrd */ public function setProxy($proxy); /* Setter for $_mwsServiceUrl * Set the URL to which the post request has to be made for unit testing */ public function setMwsServiceUrl($url); /* Getter * Gets the value for the key if the key exists in config */ public function __get($name); /* Getter for parameters string * Gets the value for the parameters string for unit testing */ public function getParameters(); /* GetUserInfo convenience funtion - Returns user's profile information from Amazon using the access token returned by the Button widget. * * @param $access_token [String] */ public function getUserInfo($access_token); /* GetMerchantAccountStatus API call - Returns the status of the Merchant Account. * @see TODO * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getMerchantAccountStatus($requestParameters = array()); /* GetOrderReferenceDetails API call - Returns details about the Order Reference object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['address_consent_token'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getOrderReferenceDetails($requestParameters = array()); /* ListOrderReference API call - Returns details about the Order Reference object and its current state from the sellers. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['query_id'] - [String] * @param requestParameters['query_id_type'] - [String] (SellerOrderId) * @optional requestParameters['page_size'] - [Int] * @optional requestParameters['created_start_time'] - [String] (Date/Time ISO8601) * @optional requestParameters['created_end_time'] - [String] (Date/Time ISO8601) Limited to 31 days * @optional requestParameters['sort_order'] - [String] (Ascending/Descending) * @optional requestParameters['mws_auth_token'] - [String] * @optional requestParameters['status_list'] - [Array] */ public function listOrderReference($requestParameters = array()); /* ListOrderReferenceByNextToken API call - Returns details about the Order Reference object and its current * state from the sellers. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['next_token'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function listOrderReferenceByNextToken($requestParameters = array()); /* SetOrderReferenceDetails API call - Sets order reference details such as the order total and a description for the order. * @see https://pay.amazon.com/developer/documentation/apireference/201751960 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @param requestParameters['amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['request_payment_authorization'] - [Boolean] * @optional requestParameters['mws_auth_token'] - [String] */ public function setOrderReferenceDetails($requestParameters = array()); /* SetOrderAttributes API call - Sets order reference attributes such as the order total and a description for the order. * Works same as SetOrderReferenceDetails, but includes additional PSP-related attributes and can also be called after * the ORO has been confirmed. Only some values can be changed the ORO has been confirmed. See API documentation. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['request_payment_authorization'] - [Boolean] * @optional requestParameters['payment_service_provider_id'] - [String] * @optional requestParameters['payment_service_provider_order_id'] - [String] * @optional requestParameters['order_item_categories'] - [array()] * @optional requestParameters['mws_auth_token'] - [String] */ public function setOrderAttributes($requestParameters = array()); /* ConfirmOrderReferenceDetails API call - Confirms that the order reference is free of constraints and all required information has been set on the order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201751980 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['success_url'] - [String] * @optional requestParameters['failure_url'] - [String] * @optional requestParameters['authorization_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function confirmOrderReference($requestParameters = array()); /* CancelOrderReferenceDetails API call - Cancels a previously confirmed order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201751990 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['cancelation_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function cancelOrderReference($requestParameters = array()); /* CloseOrderReference API call - Confirms that an order reference has been fulfilled (fully or partially) * and that you do not expect to create any new authorizations on this order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201752000 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeOrderReference($requestParameters = array()); /* CloseAuthorization API call - Closes an authorization. * @see https://pay.amazon.com/developer/documentation/apireference/201752070 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeAuthorization($requestParameters = array()); /* Authorize API call - Reserves a specified amount against the payment method(s) stored in the order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201752010 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @param requestParameters['authorization_amount'] [String] * @param requestParameters['currency_code'] - [String] * @param requestParameters['authorization_reference_id'] [String] * @optional requestParameters['capture_now'] [String] * @optional requestParameters['provider_credit_details'] - [array (array())] * @optional requestParameters['seller_authorization_note'] [String] * @optional requestParameters['transaction_timeout'] [String] - Defaults to 1440 minutes * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function authorize($requestParameters = array()); /* GetAuthorizationDetails API call - Returns the status of a particular authorization and the total amount captured on the authorization. * @see https://pay.amazon.com/developer/documentation/apireference/201752030 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getAuthorizationDetails($requestParameters = array()); /* Capture API call - Captures funds from an authorized payment instrument. * @see https://pay.amazon.com/developer/documentation/apireference/201752040 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] - [String] * @param requestParameters['capture_amount'] - [String] * @param requestParameters['currency_code'] - [String] * @param requestParameters['capture_reference_id'] - [String] * @optional requestParameters['provider_credit_details'] - [array (array())] * @optional requestParameters['seller_capture_note'] - [String] * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function capture($requestParameters = array()); /* GetCaptureDetails API call - Returns the status of a particular capture and the total amount refunded on the capture. * @see https://pay.amazon.com/developer/documentation/apireference/201752060 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_capture_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getCaptureDetails($requestParameters = array()); /* Refund API call - Refunds a previously captured amount. * @see https://pay.amazon.com/developer/documentation/apireference/201752080 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_capture_id'] - [String] * @param requestParameters['refund_reference_id'] - [String] * @param requestParameters['refund_amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['provider_credit_reversal_details'] - [array(array())] * @optional requestParameters['seller_refund_note'] [String] * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function refund($requestParameters = array()); /* GetRefundDetails API call - Returns the status of a particular refund. * @see https://pay.amazon.com/developer/documentation/apireference/201752100 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_refund_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getRefundDetails($requestParameters = array()); /* GetServiceStatus API Call - Returns the operational status of the OffAmazonPayments API section * @see https://pay.amazon.com/developer/documentation/apireference/201752110 * * The GetServiceStatus operation returns the operational status of the OffAmazonPayments API * section of Amazon Marketplace Web Service (Amazon MWS). * Status values are GREEN, GREEN_I, YELLOW, and RED. * * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getServiceStatus($requestParameters = array()); /* CreateOrderReferenceForId API Call - Creates an order reference for the given object * @see https://pay.amazon.com/developer/documentation/apireference/201751670 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['id'] - [String] * @optional requestParameters['inherit_shipping_address'] [Boolean] * @optional requestParameters['confirm_now'] - [Boolean] * @optional Amount (required when confirm_now is set to true) [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function createOrderReferenceForId($requestParameters = array()); /* GetBillingAgreementDetails API Call - Returns details about the Billing Agreement object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751690 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getBillingAgreementDetails($requestParameters = array()); /* SetBillingAgreementDetails API call - Sets Billing Agreement details such as a description of the agreement and other information about the seller. * @see https://pay.amazon.com/developer/documentation/apireference/201751700 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @param requestParameters['amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_billing_agreement_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['billing_agreement_type'] - [String] either 'CustomerInitiatedTransaction' or 'MerchantInitiatedTransaction' * @optional requestParameters['subscription_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function setBillingAgreementDetails($requestParameters = array()); /* ConfirmBillingAgreement API Call - Confirms that the Billing Agreement is free of constraints and all required information has been set on the Billing Agreement. * @see https://pay.amazon.com/developer/documentation/apireference/201751710 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['success_url'] - [String] * @optional requestParameters['failure_url'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function confirmBillingAgreement($requestParameters = array()); /* ValidateBillingAgreement API Call - Validates the status of the Billing Agreement object and the payment method associated with it. * @see https://pay.amazon.com/developer/documentation/apireference/201751720 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function validateBillingAgreement($requestParameters = array()); /* AuthorizeOnBillingAgreement API call - Reserves a specified amount against the payment method(s) stored in the Billing Agreement. * @see https://pay.amazon.com/developer/documentation/apireference/201751940 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @param requestParameters['authorization_reference_id'] [String] * @param requestParameters['authorization_amount'] [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['seller_authorization_note'] [String] * @optional requestParameters['transaction_timeout'] - Defaults to 1440 minutes * @optional requestParameters['capture_now'] [String] * @optional requestParameters['soft_descriptor'] - - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['inherit_shipping_address'] [Boolean] - Defaults to true * @optional requestParameters['mws_auth_token'] - [String] */ public function authorizeOnBillingAgreement($requestParameters = array()); /* CloseBillingAgreement API Call - Returns details about the Billing Agreement object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751950 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeBillingAgreement($requestParameters = array()); /* GetMerchantNotificationConfiguration API Call - Returns details about the defined IPN endpoints * * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getMerchantNotificationConfiguration($requestParameters = array()); /* SetMerchantNotificationConfiguration API Call - Set IPN endpoints * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['notification_configuration_list'] - [Array] * @optional requestParameters['mws_auth_token'] - [String] */ public function setMerchantNotificationConfiguration($requestParameters = array()); /* charge convenience method * Performs the API calls * 1. SetOrderReferenceDetails / SetBillingAgreementDetails * 2. ConfirmOrderReference / ConfirmBillingAgreement * 3. Authorize (with Capture) / AuthorizeOnBillingAgreeemnt (with Capture) * * @param requestParameters['merchant_id'] - [String] * * @param requestParameters['amazon_reference_id'] - [String] : Order Reference ID /Billing Agreement ID * If requestParameters['amazon_reference_id'] is empty then the following is required, * @param requestParameters['amazon_order_reference_id'] - [String] : Order Reference ID * or, * @param requestParameters['amazon_billing_agreement_id'] - [String] : Billing Agreement ID * * @param $requestParameters['charge_amount'] - [String] : Amount value to be captured * @param requestParameters['currency_code'] - [String] : Currency Code for the Amount * @param requestParameters['authorization_reference_id'] - [String]- Any unique string that needs to be passed * @optional requestParameters['charge_note'] - [String] : Seller Note sent to the buyer * @optional requestParameters['transaction_timeout'] - [String] : Defaults to 1440 minutes * @optional requestParameters['charge_order_id'] - [String] : Custom Order ID provided * @optional requestParameters['mws_auth_token'] - [String] */ public function charge($requestParameters = array()); /* GetProviderCreditDetails API Call - Get the details of the Provider Credit. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getProviderCreditDetails($requestParameters = array()); /* GetProviderCreditReversalDetails API Call - Get details of the Provider Credit Reversal. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_reversal_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getProviderCreditReversalDetails($requestParameters = array()); /* ReverseProviderCredit API Call - Reverse the Provider Credit. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_id'] - [String] * @optional requestParameters['credit_reversal_reference_id'] - [String] * @param requestParameters['credit_reversal_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['credit_reversal_note'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function reverseProviderCredit($requestParameters = array()); } amazon-pay-sdk-php/AmazonPay/IpnHandler.php000077700000040113151323541140014625 0ustar00<?php namespace AmazonPay; /* Class IPN_Handler * Takes headers and body of the IPN message as input in the constructor * verifies that the IPN is from the right resource and has the valid data */ require_once 'HttpCurl.php'; require_once 'IpnHandlerInterface.php'; if (!interface_exists('\Psr\Log\LoggerAwareInterface')) { require_once(__DIR__.'/../Psr/Log/LoggerAwareInterface.php'); } if (!interface_exists('\Psr\Log\LoggerInterface')) { require_once(__DIR__.'/../Psr/Log/LoggerInterface.php'); } use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; class IpnHandler implements IpnHandlerInterface, LoggerAwareInterface { private $headers = null; private $body = null; private $snsMessage = null; private $fields = array(); private $signatureFields = array(); private $certificate = null; private $expectedCnName = 'sns.amazonaws.com'; private $defaultHostPattern = '/^sns\.[a-zA-Z0-9\-]{3,}\.amazonaws\.com(\.cn)?$/'; // Implement a logging library that utilizes the PSR 3 logger interface private $logger = null; private $ipnConfig = array('cabundle_file' => null, 'proxy_host' => null, 'proxy_port' => -1, 'proxy_username' => null, 'proxy_password' => null); public function __construct($headers, $body, $ipnConfig = null) { $this->headers = array_change_key_case($headers, CASE_LOWER); $this->body = $body; if ($ipnConfig != null) { $this->checkConfigKeys($ipnConfig); } // Get the list of fields that we are interested in $this->fields = array( "Timestamp" => true, "Message" => true, "MessageId" => true, "Subject" => false, "TopicArn" => true, "Type" => true ); // Validate the IPN message header [x-amz-sns-message-type] $this->validateHeaders(); // Converts the IPN [Message] to Notification object $this->getMessage(); // Checks if the notification [Type] is Notification and constructs the signature fields $this->checkForCorrectMessageType(); // Verifies the signature against the provided pem file in the IPN $this->constructAndVerifySignature(); } private function checkConfigKeys($ipnConfig) { $ipnConfig = array_change_key_case($ipnConfig, CASE_LOWER); $ipnConfig = $this->trimArray($ipnConfig); foreach ($ipnConfig as $key => $value) { if (array_key_exists($key, $this->ipnConfig)) { $this->ipnConfig[$key] = $value; } else { throw new \Exception('Key ' . $key . ' is either not part of the configuration or has incorrect Key name. check the ipnConfig array key names to match your key names of your config array ', 1); } } } public function setLogger(LoggerInterface $logger = null) { $this->logger = $logger; } /* Helper function to log data within the Client */ private function logMessage($message) { if ($this->logger) { $this->logger->debug($message); } } /* Setter function * Sets the value for the key if the key exists in ipnConfig */ public function __set($name, $value) { if (array_key_exists(strtolower($name), $this->ipnConfig)) { $this->ipnConfig[$name] = $value; } else { throw new \Exception("Key " . $name . " is not part of the configuration", 1); } } /* Getter function * Returns the value for the key if the key exists in ipnConfig */ public function __get($name) { if (array_key_exists(strtolower($name), $this->ipnConfig)) { return $this->ipnConfig[$name]; } else { throw new \Exception("Key " . $name . " was not found in the configuration", 1); } } /* Trim the input Array key values */ private function trimArray($array) { foreach ($array as $key => $value) { $array[$key] = trim($value); } return $array; } private function validateHeaders() { // Quickly check that this is a sns message if (!array_key_exists('x-amz-sns-message-type', $this->headers)) { throw new \Exception("Error with message - header " . "does not contain x-amz-sns-message-type header"); } if ($this->headers['x-amz-sns-message-type'] !== 'Notification') { throw new \Exception("Error with message - header x-amz-sns-message-type is not " . "Notification, is " . $this->headers['x-amz-sns-message-type']); } } private function getMessage() { $this->snsMessage = json_decode($this->body, true); $json_error = json_last_error(); if ($json_error != 0) { $errorMsg = "Error with message - content is not in json format" . $this->getErrorMessageForJsonError($json_error) . " " . $this->snsMessage; throw new \Exception($errorMsg); } } /* Convert a json error code to a descriptive error message * * @param int $json_error message code * * @return string error message */ private function getErrorMessageForJsonError($json_error) { switch ($json_error) { case JSON_ERROR_DEPTH: return " - maximum stack depth exceeded."; break; case JSON_ERROR_STATE_MISMATCH: return " - invalid or malformed JSON."; break; case JSON_ERROR_CTRL_CHAR: return " - control character error."; break; case JSON_ERROR_SYNTAX: return " - syntax error."; break; default: return "."; break; } } /* checkForCorrectMessageType() * * Checks if the Field [Type] is set to ['Notification'] * Gets the value for the fields marked true in the fields array * Constructs the signature string */ private function checkForCorrectMessageType() { $type = $this->getMandatoryField("Type"); if (strcasecmp($type, "Notification") != 0) { throw new \Exception("Error with SNS Notification - unexpected message with Type of " . $type); } if (strcmp($this->getMandatoryField("Type"), "Notification") != 0) { throw new \Exception("Error with signature verification - unable to verify " . $this->getMandatoryField("Type") . " message"); } else { // Sort the fields into byte order based on the key name(A-Za-z) ksort($this->fields); // Extract the key value pairs and sort in byte order $signatureFields = array(); foreach ($this->fields as $fieldName => $mandatoryField) { if ($mandatoryField) { $value = $this->getMandatoryField($fieldName); } else { $value = $this->getField($fieldName); } if (!is_null($value)) { array_push($signatureFields, $fieldName); array_push($signatureFields, $value); } } /* Create the signature string - key / value in byte order * delimited by newline character + ending with a new line character */ $this->signatureFields = implode("\n", $signatureFields) . "\n"; } } /* Ensures that the URL of the certificate is one belonging to AWS. * * @param string $url Certificate URL * * @throws InvalidSnsMessageException if the cert url is invalid. */ private function validateUrl($url) { $parsed = parse_url($url); if (empty($parsed['scheme']) || empty($parsed['host']) || $parsed['scheme'] !== 'https' || substr($url, -4) !== '.pem' || !preg_match($this->defaultHostPattern, $parsed['host']) ) { throw new \Exception( 'The certificate is located on an invalid domain.' ); } } /* Verify that the signature is correct for the given data and * public key * * @param string $signature decoded signature to compare against * @param string $certificatePath path to certificate, can be file or url * * @throws Exception if there is an error with the call * * @return bool true if valid */ private function constructAndVerifySignature() { $signature = base64_decode($this->getMandatoryField("Signature")); $certificatePath = $this->getMandatoryField("SigningCertURL"); $this->validateUrl($certificatePath); $this->certificate = $this->getCertificate($certificatePath); $result = $this->verifySignatureIsCorrectFromCertificate($signature); if (!$result) { throw new \Exception("Unable to match signature from remote server: signature of " . $this->getCertificate($certificatePath) . " , SigningCertURL of " . $this->getMandatoryField("SigningCertURL") . " , SignatureOf " . $this->getMandatoryField("Signature")); } } /* getCertificate($certificatePath) * * gets the certificate from the $certificatePath using Curl */ private function getCertificate($certificatePath) { $httpCurlRequest = new HttpCurl($this->ipnConfig); $response = $httpCurlRequest->httpGet($certificatePath); return $response; } /* Verify that the signature is correct for the given data and public key * * @param string $signature decoded signature to compare against * @param string $certificate certificate object defined in Certificate.php */ public function verifySignatureIsCorrectFromCertificate($signature) { $certKey = openssl_get_publickey($this->certificate); if ($certKey === False) { throw new \Exception("Unable to extract public key from cert"); } try { $certInfo = openssl_x509_parse($this->certificate, true); $certSubject = $certInfo["subject"]; if (is_null($certSubject)) { throw new \Exception("Error with certificate - subject cannot be found"); } } catch (\Exception $ex) { throw new \Exception("Unable to verify certificate - error with the certificate subject", null, $ex); } if (strcmp($certSubject["CN"], $this->expectedCnName)) { throw new \Exception("Unable to verify certificate issued by Amazon - error with certificate subject"); } $result = -1; try { $result = openssl_verify($this->signatureFields, $signature, $certKey, OPENSSL_ALGO_SHA1); } catch (\Exception $ex) { throw new \Exception("Unable to verify signature - error with the verification algorithm", null, $ex); } return ($result > 0); } /* Extract the mandatory field from the message and return the contents * * @param string $fieldName name of the field to extract * * @throws Exception if not found * * @return string field contents if found */ private function getMandatoryField($fieldName) { $value = $this->getField($fieldName); if (is_null($value)) { throw new \Exception("Error with json message - mandatory field " . $fieldName . " cannot be found"); } return $value; } /* Extract the field if present, return null if not defined * * @param string $fieldName name of the field to extract * * @return string field contents if found, null otherwise */ private function getField($fieldName) { if (array_key_exists($fieldName, $this->snsMessage)) { return $this->snsMessage[$fieldName]; } else { return null; } } /* returnMessage() - JSON decode the raw [Message] portion of the IPN */ public function returnMessage() { return json_decode($this->snsMessage['Message'], true); } /* toJson() - Converts IPN [Message] field to JSON * * Has child elements * ['NotificationData'] [XML] - API call XML notification data * @param remainingFields - consists of remaining IPN array fields that are merged * Type - Notification * MessageId - ID of the Notification * Topic ARN - Topic of the IPN * @return response in JSON format */ public function toJson() { $response = $this->simpleXmlObject(); // Merging the remaining fields with the response $remainingFields = $this->getRemainingIpnFields(); $responseArray = array_merge($remainingFields,(array)$response); // Converting to JSON format $response = json_encode($responseArray); return $response; } /* toArray() - Converts IPN [Message] field to associative array * @return response in array format */ public function toArray() { $response = $this->simpleXmlObject(); // Converting the SimpleXMLElement Object to array() $response = json_encode($response); $response = json_decode($response, true); // Merging the remaining fields with the response array $remainingFields = $this->getRemainingIpnFields(); $response = array_merge($remainingFields,$response); return $response; } /* addRemainingFields() - Add remaining fields to the datatype * * Has child elements * ['NotificationData'] [XML] - API call XML response data * Convert to SimpleXML element object * Type - Notification * MessageId - ID of the Notification * Topic ARN - Topic of the IPN * @return response in array format */ private function simpleXmlObject() { $ipnMessage = $this->returnMessage(); $this->logMessage(sprintf('IPN received for merchant account: %s', $this->sanitizeResponseData($ipnMessage['SellerId']))); $this->logMessage($this->sanitizeResponseData($ipnMessage['NotificationData'])); // Getting the Simple XML element object of the IPN XML Response Body $response = simplexml_load_string((string) $ipnMessage['NotificationData']); // Adding the Type, MessageId, TopicArn details of the IPN to the Simple XML element Object $response->addChild('Type', $this->snsMessage['Type']); $response->addChild('MessageId', $this->snsMessage['MessageId']); $response->addChild('TopicArn', $this->snsMessage['TopicArn']); return $response; } /* getRemainingIpnFields() * Gets the remaining fields of the IPN to be later appended to the return message */ private function getRemainingIpnFields() { $ipnMessage = $this->returnMessage(); $remainingFields = array( 'NotificationReferenceId' =>$ipnMessage['NotificationReferenceId'], 'NotificationType' =>$ipnMessage['NotificationType'], 'SellerId' =>$ipnMessage['SellerId'], 'ReleaseEnvironment' =>$ipnMessage['ReleaseEnvironment'] ); return $remainingFields; } private function sanitizeResponseData($input) { $patterns = array(); $patterns[0] = '/(<SellerNote>)(.+)(<\/SellerNote>)/ms'; $patterns[1] = '/(<AuthorizationBillingAddress>)(.+)(<\/AuthorizationBillingAddress>)/ms'; $patterns[2] = '/(<SellerAuthorizationNote>)(.+)(<\/SellerAuthorizationNote>)/ms'; $patterns[3] = '/(<SellerCaptureNote>)(.+)(<\/SellerCaptureNote>)/ms'; $patterns[4] = '/(<SellerRefundNote>)(.+)(<\/SellerRefundNote>)/ms'; $replacements = array(); $replacements[0] = '$1 REMOVED $3'; $replacements[1] = '$1 REMOVED $3'; $replacements[2] = '$1 REMOVED $3'; $replacements[3] = '$1 REMOVED $3'; $replacements[4] = '$1 REMOVED $3'; return preg_replace($patterns, $replacements, $input); } } amazon-pay-sdk-php/AmazonPay/HttpCurl.php000077700000007754151323541140014364 0ustar00<?php namespace AmazonPay; /* Class HttpCurl * Handles Curl POST function for all requests */ require_once 'HttpCurlInterface.php'; class HttpCurl implements HttpCurlInterface { private $config = array(); private $header = false; private $accessToken = null; private $curlResponseInfo = null; private $headerArray = array(); /* Takes user configuration array as input * Takes configuration for API call or IPN config */ public function __construct($config = null) { $this->config = $config; } /* Setter for boolean header to get the user info */ public function setHttpHeader() { $this->header = true; } /* Setter for Access token to get the user info */ public function setAccessToken($accesstoken) { $this->accessToken = $accesstoken; } /* Add the common Curl Parameters to the curl handler $ch * Also checks for optional parameters if provided in the config * config['cabundle_file'] * config['proxy_port'] * config['proxy_host'] * config['proxy_username'] * config['proxy_password'] */ protected function commonCurlParams($url,$userAgent) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_PORT, 443); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); if (!is_null($this->config['cabundle_file'])) { curl_setopt($ch, CURLOPT_CAINFO, $this->config['cabundle_file']); } if (!empty($userAgent)) curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); if ($this->config['proxy_host'] != null && $this->config['proxy_port'] != -1) { curl_setopt($ch, CURLOPT_PROXY, $this->config['proxy_host'] . ':' . $this->config['proxy_port']); } if ($this->config['proxy_username'] != null && $this->config['proxy_password'] != null) { curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->config['proxy_username'] . ':' . $this->config['proxy_password']); } return $ch; } /* POST using curl for the following situations * 1. API calls * 2. IPN certificate retrieval * 3. Get User Info */ public function httpPost($url, $userAgent = null, $parameters = null) { $ch = $this->commonCurlParams($url,$userAgent); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters); curl_setopt($ch, CURLOPT_HEADER, false); $response = $this->execute($ch); return $response; } /* GET using curl for the following situations * 1. IPN certificate retrieval * 2. Get User Info */ public function httpGet($url, $userAgent = null) { $ch = $this->commonCurlParams($url,$userAgent); // Setting the HTTP header with the Access Token only for Getting user info if ($this->header) { $this->headerArray[] = 'Authorization: bearer ' . $this->accessToken; } $response = $this->execute($ch); return $response; } /* Execute Curl request */ /* Protected because will be used by PSP module */ protected function execute($ch) { $response = ''; // Ensure we never send the "Expect: 100-continue" header $this->headerArray[] = 'Expect:'; curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headerArray); $response = curl_exec($ch); if ($response === false) { $error_msg = "Unable to post request, underlying exception of " . curl_error($ch); curl_close($ch); throw new \Exception($error_msg); } else { $this->curlResponseInfo = curl_getinfo($ch); } curl_close($ch); return $response; } /* Get the output of Curl Getinfo */ public function getCurlResponseInfo() { return $this->curlResponseInfo; } } amazon-pay-sdk-php/AmazonPay/Client.php000077700000260740151323541140014031 0ustar00<?php namespace AmazonPay; /* Class Client * Takes configuration information * Makes API calls to MWS for Amazon Pay * returns Response Object */ require_once 'ResponseParser.php'; require_once 'HttpCurl.php'; require_once 'ClientInterface.php'; require_once 'Regions.php'; if (!interface_exists('\Psr\Log\LoggerAwareInterface')) { require_once(__DIR__.'/../Psr/Log/LoggerAwareInterface.php'); } if (!interface_exists('\Psr\Log\LoggerInterface')) { require_once(__DIR__.'/../Psr/Log/LoggerInterface.php'); } use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; class Client implements ClientInterface, LoggerAwareInterface { const SDK_VERSION = '3.6.0'; const MWS_VERSION = '2013-01-01'; const MAX_ERROR_RETRY = 3; // Construct User agent string based off of the application_name, application_version, PHP platform private $userAgent = null; private $parameters = null; private $mwsEndpointPath = null; private $mwsEndpointUrl = null; private $profileEndpoint = null; private $config = array( 'merchant_id' => null, 'secret_key' => null, 'access_key' => null, 'region' => null, 'currency_code' => null, 'sandbox' => false, 'platform_id' => null, 'cabundle_file' => null, 'application_name' => null, 'application_version' => null, 'proxy_host' => null, 'proxy_port' => -1, 'proxy_username' => null, 'proxy_password' => null, 'client_id' => null, 'app_id' => null, 'handle_throttle' => true, 'override_service_url' => null ); private $modePath = null; // Final URL to where the API parameters POST done, based off the config['region'] and respective $mwsServiceUrls private $mwsServiceUrl = null; private $mwsServiceUrls; private $profileEndpointUrls; private $regionMappings; // Implement a logging library that utilizes the PSR 3 logger interface private $logger = null; // Boolean variable to check if the API call was a success public $success = false; /* Takes user configuration array from the user as input * Takes JSON file path with configuration information as input * Validates the user configuration array against existing config array */ public function __construct($config = null) { $this->getRegionUrls(); if (!is_null($config)) { if (is_array($config)) { $configArray = $config; } elseif (!is_array($config)) { $configArray = $this->checkIfFileExists($config); } // Invoke sandbox setter to throw exception if not Boolean datatype if (!empty($configArray['sandbox'])) { $this->setSandbox($configArray['sandbox']); } if (is_array($configArray)) { $this->checkConfigKeys($configArray); } else { throw new \Exception('$config is of the incorrect type ' . gettype($configArray) . ' and should be of the type array'); } } else { throw new \Exception('$config cannot be null.'); } } public function setLogger(LoggerInterface $logger = null) { $this->logger = $logger; } /* Helper function to log data within the Client */ private function logMessage($message) { if ($this->logger) { $this->logger->debug($message); } } /* Get the Region specific properties from the Regions class.*/ private function getRegionUrls() { $regionObject = new Regions(); $this->mwsServiceUrls = $regionObject->mwsServiceUrls; $this->regionMappings = $regionObject->regionMappings; $this->profileEndpointUrls = $regionObject->profileEndpointUrls; } /* checkIfFileExists - check if the JSON file exists in the path provided */ private function checkIfFileExists($config) { if (file_exists($config)) { $jsonString = file_get_contents($config); $configArray = json_decode($jsonString, true); $jsonError = json_last_error(); if ($jsonError != 0) { $errorMsg = "Error with message - content is not in json format" . $this->getErrorMessageForJsonError($jsonError) . " " . $configArray; throw new \Exception($errorMsg); } } else { $errorMsg ='$config is not a Json File path or the Json File was not found in the path provided'; throw new \Exception($errorMsg); } return $configArray; } /* Checks if the keys of the input configuration matches the keys in the config array * if they match the values are taken else throws exception * strict case match is not performed */ private function checkConfigKeys($config) { $config = array_change_key_case($config, CASE_LOWER); $config = $this->trimArray($config); foreach ($config as $key => $value) { if (array_key_exists($key, $this->config)) { $this->config[$key] = $value; } else { throw new \Exception('Key ' . $key . ' is either not part of the configuration or has incorrect Key name. check the config array key names to match your key names of your config array', 1); } } } /* Convert a json error code to a descriptive error message * * @param int $jsonError message code * * @return string error message */ private function getErrorMessageForJsonError($jsonError) { switch ($jsonError) { case JSON_ERROR_DEPTH: return " - maximum stack depth exceeded."; break; case JSON_ERROR_STATE_MISMATCH: return " - invalid or malformed JSON."; break; case JSON_ERROR_CTRL_CHAR: return " - control character error."; break; case JSON_ERROR_SYNTAX: return " - syntax error."; break; default: return "."; break; } } /* Setter for sandbox * Sets the Boolean value for config['sandbox'] variable */ public function setSandbox($value) { if (is_bool($value)) { $this->config['sandbox'] = $value; } else { throw new \Exception('sandbox value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value'); } } /* Setter for config['client_id'] * Sets the value for config['client_id'] variable */ public function setClientId($value) { if (!empty($value)) { $this->config['client_id'] = $value; } else { throw new \Exception('setter value for client ID provided is empty'); } } /* Setter for config['app_id'] * Sets the value for config['app_id'] variable */ public function setAppId($value) { if (!empty($value)) { $this->config['app_id'] = $value; } else { throw new \Exception('setter value for app ID provided is empty'); } } /* Setter for Proxy * input $proxy [array] * @param $proxy['proxy_user_host'] - hostname for the proxy * @param $proxy['proxy_user_port'] - hostname for the proxy * @param $proxy['proxy_user_name'] - if your proxy required a username * @param $proxy['proxy_user_password'] - if your proxy required a password */ public function setProxy($proxy) { if (!empty($proxy['proxy_user_host'])) $this->config['proxy_host'] = $proxy['proxy_user_host']; if (!empty($proxy['proxy_user_port'])) $this->config['proxy_port'] = $proxy['proxy_user_port']; if (!empty($proxy['proxy_user_name'])) $this->config['proxy_username'] = $proxy['proxy_user_name']; if (!empty($proxy['proxy_user_password'])) $this->config['proxy_password'] = $proxy['proxy_user_password']; } /* Setter for $mwsServiceUrl * Set the URL to which the post request has to be made for unit testing */ public function setMwsServiceUrl($url) { $this->mwsServiceUrl = $url; } /* Getter * Gets the value for the key if the key exists in config */ public function __get($name) { if (array_key_exists(strtolower($name), $this->config)) { return $this->config[strtolower($name)]; } else { throw new \Exception('Key ' . $name . ' is either not a part of the configuration array config or the ' . $name . ' does not match the key name in the config array', 1); } } /* Getter for parameters string * Gets the value for the parameters string for unit testing */ public function getParameters() { return trim($this->parameters); } /* Trim the input Array key values */ private function trimArray($array) { foreach ($array as $key => $value) { // Do not attemp to trim array variables, boolean variables, or the proxy password // Trimming a boolean value (as a string) may not produce the expected output, so pass it through as-is if (!is_array($value) && !is_bool($value) && $key !== 'proxy_password') { $array[$key] = trim($value); } } return $array; } /* GetUserInfo convenience function - Returns user's profile information from Amazon using the access token returned by the Button widget. * * @see http://login.amazon.com/website Step 4 * @param $accessToken [String] */ public function getUserInfo($accessToken) { // Get the correct Profile Endpoint URL based off the country/region provided in the config['region'] $this->profileEndpointUrl(); if (empty($accessToken)) { throw new \InvalidArgumentException('Access Token is a required parameter and is not set'); } // To make sure double encoding doesn't occur decode first and encode again. $accessToken = urldecode($accessToken); $url = $this->profileEndpoint . '/auth/o2/tokeninfo?access_token=' . $this->urlEncode($accessToken); $httpCurlRequest = new HttpCurl($this->config); $response = $httpCurlRequest->httpGet($url); $data = json_decode($response); // Ensure that the Access Token matches either the supplied Client ID *or* the supplied App ID // Web apps and Mobile apps will have different Client ID's but App ID should be the same // As long as one of these matches, from a security perspective, we have done our due diligence if (($data->aud != $this->config['client_id']) && ($data->app_id != $this->config['app_id'])) { // The access token does not belong to us throw new \Exception('The Access Token belongs to neither your Client ID nor App ID'); } // Exchange the access token for user profile $url = $this->profileEndpoint . '/user/profile'; $httpCurlRequest = new HttpCurl($this->config); $httpCurlRequest->setAccessToken($accessToken); $httpCurlRequest->setHttpHeader(); $response = $httpCurlRequest->httpGet($url); $userInfo = json_decode($response, true); return $userInfo; } /* setParametersAndPost - sets the parameters array with non empty values from the requestParameters array sent to API calls. * If Provider Credit Details is present, values are set by setProviderCreditDetails * If Provider Credit Reversal Details is present, values are set by setProviderCreditDetails */ private function setParametersAndPost($parameters, $fieldMappings, $requestParameters) { /* For loop to take all the non empty parameters in the $requestParameters and add it into the $parameters array, * if the keys are matched from $requestParameters array with the $fieldMappings array */ foreach ($requestParameters as $param => $value) { // Do not use trim on boolean values, or it will convert them to '0' or '1' if (!is_array($value) && !is_bool($value)) { $value = trim($value); } // Ensure that no unexpected type coercions have happened if ($param === 'capture_now' || $param === 'confirm_now' || $param === 'inherit_shipping_address' || $param === 'request_payment_authorization') { if (!is_bool($value)) { throw new \Exception($param . ' value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value'); } } elseif ($param === 'provider_credit_details' || $param === 'provider_credit_reversal_details' || $param === 'order_item_categories' || $param === 'notification_configuration_list') { if (!is_array($value)) { throw new \Exception($param . ' value ' . $value . ' is of type ' . gettype($value) . ' and should be an array value'); } } // When checking for non-empty values, consider any boolean as non-empty if (array_key_exists($param, $fieldMappings) && (is_bool($value) || $value!='')) { if (is_array($value)) { // If the parameter is a provider_credit_details or provider_credit_reversal_details, call the respective functions to set the values if ($param === 'provider_credit_details') { $parameters = $this->setProviderCreditDetails($parameters, $value); } elseif ($param === 'provider_credit_reversal_details') { $parameters = $this->setProviderCreditReversalDetails($parameters, $value); } elseif ($param === 'order_item_categories') { $parameters = $this->setOrderItemCategories($parameters, $value); } elseif ($param == 'notification_configuration_list') { $parameters = $this->setNotificationConfigurationList($parameters, $value); } } else { $parameters[$fieldMappings[$param]] = $value; } } } $parameters = $this->setDefaultValues($parameters, $fieldMappings, $requestParameters); $responseObject = $this->calculateSignatureAndPost($parameters); return $responseObject; } /* calculateSignatureAndPost - convert the Parameters array to string and curl POST the parameters to MWS */ private function calculateSignatureAndPost($parameters) { // Call the signature and Post function to perform the actions. Returns XML in array format $parametersString = $this->calculateSignatureAndParametersToString($parameters); // POST using curl the String converted Parameters $response = $this->invokePost($parametersString); // Send this response as args to ResponseParser class which will return the object of the class. $responseObject = new ResponseParser($response); return $responseObject; } /* If merchant_id is not set via the requestParameters array then it's taken from the config array * * Set the platform_id if set in the config['platform_id'] array * * If currency_code is set in the $requestParameters and it exists in the $fieldMappings array, strtoupper it * else take the value from config array if set */ private function setDefaultValues($parameters, $fieldMappings, $requestParameters) { if (empty($requestParameters['merchant_id'])) $parameters['SellerId'] = $this->config['merchant_id']; if (array_key_exists('platform_id', $fieldMappings)) { if (empty($requestParameters['platform_id']) && !empty($this->config['platform_id'])) $parameters[$fieldMappings['platform_id']] = $this->config['platform_id']; } if (array_key_exists('currency_code', $fieldMappings)) { if (!empty($requestParameters['currency_code'])) { $parameters[$fieldMappings['currency_code']] = strtoupper($requestParameters['currency_code']); } else if (!(array_key_exists('Action', $parameters) && ($parameters['Action'] === 'SetOrderAttributes' || $parameters['Action'] === 'ConfirmOrderReference' || $parameters['Action'] === 'SetBillingAgreementDetails'))) { // Only supply a default CurrencyCode parameter if not using SetOrderAttributes, ConfirmOrderReference, or SetBillingAgreementDetails $parameters[$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); } } return $parameters; } /* setOrderItemCategories - helper function used by SetOrderAttributes API to set * one or more Order Item Categories */ private function setOrderItemCategories($parameters, $categories) { $categoryIndex = 0; $categoryString = 'OrderAttributes.SellerOrderAttributes.OrderItemCategories.OrderItemCategory.'; foreach ($categories as $value) { $categoryIndex = $categoryIndex + 1; $parameters[$categoryString . $categoryIndex] = $value; } return $parameters; } /* setMerchantNotificationUrls - helper function used by SetMerchantNotificationConfiguration API to set * one or more Notification Configurations */ private function setNotificationConfigurationList($parameters, $configuration) { $configurationIndex = 0; if (!is_array($configuration)) { throw new \Exception('Notification Configuration List value ' . $configuration . ' is of type ' . gettype($configuration) . ' and should be an array value'); } foreach ($configuration as $url => $events) { $configurationIndex = $configurationIndex + 1; $parameters['NotificationConfigurationList.NotificationConfiguration.' . $configurationIndex . '.NotificationUrl'] = $url; $eventIndex = 0; if (!is_array($events)) { throw new \Exception('Notification Configuration Events value ' . $events . ' is of type ' . gettype($events) . ' and should be an array value'); } foreach ($events as $event) { $eventIndex = $eventIndex + 1; $parameters['NotificationConfigurationList.NotificationConfiguration.' . $configurationIndex . '.EventTypes.EventTypeList.' . $eventIndex] = $event; } } return $parameters; } /* setProviderCreditDetails - sets the provider credit details sent via the Capture or Authorize API calls * @param provider_id - [String] * @param credit_amount - [String] * @optional currency_code - [String] */ private function setProviderCreditDetails($parameters, $providerCreditInfo) { $providerIndex = 0; $providerString = 'ProviderCreditList.member.'; $fieldMappings = array( 'provider_id' => 'ProviderId', 'credit_amount' => 'CreditAmount.Amount', 'currency_code' => 'CreditAmount.CurrencyCode' ); foreach ($providerCreditInfo as $key => $value) { $value = array_change_key_case($value, CASE_LOWER); $providerIndex = $providerIndex + 1; foreach ($value as $param => $val) { if (array_key_exists($param, $fieldMappings) && trim($val)!='') { $parameters[$providerString.$providerIndex. '.' .$fieldMappings[$param]] = $val; } } // If currency code is not entered take it from the config array if (empty($parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']])) { $parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); } } return $parameters; } /* setProviderCreditReversalDetails - sets the reverse provider credit details sent via the Refund API call. * @param provider_id - [String] * @param credit_amount - [String] * @optional currency_code - [String] */ private function setProviderCreditReversalDetails($parameters, $providerCreditInfo) { $providerIndex = 0; $providerString = 'ProviderCreditReversalList.member.'; $fieldMappings = array( 'provider_id' => 'ProviderId', 'credit_reversal_amount' => 'CreditReversalAmount.Amount', 'currency_code' => 'CreditReversalAmount.CurrencyCode' ); foreach ($providerCreditInfo as $key => $value) { $value = array_change_key_case($value, CASE_LOWER); $providerIndex = $providerIndex + 1; foreach ($value as $param => $val) { if (array_key_exists($param, $fieldMappings) && trim($val)!='') { $parameters[$providerString.$providerIndex. '.' .$fieldMappings[$param]] = $val; } } // If currency code is not entered take it from the config array if (empty($parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']])) { $parameters[$providerString.$providerIndex. '.' .$fieldMappings['currency_code']] = strtoupper($this->config['currency_code']); } } return $parameters; } /* GetMerchantAccountStatus API call - Returns the status of the Merchant Account. * @see TODO * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getMerchantAccountStatus($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetMerchantAccountStatus'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetOrderReferenceDetails API call - Returns details about the Order Reference object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['address_consent_token'] - [String] * @optional requestParameters['access_token'] - [String] * @optional requestParameters['mws_auth_token'] - [String] * * You cannot pass both address_consent_token and access_token in * the same call or you will encounter a 400/"AmbiguousToken" error */ public function getOrderReferenceDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetOrderReferenceDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'address_consent_token' => 'AddressConsentToken', 'access_token' => 'AccessToken', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ListOrderReference API call - Returns details about the Order Reference object and its current state from the sellers. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['query_id'] - [String] * @param requestParameters['query_id_type'] - [String] (SellerOrderId) * @optional requestParameters['page_size'] - [Int] * @optional requestParameters['created_start_time'] - [String] (Date/Time ISO8601) * @optional requestParameters['created_end_time'] - [String] (Date/Time ISO8601) Limited to 31 days * @optional requestParameters['sort_order'] - [String] (Ascending/Descending) * @optional requestParameters['mws_auth_token'] - [String] * @optional requestParameters['status_list'] - [Array] */ public function listOrderReference($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ListOrderReference'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $payment_domains = array( "us" => "NA_USD", "jp" => "FE_JPY", "de" => "EU_EUR", "uk" => "EU_GBP" ); $requestParameters['payment_domain'] = $payment_domains[strtolower($this->config['region'])]; $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken', 'query_id' => 'QueryId', 'query_id_type' => 'QueryIdType', 'page_size' => 'PageSize', 'created_start_time' => 'CreatedTimeRange.StartTime', 'created_end_time' => 'CreatedTimeRange.EndTime', 'sort_order' => 'SortOrder', 'payment_domain' => 'PaymentDomain' ); if( $requestParameters['order_status_list'] ){ $status_index = 0; foreach ($requestParameters['order_status_list'] as $status) { $status_index++; $requestParameters['order_status_list_'.$status_index] = $status; $fieldMappings['order_status_list_'.$status_index] = 'OrderReferenceStatusListFilter.OrderReferenceStatus.'.$status_index; } } $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ListOrderReferenceByNextToken API call - Returns details about the Order Reference object and its current * state from the sellers. * @see https://pay.amazon.com/developer/documentation/apireference/201751970 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['next_token'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function listOrderReferenceByNextToken($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ListOrderReferenceByNextToken'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken', 'next_page_token' => 'NextPageToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* SetOrderReferenceDetails API call - Sets order reference details such as the order total and a description for the order. * @see https://pay.amazon.com/developer/documentation/apireference/201751960 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @param requestParameters['amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['request_payment_authorization'] - [Boolean] * @optional requestParameters['mws_auth_token'] - [String] */ public function setOrderReferenceDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'SetOrderReferenceDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderReferenceAttributes.PlatformId', 'seller_note' => 'OrderReferenceAttributes.SellerNote', 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', 'supplementary_data' => 'OrderReferenceAttributes.SellerOrderAttributes.SupplementaryData', 'request_payment_authorization' => 'OrderReferenceAttributes.RequestPaymentAuthorization', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* SetOrderAttributes API call - Sets order reference details such as the order total and a description for the order. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['request_payment_authorization'] - [Boolean] * @optional requestParameters['payment_service_provider_id'] - [String] * @optional requestParameters['payment_service_provider_order_id'] - [String] * @optional requestParameters['order_item_categories'] - [array()] * @optional requestParameters['mws_auth_token'] - [String] */ public function setOrderAttributes($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'SetOrderAttributes'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'amount' => 'OrderAttributes.OrderTotal.Amount', 'currency_code' => 'OrderAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderAttributes.PlatformId', 'seller_note' => 'OrderAttributes.SellerNote', 'seller_order_id' => 'OrderAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderAttributes.SellerOrderAttributes.StoreName', 'custom_information' => 'OrderAttributes.SellerOrderAttributes.CustomInformation', 'supplementary_data' => 'OrderAttributes.SellerOrderAttributes.SupplementaryData', 'request_payment_authorization' => 'OrderAttributes.RequestPaymentAuthorization', 'payment_service_provider_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderId', 'payment_service_provider_order_id' => 'OrderAttributes.PaymentServiceProviderAttributes.PaymentServiceProviderOrderId', 'order_item_categories' => array(), 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ConfirmOrderReference API call - Confirms that the order reference is free of constraints and all required information has been set on the order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201751980 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['success_url'] - [String] * @optional requestParameters['failure_url'] - [String] * @optional requestParameters['authorization_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function confirmOrderReference($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ConfirmOrderReference'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode', 'mws_auth_token' => 'MWSAuthToken' ); if (isset($requestParameters['authorization_amount']) && !isset($requestParameters['currency_code'])) { $requestParameters['currency_code'] = strtoupper($this->config['currency_code']); } $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* CancelOrderReference API call - Cancels a previously confirmed order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201751990 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['cancelation_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function cancelOrderReference($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'CancelOrderReference'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'cancelation_reason' => 'CancelationReason', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* CloseOrderReference API call - Confirms that an order reference has been fulfilled (fully or partially) * and that you do not expect to create any new authorizations on this order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201752000 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeOrderReference($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'CloseOrderReference'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* CloseAuthorization API call - Closes an authorization. * @see https://pay.amazon.com/developer/documentation/apireference/201752070 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeAuthorization($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'CloseAuthorization'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* Authorize API call - Reserves a specified amount against the payment method(s) stored in the order reference. * @see https://pay.amazon.com/developer/documentation/apireference/201752010 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_order_reference_id'] - [String] * @param requestParameters['authorization_amount'] [String] * @param requestParameters['currency_code'] - [String] * @param requestParameters['authorization_reference_id'] [String] * @optional requestParameters['capture_now'] [Boolean] * @optional requestParameters['provider_credit_details'] - [array (array())] * @optional requestParameters['seller_authorization_note'] [String] * @optional requestParameters['transaction_timeout'] [String] - Defaults to 1440 minutes * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function authorize($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'Authorize'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_order_reference_id' => 'AmazonOrderReferenceId', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode', 'authorization_reference_id' => 'AuthorizationReferenceId', 'capture_now' => 'CaptureNow', 'provider_credit_details' => array(), 'seller_authorization_note' => 'SellerAuthorizationNote', 'transaction_timeout' => 'TransactionTimeout', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetAuthorizationDetails API call - Returns the status of a particular authorization and the total amount captured on the authorization. * @see https://pay.amazon.com/developer/documentation/apireference/201752030 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getAuthorizationDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetAuthorizationDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* Capture API call - Captures funds from an authorized payment instrument. * @see https://pay.amazon.com/developer/documentation/apireference/201752040 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_authorization_id'] - [String] * @param requestParameters['capture_amount'] - [String] * @param requestParameters['currency_code'] - [String] * @param requestParameters['capture_reference_id'] - [String] * @optional requestParameters['provider_credit_details'] - [array (array())] * @optional requestParameters['seller_capture_note'] - [String] * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function capture($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'Capture'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_authorization_id' => 'AmazonAuthorizationId', 'capture_amount' => 'CaptureAmount.Amount', 'currency_code' => 'CaptureAmount.CurrencyCode', 'capture_reference_id' => 'CaptureReferenceId', 'provider_credit_details' => array(), 'seller_capture_note' => 'SellerCaptureNote', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetCaptureDetails API call - Returns the status of a particular capture and the total amount refunded on the capture. * @see https://pay.amazon.com/developer/documentation/apireference/201752060 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_capture_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getCaptureDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetCaptureDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_capture_id' => 'AmazonCaptureId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* Refund API call - Refunds a previously captured amount. * @see https://pay.amazon.com/developer/documentation/apireference/201752080 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_capture_id'] - [String] * @param requestParameters['refund_reference_id'] - [String] * @param requestParameters['refund_amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['provider_credit_reversal_details'] - [array(array())] * @optional requestParameters['seller_refund_note'] [String] * @optional requestParameters['soft_descriptor'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function refund($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'Refund'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_capture_id' => 'AmazonCaptureId', 'refund_reference_id' => 'RefundReferenceId', 'refund_amount' => 'RefundAmount.Amount', 'currency_code' => 'RefundAmount.CurrencyCode', 'provider_credit_reversal_details' => array(), 'seller_refund_note' => 'SellerRefundNote', 'soft_descriptor' => 'SoftDescriptor', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetRefundDetails API call - Returns the status of a particular refund. * @see https://pay.amazon.com/developer/documentation/apireference/201752100 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_refund_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getRefundDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetRefundDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_refund_id' => 'AmazonRefundId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetServiceStatus API Call - Returns the operational status of the OffAmazonPayments API section * @see https://pay.amazon.com/developer/documentation/apireference/201752110 * * The GetServiceStatus operation returns the operational status of the OffAmazonPayments API * section of Amazon Marketplace Web Service (Amazon MWS). * Status values are GREEN, GREEN_I, YELLOW, and RED. * * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getServiceStatus($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetServiceStatus'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* CreateOrderReferenceForId API Call - Creates an order reference for the given object * @see https://pay.amazon.com/developer/documentation/apireference/201751670 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['id'] - [String] * @optional requestParameters['inherit_shipping_address'] [Boolean] * @optional requestParameters['confirm_now'] - [Boolean] * @optional Amount (required when confirm_now is set to true) [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function createOrderReferenceForId($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'CreateOrderReferenceForId'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'id' => 'Id', 'id_type' => 'IdType', 'inherit_shipping_address' => 'InheritShippingAddress', 'confirm_now' => 'ConfirmNow', 'amount' => 'OrderReferenceAttributes.OrderTotal.Amount', 'currency_code' => 'OrderReferenceAttributes.OrderTotal.CurrencyCode', 'platform_id' => 'OrderReferenceAttributes.PlatformId', 'seller_note' => 'OrderReferenceAttributes.SellerNote', 'seller_order_id' => 'OrderReferenceAttributes.SellerOrderAttributes.SellerOrderId', 'store_name' => 'OrderReferenceAttributes.SellerOrderAttributes.StoreName', 'supplementary_data' => 'OrderReferenceAttributes.SupplementaryData', 'custom_information' => 'OrderReferenceAttributes.SellerOrderAttributes.CustomInformation', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetBillingAgreementDetails API Call - Returns details about the Billing Agreement object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751690 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['address_consent_token'] - [String] * @optional requestParameters['access_token'] - [String] * @optional requestParameters['mws_auth_token'] - [String] * * You cannot pass both address_consent_token and access_token in * the same call or you will encounter a 400/"AmbiguousToken" error */ public function getBillingAgreementDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetBillingAgreementDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'address_consent_token' => 'AddressConsentToken', 'access_token' => 'AccessToken', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* SetBillingAgreementDetails API call - Sets Billing Agreement details such as a description of the agreement and other information about the seller. * @see https://pay.amazon.com/developer/documentation/apireference/201751700 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @param requestParameters['amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['seller_billing_agreement_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['billing_agreement_type'] - [String] either 'CustomerInitiatedTransaction' or 'MerchantInitiatedTransaction' * @optional requestParameters['subscription_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function setBillingAgreementDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'SetBillingAgreementDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'platform_id' => 'BillingAgreementAttributes.PlatformId', 'seller_note' => 'BillingAgreementAttributes.SellerNote', 'seller_billing_agreement_id' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.SellerBillingAgreementId', 'custom_information' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformation', 'store_name' => 'BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName', 'billing_agreement_type' => 'BillingAgreementAttributes.BillingAgreementType', 'subscription_amount' => 'BillingAgreementAttributes.SubscriptionAmount.Amount', 'currency_code' => 'BillingAgreementAttributes.SubscriptionAmount.CurrencyCode', 'mws_auth_token' => 'MWSAuthToken' ); if (isset($requestParameters['subscription_amount']) && !isset($requestParameters['currency_code'])) { $requestParameters['currency_code'] = strtoupper($this->config['currency_code']); } $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ConfirmBillingAgreement API Call - Confirms that the Billing Agreement is free of constraints and all required information has been set on the Billing Agreement. * @see https://pay.amazon.com/developer/documentation/apireference/201751710 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['success_url'] - [String] * @optional requestParameters['failure_url'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function confirmBillingAgreement($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ConfirmBillingAgreement'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'success_url' => 'SuccessUrl', 'failure_url' => 'FailureUrl', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ValidateBillignAgreement API Call - Validates the status of the Billing Agreement object and the payment method associated with it. * @see https://pay.amazon.com/developer/documentation/apireference/201751720 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function validateBillingAgreement($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ValidateBillingAgreement'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* AuthorizeOnBillingAgreement API call - Reserves a specified amount against the payment method(s) stored in the Billing Agreement. * @see https://pay.amazon.com/developer/documentation/apireference/201751940 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @param requestParameters['authorization_reference_id'] - [String] * @param requestParameters['authorization_amount'] - [String] * @param requestParameters['currency_code'] - [String] * @optional requestParameters['seller_authorization_note'] [String] * @optional requestParameters['transaction_timeout'] - Defaults to 1440 minutes * @optional requestParameters['capture_now'] [Boolean] * @optional requestParameters['soft_descriptor'] - - [String] * @optional requestParameters['seller_note'] - [String] * @optional requestParameters['platform_id'] - [String] * @optional requestParameters['custom_information'] - [String] * @optional requestParameters['seller_order_id'] - [String] * @optional requestParameters['store_name'] - [String] * @optional requestParameters['supplementary_data'] - [String] * @optional requestParameters['inherit_shipping_address'] [Boolean] - Defaults to true * @optional requestParameters['mws_auth_token'] - [String] */ public function authorizeOnBillingAgreement($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'AuthorizeOnBillingAgreement'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'authorization_reference_id' => 'AuthorizationReferenceId', 'authorization_amount' => 'AuthorizationAmount.Amount', 'currency_code' => 'AuthorizationAmount.CurrencyCode', 'seller_authorization_note' => 'SellerAuthorizationNote', 'transaction_timeout' => 'TransactionTimeout', 'capture_now' => 'CaptureNow', 'soft_descriptor' => 'SoftDescriptor', 'seller_note' => 'SellerNote', 'platform_id' => 'PlatformId', 'custom_information' => 'SellerOrderAttributes.CustomInformation', 'seller_order_id' => 'SellerOrderAttributes.SellerOrderId', 'store_name' => 'SellerOrderAttributes.StoreName', 'supplementary_data' => 'SellerOrderAttributes.SupplementaryData', 'inherit_shipping_address' => 'InheritShippingAddress', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* CloseBillingAgreement API Call - Returns details about the Billing Agreement object and its current state. * @see https://pay.amazon.com/developer/documentation/apireference/201751950 * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_billing_agreement_id'] - [String] * @optional requestParameters['closure_reason'] [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function closeBillingAgreement($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'CloseBillingAgreement'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_billing_agreement_id' => 'AmazonBillingAgreementId', 'closure_reason' => 'ClosureReason', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetMerchantNotificationConfiguration API Call - Returns details about the defined IPN endpoints * * @param requestParameters['merchant_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getMerchantNotificationConfiguration($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetMerchantNotificationConfiguration'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* SetMerchantNotificationConfiguration API Call - Set IPN endpoints * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['notification_configuration_list'] - [Array] * @optional requestParameters['mws_auth_token'] - [String] */ public function setMerchantNotificationConfiguration($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'SetMerchantNotificationConfiguration'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'notification_configuration_list' => array(), 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* charge convenience method * Performs the API calls * 1. SetOrderReferenceDetails / SetBillingAgreementDetails * 2. ConfirmOrderReference / ConfirmBillingAgreement * 3. Authorize (with Capture) / AuthorizeOnBillingAgreeemnt (with Capture) * * @param requestParameters['merchant_id'] - [String] * * @param requestParameters['amazon_reference_id'] - [String] : Order Reference ID /Billing Agreement ID * If requestParameters['amazon_reference_id'] is empty then the following is required, * @param requestParameters['amazon_order_reference_id'] - [String] : Order Reference ID * or, * @param requestParameters['amazon_billing_agreement_id'] - [String] : Billing Agreement ID * * @param $requestParameters['charge_amount'] - [String] : Amount value to be captured * @param requestParameters['currency_code'] - [String] : Currency Code for the Amount * @param requestParameters['authorization_reference_id'] - [String]- Any unique string that needs to be passed * @optional requestParameters['charge_note'] - [String] : Seller Note sent to the buyer * @optional requestParameters['transaction_timeout'] - [String] : Defaults to 1440 minutes * @optional requestParameters['charge_order_id'] - [String] : Custom Order ID provided * @optional requestParameters['mws_auth_token'] - [String] */ public function charge($requestParameters = array()) { $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $requestParameters = $this->trimArray($requestParameters); $setParameters = $authorizeParameters = $confirmParameters = $requestParameters; $chargeType = ''; if (!empty($requestParameters['amazon_order_reference_id'])) { $chargeType = 'OrderReference'; } elseif (!empty($requestParameters['amazon_billing_agreement_id'])) { $chargeType = 'BillingAgreement'; } elseif (!empty($requestParameters['amazon_reference_id'])) { switch (substr(strtoupper($requestParameters['amazon_reference_id']), 0, 1)) { case 'P': case 'S': $chargeType = 'OrderReference'; $setParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; $authorizeParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; $confirmParameters['amazon_order_reference_id'] = $requestParameters['amazon_reference_id']; break; case 'B': case 'C': $chargeType = 'BillingAgreement'; $setParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; $authorizeParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; $confirmParameters['amazon_billing_agreement_id'] = $requestParameters['amazon_reference_id']; break; default: throw new \Exception('Invalid Amazon Reference ID'); } } else { throw new \Exception('key amazon_order_reference_id or amazon_billing_agreement_id is null and is a required parameter'); } // Set the other parameters if the values are present $setParameters['amount'] = !empty($requestParameters['charge_amount']) ? $requestParameters['charge_amount'] : ''; $authorizeParameters['authorization_amount'] = !empty($requestParameters['charge_amount']) ? $requestParameters['charge_amount'] : ''; $setParameters['seller_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; $authorizeParameters['seller_authorization_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; $authorizeParameters['seller_note'] = !empty($requestParameters['charge_note']) ? $requestParameters['charge_note'] : ''; $setParameters['seller_order_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; $setParameters['seller_billing_agreement_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; $authorizeParameters['seller_order_id'] = !empty($requestParameters['charge_order_id']) ? $requestParameters['charge_order_id'] : ''; $authorizeParameters['capture_now'] = !empty($requestParameters['capture_now']) ? $requestParameters['capture_now'] : false; $response = $this->makeChargeCalls($chargeType, $setParameters, $confirmParameters, $authorizeParameters); return $response; } /* makeChargeCalls - makes API calls based off the charge type (OrderReference or BillingAgreement) */ private function makeChargeCalls($chargeType, $setParameters, $confirmParameters, $authorizeParameters) { switch ($chargeType) { case 'OrderReference': // Get the Order Reference details and feed the response object to the ResponseParser $responseObj = $this->getOrderReferenceDetails($setParameters); // Call the function getOrderReferenceDetailsStatus in ResponseParser.php providing it the XML response // $oroStatus is an array containing the State of the Order Reference ID $oroStatus = $responseObj->getOrderReferenceDetailsStatus($responseObj->toXml()); if ($oroStatus['State'] === 'Draft') { $response = $this->setOrderReferenceDetails($setParameters); if ($this->success) { $this->confirmOrderReference($confirmParameters); } } $responseObj = $this->getOrderReferenceDetails($setParameters); // Check the Order Reference Status again before making the Authorization. $oroStatus = $responseObj->getOrderReferenceDetailsStatus($responseObj->toXml()); if ($oroStatus['State'] === 'Open') { if ($this->success) { $response = $this->authorize($authorizeParameters); } } if ($oroStatus['State'] != 'Open' && $oroStatus['State'] != 'Draft') { throw new \Exception('The Order Reference is in the ' . $oroStatus['State'] . " State. It should be in the Draft or Open State"); } return $response; case 'BillingAgreement': // Get the Billing Agreement details and feed the response object to the ResponseParser $responseObj = $this->getBillingAgreementDetails($setParameters); // Call the function getBillingAgreementDetailsStatus in ResponseParser.php providing it the XML response // $baStatus is an array containing the State of the Billing Agreement $baStatus = $responseObj->getBillingAgreementDetailsStatus($responseObj->toXml()); if ($baStatus['State'] === 'Draft') { $response = $this->setBillingAgreementDetails($setParameters); if ($this->success) { $response = $this->confirmBillingAgreement($confirmParameters); } } // Check the Billing Agreement status again before making the Authorization. $responseObj = $this->getBillingAgreementDetails($setParameters); $baStatus = $responseObj->getBillingAgreementDetailsStatus($responseObj->toXml()); if ($this->success && $baStatus['State'] === 'Open') { $response = $this->authorizeOnBillingAgreement($authorizeParameters); } if ($baStatus['State'] != 'Open' && $baStatus['State'] != 'Draft') { throw new \Exception('The Billing Agreement is in the ' . $baStatus['State'] . " State. It should be in the Draft or Open State"); } return $response; default: throw new \Exception('Invalid Charge Type'); } } /* GetProviderCreditDetails API Call - Get the details of the Provider Credit. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getProviderCreditDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetProviderCreditDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_provider_credit_id' => 'AmazonProviderCreditId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* GetProviderCreditReversalDetails API Call - Get details of the Provider Credit Reversal. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_reversal_id'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function getProviderCreditReversalDetails($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'GetProviderCreditReversalDetails'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_provider_credit_reversal_id' => 'AmazonProviderCreditReversalId', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* ReverseProviderCredit API Call - Reverse the Provider Credit. * * @param requestParameters['merchant_id'] - [String] * @param requestParameters['amazon_provider_credit_id'] - [String] * @optional requestParameters['credit_reversal_reference_id'] - [String] * @param requestParameters['credit_reversal_amount'] - [String] * @optional requestParameters['currency_code'] - [String] * @optional requestParameters['credit_reversal_note'] - [String] * @optional requestParameters['mws_auth_token'] - [String] */ public function reverseProviderCredit($requestParameters = array()) { $parameters = array(); $parameters['Action'] = 'ReverseProviderCredit'; $requestParameters = array_change_key_case($requestParameters, CASE_LOWER); $fieldMappings = array( 'merchant_id' => 'SellerId', 'amazon_provider_credit_id' => 'AmazonProviderCreditId', 'credit_reversal_reference_id' => 'CreditReversalReferenceId', 'credit_reversal_amount' => 'CreditReversalAmount.Amount', 'currency_code' => 'CreditReversalAmount.CurrencyCode', 'credit_reversal_note' => 'CreditReversalNote', 'mws_auth_token' => 'MWSAuthToken' ); $responseObject = $this->setParametersAndPost($parameters, $fieldMappings, $requestParameters); return ($responseObject); } /* Create an Array of required parameters, sort them * Calculate signature and invoke the POST to the MWS Service URL * * @param AWSAccessKeyId [String] * @param Version [String] * @param SignatureMethod [String] * @param Timestamp [String] * @param Signature [String] */ private function calculateSignatureAndParametersToString($parameters = array()) { foreach ($parameters as $key => $value) { // Ensure that no unexpected type coercions have happened if ($key === 'CaptureNow' || $key === 'ConfirmNow' || $key === 'InheritShippingAddress' || $key === 'RequestPaymentAuthorization') { if (!is_bool($value)) { throw new \Exception($key . ' value ' . $value . ' is of type ' . gettype($value) . ' and should be a boolean value'); } } // Ensure boolean values are outputed as 'true' or 'false' if (is_bool($value)) { $parameters[$key] = json_encode($value); } } $parameters['AWSAccessKeyId'] = $this->config['access_key']; $parameters['Version'] = self::MWS_VERSION; $parameters['SignatureMethod'] = 'HmacSHA256'; $parameters['SignatureVersion'] = 2; $parameters['Timestamp'] = $this->getFormattedTimestamp(); uksort($parameters, 'strcmp'); $this->createServiceUrl(); $parameters['Signature'] = $this->signParameters($parameters); $parameters = $this->getParametersAsString($parameters); // Save these parameters in the parameters variable so that it can be returned for unit testing. $this->parameters = $parameters; return $parameters; } /* Computes RFC 2104-compliant HMAC signature for request parameters * Implements AWS Signature, as per following spec: * * If Signature Version is 0, it signs concatenated Action and Timestamp * * If Signature Version is 1, it performs the following: * * Sorts all parameters (including SignatureVersion and excluding Signature, * the value of which is being created), ignoring case. * * Iterate over the sorted list and append the parameter name (in original case) * and then its value. It will not URL-encode the parameter values before * constructing this string. There are no separators. * * If Signature Version is 2, string to sign is based on following: * * 1. The HTTP Request Method followed by an ASCII newline (%0A) * 2. The HTTP Host header in the form of lowercase host, followed by an ASCII newline. * 3. The URL encoded HTTP absolute path component of the URI * (up to but not including the query string parameters); * if this is empty use a forward '/'. This parameter is followed by an ASCII newline. * 4. The concatenation of all query string components (names and values) * as UTF-8 characters which are URL encoded as per RFC 3986 * (hex characters MUST be uppercase), sorted using lexicographic byte ordering. * Parameter names are separated from their values by the '=' character * (ASCII character 61), even if the value is empty. * Pairs of parameter and values are separated by the '&' character (ASCII code 38). * */ private function signParameters(array $parameters) { $signatureVersion = $parameters['SignatureVersion']; $algorithm = "HmacSHA1"; $stringToSign = null; if (2 === $signatureVersion) { $algorithm = "HmacSHA256"; $parameters['SignatureMethod'] = $algorithm; $stringToSign = $this->calculateStringToSignV2($parameters); } else { throw new \Exception("Invalid Signature Version specified"); } return $this->sign($stringToSign, $algorithm); } /* Calculate String to Sign for SignatureVersion 2 * @param array $parameters request parameters * @return String to Sign */ private function calculateStringToSignV2(array $parameters) { $data = 'POST'; $data .= "\n"; $data .= $this->mwsEndpointUrl; $data .= "\n"; $data .= $this->mwsEndpointPath; $data .= "\n"; $data .= $this->getParametersAsString($parameters); $this->logMessage($this->sanitizeRequestData($data)); return $data; } /* Convert paremeters to Url encoded query string */ private function getParametersAsString(array $parameters) { $queryParameters = array(); foreach ($parameters as $key => $value) { $queryParameters[] = $key . '=' . $this->urlEncode($value); } return implode('&', $queryParameters); } private function urlEncode($value) { return str_replace('%7E', '~', rawurlencode($value)); } /* Computes RFC 2104-compliant HMAC signature */ private function sign($data, $algorithm) { if ($algorithm === 'HmacSHA1') { $hash = 'sha1'; } else if ($algorithm === 'HmacSHA256') { $hash = 'sha256'; } else { throw new \Exception("Non-supported signing method specified"); } return base64_encode(hash_hmac($hash, $data, $this->config['secret_key'], true)); } /* Formats date as ISO 8601 timestamp */ private function getFormattedTimestamp() { return gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); } /* invokePost takes the parameters and invokes the httpPost function to POST the parameters * Exponential retries on error 500 and 503 * The response from the POST is an XML which is converted to Array */ private function invokePost($parameters) { $response = array(); $statusCode = 200; $this->success = false; // Submit the request and read response body try { $shouldRetry = true; $retries = 0; do { try { $this->constructUserAgentHeader(); $httpCurlRequest = new HttpCurl($this->config); $response = $httpCurlRequest->httpPost($this->mwsServiceUrl, $this->userAgent, $parameters); $curlResponseInfo = $httpCurlRequest->getCurlResponseInfo(); $statusCode = $curlResponseInfo["http_code"]; $this->logMessage($this->userAgent); $response = array( 'Status' => $statusCode, 'ResponseBody' => $response ); $statusCode = $response['Status']; if ($statusCode == 200) { $shouldRetry = false; $this->success = true; } elseif ($statusCode == 500 || $statusCode == 503) { $shouldRetry = true; if ($shouldRetry && strtolower($this->config['handle_throttle'])) { $this->pauseOnRetry(++$retries, $statusCode); } } else { $shouldRetry = false; } } catch (\Exception $e) { throw $e; } } while ($shouldRetry); } catch (\Exception $se) { throw $se; } $this->logMessage($this->sanitizeResponseData($response['ResponseBody'])); return $response; } /* Exponential sleep on failed request * Up to three retries will occur if first reqest fails * after 1.0 second, 2.2 seconds, and finally 7.0 seconds * @param retries current retry * @throws Exception if maximum number of retries has been reached */ private function pauseOnRetry($retries, $status) { if ($retries <= self::MAX_ERROR_RETRY) { // PHP delays are in microseconds (1 million microsecond = 1 sec) // 1st delay is (4^1) * 100000 + 600000 = 0.4 + 0.6 second = 1.0 sec // 2nd delay is (4^2) * 100000 + 600000 = 1.6 + 0.6 second = 2.2 sec // 3rd delay is (4^3) * 100000 + 600000 = 6.4 + 0.6 second = 7.0 sec $delay = (int) (pow(4, $retries) * 100000) + 600000; usleep($delay); } else { throw new \Exception('Error Code: '. $status.PHP_EOL.'Maximum number of retry attempts - '. $retries .' reached'); } } /* Create MWS service URL and the Endpoint path */ private function createServiceUrl() { $this->modePath = strtolower($this->config['sandbox']) ? 'OffAmazonPayments_Sandbox' : 'OffAmazonPayments'; if (!empty($this->config['region'])) { $region = strtolower($this->config['region']); if (array_key_exists($region, $this->regionMappings)) { if (!is_null($this->config['override_service_url'])) { $this->mwsEndpointUrl = preg_replace("(https?://)", "", $this->config['override_service_url']); } else { $this->mwsEndpointUrl = $this->mwsServiceUrls[$this->regionMappings[$region]]; } $this->mwsServiceUrl = 'https://' . $this->mwsEndpointUrl . '/' . $this->modePath . '/' . self::MWS_VERSION; $this->mwsEndpointPath = '/' . $this->modePath . '/' . self::MWS_VERSION; } else { throw new \Exception($region . ' is not a valid region'); } } else { throw new \Exception("config['region'] is a required parameter and is not set"); } } /* Based on the config['region'] and config['sandbox'] values get the user profile URL */ private function profileEndpointUrl() { $profileEnvt = strtolower($this->config['sandbox']) ? "api.sandbox" : "api"; if (!empty($this->config['region'])) { $region = strtolower($this->config['region']); if (array_key_exists($region, $this->regionMappings) ) { $this->profileEndpoint = 'https://' . $profileEnvt . '.' . $this->profileEndpointUrls[$region]; } else { throw new \Exception($region . ' is not a valid region'); } } else { throw new \Exception("config['region'] is a required parameter and is not set"); } } /* Create the User Agent Header sent with the POST request */ /* Protected because of PSP module usaged */ protected function constructUserAgentHeader() { $this->userAgent = 'amazon-pay-sdk-php/' . self::SDK_VERSION . ' ('; if (($this->config['application_name']) || ($this->config['application_version'])) { if ($this->config['application_name']) { $this->userAgent .= $this->quoteApplicationName($this->config['application_name']); if ($this->config['application_version']) { $this->userAgent .= '/'; } } if ($this->config['application_version']) { $this->userAgent .= $this->quoteApplicationVersion($this->config['application_version']); } $this->userAgent .= '; '; } $this->userAgent .= 'PHP/' . phpversion() . '; '; $this->userAgent .= php_uname('s') . '/' . php_uname('m') . '/' . php_uname('r'); $this->userAgent .= ')'; } /* Collapse multiple whitespace characters into a single ' ' and backslash escape '\', * and '/' characters from a string. * @param $s * @return string */ private function quoteApplicationName($s) { $quotedString = preg_replace('/ {2,}|\s/', ' ', $s); $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString); $quotedString = preg_replace('/\//', '\\/', $quotedString); return $quotedString; } /* Collapse multiple whitespace characters into a single ' ' and backslash escape '\', * and '(' characters from a string. * * @param $s * @return string */ private function quoteApplicationVersion($s) { $quotedString = preg_replace('/ {2,}|\s/', ' ', $s); $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString); $quotedString = preg_replace('/\\(/', '\\(', $quotedString); return $quotedString; } private function sanitizeRequestData($input) { $patterns = array(); $patterns[0] = '/(SellerNote=)(.+)(&)/ms'; $patterns[1] = '/(SellerAuthorizationNote=)(.+)(&)/ms'; $patterns[2] = '/(SellerCaptureNote=)(.+)(&)/ms'; $patterns[3] = '/(SellerRefundNote=)(.+)(&)/ms'; $replacements = array(); $replacements[0] = '$1REMOVED$3'; $replacements[1] = '$1REMOVED$3'; $replacements[2] = '$1REMOVED$3'; $replacements[3] = '$1REMOVED$3'; return preg_replace($patterns, $replacements, $input); } private function sanitizeResponseData($input) { $patterns = array(); $patterns[0] = '/(<Buyer>)(.+)(<\/Buyer>)/ms'; $patterns[1] = '/(<PhysicalDestination>)(.+)(<\/PhysicalDestination>)/ms'; $patterns[2] = '/(<BillingAddress>)(.+)(<\/BillingAddress>)/ms'; $patterns[3] = '/(<SellerNote>)(.+)(<\/SellerNote>)/ms'; $patterns[4] = '/(<AuthorizationBillingAddress>)(.+)(<\/AuthorizationBillingAddress>)/ms'; $patterns[5] = '/(<SellerAuthorizationNote>)(.+)(<\/SellerAuthorizationNote>)/ms'; $patterns[6] = '/(<SellerCaptureNote>)(.+)(<\/SellerCaptureNote>)/ms'; $patterns[7] = '/(<SellerRefundNote>)(.+)(<\/SellerRefundNote>)/ms'; $replacements = array(); $replacements[0] = '$1 REMOVED $3'; $replacements[1] = '$1 REMOVED $3'; $replacements[2] = '$1 REMOVED $3'; $replacements[3] = '$1 REMOVED $3'; $replacements[4] = '$1 REMOVED $3'; $replacements[5] = '$1 REMOVED $3'; $replacements[6] = '$1 REMOVED $3'; $replacements[7] = '$1 REMOVED $3'; return preg_replace($patterns, $replacements, $input); } /* Computes RFC 2104-compliant HMAC signature */ public static function getSignature($stringToSign, $secretKey) { return base64_encode(hash_hmac('sha256', $stringToSign, $secretKey, true)); } } amazon-pay-sdk-php/AmazonPay/ResponseParser.php000077700000005132151323541140015556 0ustar00<?php namespace AmazonPay; /* ResponseParser * Methods provided to convert the Response from the POST to XML, Array or JSON */ require_once 'ResponseInterface.php'; class ResponseParser implements ResponseInterface { public $response = null; public function __construct($response=null) { $this->response = $response; } /* Returns the XML portion of the response */ public function toXml() { return $this->response['ResponseBody']; } /* toJson - converts XML into Json * @param $response [XML] */ public function toJson() { $response = $this->simpleXmlObject(); return (json_encode($response)); } /* toArray - converts XML into associative array * @param $this->response [XML] */ public function toArray() { $response = $this->simpleXmlObject(); // Converting the SimpleXMLElement Object to array() $response = json_encode($response); return (json_decode($response, true)); } private function simpleXmlObject() { $response = $this->response; // Getting the HttpResponse Status code to the output as a string $status = strval($response['Status']); // Getting the Simple XML element object of the XML Response Body $response = simplexml_load_string((string) $response['ResponseBody']); // Adding the HttpResponse Status code to the output as a string $response->addChild('ResponseStatus', $status); return $response; } /* Get the status of the Order Reference ID */ public function getOrderReferenceDetailsStatus($response) { $oroStatus = $this->getStatus('GetORO', '//GetORO:OrderReferenceStatus', $response); return $oroStatus; } /* Get the status of the BillingAgreement */ public function getBillingAgreementDetailsStatus($response) { $baStatus = $this->getStatus('GetBA', '//GetBA:BillingAgreementStatus', $response); return $baStatus; } private function getStatus($type, $path, $response) { $data= new \SimpleXMLElement($response); $namespaces = $data->getNamespaces(true); foreach($namespaces as $key=>$value){ $namespace = $value; } $data->registerXPathNamespace($type, $namespace); foreach ($data->xpath($path) as $value) { $status = json_decode(json_encode((array)$value), TRUE); } return $status; } } amazon-pay-sdk-php/AmazonPay/Regions.php000077700000001026151323541140014207 0ustar00<?php namespace AmazonPay; /* Class Regions * Defines all Region specific properties */ class Regions { public $mwsServiceUrls = array('eu' => 'mws-eu.amazonservices.com', 'na' => 'mws.amazonservices.com', 'jp' => 'mws.amazonservices.jp'); public $profileEndpointUrls = array('uk' => 'amazon.co.uk', 'us' => 'amazon.com', 'de' => 'amazon.de', 'jp' => 'amazon.co.jp'); public $regionMappings = array('de' => 'eu', 'uk' => 'eu', 'us' => 'na', 'jp' => 'jp'); } amazon-pay-sdk-php/AmazonPay/ResponseInterface.php000077700000001255151323541140016224 0ustar00<?php namespace AmazonPay; /* Interface for ResponseParser.php */ interface ResponseInterface { /* Returns the XML portion of the response */ public function toXml(); /* toJson - converts XML into Json * @param $response [XML] */ public function toJson(); /* toArray - converts XML into associative array * @param $this->_response [XML] */ public function toArray(); /* Get the status of the BillingAgreement */ public function getBillingAgreementDetailsStatus($response); /* Get the status of the OrderReference */ public function getOrderReferenceDetailsStatus($response); } amazon-pay-sdk-php/AmazonPay/IpnHandlerInterface.php000077700000001445151323541140016453 0ustar00<?php namespace AmazonPay; /* Interface for IpnHandler.php */ interface IpnHandlerInterface { /* returnMessage() - JSON decode the raw [Message] portion of the IPN */ public function returnMessage(); /* toJson() - Converts IPN [Message] field to JSON * * Has child elements * ['NotificationData'] [XML] - API call XML notification data * @param remainingFields - consists of remaining IPN array fields that are merged * Type - Notification * MessageId - ID of the Notification * Topic ARN - Topic of the IPN * @return response in JSON format */ public function toJson(); /* toArray() - Converts IPN [Message] field to associative array * @return response in array format */ public function toArray(); } amazon-pay-sdk-php/AmazonPay/.htaccess000077700000000177151323541140013674 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/AmazonPay/HttpCurlInterface.php000077700000001334151323541140016171 0ustar00<?php namespace AmazonPay; /* Interface for HttpCurl.php */ interface HttpCurlInterface { /* Set Http header for Access token for the GetUserInfo call */ public function setHttpHeader(); /* Setter for Access token to get the user info */ public function setAccessToken($accesstoken); /* POST using curl for the following situations * 1. API calls * 2. IPN certificate retrieval * 3. Get User Info */ public function httpPost($url, $userAgent = null, $parameters = null); /* GET using curl for the following situations * 1. IPN certificate retrieval * 3. Get User Info */ public function httpGet($url, $userAgent = null); } amazon-pay-sdk-php/.htaccess000077700000000177151323541140011775 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-sdk-php/NOTICE.txt000077700000001134151323541140011713 0ustar00*-*-**-***-*****-********-************* Amazon Pay SDK (PHP) Copyright 2013-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); *-*-**-***-*****-********-************* You may not use this file except in compliance with the License. You may obtain a copy of the License at: http://aws.amazon.com/apache2.0 This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. amazon-pay-module/Domain/AbstractAmazonCaptureResponse.php000077700000004403151323541140020006 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Payment\Domain\Details\AmazonCaptureDetails; use Amazon\Payment\Domain\Details\AmazonCaptureDetailsFactory; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractAmazonCaptureResponse { /** * @var AmazonCaptureDetails */ private $details; /** * AbstractAmazonCaptureResponse constructor. * * @param ResponseInterface $response * @param AmazonCaptureDetailsFactory $amazonCaptureDetailsFactory */ public function __construct( ResponseInterface $response, AmazonCaptureDetailsFactory $amazonCaptureDetailsFactory ) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException(); } $details = $data[$this->getResultKey()]['CaptureDetails']; $this->details = $amazonCaptureDetailsFactory->create([ 'details' => $details ]); } /** * @return AmazonCaptureDetails */ public function getDetails() { return $this->details; } /** * Get result key * * @return string */ abstract protected function getResultKey(); } amazon-pay-module/Domain/AmazonRefundStatus.php000077700000002310151323541140015622 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonRefundStatus extends AbstractAmazonStatus { const STATE_PENDING = 'Pending'; const STATE_COMPLETED = 'Completed'; const STATE_DECLINED = 'Declined'; } amazon-pay-module/Domain/AmazonAuthorizationResponse.php000077700000002420151323541140017554 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthorizationResponse extends AbstractAmazonAuthorizationResponse { private $resultKey = 'AuthorizeResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AmazonCaptureResponse.php000077700000002402151323541140016317 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCaptureResponse extends AbstractAmazonCaptureResponse { private $resultKey = 'CaptureResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AmazonConstraint.php000077700000004774151323541140015337 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonConstraint { const PAYMENT_METHOD_NOT_ALLOWED_ID = 'PaymentMethodNotAllowed'; const PAYMENT_PLAN_NOT_SET_ID = 'PaymentPlanNotSet'; /** * @var string */ private $id; /** * @var string */ private $description; /** * AmazonConstraint constructor. * * @param string $id * @param string $description */ public function __construct($id, $description) { $this->id = $id; $this->description = $description; } /** * Get id * * @return string */ public function getId() { return $this->id; } /** * Get description * * @return string */ public function getDescription() { return $this->description; } public function getErrorMessage() { switch ($this->getId()) { case static::PAYMENT_METHOD_NOT_ALLOWED_ID: return __('The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.'); case static::PAYMENT_PLAN_NOT_SET_ID: return __('No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.'); default: return __('The order failed due to a technical error, please select another payment method or contact our support.'); } } } amazon-pay-module/Domain/AmazonRefundDetailsResponse.php000077700000002420151323541140017445 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonRefundDetailsResponse extends AbstractAmazonRefundResponse { private $resultKey = 'GetRefundDetailsResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AmazonRefundResponse.php000077700000002441151323541140016142 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonRefundResponse extends AbstractAmazonRefundResponse { private $resultKey = 'RefundResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AbstractAmazonRefundResponse.php000077700000004332151323541140017627 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Payment\Domain\Details\AmazonRefundDetails; use Amazon\Payment\Domain\Details\AmazonRefundDetailsFactory; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractAmazonRefundResponse { /** * @var AmazonRefundDetails */ protected $details; /** * AbstractAmazonRefundResponse constructor. * * @param ResponseInterface $response * @param AmazonRefundDetailsFactory $amazonRefundDetailsFactory */ public function __construct( ResponseInterface $response, AmazonRefundDetailsFactory $amazonRefundDetailsFactory ) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException(); } $this->details = $amazonRefundDetailsFactory->create([ 'details' => $data[$this->getResultKey()]['RefundDetails'] ]); } /** * @return AmazonRefundDetails */ public function getDetails() { return $this->details; } /** * Get result key * * @return string */ abstract protected function getResultKey(); } amazon-pay-module/Domain/Validator/AmazonAuthorization.php000077700000006117151323541140017771 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain\Validator; use Amazon\Payment\Domain\AmazonAuthorizationStatus; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetails; /** * Class AmazonAuthorization * validates Amazon Pay status during cron updates. * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthorization { /** * @param AmazonAuthorizationDetails $details * @return array */ public function validate(AmazonAuthorizationDetails $details) { $status = $details->getStatus(); switch ($status->getState()) { case AmazonAuthorizationStatus::STATE_CLOSED: switch ($status->getReasonCode()) { case AmazonAuthorizationStatus::REASON_MAX_CAPTURES_PROCESSED: return [ 'result' => true, 'reason' => AmazonAuthorizationStatus::REASON_MAX_CAPTURES_PROCESSED ]; } break; case AmazonAuthorizationStatus::STATE_OPEN: case AmazonAuthorizationStatus::STATE_PENDING: return ['result' => true, 'reason' => $status->getState()]; case AmazonAuthorizationStatus::STATE_DECLINED: return ['result' => false, 'reason' => $this->getReasonCode($status)]; } return ['result' => false, 'reason' => $status->getState()]; } /** * Need to ensure three specific reason codes come through during processing. * * @param AmazonAuthorizationStatus $status * @return null|string */ protected function getReasonCode(AmazonAuthorizationStatus $status) { switch ($status->getReasonCode()) { case AmazonAuthorizationStatus::REASON_TRANSACTION_TIMEOUT: case AmazonAuthorizationStatus::REASON_PROCESSING_FAILURE: return 'temporary'; case AmazonAuthorizationStatus::REASON_AMAZON_REJECTED: return 'hard_decline'; case AmazonAuthorizationStatus::REASON_INVALID_PAYMENT_METHOD: return 'soft_decline'; } return $status->getReasonCode(); } } amazon-pay-module/Domain/Validator/.htaccess000077700000000177151323541140015050 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Domain/Details/AmazonAuthorizationDetails.php000077700000006505151323541140020740 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain\Details; use Amazon\Payment\Domain\AmazonAuthorizationStatus; use Amazon\Payment\Domain\AmazonAuthorizationStatusFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthorizationDetails { /** * @var AmazonAuthorizationStatus */ private $status; /** * @var string|null */ private $captureTransactionId; /** * @var string|null */ private $authorizeTransactionId; /** * @var bool */ private $captureNow = false; /** * AmazonAuthorizationDetails constructor. * * @param AmazonAuthorizationStatusFactory $amazonAuthorizationStatusFactory * @param array $details */ public function __construct(AmazonAuthorizationStatusFactory $amazonAuthorizationStatusFactory, array $details) { $status = $details['AuthorizationStatus']; $this->status = $amazonAuthorizationStatusFactory->create([ 'state' => $status['State'], 'reasonCode' => (isset($status['ReasonCode']) ? $status['ReasonCode'] : null) ]); if (isset($details['IdList']['member'])) { $this->captureTransactionId = $details['IdList']['member']; } if (isset($details['AmazonAuthorizationId'])) { $this->authorizeTransactionId = $details['AmazonAuthorizationId']; } if (isset($details['CaptureNow'])) { $this->captureNow = ('true' === $details['CaptureNow']); } } /** * Get status * * @return AmazonAuthorizationStatus */ public function getStatus() { return $this->status; } /** * Get authorize transaction id * * @return string|null */ public function getAuthorizeTransactionId() { return $this->authorizeTransactionId; } /** * Get capture transaction id * * @return string|null */ public function getCaptureTransactionId() { return $this->captureTransactionId; } /** * Has capture * * @return bool */ public function hasCapture() { return $this->captureNow; } /** * Is pending * * @return bool */ public function isPending() { return (AmazonAuthorizationStatus::STATE_PENDING === $this->getStatus()->getState()); } } amazon-pay-module/Domain/Details/AmazonCaptureDetails.php000077700000004432151323541140017500 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain\Details; use Amazon\Payment\Domain\AmazonCaptureStatus; use Amazon\Payment\Domain\AmazonCaptureStatusFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCaptureDetails { /** * @var AmazonCaptureStatus */ private $status; /** * @var string|null */ private $transactionId; /** * AmazonCaptureDetails constructor. * * @param AmazonCaptureStatusFactory $amazonCaptureStatusFactory * @param array $details */ public function __construct(AmazonCaptureStatusFactory $amazonCaptureStatusFactory, array $details) { $status = $details['CaptureStatus']; $this->status = $amazonCaptureStatusFactory->create([ 'state' => $status['State'], 'reasonCode' => (isset($status['ReasonCode']) ? $status['ReasonCode'] : null) ]); if (isset($details['AmazonCaptureId'])) { $this->transactionId = $details['AmazonCaptureId']; } } /** * Get status * * @return AmazonCaptureStatus */ public function getStatus() { return $this->status; } /** * Get transaction id * * @return string|null */ public function getTransactionId() { return $this->transactionId; } } amazon-pay-module/Domain/Details/.htaccess000077700000000177151323541140014510 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Domain/Details/AmazonOrderDetails.php000077700000004360151323541140017150 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain\Details; use Amazon\Payment\Domain\AmazonOrderStatus; use Amazon\Payment\Domain\AmazonOrderStatusFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonOrderDetails { /** * @var string */ private $orderReferenceId; /** * @var AmazonOrderStatus */ private $status; /** * AmazonOrderDetails constructor. * * @param AmazonOrderStatusFactory $amazonOrderStatusFactory * @param array $details */ public function __construct(AmazonOrderStatusFactory $amazonOrderStatusFactory, array $details) { $status = $details['OrderReferenceStatus']; $this->status = $amazonOrderStatusFactory->create( [ 'state' => $status['State'], 'reasonCode' => (isset($status['ReasonCode']) ? $status['ReasonCode'] : null) ] ); $this->orderReferenceId = $details['AmazonOrderReferenceId']; } /** * Get status * * @return AmazonOrderStatus */ public function getStatus() { return $this->status; } /** * Get order reference id * * @return string */ public function getOrderReferenceId() { return $this->orderReferenceId; } } amazon-pay-module/Domain/Details/AmazonRefundDetails.php000077700000005272151323541140017323 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain\Details; use Amazon\Payment\Domain\AmazonRefundStatus; use Amazon\Payment\Domain\AmazonRefundStatusFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonRefundDetails { /** * @var AmazonRefundStatus */ private $refundStatus; /** * @var string|null */ private $refundId; /** * @param AmazonRefundStatusFactory $amazonRefundStatusFactory * @param array $details */ public function __construct( AmazonRefundStatusFactory $amazonRefundStatusFactory, array $details ) { $statusData = $details['RefundStatus']; $this->refundStatus = $amazonRefundStatusFactory->create([ 'state' => $statusData['State'], 'reasonCode' => isset($statusData['ReasonCode']) ? $statusData['ReasonCode'] : null ]); if (isset($details['AmazonRefundId'])) { $this->refundId = $details['AmazonRefundId']; } } /** * @return AmazonRefundStatus */ public function getRefundStatus() { return $this->refundStatus; } /** * @return string|null */ public function getRefundId() { return $this->refundId; } /** * @return bool */ public function isRefundPending() { return $this->refundStatus->getState() === AmazonRefundStatus::STATE_PENDING; } /** * @return bool */ public function isRefundCompleted() { return $this->refundStatus->getState() === AmazonRefundStatus::STATE_COMPLETED; } /** * @return bool */ public function isRefundDeclined() { return $this->refundStatus->getState() === AmazonRefundStatus::STATE_DECLINED; } } amazon-pay-module/Domain/AmazonCaptureDetailsResponse.php000077700000002423151323541140017630 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCaptureDetailsResponse extends AbstractAmazonCaptureResponse { private $resultKey = 'GetCaptureDetailsResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AbstractAmazonStatus.php000077700000003365151323541140016155 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractAmazonStatus { /** * @var string */ private $state; /** * @var string */ private $reasonCode; /** * AmazonAuthorizationStatus constructor. * * @param string $state * @param string|null $reasonCode */ public function __construct($state, $reasonCode = null) { $this->state = $state; $this->reasonCode = $reasonCode; } /** * Get state * * @return string */ public function getState() { return $this->state; } /** * Get reason code * * @return string|null */ public function getReasonCode() { return $this->reasonCode; } } amazon-pay-module/Domain/AmazonOrderStatus.php000077700000002404151323541140015456 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonOrderStatus extends AbstractAmazonStatus { const STATE_DRAFT = 'Draft'; const STATE_OPEN = 'Open'; const STATE_SUSPENDED = 'Suspended'; const STATE_CANCELED= 'Canceled'; const STATE_CLOSED = 'Closed'; } amazon-pay-module/Domain/AmazonAuthorizationDetailsResponse.php000077700000002445151323541140021071 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthorizationDetailsResponse extends AbstractAmazonAuthorizationResponse { private $resultKey = 'GetAuthorizationDetailsResult'; /** * {@inheritDoc} */ protected function getResultKey() { return $this->resultKey; } } amazon-pay-module/Domain/AmazonCaptureStatus.php000077700000002354151323541140016012 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCaptureStatus extends AbstractAmazonStatus { const STATE_COMPLETED = 'Completed'; const STATE_PENDING = 'Pending'; const STATE_DECLINED = 'Declined'; const STATE_CLOSED = 'Closed'; } amazon-pay-module/Domain/AmazonSetOrderDetailsResponse.php000077700000004271151323541140017757 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use Amazon\Core\Exception\AmazonServiceUnavailableException; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonSetOrderDetailsResponse { /** * @var AmazonConstraint[] */ private $constraints; public function __construct(ResponseInterface $response, AmazonConstraintFactory $amazonConstraintFactory) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException( $data['Error']['Type'], $data['Error']['Code'], $data['Error']['Message'] ); } $details = $data['SetOrderReferenceDetailsResult']['OrderReferenceDetails']; $this->constraints = []; if (isset($details['Constraints'])) { foreach ($details['Constraints'] as $constraint) { $this->constraints[] = $amazonConstraintFactory->create([ 'id' => $constraint['ConstraintID'], 'description' => $constraint['Description'] ]); } } } public function getConstraints() { return $this->constraints; } } amazon-pay-module/Domain/AbstractAmazonAuthorizationResponse.php000077700000004523151323541140021246 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetails; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetailsFactory; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractAmazonAuthorizationResponse { /** * @var AmazonAuthorizationDetails */ protected $details; /** * AbstractAmazonAuthorizationResponse constructor. * * @param ResponseInterface $response * @param AmazonAuthorizationDetailsFactory $amazonAuthorizationDetailsFactory */ public function __construct( ResponseInterface $response, AmazonAuthorizationDetailsFactory $amazonAuthorizationDetailsFactory ) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException(); } $details = $data[$this->getResultKey()]['AuthorizationDetails']; $this->details = $amazonAuthorizationDetailsFactory->create([ 'details' => $details ]); } /** * @return AmazonAuthorizationDetails */ public function getDetails() { return $this->details; } /** * Get result key * * @return string */ abstract protected function getResultKey(); } amazon-pay-module/Domain/AmazonGetOrderDetailsResponse.php000077700000003716151323541140017746 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Payment\Domain\Details\AmazonOrderDetails; use Amazon\Payment\Domain\Details\AmazonOrderDetailsFactory; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonGetOrderDetailsResponse { /** * @var AmazonOrderDetails */ private $details; public function __construct(ResponseInterface $response, AmazonOrderDetailsFactory $amazonOrderDetailsFactory) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException(); } $details = $data['GetOrderReferenceDetailsResult']['OrderReferenceDetails']; $this->details = $amazonOrderDetailsFactory->create( [ 'details' => $details ] ); } /** * @return AmazonOrderDetails */ public function getDetails() { return $this->details; } } amazon-pay-module/Domain/.htaccess000077700000000177151323541140013123 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Domain/AmazonAuthorizationStatus.php000077700000003177151323541140017253 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Domain; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthorizationStatus extends AbstractAmazonStatus { const STATE_OPEN = 'Open'; const STATE_PENDING = 'Pending'; const STATE_DECLINED = 'Declined'; const STATE_CLOSED = 'Closed'; const REASON_INVALID_PAYMENT_METHOD = 'InvalidPaymentMethod'; const REASON_PROCESSING_FAILURE = 'ProcessingFailure'; const REASON_AMAZON_REJECTED = 'AmazonRejected'; const REASON_TRANSACTION_TIMEOUT = 'TransactionTimedOut'; const REASON_MAX_CAPTURES_PROCESSED = 'MaxCapturesProcessed'; const REASON_SELLER_CLOSED = 'SellerClosed'; const REASON_EXPIRED_UNUSED = 'ExpiredUnused'; } amazon-pay-module/Ipn/IpnHandler.php000077700000003012151323541140013370 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Ipn; use AmazonPay\IpnHandler as AmazonIpnHandler; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IpnHandler extends AmazonIpnHandler { /** * IpnHandler constructor. * * Change variable names to fix an issue with M2 DI Compiler * * @param array $requestHeaders * @param string $requestBody * @param null|array $ipnConfig */ public function __construct($requestHeaders, $requestBody, $ipnConfig = null) { parent::__construct($requestHeaders, $requestBody, $ipnConfig); } } amazon-pay-module/Ipn/IpnHandlerFactory.php000077700000004537151323541140014735 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Ipn; use Amazon\Core\Helper\Data; use Magento\Framework\ObjectManagerInterface; use AmazonPay\IpnHandlerInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IpnHandlerFactory implements IpnHandlerFactoryInterface { /** * @var ObjectManagerInterface */ private $objectManager; /** * @var string */ private $instanceName; /** * @var LoggerInterface */ private $logger; /** * @var Data */ private $coreHelper; public function __construct( ObjectManagerInterface $objectManager, LoggerInterface $logger, Data $coreHelper, $instanceName = '\\AmazonPay\\IpnHandlerInterface' ) { $this->objectManager = $objectManager; $this->instanceName = $instanceName; $this->logger = $logger; $this->coreHelper = $coreHelper; } /** * {@inheritdoc} */ public function create($headers, $body) { $handler = $this->objectManager->create( $this->instanceName, ['requestHeaders' => $headers, 'requestBody' => $body] ); if ($handler instanceof LoggerAwareInterface && $this->coreHelper->isLoggingEnabled()) { $handler->setLogger($this->logger); } return $handler; } } amazon-pay-module/Ipn/IpnHandlerFactoryInterface.php000077700000001622151323541140016546 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Ipn; use AmazonPay\IpnHandlerInterface; interface IpnHandlerFactoryInterface { /** * Create amazon ipn instance * * @param array $headers * @param string $body * * @return IpnHandlerInterface */ public function create($headers, $body); } amazon-pay-module/Ipn/.htaccess000077700000000177151323541140012442 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Controller/Payment/CompleteCheckout.php000077700000020126151323541140017621 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Controller\Payment; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Core\Helper\Data as AmazonHelper; use Amazon\Core\Model\AmazonConfig; use Amazon\Core\Exception\AmazonWebapiException; use Amazon\Core\Logger\ExceptionLogger; use Amazon\Payment\Api\OrderInformationManagementInterface; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\Exception\NotFoundException; use Magento\Quote\Api\CartManagementInterface; use Magento\Quote\Api\GuestCartManagementInterface; use Magento\Checkout\Model\Session as CheckoutSession; use Magento\Customer\Model\Session; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\Message\ManagerInterface as MessageManager; use Magento\Framework\App\ObjectManager; /** * Class CompleteCheckout * * @package Amazon\Payment\Controller\Payment * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CompleteCheckout extends Action { /** * @var AmazonConfig */ private $amazonConfig; /** * @var AmazonHelper */ private $amazonHelper; /** * @var CheckoutSession */ private $checkoutSession; /** * @var CartManagementInterface */ private $cartManagement; /** * @var PageFactory */ private $pageFactory; /** * @var ExceptionLogger */ private $exceptionLogger; /** * @var OrderInformationManagementInterface */ private $orderInformationManagement; /** * CompleteCheckout constructor. * * @param Context $context * @param AmazonConfig $amazonConfig * @param AmazonHelper $amazonHelper * @param CartManagementInterface $cartManagement * @param GuestCartManagementInterface $guestCartManagement * @param CheckoutSession $checkoutSession * @param Session $session * @param PageFactory $pageFactory * @param MessageManager $messageManager * @param ExceptionLogger $exceptionLogger * @param OrderInformationManagementInterface $orderInformationManagement */ public function __construct( Context $context, AmazonConfig $amazonConfig, AmazonHelper $amazonHelper, CartManagementInterface $cartManagement, GuestCartManagementInterface $guestCartManagement, CheckoutSession $checkoutSession, Session $session, PageFactory $pageFactory, MessageManager $messageManager, ExceptionLogger $exceptionLogger = null, OrderInformationManagementInterface $orderInformationManagement = null ) { parent::__construct($context); $this->amazonConfig = $amazonConfig; $this->amazonHelper = $amazonHelper; $this->cartManagement = $cartManagement; $this->checkoutSession = $checkoutSession; $this->session = $session; $this->pageFactory = $pageFactory; $this->messageManager = $messageManager; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); $this->orderInformationManagement = $orderInformationManagement ?: ObjectManager::getInstance() ->get(OrderInformationManagementInterface::class); } /* * @inheritdoc */ public function execute() { try { $authenticationStatus = $this->getRequest()->getParam('AuthenticationStatus'); // Bypass cache check in \Magento\PageCache\Model\DepersonalizeChecker $this->getRequest()->setParams(['ajax' => 1]); switch ($authenticationStatus) { case 'Success': try { if (!$this->session->isLoggedIn()) { $this->checkoutSession->getQuote()->setCheckoutMethod(CartManagementInterface::METHOD_GUEST); } $this->cartManagement->placeOrder($this->checkoutSession->getQuoteId()); if ($this->amazonHelper->getAuthorizationMode() == 'synchronous_possible') { $this->messageManager->addNoticeMessage(__( 'Your transaction with Amazon Pay is currently being validated. ' . 'Please be aware that we will inform you shortly as needed.' )); } return $this->_redirect('checkout/onepage/success'); } catch (AmazonWebapiException $e) { if ($this->amazonConfig->isSoftDecline($e->getCode())) { return $this->_redirect('checkout', [ '_query' => 'orderReferenceId=' . $this->getOrderReferenceId(), '_fragment' => 'payment', ]); } $this->exceptionLogger->logException($e); $this->messageManager->addErrorMessage($e->getMessage()); } break; case 'Failure': $this->messageManager->addErrorMessage(__( 'Amazon Pay was unable to authenticate the payment instrument. ' . 'Please try again, or use a different payment method.' )); break; case 'Abandoned': default: $this->messageManager->addErrorMessage(__( 'The SCA challenge was not completed successfully. ' . 'Please try again, or use a different payment method.' )); return $this->_redirect('checkout', [ '_query' => 'orderReferenceId=' . $this->getOrderReferenceId(), '_fragment' => 'payment', ]); } $orderReferenceId = $this->getOrderReferenceId(); if ($orderReferenceId) { // Cancel the order to prevent confusion when the merchant views Transactions in Seller Central try { $this->orderInformationManagement->cancelOrderReference($orderReferenceId, $this->checkoutSession->getQuote()->getStoreId()); } catch (AmazonServiceUnavailableException $e) { $this->exceptionLogger->logException($e); } } return $this->_redirect('checkout/cart'); } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } /** * Return Amazon order reference ID * * @return string * @throws NotFoundException * @throws \Magento\Framework\Exception\LocalizedException * @throws \Magento\Framework\Exception\NoSuchEntityException */ private function getOrderReferenceId() { $quote = $this->checkoutSession->getQuote(); if (!$quote) { throw new NotFoundException(__('Failed to retrieve quote from checkoutSession')); } return $quote ->getExtensionAttributes() ->getAmazonOrderReferenceId() ->getAmazonOrderReferenceId(); } } amazon-pay-module/Controller/Payment/Ipn.php000077700000006131151323541140015111 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Controller\Payment; use Amazon\Core\Exception\AmazonWebapiException; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Config\Source\UpdateMechanism; use Amazon\Core\Logger\ExceptionLogger; use Amazon\Payment\Api\Ipn\CompositeProcessorInterface; use Amazon\Payment\Ipn\IpnHandlerFactoryInterface; use Magento\Framework\App\Action\Action; use Magento\Framework\App\Action\Context; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\ResponseInterface; use Magento\Framework\Exception\NotFoundException; use Magento\Framework\App\ObjectManager; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Ipn extends Action { /** * @var IpnHandlerFactoryInterface */ private $ipnHandlerFactory; /** * @var CompositeProcessorInterface */ private $compositeProcessor; /** * @var Data */ private $coreHelper; /** * @var ExceptionLogger */ private $exceptionLogger; public function __construct( Context $context, IpnHandlerFactoryInterface $ipnHandlerFactory, CompositeProcessorInterface $compositeProcessor, Data $coreHelper, ExceptionLogger $exceptionLogger = null ) { parent::__construct($context); $this->ipnHandlerFactory = $ipnHandlerFactory; $this->compositeProcessor = $compositeProcessor; $this->coreHelper = $coreHelper; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); } public function execute() { try { if (UpdateMechanism::IPN !== $this->coreHelper->getUpdateMechanism()) { throw new NotFoundException(__('IPN not enabled.')); } $headers = $this->_request->getHeaders()->toArray(); $body = $this->_request->getContent(); $ipnHandler = $this->ipnHandlerFactory->create($headers, $body); $ipnData = $ipnHandler->toArray(); $this->compositeProcessor->process($ipnData); } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } } amazon-pay-module/Controller/Payment/.htaccess000077700000000177151323541140015454 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Controller/.htaccess000077700000000177151323541140014037 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Unit/Observer/DataAssignObserverTest.php000077700000005442151323541140020642 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Test\Unit\Observer; use Magento\Framework\DataObject; use Magento\Framework\Event; use Magento\Payment\Model\InfoInterface; use Magento\Payment\Observer\AbstractDataAssignObserver; use Amazon\Payment\Observer\DataAssignObserver; use Magento\Quote\Api\Data\PaymentInterface; /** * Class DataAssignObserverTest * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class DataAssignObserverTest extends \PHPUnit\Framework\TestCase { const KEY_SANDBOX_SIMULATION_REFERENCE = 'sandbox_simulation_reference'; public function testExecute() { $observerContainer = $this->getMockBuilder(Event\Observer::class) ->disableOriginalConstructor() ->getMock(); $event = $this->getMockBuilder(Event::class) ->disableOriginalConstructor() ->getMock(); $paymentInfoModel = $this->createMock(InfoInterface::class); $dataObject = new DataObject( [ PaymentInterface::KEY_ADDITIONAL_DATA => [ 'sandbox_simulation_reference' => self::KEY_SANDBOX_SIMULATION_REFERENCE ] ] ); $observerContainer->expects(static::atLeastOnce()) ->method('getEvent') ->willReturn($event); $event->expects(static::exactly(2)) ->method('getDataByKey') ->willReturnMap( [ [AbstractDataAssignObserver::MODEL_CODE, $paymentInfoModel], [AbstractDataAssignObserver::DATA_CODE, $dataObject] ] ); $paymentInfoModel->expects(static::at(0)) ->method('setAdditionalInformation') ->with('sandbox_simulation_reference', self::KEY_SANDBOX_SIMULATION_REFERENCE); $observer = new DataAssignObserver(); $observer->execute($observerContainer); } } amazon-pay-module/Test/Unit/Observer/.htaccess000077700000000177151323541140015341 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Unit/Observer/AddAmazonButtonTest.php000077700000005410151323541140020141 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Test\Unit\Observer; use Amazon\Payment\Block\Minicart\Button; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Catalog\Block\ShortcutButtons; use Magento\Framework\Event; use Magento\Framework\Event\Observer; use Amazon\Payment\Observer\AddAmazonButton; /** * Class AddAmazonButtonTest * * @see \Amazon\Payment\Observer\AddAmazonButton * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AddAmazonButtonTest extends \PHPUnit\Framework\TestCase { public function testExecute() { $objectManager = new ObjectManager($this); $data = $objectManager->getObject(\Amazon\Core\Helper\Data::class); $shortcutFactory = $objectManager->getObject(\Amazon\Payment\Helper\Shortcut\Factory::class); $addAmazonButton = new AddAmazonButton($data, $shortcutFactory); /** @var Observer|\PHPUnit_Framework_MockObject_MockObject $observerMock */ $observerMock = $this->getMockBuilder(Observer::class) ->disableOriginalConstructor() ->getMock(); /** @var Event|\PHPUnit_Framework_MockObject_MockObject $eventMock */ $eventMock = $this->getMockBuilder(Event::class) ->setMethods(['getContainer']) ->disableOriginalConstructor() ->getMock(); /** @var ShortcutButtons|\PHPUnit_Framework_MockObject_MockObject $shortcutButtonsMock */ $shortcutButtonsMock = $this->getMockBuilder(ShortcutButtons::class) ->disableOriginalConstructor() ->getMock(); $observerMock->expects(self::once()) ->method('getEvent') ->willReturn($eventMock); $eventMock->expects(self::once()) ->method('getContainer') ->willReturn($shortcutButtonsMock); $addAmazonButton->execute($observerMock); } } amazon-pay-module/Test/Unit/.htaccess000077700000000177151323541140013552 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php000077700000022170151323541140022726 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Test\Unit\Gateway\Command; use Amazon\Payment\Gateway\Command\CaptureStrategyCommand; use Amazon\Core\Helper\Data; use Amazon\Payment\Gateway\Data\Order\OrderAdapterFactory; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\Search\SearchCriteria; use Magento\Payment\Gateway\Command\CommandPoolInterface; use Magento\Payment\Gateway\Command\GatewayCommand; use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Payment\Gateway\Data\PaymentDataObject; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Sales\Model\Order\Payment; use Magento\Sales\Model\ResourceModel\Order\Payment\Transaction\CollectionFactory; use PHPUnit_Framework_MockObject_MockObject as MockObject; /** * Class CaptureStrategyCommandTest * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CaptureStrategyCommandTest extends \PHPUnit\Framework\TestCase { /** * @var CaptureStrategyCommand */ private $strategyCommand; /** * @var CommandPoolInterface|MockObject */ private $commandPool; /** * @var TransactionRepositoryInterface|MockObject */ private $transactionRepository; /** * @var FilterBuilder|MockObject */ private $filterBuilder; /** * @var SearchCriteriaBuilder|MockObject */ private $searchCriteriaBuilder; /** * @var Payment|MockObject */ private $payment; /** * @var GatewayCommand|MockObject */ private $command; /** * @var Data|MockObject */ private $coreHelper; /** * @var OrderAdapterFactory|MockObject */ private $orderAdapterFactory; /** * Sets up base classes needed to mock the command strategy class */ protected function setUp(): void { $this->commandPool = $this->getMockBuilder(CommandPoolInterface::class) ->disableOriginalConstructor() ->setMethods(['get', '__wakeup']) ->getMock(); $this->initCommandMock(); $this->initTransactionRepositoryMock(); $this->initFilterBuilderMock(); $this->initSearchCriteriaBuilderMock(); $this->initOrderAdapterFactoryMock(); $this->coreHelper = $this->getMockBuilder(\Amazon\Core\Helper\Data::class) ->disableOriginalConstructor() ->getMock(); $this->strategyCommand = new CaptureStrategyCommand( $this->commandPool, $this->transactionRepository, $this->searchCriteriaBuilder, $this->filterBuilder, $this->coreHelper, $this->orderAdapterFactory ); } /** * Tests if command strategy class returns correct command value when item is authorized but not captured * @throws \Magento\Payment\Gateway\Command\CommandException */ public function testSaleExecute() { $paymentData = $this->getPaymentDataObjectMock(); $subject['payment'] = $paymentData; $this->payment->method('getAuthorizationTransaction') ->willReturn(false); $this->payment->method('getId') ->willReturn(1); $this->coreHelper->method('getPaymentAction')->willReturn('authorize_capture'); $this->buildSearchCriteria(); $this->transactionRepository->method('getTotalCount') ->willReturn(0); $this->commandPool->method('get') ->with(CaptureStrategyCommand::SALE) ->willReturn($this->command); $this->strategyCommand->execute($subject); } /** * Tests if command strategy class returns correct command value when item is to be authorized and captured * @throws \Magento\Payment\Gateway\Command\CommandException */ public function testCaptureExecute() { $paymentData = $this->getPaymentDataObjectMock(); $subject['payment'] = $paymentData; $lastTransId = 'transaction_id'; $this->payment->method('getAuthorizationTransaction') ->willReturn(true); $this->payment->method('getLastTransId') ->willReturn($lastTransId); $this->payment->method('getId') ->willReturn(1); $this->buildSearchCriteria(); $this->transactionRepository->method('getTotalCount') ->willReturn(0); $this->commandPool->method('get') ->with(CaptureStrategyCommand::CAPTURE) ->willReturn($this->command); $this->strategyCommand->execute($subject); } /** * Creates mock for payment data object and order payment * @return MockObject */ private function getPaymentDataObjectMock() { $this->payment = $this->getMockBuilder(Payment::class) ->disableOriginalConstructor() ->getMock(); $mock = $this->getMockBuilder(PaymentDataObject::class) ->setMethods(['getPayment', 'getOrder']) ->disableOriginalConstructor() ->getMock(); $mock->method('getPayment') ->willReturn($this->payment); $order = $this->getMockBuilder(OrderAdapterInterface::class) ->disableOriginalConstructor() ->getMock(); $mock->method('getOrder') ->willReturn($order); return $mock; } /** * Creates mock for gateway command object */ private function initCommandMock() { $this->command = $this->getMockBuilder(GatewayCommand::class) ->disableOriginalConstructor() ->setMethods(['execute']) ->getMock(); $this->command->method('execute') ->willReturn([]); } /** * Creates mock for filter object */ private function initFilterBuilderMock() { $this->filterBuilder = $this->getMockBuilder(FilterBuilder::class) ->disableOriginalConstructor() ->setMethods(['setField', 'setValue', 'create', '__wakeup']) ->getMock(); } /** * Builds search criteria */ private function buildSearchCriteria() { $this->filterBuilder->expects(self::exactly(2)) ->method('setField') ->willReturnSelf(); $this->filterBuilder->expects(self::exactly(2)) ->method('setValue') ->willReturnSelf(); $searchCriteria = new SearchCriteria(); $this->searchCriteriaBuilder->expects(self::exactly(2)) ->method('addFilters') ->willReturnSelf(); $this->searchCriteriaBuilder->method('create') ->willReturn($searchCriteria); $this->transactionRepository->method('getList') ->with($searchCriteria) ->willReturnSelf(); } /** * Create mock for search criteria object */ private function initSearchCriteriaBuilderMock() { $this->searchCriteriaBuilder = $this->getMockBuilder(SearchCriteriaBuilder::class) ->disableOriginalConstructor() ->setMethods(['addFilters', 'create', '__wakeup']) ->getMock(); } /** * Create mock for transaction repository */ private function initTransactionRepositoryMock() { $this->transactionRepository = $this->getMockBuilder(TransactionRepositoryInterface::class) ->disableOriginalConstructor() ->setMethods(['getList', 'getTotalCount', 'delete', 'get', 'save', 'create', '__wakeup']) ->getMock(); } /** * Create mock for Order Adapter Factory */ public function initOrderAdapterFactoryMock() { $this->orderAdapterFactory = $this->getMockBuilder(OrderAdapterFactory::class) ->disableOriginalConstructor() ->setMethods(['create']) ->getMock(); $orderMock = $this->getMockBuilder(OrderAdapterInterface::class) ->disableOriginalConstructor() ->setMethods(['getAmazonOrderID']) ->getMock(); $orderMock->method('getAmazonOrderID') ->willReturn('123456'); $this->orderAdapterFactory->method('create') ->willReturn($orderMock); } } amazon-pay-module/Test/Unit/Gateway/Command/.htaccess000077700000000177151323541140016531 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Unit/Gateway/.htaccess000077700000000177151323541140015153 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/ActionGroup/AmazonLoginActionGroup/AmazonLoginPopupActionGroup.xml000077700000002333151323541140026707 0ustar00<?xml version="1.0" encoding="UTF-8"?> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Open login popup and complete form--> <actionGroup name="AmazonLoginPopupActionGroup"> <!--Save opener window name since popup auto-closes--> <executeJS function="return window.name;" stepKey="openerName"/> <switchToWindow userInput="amazonloginpopup" stepKey="switchToWindowLoginpopup"/> <waitForPageLoad stepKey="waitForPageLoadPopup"/> <!-- Fill in login form --> <waitForElement selector="{{AmazonLoginSection.apEmail}}" time="30" stepKey="apWaitForLogin"/> <fillField selector="{{AmazonLoginSection.apEmail}}" userInput="{{AmazonLogin.email}}" stepKey="apEnterEmail"/> <fillField selector="{{AmazonLoginSection.apPassword}}" userInput="{{AmazonLogin.password}}" stepKey="apEnterPassword"/> <click selector="{{AmazonLoginSection.apSignin}}" stepKey="clickSigninButton"/> <!--Prevent "NoSuchWindowException: window was already closed"--> <switchToWindow userInput="{$openerName}" stepKey="switchToWindowOpener" /> </actionGroup> </actionGroups> amazon-pay-module/Test/Mftf/ActionGroup/AmazonLoginActionGroup/AmazonLoginRedirectActionGroup.xml000077700000001750151323541140027347 0ustar00<?xml version="1.0" encoding="UTF-8"?> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Fill in login from redirect form and submit--> <actionGroup name="AmazonLoginRedirectActionGroup"> <waitForElement selector="{{AmazonLoginSection.apEmail}}" time="10" stepKey="apWaitForLogin"/> <fillField selector="{{AmazonLoginSection.apEmail}}" userInput="{{AmazonLogin.email}}" stepKey="apEnterEmail"/> <fillField selector="{{AmazonLoginSection.apPassword}}" userInput="{{AmazonLogin.password}}" stepKey="apEnterPassword"/> <click selector="{{AmazonLoginSection.apSignin}}" stepKey="clickSigninButton"/> <waitForPageLoad stepKey="waitForPageLoadLogin"/> <conditionalClick selector="{{AmazonLoginSection.apConsent}}" dependentSelector="{{AmazonLoginSection.apConsent}}" visible="true" stepKey="clickLoginConsent"/> </actionGroup> </actionGroups> amazon-pay-module/Test/Mftf/ActionGroup/AmazonLoginActionGroup/.htaccess000077700000000177151323541140022352 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/ActionGroup/.htaccess000077700000000177151323541140015761 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup/AmazonCheckoutCcActionGroup.xml000077700000002453151323541140027326 0ustar00<?xml version="1.0" encoding="UTF-8"?> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Select credit card number and submit--> <actionGroup name="AmazonCheckoutCcActionGroup"> <arguments> <argument name="cc" defaultValue="1111" type="string"/> </arguments> <executeJS function="return window.name;" stepKey="topName"/> <!--Get wallet iframe name (dynamic)--> <executeJS function="return jQuery('#walletWidgetDiv iframe').attr('name');" stepKey="iframeName"/> <!--Expand Wallet Widget to expose all CC# (and avoid JS paging)--> <executeJS function="jQuery('#walletWidgetDiv').css('height', '450px');" stepKey="executeJsHeight"/> <!--Select CC#--> <switchToIFrame userInput="{$iframeName}" stepKey="switchToIFrameWidget"/> <executeJS function="$('.card-number:contains({{cc}})').closest('a').click();" stepKey="executeJsCc"/> <!--Place order--> <switchToWindow userInput="{$topName}" stepKey="switchToWindowTop" /> <waitForPageLoad stepKey="waitForPageLoadPayment1" /> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> </actionGroup> </actionGroups> Test/Mftf/ActionGroup/AmazonCheckoutActionGroup/AmazonCheckoutSubmitActionGroup.xml000077700000001221151323541140030155 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Place order--> <actionGroup name="AmazonCheckoutSubmitActionGroup" extends="AmazonCheckoutBeginActionGroup"> <!--Click Place Order button--> <click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="clickPlaceOrder"/> <!--See success messages--> <see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </actionGroup> </actionGroups> amazon-pay-module/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup/AmazonCheckoutBeginActionGroup.xml000077700000002220151323541140030015 0ustar00<?xml version="1.0" encoding="UTF-8"?> <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> <!--Begin checkout and proceed to final step--> <actionGroup name="AmazonCheckoutBeginActionGroup"> <!-- slight delay to allow for the shipping methods to refresh if needed --> <wait time="2" stepKey="giveShippingChanceToReload"/> <waitForElement selector="{{CheckoutShippingMethodsSection.shippingMethodRow}}" time="20" stepKey="apWaitForShipping"/> <waitForPageLoad stepKey="apWaitPageLoadShipping" /> <click selector="{{CheckoutShippingMethodsSection.firstShippingMethod}}" stepKey="clickShippingMethod"/> <waitForPageLoad stepKey="waitForPageLoadPayment1" /> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> <click selector="{{CheckoutShippingMethodsSection.next}}" stepKey="clickContinueButton"/> <waitForPageLoad stepKey="waitForPageLoadPayment2" /> <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/> </actionGroup> </actionGroups> amazon-pay-module/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup/.htaccess000077700000000177151323541140023047 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/Metadata/AmazonCountryConfigMeta.xml000077700000003200151323541140020727 0ustar00<?xml version="1.0" encoding="UTF-8"?> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="AmazonCountryAllowConfig" dataType="amazon_country_allow_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/" method="POST"> <object key="groups" dataType="amazon_country_allow_config"> <object key="country" dataType="amazon_country_allow_config"> <object key="fields" dataType="amazon_country_allow_config"> <object key="allow" dataType="allow"> <field key="value">string</field> </object> </object> </object> </object> </operation> <operation name="DefaultAmazonCountryAllowConfig" dataType="default_amazon_country_allow_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/general/" method="POST"> <object key="groups" dataType="default_amazon_country_allow_config"> <object key="country" dataType="default_amazon_country_allow_config"> <object key="fields" dataType="default_amazon_country_allow_config"> <object key="allow" dataType="default_amazon_country_allow_config"> <object key="inherit" dataType="amazonCountryAllowFlagZero"> <field key="value">integer</field> </object> </object> </object> </object> </object> </operation> </operations> amazon-pay-module/Test/Mftf/Metadata/AmazonCurrencyConfigMeta.xml000077700000005013151323541140021062 0ustar00<?xml version="1.0" encoding="UTF-8"?> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="AmazonCurrencyConfig" dataType="amazon_currency_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/currency/" method="POST"> <object key="groups" dataType="amazon_currency_config"> <object key="options" dataType="amazon_currency_config"> <object key="fields" dataType="amazon_currency_config"> <object key="base" dataType="base"> <field key="value">string</field> </object> <object key="default" dataType="default"> <field key="value">string</field> </object> <object key="allow" dataType="allow"> <array key="value"> <value>string</value> </array> </object> </object> </object> </object> </operation> <operation name="DefaultAmazonCurrencyConfig" dataType="default_amazon_currency_config" type="create" auth="adminFormKey" url="/admin/system_config/save/section/currency/" method="POST"> <object key="groups" dataType="default_amazon_currency_config"> <object key="options" dataType="default_amazon_currency_config"> <object key="fields" dataType="default_amazon_currency_config"> <object key="base" dataType="default_amazon_currency_config"> <object key="inherit" dataType="amazonCurrencyBaseFlagZero"> <field key="value">integer</field> </object> </object> <object key="default" dataType="default_amazon_currency_config"> <object key="inherit" dataType="amazonCurrencyDefaultFlagZero"> <field key="value">integer</field> </object> </object> <object key="allow" dataType="default_amazon_currency_config"> <object key="inherit" dataType="amazonCurrencyAllowFlagZero"> <field key="value">integer</field> </object> </object> </object> </object> </object> </operation> </operations> amazon-pay-module/Test/Mftf/Metadata/AmazonPaymentConfigMeta.xml000077700000006200151323541140020704 0ustar00<?xml version="1.0" encoding="UTF-8"?> <operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> <operation name="CreateAmazonPaymentConfigState" dataType="amazon_payment_config_state" type="create" auth="adminFormKey" url="/admin/system_config/save/section/payment/" method="POST"> <object key="groups" dataType="amazon_payment_config_state"> <object key="amazon_payment" dataType="amazon_payment_config_state"> <object key="groups" dataType="amazon_payment_config_state"> <object key="credentials" dataType="amazon_payment_config_state"> <object key="fields" dataType="amazon_payment_config_state"> <object key="merchant_id" dataType="merchant_id"> <field key="value">string</field> </object> <object key="access_key" dataType="access_key"> <field key="value">string</field> </object> <object key="secret_key" dataType="secret_key"> <field key="value">string</field> </object> <object key="client_id" dataType="client_id"> <field key="value">string</field> </object> <object key="client_secret" dataType="client_secret"> <field key="value">string</field> </object> <object key="payment_region" dataType="payment_region"> <field key="value">string</field> </object> <object key="sandbox" dataType="sandbox"> <field key="value">string</field> </object> <object key="payment_action" dataType="payment_action"> <field key="value">string</field> </object> <object key="authorization_mode" dataType="authorization_mode"> <field key="value">string</field> </object> </object> </object> <object key="options" dataType="amazon_payment_config_state"> <object key="fields" dataType="amazon_payment_config_state"> <object key="active" dataType="amazon_pay_active"> <field key="value">string</field> </object> <object key="lwa_enabled" dataType="lwa_enabled"> <field key="value">string</field> </object> </object> </object> </object> </object> </object> </operation> </operations> amazon-pay-module/Test/Mftf/Metadata/.htaccess000077700000000177151323541140015247 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>Test/Mftf/Test/AmazonMulticurrencyTest/AmazonCheckoutMulticurrencyDisabledNoButtonV2Test.xml000077700000003417151323541140032060 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutMulticurrencyDisabledNoButton" extends="AmazonCheckoutAddProduct"> <annotations> <stories value="Amazon Checkout Multicurrency Disabled No Button"/> <title value="Amazon Checkout Multicurrency Disabled No Button"/> <description value="User should not be able to checkout with Amazon Pay when multi-currency is disabled."/> <severity value="CRITICAL"/> <group value="amazon_payment"/> <group value="amazon_payment_multicurrency"/> </annotations> <before> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData" before="flushCache"/> <createData entity="EUAmazonMultiCurrencyConfig" stepKey="SampleAmazonCurrencyConfig" before="flushCache"/> <!-- ensure multicurrency disabled --> <magentoCLI command="config:set payment/amazon_payment/multicurrency 0" stepKey="setMulticurrency" before="flushCache"/> </before> <after> <createData entity="SampleAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <!--Verify we don't see Amazon Pay Button--> <dontSeeElement selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="dontSeeEnabledAmazonButton"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonMulticurrencyTest/AmazonCheckoutMulticurrencySuccessTest.xml000077700000007565151323541140030147 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutMulticurrencySuccess" extends="AmazonCheckoutAddProduct"> <annotations> <stories value="Amazon Checkout Multicurrency"/> <title value="Amazon Checkout Multicurrency Success"/> <description value="User should be able to checkout with Amazon Pay when multicurrency is enabled and they are using a supported currency."/> <severity value="CRITICAL"/> <group value="amazon_payment"/> <group value="amazon_payment_multicurrency"/> </annotations> <before> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData" before="flushCache"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig" before="flushCache"/> <!-- set default currency to one supported for multicurrency --> <magentoCLI command="config:set currency/options/default USD" stepKey="setDefaultCurrency" before="flushCache"/> <!-- enable multicurrency --> <magentoCLI command="config:set payment/amazon_payment/multicurrency 1" stepKey="setMulticurrency" before="flushCache"/> </before> <after> <createData entity="SampleAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <!-- disable multicurrency --> <magentoCLI command="config:set payment/amazon_payment/multicurrency 0" stepKey="disableMulticurrency" before="flushCache"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!-- Click on mini cart --> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> <!-- Login (redirect) --> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!-- Place order --> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <!-- Create Invoice --> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/> <waitForPageLoad stepKey="waitForInvoicePage"/> <!-- Verify invoice item qtys cannot be changed --> <dontSeeElement stepKey="dontSeeItemQtyToInvoice1" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}"/> <dontSeeElement stepKey="dontSeeItemQtyToInvoice2" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}"/> <dontSeeElement stepKey="dontSeeUpdateQty" selector="{{AdminInvoiceItemsSection.updateQty}}"/> <!-- Submit and verify the invoice created using the presentmentCurrency --> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/> <waitForPageLoad stepKey="waitForLoadPage"/> <see userInput="The invoice has been created." stepKey="seeMessage"/> <see userInput="Captured amount of €6.23 [$8.82] online." stepKey="seeCapturedAmount"/> </test> </tests> Test/Mftf/Test/AmazonMulticurrencyTest/AmazonCheckoutMulticurrencyCurrencyNoButtonV2Test.xml000077700000003674151323541140032150 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutMulticurrencyCurrencyNoButton" extends="AmazonCheckoutAddProduct"> <annotations> <stories value="Amazon Multicurrency Checkout No Button"/> <title value="Amazon Multicurrency Checkout No Button"/> <description value="User should not be able to checkout with Amazon Pay when not in an allowed multi-currency region."/> <severity value="CRITICAL"/> <group value="amazon_payment"/> <group value="amazon_payment_multicurrency"/> </annotations> <before> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData" before="flushCache"/> <createData entity="EUAmazonInvalidMultiCurrencyConfig" stepKey="SampleAmazonCurrencyConfig" before="flushCache"/> <!-- enable multicurrency --> <magentoCLI command="config:set payment/amazon_payment/multicurrency 1" stepKey="setMulticurrency" before="flushCache"/> </before> <after> <createData entity="SampleAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <!-- disable multicurrency --> <magentoCLI command="config:set payment/amazon_payment/multicurrency 0" stepKey="disableMulticurrency" before="flushCache"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <!--Verify we don't see Amazon Pay Button--> <dontSeeElement selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="dontSeeEnabledAmazonButton"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonMulticurrencyTest/.htaccess000077700000000177151323541140021321 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutFreeShippingTest.xml000077700000002773151323541140026561 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutFreeShipping" extends="AmazonCheckoutAddProductDetail"> <annotations> <features value="Amazon Pay"/> <stories value="Complete checkout with free shipping"/> <title value="Amazon Pay Checkout Free Shipping"/> <description value="Perform checkout with free shipping"/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <magentoCLI command="config:set carriers/freeshipping/active 1" stepKey="enableFreeShipping"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="config:set carriers/freeshipping/active 0" stepKey="disableFreeShipping"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutSuccessAfterDeclinedTest.xml000077700000003212151323541140030126 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutSuccessAfterDeclined" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Amazon Pay Success After being Declined by InvalidPaymentMethod error"/> <title value="Amazon Pay Success After being Declined by InvalidPaymentMethod error"/> <description value="Test user ability to placed order with different CC after being declined"/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup"/> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="3434"/> </actionGroup> <!--Decline Error Message--> <waitForText userInput="There has been a problem with the selected payment method" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Place order again with normal CC--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupGood"/> <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutCustomerTest.xml000077700000002763151323541140025776 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutCustomer" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Success page elements are presented for placed order with Amazon Pay"/> <title value="Amazon Pay Checkout from Customer Account page"/> <description value="Perform checkout after logging in from customer account page and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <magentoCLI command="config:set {{AmazonLwaConfig.path}} 1" stepKey="enableAmazonLwa"/> </before> <after> <magentoCLI command="config:set {{AmazonLwaConfig.path}} 0" stepKey="disableAmazonLwa"/> </after> <!--Go to Customer page--> <amOnPage url="/customer/account/" stepKey="goToMyAccountPage" /> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.loginButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutPageTest.xml000077700000002420151323541140025037 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutPage" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Success page elements are presented for placed order with Amazon Pay"/> <title value="Amazon Pay Checkout from Checkout page"/> <description value="Perform checkout from checkout page and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <!--Go to Checkout--> <actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMinicart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.checkoutPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutAddProductDetailTest.xml000077700000004146151323541140027346 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutAddProductDetail"> <annotations> <features value="Amazon Pay"/> <stories value="Prepares product to be checked out"/> <title value="Amazon Pay Add Product to Cart from Detail Page"/> <description value="Creates and loads simple product and adds it to cart using Amazon Pay button on product detail page."/> <severity value="BLOCKER"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to product page--> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoadCatalog" time="30"/> <!--Add to cart via Amazon Pay button on product page--> <waitForElement selector="{{AmazonCheckoutSection.productPayButton}}" time="30" stepKey="apWaitForPayButton"/> <waitForElement selector="#OffAmazonPaymentsWidgets0" time="30" stepKey="apWaitForPayButton2"/> <waitForJS function="return document.getElementById('{{AmazonCheckoutSection.productPayButton}}'.substr(1)).clientHeight > 10;" stepKey="waitForPayButtonClickable" /> <click selector="{{AmazonCheckoutSection.productPayButton}}" stepKey="clickProductPayButton"/> <!--Login (redirect)--> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutCartTest.xml000077700000002366151323541140025065 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutCart" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Success page elements are presented for placed order with Amazon Pay"/> <title value="Amazon Pay Checkout from Cart"/> <description value="Perform checkout from cart page and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutSCASuccessTest.xml000077700000003532151323541140026127 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutSCASuccess" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="(SCA) Success page elements are presented for placed order with Amazon Pay"/> <title value="(SCA) Amazon Pay Checkout from Cart"/> <description value="Perform checkout from cart page and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_sca"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests>amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutDisplayLanguageTest.xml000077700000003154151323541140027241 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDisplayLanguage" extends="AmazonCheckoutAddProductDetail"> <annotations> <features value="Amazon Pay"/> <stories value="Complete checkout with non-default display language setting"/> <title value="Amazon Pay Checkout Display Language"/> <description value="Perform checkout with non-default display language and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <magentoCLI command="config:set payment/amazon_payment/button_display_language de_DE" stepKey="setDeDisplayLanguage"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="config:set payment/amazon_payment/button_display_language ''" stepKey="setDeDisplayLanguage"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutProductDetailTest.xml000077700000001611151323541140026727 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutProductDetail" extends="AmazonCheckoutAddProductDetail"> <annotations> <features value="Amazon Pay"/> <stories value="Success page elements are presented for placed order with Amazon Pay"/> <title value="Amazon Pay Checkout from Product Details"/> <description value="Perform checkout from product details page and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutGroupedProductTest.xml000077700000010142151323541140027131 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutGroupedProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Complete checkout with bundled product"/> <title value="Amazon Pay Checkout Bundled Product"/> <description value="Perform checkout with bundled product and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <!--Create Grouped product with three simple product --> <createData entity="ApiProductWithDescription" stepKey="simple1" before="simple2"> <field key="price">100.00</field> </createData> <createData entity="ApiProductWithDescription" stepKey="simple2" before="simple3"> <field key="price">200.00</field> </createData> <createData entity="ApiProductWithDescription" stepKey="simple3" before="product"> <field key="price">300.00</field> </createData> <createData entity="ApiGroupedProduct" stepKey="product"/> <createData entity="OneSimpleProductLink" stepKey="addProductOne"> <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple1"/> </createData> <updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductTwo"> <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple2"/> </updateData> <updateData entity="OneMoreSimpleProductLink" createDataKey="addProductOne" stepKey="addProductThree"> <requiredEntity createDataKey="product"/> <requiredEntity createDataKey="simple3"/> </updateData> <magentoCLI command="indexer:reindex" stepKey="reindex"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <deleteData createDataKey="simple1" stepKey="deleteProduct1"/> <deleteData createDataKey="simple2" stepKey="deleteProduct2"/> <deleteData createDataKey="simple3" stepKey="deleteProduct3"/> <deleteData createDataKey="product" stepKey="deleteGroupProduct"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!-- Fill Quantity and add Product to the cart --> <actionGroup ref="StorefrontAddThreeGroupedProductToTheCartActionGroup" stepKey="addGropedProductsToTheCart"> <argument name="urlKey" value="$$product.custom_attributes[url_key]$$"/> <argument name="product1" value="$$simple1.name$$"/> <argument name="product2" value="$$simple2.name$$"/> <argument name="product3" value="$$simple3.name$$"/> <argument name="qty1" value="1"/> <argument name="qty2" value="2"/> <argument name="qty3" value="3"/> </actionGroup> <!--Open minicart--> <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart" /> <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink" /> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart" /> <!--Login (redirect)--> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutConfigurableProductTest.xml000077700000017572151323541140030142 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutConfigurableProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Complete checkout with configurable product"/> <title value="Amazon Pay Checkout Configurable Product"/> <description value="Perform checkout with configurable product and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <!-- Create Default Category --> <createData entity="_defaultCategory" stepKey="createCategory"/> <!-- Create an attribute with three options to be used in the first child product --> <createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/> <createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <!-- Add the attribute just created to default attribute set --> <createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet"> <requiredEntity createDataKey="createConfigProductAttribute"/> </createData> <!-- Get the first option of the attribute created --> <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1"> <requiredEntity createDataKey="createConfigProductAttribute"/> </getData> <!-- Get the second option of the attribute created --> <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2"> <requiredEntity createDataKey="createConfigProductAttribute"/> </getData> <!-- Get the third option of the attribute created --> <getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3"> <requiredEntity createDataKey="createConfigProductAttribute"/> </getData> <!-- Create Configurable product --> <createData entity="BaseConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <!-- Create a simple product and give it the attribute with the first option --> <createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> <field key="price">10.00</field> </createData> <!--Create a simple product and give it the attribute with the second option --> <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption2"/> <field key="price">20.00</field> </createData> <!--Create a simple product and give it the attribute with the Third option --> <createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3"> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption3"/> <field key="price">30.00</field> </createData> <!-- Create the configurable product --> <createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigProductAttribute"/> <requiredEntity createDataKey="getConfigAttributeOption1"/> <requiredEntity createDataKey="getConfigAttributeOption2"/> <requiredEntity createDataKey="getConfigAttributeOption3"/> </createData> <!-- Add the first simple product to the configurable product --> <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct1"/> </createData> <!-- Add the second simple product to the configurable product --> <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct2"/> </createData> <!-- Add the third simple product to the configurable product --> <createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3"> <requiredEntity createDataKey="createConfigProduct"/> <requiredEntity createDataKey="createConfigChildProduct3"/> </createData> <magentoCLI command="cache:flush" stepKey="flushCache"/> <magentoCLI command="indexer:reindex" stepKey="reindex"/> </before> <after> <deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/> <deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/> <deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/> <deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> </after> <!-- Add Configurable Product to the cart --> <actionGroup ref="StorefrontAddConfigurableProductToTheCartActionGroup" stepKey="addConfigurableProductToCart"> <argument name="urlKey" value="$$createConfigProduct.custom_attributes[url_key]$$" /> <argument name="productAttribute" value="$$createConfigProductAttribute.default_value$$"/> <argument name="productOption" value="$$getConfigAttributeOption2.label$$"/> <argument name="qty" value="2"/> </actionGroup> <!--Open minicart--> <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart" /> <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink" /> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart" /> <!--Login (redirect)--> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutAddProductTest.xml000077700000003103151323541140026213 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Prepares product to be checked out"/> <title value="Amazon Pay Add Product to Cart"/> <description value="Adds product to cart."/> <severity value="BLOCKER"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to product page--> <amOnPage url="$$createSimpleProduct.custom_attributes[url_key]$$.html" stepKey="navigateToSimpleProductPage"/> <waitForPageLoad stepKey="waitForPageLoadCatalog"/> <!--Add Product to Shopping Cart--> <actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"> <argument name="productName" value="$$createSimpleProduct.name$$"/> </actionGroup> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutMiniCartTest.xml000077700000002661151323541140025700 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutMiniCart" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="Success page elements are presented for placed order with Amazon Pay"/> <title value="Amazon Pay Checkout from Minicart"/> <description value="Perform checkout from minicart and ensure Success page."/> <severity value="CRITICAL"/> <group value="amazon_checkout"/> <group value="amazon_payment"/> </annotations> <!--Open minicart--> <waitForElement selector="{{StorefrontMinicartSection.showCart}}" stepKey="waitForShowMinicart" /> <waitForElement selector="{{StorefrontMinicartSection.viewAndEditCart}}" stepKey="waitForCartLink" /> <click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickShowMinicart" /> <!--Login (redirect)--> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!--Place order--> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutSuccessTest/.htaccess000077700000000177151323541140021552 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>Test/Mftf/Test/AmazonCheckoutSuccessTest/AmazonCheckoutSuccessAfterSCAAbandonedTest.xml000077700000004414151323541140030626 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutSuccessAfterSCAAbandoned" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="(SCA) Amazon Success After SCA Abandoned"/> <title value="(SCA) Amazon Success After SCA Abandoned"/> <description value="Perform checkout from cart page and ensure SCA Abandoned page."/> <severity value="CRITICAL"/> <group value="amazon_sca"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart"/> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup"/> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup"/> <!--Place order with SCA Abandoned CC--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="4440"/> </actionGroup> <!--Transaction declined error message--> <waitForText userInput="There has been a problem with the selected payment method" selector=".message" stepKey="waitForText"/> </test> </tests> Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutDeclineAmazonRejectedTest.xml000077700000003643151323541140030226 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDeclineAmazonRejected" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test decline error messages using sandbox CC# with Amazon Pay"/> <title value="Amazon Pay Decline AmazonRejected"/> <description value="Test CC decline message, logout, and redirect to cart with Amazon Pay"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="2323" /> </actionGroup> <!--Decline Error Message - These messages are sometimes not showing up, but the redirect to cart always happens --> <!-- <waitForText userInput="please choose another payment method" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/>--> <!--Verify iframe wallet message--> <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutAddressFailureTest.xml000077700000007167151323541140027030 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutAddressFailure" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test new shipping address validation"/> <title value="Amazon Pay Invalid Shipping Address"/> <description value="Adds an invalid address to Amazon Address widget to test Magento shipping address validation"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SingleCountryAllowConfig" stepKey="SingleCountryAllowConfig"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultCountryAllowConfig" stepKey="DefaultCountryAllowConfig"/> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Save opener window name since popup auto-closes--> <executeJS function="return window.name;" stepKey="openerName"/> <!--Get address widget iframe name (dynamic)--> <wait time="5" stepKey="jankyWaitForIframe"/> <executeJS function="return jQuery('#addressBookWidgetDiv iframe').attr('name');" stepKey="iframeName"/> <switchToIFrame userInput="{$iframeName}" stepKey="switchToIFrameWidget"/> <!--Open new address pop-up--> <click selector="{{AmazonCheckoutSection.addNewAddress}}" stepKey="clickAddNew"/> <waitForPageLoad stepKey="waitForPageLoadPopup"/> <executeJS function="return document.getElementById('addShippingAddressForm').target;" stepKey="windowAddressName"/> <switchToWindow userInput="{$windowAddressName}" stepKey="switchToWindowAddress"/> <waitForElement selector="{{AmazonAddressSection.name}}" time="10" stepKey="apWait"/> <!--Add new address--> <!--Select is hidden, so must change with JS--> <executeJS function="document.getElementById('{{AmazonAddressSection.country}}').value = '{{AmazonAddressFail.country}}'" stepKey="apcountry"/> <fillField selector="{{AmazonAddressSection.name}}" userInput="{{AmazonAddressFail.name}}" stepKey="enterName"/> <fillField selector="{{AmazonAddressSection.address}}" userInput="{{AmazonAddressFail.address}}" stepKey="enterAddress"/> <fillField selector="{{AmazonAddressSection.city}}" userInput="{{AmazonAddressFail.city}}" stepKey="enterCity"/> <fillField selector="{{AmazonAddressSection.region}}" userInput="{{AmazonAddressFail.region}}" stepKey="enterRegion"/> <fillField selector="{{AmazonAddressSection.postal}}" userInput="{{AmazonAddressFail.postal}}" stepKey="enterPostal"/> <fillField selector="{{AmazonAddressSection.phone}}" userInput="{{AmazonAddressFail.phone}}" stepKey="enterPhone"/> <click selector="{{AmazonAddressSection.submit}}" stepKey="clickAddAddressButton"/> <!--Switch back to Magento and detect error from new address--> <switchToWindow userInput="{$openerName}" stepKey="switchToWindowOpener" /> <waitForText userInput="The country associated with your address is not allowed" selector=".message" stepKey="waitForText"/> </test> </tests> Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutDeclineTransactionTimedOutInstantTest.xml000077700000004132151323541140032626 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDeclineTransactionTimedOutInstant" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test decline error messages using sandbox CC# with Amazon Pay"/> <title value="Amazon Pay Decline TransactionTimedOut with Instant Authorization"/> <description value="Test CC timeout message with Amazon Pay"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <before> <magentoCLI stepKey="setAuthMode" command="config:set payment/amazon_payment/authorization_mode synchronous" /> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="5656" /> </actionGroup> <!--Timeout Error Message - These messages are sometimes not showing up, but the redirect to cart always happens --> <!-- <waitForText userInput="please choose another payment method" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/>--> <!--Wait for redirect to cart--> <wait time="5" stepKey="waitRedirect"/> <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutSCAFailureTest.xml000077700000004351151323541140026041 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutSCAFailure" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="(SCA) Amazon SCA Failed"/> <title value="(SCA) Amazon SCA Failed"/> <description value="Perform checkout from cart page and ensure SCA Failure page."/> <severity value="CRITICAL"/> <group value="amazon_sca"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with SCA Failure CC--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="8320" /> </actionGroup> <!--Transaction declined error message--> <waitForText userInput="There was a problem with your payment." selector=".message" stepKey="waitForText"/> </test> </tests> Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutDeclineTransactionTimedOutAutomaticTest.xml000077700000004341151323541140033136 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDeclineTransactionTimedOutAutomatic" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test decline error messages using sandbox CC# with Amazon Pay"/> <title value="Amazon Pay Decline TransactionTimedOut with Automatic Authorization)"/> <description value="Test CC timeout message with Amazon Pay"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <before> <magentoCLI stepKey="setAuthMode" command="config:set payment/amazon_payment/authorization_mode asynchronous" /> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI stepKey="setAuthMode" command="config:set payment/amazon_payment/authorization_mode synchronous" /> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="5656" /> </actionGroup> <!--Transaction declined error message - These messages are sometimes not showing up, but the redirect to cart always happens--> <!-- <waitForText userInput="Transaction has been declined" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/>--> <!--Wait for redirect to cart--> <wait time="5" stepKey="waitRedirect"/> <seeInCurrentUrl url="{{CheckoutCartPage.url}}" stepKey="assertUrl"/> </test> </tests> Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutDeclineInvalidPaymentMethodTest.xml000077700000002431151323541140031412 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDeclineInvalidPaymentMethod" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test decline error messages using sandbox CC# with Amazon Pay"/> <title value="Amazon Pay Decline InvalidPaymentMethod"/> <description value="Test CC decline message and then success page elements for placed order with Amazon Pay"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="3434" /> </actionGroup> <!--Decline Error Message--> <waitForText userInput="There has been a problem with the selected payment method" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/> </test> </tests> Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutDeclinePaymentMethodTest.xml000077700000004076151323541140030112 0ustar00amazon-pay-module<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutDeclinePaymentMethod" extends="AmazonCheckoutAddProductDetail"> <annotations> <stories value="Test decline error messages using sandbox CC# with Amazon Pay"/> <title value="Amazon Pay Decline PaymentMethodNotAllowed"/> <description value="Test CC decline message and then success page elements for placed order with Amazon Pay"/> <severity value="CRITICAL"/> <group value="amazon_decline"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with invalid test CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="4545" /> </actionGroup> <!--Decline Error Message--> <waitForText userInput="The selected payment method is not available for this transaction" selector="{{AdminMessagesSection.errorMessage}}" stepKey="waitForText"/> <!--Use default CC#--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupGood"/> <!--See success message--> <waitForText selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonCheckoutDeclineTest/.htaccess000077700000000177151323541140021505 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/Test/AmazonCheckoutDeclineTest/AmazonCheckoutSCAAbandonedTest.xml000077700000004410151323541140026321 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonCheckoutSCAAbandoned" extends="AmazonCheckoutAddProduct"> <annotations> <features value="Amazon Pay"/> <stories value="(SCA) Amazon SCA Abandoned"/> <title value="(SCA) Amazon SCA Abandoned"/> <description value="Perform checkout from cart page and ensure SCA Abandoned page."/> <severity value="CRITICAL"/> <group value="amazon_sca"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct"/> <createData entity="EUAmazonPaymentConfig" stepKey="SampleAmazonPaymentConfigData"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SampleAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!--Go to Cart--> <actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="cartOpenCart" /> <waitForAjaxLoad stepKey="waitForAjaxLoad"/> <!--Login (popup)--> <click selector="{{AmazonCheckoutSection.cartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginPopupActionGroup" stepKey="AmazonLoginPopupActionGroup" /> <!--Begin checkout--> <actionGroup ref="AmazonCheckoutBeginActionGroup" stepKey="AmazonCheckoutBeginActionGroup" /> <!--Place order with SCA Abandoned CC--> <actionGroup ref="AmazonCheckoutCcActionGroup" stepKey="AmazonCheckoutCcActionGroupBad"> <argument name="cc" value="4440" /> </actionGroup> <!--Transaction declined error message--> <waitForText userInput="There has been a problem with the selected payment method" selector=".message" stepKey="waitForText"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/.htaccess000077700000000177151323541140014446 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/Test/AmazonInvoiceTest/AmazonInvoiceSingleTest.xml000077700000010024151323541140023530 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonInvoiceSingle"> <annotations> <stories value="Amazon Pay Invoice"/> <title value="Admin user must be unable to split invoices when configuration disallows"/> <description value="Admin user must be unable to split invoices when configuration disallows"/> <severity value="CRITICAL"/> <group value="amazon_invoice"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct1"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct2"/> <createData entity="EUAmazonPaymentConfig" stepKey="SingleInvoiceAmazonPaymentConfig"/> <createData entity="EUAmazonCurrencyConfig" stepKey="SingleInvoiceAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <createData entity="DefaultAmazonCurrencyConfig" stepKey="DefaultAmazonCurrencyConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!-- Go to product 1 page and add to cart --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProduct1StoreFront"> <argument name="productUrl" value="$$createSimpleProduct1.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProduct1ToCart"/> <!-- Go to product 2 page and add to cart --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProduct2StoreFront"> <argument name="productUrl" value="$$createSimpleProduct2.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProduct2ToCart"/> <!-- Click on mini cart --> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> <!-- Login (redirect) --> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!-- Place order --> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <!-- Create Invoice --> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice"/> <waitForPageLoad stepKey="waitForInvoicePage"/> <!-- Verify invoice item qtys cannot be changed --> <dontSeeElement stepKey="dontSeeItemQtyToInvoice1" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}"/> <dontSeeElement stepKey="dontSeeItemQtyToInvoice2" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}"/> <dontSeeElement stepKey="dontSeeUpdateQty" selector="{{AdminInvoiceItemsSection.updateQty}}"/> <!-- Submit and verify the invoice created --> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice"/> <waitForPageLoad stepKey="waitForLoadPage"/> <see userInput="The invoice has been created." stepKey="seeMessage"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonInvoiceTest/AmazonInvoiceSplitTest.xml000077700000010230151323541140023401 0ustar00<?xml version="1.0" encoding="UTF-8"?> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AmazonInvoiceSplit"> <annotations> <stories value="Amazon Pay Invoice"/> <title value="Admin user must be able to split invoices when configuration allows"/> <description value="Admin user must be able to split invoices when configuration allows"/> <severity value="CRITICAL"/> <group value="amazon_invoice"/> <group value="amazon_payment"/> </annotations> <before> <createData entity="SimpleTwo" stepKey="createSimpleProduct1"/> <createData entity="SimpleTwo" stepKey="createSimpleProduct2"/> <createData entity="SampleAmazonPaymentConfig" stepKey="SplitInvoiceAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </before> <after> <createData entity="DefaultAmazonPaymentConfig" stepKey="DefaultAmazonPaymentConfig"/> <magentoCLI command="cache:flush" stepKey="flushCache"/> </after> <!-- Go to product 1 page and add to cart --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProduct1StoreFront"> <argument name="productUrl" value="$$createSimpleProduct1.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProduct1ToCart"/> <!-- Go to product 2 page and add to cart --> <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProduct2StoreFront"> <argument name="productUrl" value="$$createSimpleProduct2.custom_attributes[url_key]$$"/> </actionGroup> <actionGroup ref="StorefrontAddToTheCartActionGroup" stepKey="addProduct2ToCart"/> <!-- Click on mini cart --> <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/> <!-- Login (redirect) --> <click selector="{{AmazonCheckoutSection.miniCartPayButton}}" stepKey="clickAmazonCartButton"/> <actionGroup ref="AmazonLoginRedirectActionGroup" stepKey="AmazonLoginRedirectActionGroup" /> <!-- Place order --> <actionGroup ref="AmazonCheckoutSubmitActionGroup" stepKey="AmazonCheckoutSubmitActionGroup" /> <grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber}}" stepKey="grabOrderNumber"/> <!-- Login as admin --> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <!-- Open created order in backend --> <amOnPage url="{{AdminOrdersPage.url}}" stepKey="goToOrders"/> <waitForPageLoad stepKey="waitForOrdersPageLoad"/> <actionGroup ref="OpenOrderByIdActionGroup" stepKey="filterOrderGridById"> <argument name="orderId" value="$grabOrderNumber"/> </actionGroup> <!-- Create Invoice 1 --> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice1"/> <waitForPageLoad stepKey="waitForInvoicePage1"/> <fillField stepKey="fillQty" userInput="1" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}"/> <fillField stepKey="fillNoQty" userInput="0" selector="{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}"/> <click selector="{{AdminInvoiceItemsSection.updateQty}}" stepKey="updateQty"/> <waitForPageLoad stepKey="waitPageToBeLoaded"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice1"/> <waitForPageLoad stepKey="waitForLoadPage1"/> <see userInput="The invoice has been created." stepKey="seeMessage1"/> <!-- Create Invoice 2 --> <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoice2"/> <waitForPageLoad stepKey="waitForInvoicePage2"/> <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="submitInvoice2"/> <waitForPageLoad stepKey="waitForLoadPage2"/> <see userInput="The invoice has been created." stepKey="seeMessage2"/> </test> </tests> amazon-pay-module/Test/Mftf/Test/AmazonInvoiceTest/.htaccess000077700000000177151323541140020050 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/README.md000077700000000125151323541140013201 0ustar00# Amazon Payment Functional Tests Functional Test Module for Amazon Payment modules.amazon-pay-module/Test/Mftf/Data/AmazonCountryData.xml000077700000001465151323541140016730 0ustar00<?xml version="1.0" encoding="UTF-8"?> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="SingleCountryAllowConfig" type="amazon_country_allow_config"> <requiredEntity type="allow">SingleCountryAllowValue</requiredEntity> </entity> <entity name="SingleCountryAllowValue" type="allow"> <data key="value">US</data> </entity> <entity name="DefaultCountryAllowConfig" type="default_amazon_country_allow_config"> <requiredEntity type="amazonCountryAllowFlagZero">DefaultCountryAllowFlagZero</requiredEntity> </entity> <entity name="DefaultCountryAllowFlagZero" type="amazonCountryAllowFlagZero"> <data key="value">1</data> </entity> </entities> amazon-pay-module/Test/Mftf/Data/AmazonAddressData.xml000077700000001315151323541140016644 0ustar00<?xml version="1.0" encoding="UTF-8"?> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <!--"Fail Address" to trigger Magento shipping address validation error--> <entity name="AmazonAddressFail" type="amazon_address"> <data key="country">BQ</data> <data key="name">Bonaire International Airport</data> <data key="address">Plasa Medardo SV Thielman 1</data> <data key="city">Kralendijk</data> <data key="region">Caribbean Netherlands</data> <data key="postal">12345</data> <data key="phone">+555 555 5555</data> </entity> </entities> amazon-pay-module/Test/Mftf/Data/AmazonCurrencyData.xml000077700000005766151323541140017067 0ustar00<?xml version="1.0" encoding="UTF-8"?> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="AmazonAllowCurrencyValue" type="allow"> <array key="value"> <item>USD</item> <item>EUR</item> </array> </entity> <entity name="AmazonAllowMultiCurrencyValue" type="allow"> <array key="value"> <item>USD</item> <item>EUR</item> <item>GBP</item> <item>JPY</item> <item>NOK</item> <item>CZK</item> <item>EUR</item> <item>CZK</item> </array> </entity> <entity name="EUAmazonCurrencyConfig" type="amazon_currency_config"> <requiredEntity type="base">EUAmazonBaseCurrencyValue</requiredEntity> <requiredEntity type="default">EUAmazonDefaultCurrencyValue</requiredEntity> <requiredEntity type="allow">AmazonAllowCurrencyValue</requiredEntity> </entity> <entity name="EUAmazonMultiCurrencyConfig" type="amazon_currency_config"> <requiredEntity type="base">EUAmazonBaseCurrencyValue</requiredEntity> <requiredEntity type="default">EUAmazonDefaultMultiCurrencyValue</requiredEntity> <requiredEntity type="allow">AmazonAllowMultiCurrencyValue</requiredEntity> </entity> <entity name="EUAmazonInvalidMultiCurrencyConfig" type="amazon_currency_config"> <requiredEntity type="base">EUAmazonBaseCurrencyValue</requiredEntity> <requiredEntity type="default">EUAmazonNoMultiCurrencyValue</requiredEntity> <requiredEntity type="allow">AmazonAllowMultiCurrencyValue</requiredEntity> </entity> <entity name="EUAmazonBaseCurrencyValue" type="base"> <data key="value">EUR</data> </entity> <entity name="EUAmazonDefaultCurrencyValue" type="default"> <data key="value">EUR</data> </entity> <entity name="EUAmazonMultiCurrencyValue" type="default"> <data key="value">USD</data> </entity> <entity name="EUAmazonNoMultiCurrencyValue" type="default"> <data key="value">CZK</data> </entity> <entity name="DefaultAmazonCurrencyConfig" type="default_amazon_currency_config"> <requiredEntity type="amazonCurrencyBaseFlagZero">DefaultAmazonCurrencyBaseFlagZero</requiredEntity> <requiredEntity type="amazonCurrencyDefaultFlagZero">DefaultAmazonCurrencyDefaultFlagZero</requiredEntity> <requiredEntity type="amazonCurrencyAllowFlagZero">DefaultAmazonCurrencyAllowFlagZero</requiredEntity> </entity> <entity name="DefaultAmazonCurrencyBaseFlagZero" type="amazonCurrencyBaseFlagZero"> <data key="value">1</data> </entity> <entity name="DefaultAmazonCurrencyDefaultFlagZero" type="amazonCurrencyDefaultFlagZero"> <data key="value">1</data> </entity> <entity name="DefaultAmazonCurrencyAllowFlagZero" type="amazonCurrencyAllowFlagZero"> <data key="value">1</data> </entity> </entities> amazon-pay-module/Test/Mftf/Data/AmazonPaymentData.xml000077700000014646151323541140016707 0ustar00<?xml version="1.0" encoding="UTF-8"?> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="SampleAmazonPaymentConfig" type="amazon_payment_config_state"> <requiredEntity type="merchant_id">SampleAmazonMerchantId</requiredEntity> <requiredEntity type="access_key">SampleAmazonAccessKey</requiredEntity> <requiredEntity type="secret_key">SampleAmazonSecretKey</requiredEntity> <requiredEntity type="client_id">SampleAmazonClientId</requiredEntity> <requiredEntity type="client_secret">SampleAmazonClientSecret</requiredEntity> <requiredEntity type="payment_region">SampleAmazonPaymentRegion</requiredEntity> <requiredEntity type="sandbox">SampleAmazonSandbox</requiredEntity> <requiredEntity type="payment_action">SampleAmazonPaymentAction</requiredEntity> <requiredEntity type="authorization_mode">SampleAmazonAuthorizationMode</requiredEntity> <requiredEntity type="amazon_pay_active">SampleAmazonPayActive</requiredEntity> </entity> <entity name="SampleAmazonMerchantId" type="merchant_id"> <data key="value">{{_CREDS.amazon/v1_merchant_id}}</data> </entity> <entity name="SampleAmazonAccessKey" type="access_key"> <data key="value">{{_CREDS.amazon/v1_access_key}}</data> </entity> <entity name="SampleAmazonSecretKey" type="secret_key"> <data key="value">{{_CREDS.amazon/v1_secret_key}}</data> </entity> <entity name="SampleAmazonClientId" type="client_id"> <data key="value">{{_CREDS.amazon/v1_client_id}}</data> </entity> <entity name="SampleAmazonClientSecret" type="client_secret"> <data key="value">{{_CREDS.amazon/v1_client_secret}}</data> </entity> <entity name="SampleAmazonPaymentRegion" type="payment_region"> <data key="value">{{_CREDS.amazon/v1_region}}</data> </entity> <entity name="SampleAmazonSandbox" type="sandbox"> <data key="value">1</data> </entity> <entity name="SampleAmazonPaymentAction" type="payment_action"> <data key="value">authorize</data> </entity> <entity name="SampleAmazonAuthorizationMode" type="authorization_mode"> <data key="value">synchronous</data> </entity> <entity name="SampleAmazonPayActive" type="amazon_pay_active"> <data key="value">1</data> </entity> <!-- EU configuration used to test region-specific features --> <entity name="EUAmazonPaymentConfig" type="amazon_payment_config_state"> <requiredEntity type="merchant_id">EUAmazonMerchantId</requiredEntity> <requiredEntity type="access_key">EUAmazonAccessKey</requiredEntity> <requiredEntity type="secret_key">EUAmazonSecretKey</requiredEntity> <requiredEntity type="client_id">EUAmazonClientId</requiredEntity> <requiredEntity type="client_secret">EUAmazonClientSecret</requiredEntity> <requiredEntity type="payment_region">EUAmazonPaymentRegion</requiredEntity> <requiredEntity type="sandbox">SampleAmazonSandbox</requiredEntity> <requiredEntity type="payment_action">SampleAmazonPaymentAction</requiredEntity> <requiredEntity type="authorization_mode">SampleAmazonAuthorizationMode</requiredEntity> <requiredEntity type="amazon_pay_active">SampleAmazonPayActive</requiredEntity> </entity> <entity name="EUAmazonMerchantId" type="merchant_id"> <data key="value">{{_CREDS.amazon/v1_eu_merchant_id}}</data> </entity> <entity name="EUAmazonAccessKey" type="access_key"> <data key="value">{{_CREDS.amazon/v1_eu_access_key}}</data> </entity> <entity name="EUAmazonSecretKey" type="secret_key"> <data key="value">{{_CREDS.amazon/v1_eu_secret_key}}</data> </entity> <entity name="EUAmazonClientId" type="client_id"> <data key="value">{{_CREDS.amazon/v1_eu_client_id}}</data> </entity> <entity name="EUAmazonClientSecret" type="client_secret"> <data key="value">{{_CREDS.amazon/v1_eu_client_secret}}</data> </entity> <entity name="EUAmazonPaymentRegion" type="payment_region"> <data key="value">de</data> </entity> <!-- default configuration used to restore Magento config --> <entity name="DefaultAmazonPaymentConfig" type="amazon_payment_config_state"> <requiredEntity type="merchant_id">DefaultAmazonMerchantId</requiredEntity> <requiredEntity type="access_key">DefaultAmazonAccessKey</requiredEntity> <requiredEntity type="secret_key">DefaultAmazonSecretKey</requiredEntity> <requiredEntity type="client_id">DefaultAmazonClientId</requiredEntity> <requiredEntity type="client_secret">DefaultAmazonClientSecret</requiredEntity> <requiredEntity type="payment_region">DefaultAmazonPaymentRegion</requiredEntity> <requiredEntity type="sandbox">DefaultAmazonSandbox</requiredEntity> <requiredEntity type="payment_action">DefaultAmazonPaymentAction</requiredEntity> <requiredEntity type="authorization_mode">DefaultAmazonAuthorizationMode</requiredEntity> <requiredEntity type="amazon_pay_active">DefaultAmazonPayActive</requiredEntity> </entity> <entity name="DefaultAmazonMerchantId" type="merchant_id"> <data key="value"/> </entity> <entity name="DefaultAmazonAccessKey" type="access_key"> <data key="value"/> </entity> <entity name="DefaultAmazonSecretKey" type="secret_key"> <data key="value"/> </entity> <entity name="DefaultAmazonClientId" type="client_id"> <data key="value"/> </entity> <entity name="DefaultAmazonClientSecret" type="client_secret"> <data key="value"/> </entity> <entity name="DefaultAmazonPaymentRegion" type="payment_region"> <data key="value"/> </entity> <entity name="DefaultAmazonSandbox" type="sandbox"> <data key="value"/> </entity> <entity name="DefaultAmazonPaymentAction" type="payment_action"> <data key="value">authorize</data> </entity> <entity name="DefaultAmazonAuthorizationMode" type="authorization_mode"> <data key="value">synchronous</data> </entity> <entity name="DefaultAmazonPayActive" type="amazon_pay_active"> <data key="value">0</data> </entity> <!-- Misc configurations --> <entity name="AmazonLwaConfig"> <data key="path">payment/amazon_payment/lwa_enabled</data> </entity> </entities> amazon-pay-module/Test/Mftf/Data/.htaccess000077700000000177151323541140014400 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/Data/AmazonLoginData.xml000077700000000661151323541140016332 0ustar00<?xml version="1.0" encoding="UTF-8"?> <entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> <entity name="AmazonLogin" type="amazon_login"> <data key="email">{{_CREDS.amazon/test_account_eu_email}}</data> <data key="password">{{_CREDS.amazon/test_account_eu_password}}</data> </entity> </entities> amazon-pay-module/Test/Mftf/Section/AmazonCheckoutSection.xml000077700000001716151323541140020317 0ustar00<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AmazonCheckoutSection"> <element name="cartPayButton" type="button" selector="#PayWithAmazon-checkout-cart-shortcut-buttons img"/> <element name="miniCartPayButton" type="button" selector="#minicart-amazon-pay-button img"/> <element name="productPayButton" type="button" selector="#amazon-addtoCart-amazon-pay-button-product"/> <element name="checkoutPayButton" type="button" selector=".amazon-button-container img"/> <element name="loginButton" type="button" selector="#LoginWithAmazon-amazon-login img"/> <element name="addNewAddress" type="block" selector=".footer .info a"/> </section> </sections> amazon-pay-module/Test/Mftf/Section/AmazonAddressSection.xml000077700000002226151323541140020134 0ustar00<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <!--Amazon New Address Widget--> <section name="AmazonAddressSection"> <element name="country" type="select" selector="address-ui-widgets-countryCode-dropdown-nativeId"/> <element name="name" type="input" selector="#address-ui-widgets-enterAddressFullName"/> <element name="address" type="input" selector="#address-ui-widgets-enterAddressLine1"/> <element name="city" type="input" selector="#address-ui-widgets-enterAddressCity"/> <element name="region" type="input" selector="#address-ui-widgets-enterAddressStateOrRegion"/> <element name="postal" type="input" selector="#address-ui-widgets-enterAddressPostalCode"/> <element name="phone" type="input" selector="#address-ui-widgets-enterAddressPhoneNumber"/> <element name="submit" type="button" selector="[type=submit]"/> </section> </sections> amazon-pay-module/Test/Mftf/Section/AmazonLoginSection.xml000077700000001234151323541140017615 0ustar00<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AmazonLoginSection"> <element name="apEmail" type="input" selector="#ap_email"/> <element name="apPassword" type="input" selector="#ap_password"/> <element name="apSignin" type="button" selector="#signInSubmit"/> <element name="apConsent" type="button" selector="[name=consentApproved]"/> </section> </sections> amazon-pay-module/Test/Mftf/Section/.htaccess000077700000000177151323541140015133 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/Mftf/.htaccess000077700000000177151323541140013527 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Test/.htaccess000077700000000177151323541140012633 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Api/Ipn/ProcessorInterface.php000077700000001616151323541140015665 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Ipn; /** * @api */ interface ProcessorInterface { /** * @param array $ipnData * * @return boolean */ public function supports(array $ipnData); /** * @param array $ipnData * * @return void */ public function process(array $ipnData); } amazon-pay-module/Api/Ipn/CompositeProcessorInterface.php000077700000001435151323541140017547 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Ipn; /** * @api */ interface CompositeProcessorInterface { /** * @param array $ipnData * * @return void */ public function process(array $ipnData); } amazon-pay-module/Api/Ipn/.htaccess000077700000000177151323541140013153 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Api/AddressManagementInterface.php000077700000002127151323541140016540 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api; /** * @api */ interface AddressManagementInterface { /** * @param string $amazonOrderReferenceId * @param string $addressConsentToken * * @return mixed */ public function getShippingAddress($amazonOrderReferenceId, $addressConsentToken); /** * @param string $amazonOrderReferenceId * @param string $addressConsentToken * * @return mixed */ public function getBillingAddress($amazonOrderReferenceId, $addressConsentToken); } amazon-pay-module/Api/QuoteLinkManagementInterface.php000077700000001640151323541140017065 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api; /** * @api */ interface QuoteLinkManagementInterface { /** * Link Amazon Reference ID to cart quote * * @param CartInterface $cartInterface * @return void */ public function setAmazonOrderReferenceIdExtensionAttribute(\Magento\Quote\Api\Data\CartInterface $cartInterface); } amazon-pay-module/Api/OrderInformationManagementInterface.php000077700000003356151323541140020441 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api; use Magento\Framework\Exception\LocalizedException; /** * @api */ interface OrderInformationManagementInterface { /** * @param string $amazonOrderReferenceId * @param array $allowedConstraints * @return void * @throws LocalizedException */ public function saveOrderInformation($amazonOrderReferenceId, $allowedConstraints = []); /** * @param string $amazonOrderReferenceId * @param null|integer $storeId * @return void * @throws LocalizedException */ public function confirmOrderReference($amazonOrderReferenceId, $storeId = null); /** * @param string $amazonOrderReferenceId * @param null|integer $storeId * @return void * @throws LocalizedException */ public function closeOrderReference($amazonOrderReferenceId, $storeId = null); /** * @param string $amazonOrderReferenceId * @param null|integer $storeId * @return void * @throws LocalizedException */ public function cancelOrderReference($amazonOrderReferenceId, $storeId = null); /** * @return void */ public function removeOrderReference(); } amazon-pay-module/Api/Data/PendingRefundInterface.php000077700000004664151323541140016567 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Data; use Amazon\Payment\Model\ResourceModel\PendingRefund as PendingRefundResource; /** * @api */ interface PendingRefundInterface { const ID = 'entity_id'; const REFUND_ID = 'refund_id'; const ORDER_ID = 'order_id'; const PAYMENT_ID = 'payment_id'; const CREATED_AT = 'created_at'; /** * @return integer */ public function getId(); /** * @return string */ public function getRefundId(); /** * @param string $refundId * @return $this */ public function setRefundId($refundId); /** * @return integer */ public function getPaymentId(); /** * @param integer $paymentId * @return $this */ public function setPaymentId($paymentId); /** * @return integer */ public function getOrderId(); /** * @param integer $orderId * @return $this */ public function setOrderId($orderId); /** * @return string */ public function getCreatedAt(); /** * @param string $createdAt * @return $this */ public function setCreatedAt($createdAt); /** * @return $this * @throws \Exception */ public function save(); /** * @return $this * @throws \Exception */ public function delete(); /** * @param integer $modelId * @param null|string $field * @return $this */ public function load($modelId, $field = null); /** * Set whether to lock db record on load * * @param boolean $lockOnLoad * @return $this */ public function setLockOnLoad($lockOnLoad); /** * Get whether to lock db record on load * * @return boolean */ public function hasLockOnLoad(); /** * @return PendingRefundResource */ public function getResource(); } amazon-pay-module/Api/Data/OrderLinkInterface.php000077700000003054151323541140015720 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Data; use Exception; /** * @api */ interface OrderLinkInterface { /** * Set amazon order reference id * * @param string $amazonOrderReferenceId * * @return $this */ public function setAmazonOrderReferenceId($amazonOrderReferenceId); /** * Get amazon order reference id * * @return string */ public function getAmazonOrderReferenceId(); /** * Set order id * * @param integer $orderId * * @return $this */ public function setOrderId($orderId); /** * Get order id * * @return integer */ public function getOrderId(); /** * Save order link * * @return $this * @throws Exception */ public function save(); /** * Load order link data * * @param integer $modelId * @param null|string $field * @return $this */ public function load($modelId, $field = null); } amazon-pay-module/Api/Data/PendingAuthorizationInterface.php000077700000010501151323541140020167 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Data; use Amazon\Payment\Model\ResourceModel\PendingAuthorization as PendingAuthorizationResourceModel; use Exception; use Magento\Sales\Api\Data\OrderInterface; /** * @api */ interface PendingAuthorizationInterface { const ID = 'entity_id'; const AUTHORIZATION_ID = 'authorization_id'; const CAPTURE_ID = 'capture_id'; const ORDER_ID = 'order_id'; const PAYMENT_ID = 'payment_id'; const CREATED_AT = 'created_at'; const UPDATED_AT = 'updated_at'; const PROCESSED = 'processed'; const CAPTURE = 'capture'; /** * Get pending authorization id * * @return integer */ public function getId(); /** * Get order id * * @return string */ public function getOrderId(); /** * Set order id * * @param string $orderId * * @return $this */ public function setOrderId($orderId); /** * Get authorization id * * @return string */ public function getAuthorizationId(); /** * Set authorization id * * @param string $authorizationId * * @return $this */ public function setAuthorizationId($authorizationId); /** * Get capture id * * @return string */ public function getCaptureId(); /** * Set capture id * * @param string $captureId * * @return $this */ public function setCaptureId($captureId); /** * Get payment id * * @return integer */ public function getPaymentId(); /** * Set payment id * * @param integer $paymentId * * @return $this */ public function setPaymentId($paymentId); /** * Is processed * * @return boolean */ public function isProcessed(); /** * Set processed * * @param boolean $processed * * @return $this */ public function setProcessed($processed); /** * Is capture * * @return boolean */ public function isCapture(); /** * Set capture * * @param boolean $capture * * @return $this */ public function setCapture($capture); /** * Get created at * * @return string */ public function getCreatedAt(); /** * Set created at * * @param string $createdAt * * @return $this */ public function setCreatedAt($createdAt); /** * Get updated at * * @return string */ public function getUpdatedAt(); /** * Set created at * * @param string $updatedAt * * @return $this */ public function setUpdatedAt($updatedAt); /** * Set order * * @param OrderInterface $order * * @return $this */ public function setOrder(OrderInterface $order); /** * Save pending authorization * * @return $this * @throws Exception */ public function save(); /** * Delete pending authorization * * @return $this * @throws Exception */ public function delete(); /** * Load pending authorization data * * @param integer $modelId * @param null|string $field * * @return $this */ public function load($modelId, $field = null); /** * Set whether to lock db record on load * * @param boolean $lockOnLoad * * @return $this */ public function setLockOnLoad($lockOnLoad); /** * Get whether to lock db record on load * * @return boolean */ public function hasLockOnLoad(); /** * Retrieve model resource * * @return PendingAuthorizationResourceModel */ public function getResource(); } amazon-pay-module/Api/Data/PendingCaptureInterface.php000077700000005636151323541140016747 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Data; use Amazon\Payment\Model\ResourceModel\PendingCapture as PendingCaptureResourceModel; use Exception; /** * @api */ interface PendingCaptureInterface { const ID = 'entity_id'; const CAPTURE_ID = 'capture_id'; const ORDER_ID = 'order_id'; const PAYMENT_ID = 'payment_id'; const CREATED_AT = 'created_at'; /** * Get pending capture id * * @return integer */ public function getId(); /** * Get capture id * * @return string */ public function getCaptureId(); /** * Set capture id * * @param string $captureId * * @return $this */ public function setCaptureId($captureId); /** * Get payment id * * @return integer */ public function getPaymentId(); /** * Set payment id * * @param integer $paymentId * * @return $this */ public function setPaymentId($paymentId); /** * Get order id * * @return integer */ public function getOrderId(); /** * Set order id * * @param integer $orderId * * @return $this */ public function setOrderId($orderId); /** * Get created at * * @return string */ public function getCreatedAt(); /** * Set created at * * @param string $createdAt * * @return $this */ public function setCreatedAt($createdAt); /** * Save pending capture * * @return $this * @throws Exception */ public function save(); /** * Delete pending capture * * @return $this * @throws Exception */ public function delete(); /** * Load pending capture data * * @param integer $modelId * @param null|string $field * * @return $this */ public function load($modelId, $field = null); /** * Set whether to lock db record on load * * @param boolean $lockOnLoad * * @return $this */ public function setLockOnLoad($lockOnLoad); /** * Get whether to lock db record on load * * @return boolean */ public function hasLockOnLoad(); /** * Retrieve model resource * * @return PendingCaptureResourceModel */ public function getResource(); } amazon-pay-module/Api/Data/.htaccess000077700000000177151323541140013276 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Api/Data/QuoteLinkInterface.php000077700000004605151323541140015745 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Api\Data; use Exception; /** * @api */ interface QuoteLinkInterface { /** * @return mixed */ public function getId(); /** * Set amazon order reference id * * @param string $amazonOrderReferenceId * * @return $this */ public function setAmazonOrderReferenceId($amazonOrderReferenceId); /** * Get amazon order reference id * * @return string */ public function getAmazonOrderReferenceId(); /** * Set quote id * * @param integer $quoteId * * @return $this */ public function setQuoteId($quoteId); /** * Get quote id * * @return integer */ public function getQuoteId(); /** * Set sandbox simulation reference * * @param string $sandboxSimulationReference * * @return $this */ public function setSandboxSimulationReference($sandboxSimulationReference); /** * Get sandbox simulation reference * * @return string */ public function getSandboxSimulationReference(); /** * Set quote confirmed with amazon * * @param boolean $confirmed * * @return $this */ public function setConfirmed($confirmed); /** * Get quote confirmed with amazon * * @return boolean */ public function isConfirmed(); /** * Save quote link * * @return $this * @throws Exception */ public function save(); /** * Delete quote link from database * * @return $this * @throws Exception */ public function delete(); /** * Load quote link data * * @param integer $modelId * @param null|string $field * @return $this */ public function load($modelId, $field = null); } amazon-pay-module/Api/.htaccess000077700000000177151323541140012425 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/registration.php000077700000001525151323541140013337 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ use Magento\Framework\Component\ComponentRegistrar; $registrar = new ComponentRegistrar(); if ($registrar->getPath(ComponentRegistrar::MODULE, 'Amazon_Payment') === null) { ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Amazon_Payment', __DIR__); } amazon-pay-module/Cron/GetAmazonCaptureUpdates.php000077700000014646151323541140016275 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Cron; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Config\Source\UpdateMechanism; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Amazon\Payment\Model\PaymentManagement\Capture; use Amazon\Payment\Model\ResourceModel\PendingCapture\CollectionFactory; use Magento\Framework\Data\Collection; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\Search\FilterGroup; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class GetAmazonCaptureUpdates { /** * @var int */ private $limit; /** * @var CollectionFactory */ private $collectionFactory; /** * @var Capture */ private $capture; /** * @var Data */ private $coreHelper; /** * @var TransactionRepositoryInterface */ private $transactionRepository; /** * @var FilterBuilder */ private $filterBuilder; /** * @var SearchCriteriaBuilder */ private $searchBuilder; /** * @var FilterGroup */ private $filterGroup; /** * @var LoggerInterface */ private $logger; /** * GetAmazonCaptureUpdates constructor. * @param CollectionFactory $collectionFactory * @param Capture $capture * @param Data $coreHelper * @param TransactionRepositoryInterface $transactionRepository * @param SearchCriteriaBuilder $searchBuilder * @param FilterBuilder $filterBuilder * @param FilterGroup $filterGroup * @param LoggerInterface $logger * @param int $limit */ public function __construct( CollectionFactory $collectionFactory, Capture $capture, Data $coreHelper, TransactionRepositoryInterface $transactionRepository, SearchCriteriaBuilder $searchBuilder, FilterBuilder $filterBuilder, FilterGroup $filterGroup, LoggerInterface $logger, $limit = 100 ) { $this->collectionFactory = $collectionFactory; $this->capture = $capture; $this->coreHelper = $coreHelper; $this->transactionRepository = $transactionRepository; $this->searchBuilder = $searchBuilder; $this->filterBuilder = $filterBuilder; $this->filterGroup = $filterGroup; $this->logger = $logger; $limit = (int)$limit; if ($limit < 1) { throw new \InvalidArgumentException('Limit must be greater than 1.'); } $this->limit = $limit; } /** * Since we might not get order or payment ID during gateway transaction, we make sure items in the * amazon_pending_capture table have these IDs if they are not set by matching them to a transaction that * has matching transaction or parent transaction IDs. */ private function updateIds() { // only get items that have no order ID set since we don't want to have to keep repeating this $collection = $this->collectionFactory ->create() ->addFieldToFilter('order_id', ['eq' => 0]) ->addOrder(PendingCaptureInterface::CREATED_AT, Collection::SORT_ORDER_ASC) ->setPageSize($this->limit) ->setCurPage(1); foreach ($collection->getItems() as $item) { if ($item) { $hasTransaction = false; $parent = $this->filterBuilder ->setField('parent_txn_id') ->setValue($item->getCaptureId()) ->setConditionType('eq') ->create(); $child = $this->filterBuilder ->setField('txn_id') ->setValue($item->getCaptureId()) ->setConditionType('eq') ->create(); $filterOr = $this->filterGroup->setFilters([$parent, $child]); $searchCriteria = $this->searchBuilder->setFilterGroups([$filterOr])->create(); $transactionList = $this->transactionRepository->getList($searchCriteria); foreach ($transactionList->getItems() as $transaction) { if ($transaction) { $item->setPaymentId($transaction->getPaymentId()); $item->setOrderId($transaction->getOrderId()); $item->save(); $hasTransaction = true; } } // If there's no match, get rid of this item in the table so the cron job will not error out. if (!$hasTransaction) { $item->delete(); } } } } /** * During cron, process payments if possible. */ public function execute() { if (UpdateMechanism::IPN === $this->coreHelper->getUpdateMechanism()) { return; } $this->updateIds(); $collection = $this->collectionFactory ->create() ->addOrder(PendingCaptureInterface::CREATED_AT, Collection::SORT_ORDER_ASC) ->setPageSize($this->limit) ->setCurPage(1); $pendingCaptureIds = $collection->getIdGenerator(); foreach ($pendingCaptureIds as $pendingCaptureId) { try { $this->capture->updateCapture($pendingCaptureId); } catch (\Exception $e) { $this->logger->error($e); } } } } amazon-pay-module/Cron/GetAmazonAuthorizationUpdates.php000077700000015054151323541140017524 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Cron; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Config\Source\UpdateMechanism; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Model\PaymentManagement\Authorization; use Amazon\Payment\Model\ResourceModel\PendingAuthorization\CollectionFactory; use Magento\Framework\Data\Collection; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\Search\FilterGroup; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class GetAmazonAuthorizationUpdates { /** * @var int */ private $limit; /** * @var CollectionFactory */ private $collectionFactory; /** * @var Authorization */ private $authorization; /** * @var Data */ private $coreHelper; /** * @var TransactionRepositoryInterface */ private $transactionRepository; /** * @var FilterBuilder */ private $filterBuilder; /** * @var SearchCriteriaBuilder */ private $searchBuilder; /** * @var FilterGroup */ private $filterGroup; /** * @var LoggerInterface */ private $logger; /** * GetAmazonAuthorizationUpdates constructor. * @param CollectionFactory $collectionFactory * @param Authorization $authorization * @param Data $coreHelper * @param TransactionRepositoryInterface $transactionRepository * @param SearchCriteriaBuilder $searchBuilder * @param FilterBuilder $filterBuilder * @param FilterGroup $filterGroup * @param LoggerInterface $logger * @param int $limit */ public function __construct( CollectionFactory $collectionFactory, Authorization $authorization, Data $coreHelper, TransactionRepositoryInterface $transactionRepository, SearchCriteriaBuilder $searchBuilder, FilterBuilder $filterBuilder, FilterGroup $filterGroup, LoggerInterface $logger, $limit = 100 ) { $this->collectionFactory = $collectionFactory; $this->authorization = $authorization; $this->coreHelper = $coreHelper; $this->transactionRepository = $transactionRepository; $this->searchBuilder = $searchBuilder; $this->filterBuilder = $filterBuilder; $this->filterGroup = $filterGroup; $this->logger = $logger; $limit = (int)$limit; if ($limit < 1) { throw new \InvalidArgumentException('Limit must be greater than 1.'); } $this->limit = $limit; } /** * Since we can't get order or payment ID during gateway transaction, we make sure items in the * amazon_pending_authorization table have these IDs if they are not set by matching them to a transaction that * has matching transaction or parent transaction IDs. */ private function updateIds() { // only get items that have no order ID set since we don't want to have to keep repeating this $collection = $this->collectionFactory ->create() ->addFieldToFilter('order_id', ['eq' => 0]) ->addOrder(PendingAuthorizationInterface::UPDATED_AT, Collection::SORT_ORDER_ASC) ->setPageSize($this->limit) ->setCurPage(1); foreach ($collection->getItems() as $item) { if ($item) { $hasTransaction = false; $parent = $this->filterBuilder ->setField('parent_txn_id') ->setValue($item->getAuthorizationId()) ->setConditionType('eq') ->create(); $child = $this->filterBuilder ->setField('txn_id') ->setValue($item->getAuthorizationId()) ->setConditionType('eq') ->create(); $filterOr = $this->filterGroup->setFilters([$parent, $child]); $searchCriteria = $this->searchBuilder->setFilterGroups([$filterOr])->create(); $transactionList = $this->transactionRepository->getList($searchCriteria); foreach ($transactionList->getItems() as $transaction) { if ($transaction) { $item->setPaymentId($transaction->getPaymentId()); $item->setOrderId($transaction->getOrderId()); $item->save(); $hasTransaction = true; } } // If there's no match, get rid of this item in the table so the cron job will not error out. if (!$hasTransaction) { $item->delete(); } } } } /** * During cron, process payments if possible. */ public function execute() { if (UpdateMechanism::IPN === $this->coreHelper->getUpdateMechanism()) { return; } $this->updateIds(); $collection = $this->collectionFactory ->create() ->addOrder(PendingAuthorizationInterface::UPDATED_AT, Collection::SORT_ORDER_ASC) ->setPageSize($this->limit) ->setCurPage(1); $pendingAuthorizationIds = $collection->getIdGenerator(); foreach ($pendingAuthorizationIds as $pendingAuthorizationId) { try { $this->authorization->updateAuthorization($pendingAuthorizationId); } catch (\Exception $e) { $this->logger->error($e); } } } } amazon-pay-module/Cron/ProcessAmazonRefunds.php000077700000005755151323541140015652 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Cron; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Config\Source\UpdateMechanism; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Model\QueuedRefundUpdaterFactory; use Amazon\Payment\Model\ResourceModel\PendingRefund\CollectionFactory; use Magento\Framework\Data\Collection; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ProcessAmazonRefunds { /** * @var int */ private $limit; /** * @var CollectionFactory */ private $queuedRefundsCollectionFactory; /** * @var QueuedRefundUpdaterFactory */ private $queuedRefundUpdater; /** * @var Data */ private $coreHelper; /** * @param CollectionFactory $collectionFactory * @param QueuedRefundUpdaterFactory $queuedRefundUpdater * @param int $limit */ public function __construct( CollectionFactory $collectionFactory, QueuedRefundUpdaterFactory $queuedRefundUpdater, Data $coreHelper, $limit = 100 ) { $this->queuedRefundsCollectionFactory = $collectionFactory; $this->queuedRefundUpdater = $queuedRefundUpdater; $this->coreHelper = $coreHelper; $limit = (int)$limit; if ($limit < 1) { throw new \InvalidArgumentException('Limit must be greater than 1.'); } $this->limit = $limit; } public function execute() { if (UpdateMechanism::IPN === $this->coreHelper->getUpdateMechanism()) { return; } $collection = $this->queuedRefundsCollectionFactory ->create() ->addOrder(PendingRefundInterface::CREATED_AT, Collection::SORT_ORDER_ASC) ->setPageSize($this->limit) ->setCurPage(1); $queuedRefundUpdater = $this->queuedRefundUpdater->create(); foreach ($collection->getIdGenerator() as $pendingRefundId) { $queuedRefundUpdater->checkAndUpdateRefund($pendingRefundId); } } } amazon-pay-module/Cron/.htaccess000077700000000177151323541140012615 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/README.md000077700000001466151323541140011377 0ustar00# Amazon_Payment Module The Amazon_Payment module provides the "Amazon Pay" payment method. ## About Amazon Pay and Login Amazon Pay and Login provides integration of your Magento 2 store with Amazon Pay and Login with Amazon services. This 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 Pay transactions are protected by Amazon's A-to-z Guarantee. ## Dependencies You can find a list of modules in the require section of the `composer.json` file located in the same directory as this `README.md` file. ## Extension Points Amazon Pay does not provide any specific extension points. ## Additional Information [View the Complete User Guide](https://amzn.github.io/amazon-payments-magento-2-plugin/)amazon-pay-module/Model/Ipn/AuthorizationProcessor.php000077700000007116151323541140017155 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Ipn; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Api\Ipn\ProcessorInterface; use Amazon\Payment\Model\PaymentManagement\Authorization; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetailsFactory; use Amazon\Payment\Model\ResourceModel\PendingAuthorization\CollectionFactory; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizationProcessor implements ProcessorInterface { /** * @var AmazonAuthorizationDetailsFactory */ private $amazonAuthorizationDetailsFactory; /** * @var Authorization */ private $authorization; /** * @var CollectionFactory */ private $collectionFactory; /** * @var StoreManagerInterface */ private $storeManager; public function __construct( AmazonAuthorizationDetailsFactory $amazonAuthorizationDetailsFactory, Authorization $authorization, CollectionFactory $collectionFactory, StoreManagerInterface $storeManager ) { $this->amazonAuthorizationDetailsFactory = $amazonAuthorizationDetailsFactory; $this->authorization = $authorization; $this->collectionFactory = $collectionFactory; $this->storeManager = $storeManager; } /** * {@inheritDoc} */ public function supports(array $ipnData) { return (isset($ipnData['NotificationType']) && 'PaymentAuthorize' === $ipnData['NotificationType']); } /** * {@inheritDoc} */ public function process(array $ipnData) { $details = $this->amazonAuthorizationDetailsFactory->create( [ 'details' => $ipnData['AuthorizationDetails'] ] ); $collection = $this->collectionFactory ->create() ->addFieldToFilter( PendingAuthorizationInterface::AUTHORIZATION_ID, [ 'eq' => $details->getAuthorizeTransactionId() ] ) ->setPageSize(1) ->setCurPage(1); $collection->getSelect() ->join(['so' => $collection->getTable('sales_order')], 'main_table.order_id = so.entity_id', []) ->where('so.store_id = ?', $this->storeManager->getStore()->getId()); if (count($items = $collection->getItems())) { $pendingAuthorization = current($items); $this->authorization->setThrowExceptions(true); $this->authorization->updateAuthorization($pendingAuthorization->getId(), $details); } } } amazon-pay-module/Model/Ipn/OrderProcessor.php000077700000007153151323541140015371 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Ipn; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Api\Ipn\ProcessorInterface; use Amazon\Payment\Model\PaymentManagement\Authorization; use Amazon\Payment\Domain\Details\AmazonOrderDetailsFactory; use Amazon\Payment\Model\ResourceModel\OrderLink; use Amazon\Payment\Model\ResourceModel\PendingAuthorization\CollectionFactory; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderProcessor implements ProcessorInterface { /** * @var AmazonOrderDetailsFactory */ private $amazonOrderDetailsFactory; /** * @var AuthorizationInterface */ private $authorization; /** * @var CollectionFactory */ private $collectionFactory; /** * @var StoreManagerInterface */ private $storeManager; public function __construct( AmazonOrderDetailsFactory $amazonOrderDetailsFactory, Authorization $authorization, CollectionFactory $collectionFactory, StoreManagerInterface $storeManager ) { $this->amazonOrderDetailsFactory = $amazonOrderDetailsFactory; $this->collectionFactory = $collectionFactory; $this->authorization = $authorization; $this->storeManager = $storeManager; } /** * {@inheritDoc} */ public function supports(array $ipnData) { return (isset($ipnData['NotificationType']) && 'OrderReferenceNotification' === $ipnData['NotificationType']); } /** * {@inheritDoc} */ public function process(array $ipnData) { $details = $this->amazonOrderDetailsFactory->create([ 'details' => $ipnData['OrderReference'] ]); $collection = $this->collectionFactory ->create() ->addFieldToFilter(PendingAuthorizationInterface::PROCESSED, ['eq' => 1]) ->setPageSize(1) ->setCurPage(1); $collection->getSelect() ->join(['so' => $collection->getTable('sales_order')], 'main_table.order_id = so.entity_id', []) ->where('so.store_id = ?', $this->storeManager->getStore()->getId()) ->join(['ao' => $collection->getTable(OrderLink::TABLE_NAME)], 'main_table.order_id = ao.order_id', []) ->where('ao.amazon_order_reference_id = ?', $details->getOrderReferenceId()); if (count($items = $collection->getItems())) { $pendingAuthorization = current($items); $this->authorization->setThrowExceptions(true); $this->authorization->updateAuthorization($pendingAuthorization->getId(), null, $details); } } } amazon-pay-module/Model/Ipn/CaptureProcessor.php000077700000006460151323541140015721 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Ipn; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Amazon\Payment\Api\Ipn\ProcessorInterface; use Amazon\Payment\Model\PaymentManagement\Capture; use Amazon\Payment\Domain\Details\AmazonCaptureDetailsFactory; use Amazon\Payment\Model\ResourceModel\PendingCapture\CollectionFactory; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CaptureProcessor implements ProcessorInterface { /** * @var AmazonCaptureDetailsFactory */ private $amazonCaptureDetailsFactory; /** * @var Capture */ private $capture; /** * @var CollectionFactory */ private $collectionFactory; /** * @var StoreManagerInterface */ private $storeManager; public function __construct( AmazonCaptureDetailsFactory $amazonCaptureDetailsFactory, Capture $capture, CollectionFactory $collectionFactory, StoreManagerInterface $storeManager ) { $this->amazonCaptureDetailsFactory = $amazonCaptureDetailsFactory; $this->capture = $capture; $this->collectionFactory = $collectionFactory; $this->storeManager = $storeManager; } /** * {@inheritDoc} */ public function supports(array $ipnData) { return (isset($ipnData['NotificationType']) && 'PaymentCapture' === $ipnData['NotificationType']); } /** * {@inheritDoc} */ public function process(array $ipnData) { $details = $this->amazonCaptureDetailsFactory->create([ 'details' => $ipnData['CaptureDetails'] ]); $collection = $this->collectionFactory ->create() ->addFieldToFilter(PendingCaptureInterface::CAPTURE_ID, ['eq' => $details->getTransactionId()]) ->setPageSize(1) ->setCurPage(1); $collection->getSelect() ->join(['so' => $collection->getTable('sales_order')], 'main_table.order_id = so.entity_id', []) ->where('so.store_id = ?', $this->storeManager->getStore()->getId()); if (count($items = $collection->getItems())) { $pendingCapture = current($items); $this->capture->setThrowExceptions(true); $this->capture->updateCapture($pendingCapture->getId(), $details); } } } amazon-pay-module/Model/Ipn/RefundProcessor.php000077700000006554151323541140015545 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Ipn; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Api\Ipn\ProcessorInterface; use Amazon\Payment\Domain\Details\AmazonRefundDetailsFactory; use Amazon\Payment\Model\QueuedRefundUpdater; use Amazon\Payment\Model\ResourceModel\PendingRefund\CollectionFactory; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class RefundProcessor implements ProcessorInterface { /** * @var AmazonRefundDetailsFactory */ private $amazonRefundDetailsFactory; /** * @var QueuedRefundUpdater */ private $queuedRefundUpdater; /** * @var CollectionFactory */ private $collectionFactory; /** * @var StoreManagerInterface */ private $storeManager; public function __construct( AmazonRefundDetailsFactory $amazonRefundDetailsFactory, QueuedRefundUpdater $queuedRefundUpdater, CollectionFactory $collectionFactory, StoreManagerInterface $storeManager ) { $this->amazonRefundDetailsFactory = $amazonRefundDetailsFactory; $this->queuedRefundUpdater = $queuedRefundUpdater; $this->collectionFactory = $collectionFactory; $this->storeManager = $storeManager; } /** * {@inheritDoc} */ public function supports(array $ipnData) { return (isset($ipnData['NotificationType']) && 'PaymentRefund' === $ipnData['NotificationType']); } /** * {@inheritDoc} */ public function process(array $ipnData) { $details = $this->amazonRefundDetailsFactory->create([ 'details' => $ipnData['RefundDetails'] ]); $collection = $this->collectionFactory ->create() ->addFieldToFilter(PendingRefundInterface::REFUND_ID, ['eq' => $details->getRefundId()]) ->setPageSize(1) ->setCurPage(1); $collection->getSelect() ->join(['so' => $collection->getTable('sales_order')], 'main_table.order_id = so.entity_id', []) ->where('so.store_id = ?', $this->storeManager->getStore()->getId()); if (count($items = $collection->getItems())) { $pendingRefund = current($items); $this->queuedRefundUpdater->setThrowExceptions(true); $this->queuedRefundUpdater->checkAndUpdateRefund($pendingRefund->getId(), $details); } } } amazon-pay-module/Model/Ipn/CompositeProcessor.php000077700000003215151323541140016253 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Ipn; use Amazon\Payment\Api\Ipn\CompositeProcessorInterface; use Amazon\Payment\Api\Ipn\ProcessorInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CompositeProcessor implements CompositeProcessorInterface { /** * @var ProcessorInterface[] */ private $processors; public function __construct(array $processors) { $this->processors = $processors; } /** * {@inheritDoc} */ public function process(array $ipnData) { foreach ($this->processors as $processor) { if ($processor->supports($ipnData)) { return $processor->process($ipnData); } } } } amazon-pay-module/Model/Ipn/.htaccess000077700000000177151323541140013502 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/Adapter/AmazonPaymentAdapter.php000077700000033054151323541140017333 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Adapter; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Domain\AmazonSetOrderDetailsResponseFactory; use Amazon\Payment\Model\OrderLinkFactory; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Domain\AmazonAuthorizationResponseFactory; use Amazon\Payment\Domain\AmazonCaptureResponseFactory; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Magento\Framework\UrlInterface; use Magento\Sales\Model\OrderRepository; use Magento\Framework\App\ObjectManager; /** * Class AmazonPaymentAdapter * Use \Amazon\Payment\Model\Adapter\AmazonPaymentAdapterFactory to create new instance of adapter. * @codeCoverageIgnore * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonPaymentAdapter { const SUCCESS_CODES = ['Open', 'Closed', 'Completed']; const PENDING_CODE = 'Pending'; /** * @var Logger */ private $logger; /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var AmazonSetOrderDetailsResponseFactory */ private $amazonSetOrderDetailsResponseFactory; /** * @var AmazonCaptureResponseFactory */ private $amazonCaptureResponseFactory; /** * @var AmazonAuthorizationResponseFactory */ private $amazonAuthorizationResponseFactory; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var UrlInterface */ private $urlBuilder; /** * @var OrderLinkFactory */ private $orderLinkFactory; /** * @var OrderRepository */ private $orderRepository; /** * AmazonPaymentAdapter constructor. * @param ClientFactoryInterface $clientFactory * @param AmazonCaptureResponseFactory $amazonCaptureResponseFactory * @param AmazonSetOrderDetailsResponseFactory $amazonSetOrderDetailsResponseFactory * @param AmazonAuthorizationResponseFactory $amazonAuthorizationResponseFactory * @param SubjectReader $subjectReader * @param Data $coreHelper * @param Logger $logger * @param UrlInterface $urlBuilder * @param OrderLinkFactory $orderLinkFactory * @param OrderRepository $orderRepository */ public function __construct( ClientFactoryInterface $clientFactory, AmazonCaptureResponseFactory $amazonCaptureResponseFactory, AmazonSetOrderDetailsResponseFactory $amazonSetOrderDetailsResponseFactory, AmazonAuthorizationResponseFactory $amazonAuthorizationResponseFactory, SubjectReader $subjectReader, Data $coreHelper, Logger $logger, UrlInterface $urlBuilder = null, OrderLinkFactory $orderLinkFactory = null, OrderRepository $orderRepository = null ) { $this->clientFactory = $clientFactory; $this->amazonSetOrderDetailsResponseFactory = $amazonSetOrderDetailsResponseFactory; $this->logger = $logger; $this->amazonCaptureResponseFactory = $amazonCaptureResponseFactory; $this->amazonAuthorizationResponseFactory = $amazonAuthorizationResponseFactory; $this->subjectReader = $subjectReader; $this->coreHelper = $coreHelper; $this->urlBuilder = $urlBuilder ?: ObjectManager::getInstance()->get(UrlInterface::class); $this->orderLinkFactory = $orderLinkFactory ?: ObjectManager::getInstance()->get(OrderLinkFactory::class); $this->orderRepository = $orderRepository ?: ObjectManager::getInstance()->get(OrderRepository::class); } /** * Sets Amazon Pay order data * * @param $storeId * @param $data * @return array */ public function setOrderReferenceDetails($storeId, $data) { $response = []; try { $responseParser = $this->clientFactory->create($storeId)->setOrderReferenceDetails($data); $constraints = $this->amazonSetOrderDetailsResponseFactory->create( [ 'response' => $responseParser ] ); $response = [ 'status' => $responseParser->response['Status'], 'constraints' => $constraints->getConstraints() ]; } catch (\Exception $e) { $log['error'] = $e->getMessage(); $this->logger->debug($log); } return $response; } /** * Confirms that payment has been created for Amazon Pay * * @param $storeId * @param $amazonOrderReferenceId * @return array */ private function confirmOrderReference($storeId, $amazonOrderReferenceId) { $response = []; $response = $this->clientFactory->create($storeId)->confirmOrderReference( [ 'amazon_order_reference_id' => $amazonOrderReferenceId, 'success_url' => $this->urlBuilder->getUrl('amazonpayments/payment/completecheckout'), 'failure_url' => $this->urlBuilder->getUrl('amazonpayments/payment/completecheckout') ] ); if (!$response) { $log['error'] = __('Unable to confirm order reference.'); $this->logger->debug($log); } return $response; } /** * @param $storeId * @param $data * @return \Amazon\Payment\Domain\AmazonAuthorizationResponse|\Amazon\Payment\Domain\Details\AmazonAuthorizationDetails */ private function getAuthorization($storeId, $data) { $response = null; $client = $this->clientFactory->create($storeId); $responseParser = $client->authorize($data); $response = $this->amazonAuthorizationResponseFactory->create(['response' => $responseParser]); return $response ? $response->getDetails() : $response; } /** * @param $amazonOrderReferenceId * @return \Magento\Sales\Api\Data\OrderInterface * @throws \Magento\Framework\Exception\InputException * @throws \Magento\Framework\Exception\NoSuchEntityException */ private function getOrderByReference($amazonOrderReferenceId) { $orderLink = $this->orderLinkFactory->create()->load($amazonOrderReferenceId, 'amazon_order_reference_id'); $orderId = $orderLink->getOrderId(); if ($orderId === null) { return null; } return $this->orderRepository->get($orderId); } /** * @param $data * @param bool $captureNow * @return array */ public function authorize($data, $captureNow = false, $attempts = 0) { $response = []; $order = $this->getOrderByReference($data['amazon_order_reference_id']); if ($order) { $storeId = $order->getStoreId(); } else { $storeId = $this->subjectReader->getStoreId(); } $authMode = $this->coreHelper->getAuthorizationMode('store', $storeId); (isset($data['additional_information']) && $data['additional_information'] != 'default') ? $additionalInformation = $data['additional_information'] : $additionalInformation = ''; if ($additionalInformation) { if ($additionalInformation == 'TransactionTimedOut') { $response['response_code'] = 'TransactionTimedOut'; } unset($data['additional_information']); } $authorizeData = [ 'amazon_order_reference_id' => $data['amazon_order_reference_id'], 'authorization_amount' => $data['amount'], 'currency_code' => $data['currency_code'], 'authorization_reference_id' => $data['amazon_order_reference_id'] . '-A' . time().$attempts, 'capture_now' => $captureNow, 'transaction_timeout' => 0 ]; if (isset($data['seller_authorization_note'])) { $authorizeData['seller_authorization_note'] = $data['seller_authorization_note']; } /** if first synchronous attempt failed, on second attempt try an asynchronous attempt. */ if ($authMode != 'synchronous' && $attempts) { $authorizeData['transaction_timeout'] = 1440; } $response['status'] = false; $response['attempts'] = $attempts; $response['auth_mode'] = $authMode; $response['constraints'] = []; $response['amazon_order_reference_id'] = $data['amazon_order_reference_id']; $authorizeResponse = $this->getAuthorization($storeId, $authorizeData); if ($authorizeResponse->getCaptureTransactionId() || $authorizeResponse->getAuthorizeTransactionId()) { $response['authorize_transaction_id'] = $authorizeResponse->getAuthorizeTransactionId(); if ($authorizeResponse->getStatus()->getState() == self::PENDING_CODE && $authMode == 'synchronous_possible') { if ($captureNow) { $response['capture_transaction_id'] = $authorizeResponse->getCaptureTransactionId(); } $response['response_code'] = 'TransactionTimedOut'; } elseif (!in_array($authorizeResponse->getStatus()->getState(), self::SUCCESS_CODES)) { $response['response_code'] = $authorizeResponse->getStatus()->getReasonCode(); if ($authMode == 'synchronous' && $authorizeResponse->getStatus()->getReasonCode() == 'TransactionTimedOut') { $cancelData = [ 'store_id' => $storeId, 'amazon_order_reference_id' => $data['amazon_order_reference_id'] ]; $this->clientFactory->create($storeId)->cancelOrderReference($cancelData); } } else { $response['status'] = true; if ($captureNow) { $response['capture_transaction_id'] = $authorizeResponse->getCaptureTransactionId(); } } } else { $response['status'] = false; $response['response_status'] = $authorizeResponse->getStatus()->getState(); $response['response_code'] = $authorizeResponse->getStatus()->getReasonCode(); $log['error'] = $authorizeResponse->getStatus()->getState() . ': ' . $authorizeResponse->getStatus()->getReasonCode(); $this->logger->debug($log); } if ($additionalInformation) { $response['sandbox'] = $additionalInformation; } return $response; } /** * @param array $data * @param string $storeId * @return array */ public function completeCapture($data, $storeId) { $response = [ 'status' => false ]; $responseParser = $this->clientFactory->create($storeId)->capture($data); if ($responseParser->response['Status'] == 200) { $captureResponse = $this->amazonCaptureResponseFactory->create(['response' => $responseParser]); $capture = $captureResponse->getDetails(); $captureCode = $capture->getStatus()->getState(); $successCodes = array_merge(self::SUCCESS_CODES, [self::PENDING_CODE]); if (in_array($captureCode, $successCodes)) { $response = [ 'status' => true, 'transaction_id' => $capture->getTransactionId(), 'pending' => $captureCode == self::PENDING_CODE, ]; } else { $response['response_code'] = $capture->getReasonCode(); } } else { $log['error'] = __('AmazonPaymentAdapter: Bad status - no capture details available.'); $this->logger->debug($log); } return $response; } /** * @param $storeId * @param $amazonId * @param $orderId */ public function setOrderAttributes($storeId, $amazonId, $orderId) { $orderAttributes = [ 'amazon_order_reference_id' => $amazonId, 'seller_order_id' => $orderId ]; $this->clientFactory->create($storeId)->setOrderAttributes($orderAttributes); } /** * @param $data * @return bool */ public function checkAuthorizationStatus($data) { $authorizeData = [ 'amazon_authorization_id' => $data['amazon_authorization_id'] ]; $storeId = $data['store_id']; $responseParser = $this->clientFactory->create($storeId)->getAuthorizationDetails($authorizeData); if ($responseParser->response['Status'] != 200) { $log['error'] = 'AmazonPaymentAdapter: Called getAuthorizationDetails and received bad status response: ' . $responseParser->response['Status']; $this->logger->debug($log); return false; } return true; } } amazon-pay-module/Model/Adapter/.htaccess000077700000000177151323541140014334 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/AddressManagement.php000077700000024131151323541140015245 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Core\Domain\AmazonAddressFactory; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Payment\Api\AddressManagementInterface; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Amazon\Payment\Helper\Address; use Amazon\Payment\Domain\AmazonOrderStatus; use Amazon\Payment\Domain\AmazonAuthorizationStatus; use Exception; use Magento\Checkout\Model\Session; use Magento\Customer\Model\AddressFactory; use Magento\Directory\Model\ResourceModel\Country\CollectionFactory; use Magento\Framework\Exception\SessionException; use Magento\Framework\Validator\Exception as ValidatorException; use Magento\Framework\Validator\Factory; use Magento\Framework\Webapi\Exception as WebapiException; use Magento\Quote\Model\Quote; use AmazonPay\ResponseInterface; use Psr\Log\LoggerInterface; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AddressManagement implements AddressManagementInterface { /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var Address */ private $addressHelper; /** * @var QuoteLinkInterfaceFactory */ private $quoteLinkFactory; /** * @var Session */ private $session; /** * @var CollectionFactory */ private $countryCollectionFactory; /** * @var AmazonAddressFactory */ private $amazonAddressFactory; /** * @var Factory */ private $validatorFactory; /** * @var LoggerInterface */ private $logger; /** * @var AddressFactory */ private $addressFactory; /** * @param ClientFactoryInterface $clientFactory * @param Address $addressHelper * @param QuoteLinkInterfaceFactory $quoteLinkFactory * @param Session $session * @param CollectionFactory $countryCollectionFactory * @param AmazonAddressFactory $amazonAddressFactory * @param Factory $validatorFactory * @param LoggerInterface $logger * @param AddressFactory $addressFactory */ public function __construct( ClientFactoryInterface $clientFactory, Address $addressHelper, QuoteLinkInterfaceFactory $quoteLinkFactory, Session $session, CollectionFactory $countryCollectionFactory, AmazonAddressFactory $amazonAddressFactory, Factory $validatorFactory, LoggerInterface $logger, AddressFactory $addressFactory ) { $this->clientFactory = $clientFactory; $this->addressHelper = $addressHelper; $this->quoteLinkFactory = $quoteLinkFactory; $this->session = $session; $this->countryCollectionFactory = $countryCollectionFactory; $this->amazonAddressFactory = $amazonAddressFactory; $this->validatorFactory = $validatorFactory; $this->logger = $logger; $this->addressFactory = $addressFactory; } /** * {@inheritdoc} */ public function getShippingAddress($amazonOrderReferenceId, $addressConsentToken) { try { $data = $this->getOrderReferenceDetails($amazonOrderReferenceId, $addressConsentToken); if ($this->isSuspendedStatus($data)) { throw new WebapiException(__('There has been a problem with the selected payment method on your ' . 'Amazon account. Please choose another one.')); } $this->updateQuoteLink($amazonOrderReferenceId); if (isset($data['OrderReferenceDetails']['Destination']['PhysicalDestination'])) { $shippingAddress = $data['OrderReferenceDetails']['Destination']['PhysicalDestination']; if (!isset($shippingAddress['Phone']) || empty($shippingAddress['Phone'])) { $shippingAddress['Phone'] = '000-000-0000'; } return $this->convertToMagentoAddress($shippingAddress, true); } throw new Exception(); } catch (SessionException $e) { throw $e; } catch (WebapiException $e) { throw $e; } catch (ValidatorException $e) { throw $e; } catch (Exception $e) { $this->logger->error($e); $this->throwUnknownErrorException(); } } /** * {@inheritdoc} */ public function getBillingAddress($amazonOrderReferenceId, $addressConsentToken) { try { $data = $this->getOrderReferenceDetails($amazonOrderReferenceId, $addressConsentToken); $this->updateQuoteLink($amazonOrderReferenceId); // Re-open suspended InvalidPaymentMethod decline during ConfirmOrderReference $this->session->setData('is_amazon_suspended', $this->isSuspendedStatus($data)); if (isset($data['OrderReferenceDetails']['BillingAddress']['PhysicalAddress'])) { $billingAddress = $data['OrderReferenceDetails']['BillingAddress']['PhysicalAddress']; if (!isset($billingAddress['Phone']) || !$billingAddress['Phone']) { $billingAddress['Phone'] = '000-000-0000'; } return $this->convertToMagentoAddress($billingAddress); } elseif (isset($data['OrderReferenceDetails']['Destination']['PhysicalDestination'])) { $billingAddress = $data['OrderReferenceDetails']['Destination']['PhysicalDestination']; return $this->convertToMagentoAddress($billingAddress); } throw new Exception(); } catch (WebapiException $e) { throw $e; } catch (Exception $e) { $this->throwUnknownErrorException(); } } protected function throwUnknownErrorException() { throw new WebapiException( __('Amazon could not process your request.'), 0, WebapiException::HTTP_INTERNAL_ERROR ); } protected function convertToMagentoAddress(array $address, $isShippingAddress = false) { $amazonAddress = $this->amazonAddressFactory->create(['address' => $address]); $magentoAddress = $this->addressHelper->convertToMagentoEntity($amazonAddress); if ($isShippingAddress) { $validator = $this->validatorFactory->createValidator('amazon_address', 'on_select'); if (! $validator->isValid($magentoAddress)) { throw new ValidatorException(null, null, [$validator->getMessages()]); } $countryCollection = $this->countryCollectionFactory->create(); $collectionSize = $countryCollection->loadByStore() ->addFieldToFilter('country_id', ['eq' => $magentoAddress->getCountryId()]) ->setPageSize(1) ->setCurPage(1) ->getSize(); if (1 != $collectionSize) { throw new WebapiException(__('the country for your address is not allowed for this store')); } // Validate address $validate = $this->addressFactory->create()->updateData($magentoAddress)->validate(); if (is_array($validate)) { $validate[] = __('Your address may be updated in your Amazon account.'); throw new ValidatorException(null, null, [$validate]); } } return [$this->addressHelper->convertToArray($magentoAddress)]; } protected function getOrderReferenceDetails($amazonOrderReferenceId, $addressConsentToken) { $client = $this->clientFactory->create(); /** * @var ResponseInterface $response */ $response = $client->getOrderReferenceDetails( [ 'amazon_order_reference_id' => $amazonOrderReferenceId, 'address_consent_token' => $addressConsentToken ] ); $data = $response->toArray(); if (200 != $data['ResponseStatus'] || ! isset($data['GetOrderReferenceDetailsResult'])) { throw new AmazonServiceUnavailableException(); } return $data['GetOrderReferenceDetailsResult']; } protected function updateQuoteLink($amazonOrderReferenceId) { $quote = $this->session->getQuote(); if (! $quote->getId()) { throw new SessionException(__('Your session has expired, please reload the page and try again.')); } $quoteLink = $this->quoteLinkFactory->create()->load($quote->getId(), 'quote_id'); if ($quoteLink->getAmazonOrderReferenceId() != $amazonOrderReferenceId) { $quoteLink ->setAmazonOrderReferenceId($amazonOrderReferenceId) ->setQuoteId($quote->getId()) ->setConfirmed(false) ->save(); } } protected function isSuspendedStatus($data) { $orderStatus = $data['OrderReferenceDetails']['OrderReferenceStatus'] ?? false; return $orderStatus && $orderStatus['State'] == AmazonOrderStatus::STATE_SUSPENDED; } } amazon-pay-module/Model/PaymentManagement/Capture.php000077700000023650151323541140016705 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\PaymentManagement; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Amazon\Payment\Api\Data\PendingCaptureInterfaceFactory; use Amazon\Payment\Model\PaymentManagement\Capture; use Amazon\Payment\Model\PaymentManagement; use Amazon\Payment\Domain\AmazonCaptureDetailsResponseFactory; use Amazon\Payment\Domain\AmazonCaptureStatus; use Amazon\Payment\Domain\Details\AmazonCaptureDetails; use Exception; use Magento\Backend\Model\UrlInterface; use Magento\Framework\Api\SearchCriteriaBuilderFactory; use Magento\Framework\Notification\NotifierInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\OrderPaymentInterface; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Sales\Api\InvoiceRepositoryInterface; use Magento\Sales\Api\OrderPaymentRepositoryInterface; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Store\Model\StoreManagerInterface; use Psr\Log\LoggerInterface; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Capture extends AbstractOperation { /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var PendingCaptureInterfaceFactory */ private $pendingCaptureFactory; /** * @var AmazonCaptureDetailsResponseFactory */ private $amazonCaptureDetailsResponseFactory; /** * @var OrderPaymentRepositoryInterface */ private $orderPaymentRepository; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var TransactionRepositoryInterface */ private $transactionRepository; /** * @var StoreManagerInterface */ private $storeManager; /** * @var PaymentManagement */ private $paymentManagement; /** * @var LoggerInterface */ private $logger; /** * @var bool */ private $throwExceptions = false; /** * Capture constructor. * * @param NotifierInterface $notifier * @param UrlInterface $urlBuilder * @param SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory * @param InvoiceRepositoryInterface $invoiceRepository * @param ClientFactoryInterface $clientFactory * @param PendingCaptureInterfaceFactory $pendingCaptureFactory * @param AmazonCaptureDetailsResponseFactory $amazonCaptureDetailsResponseFactory * @param OrderPaymentRepositoryInterface $orderPaymentRepository * @param OrderRepositoryInterface $orderRepository * @param TransactionRepositoryInterface $transactionRepository * @param StoreManagerInterface $storeManager * @param PaymentManagement $paymentManagement * @param LoggerInterface $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( NotifierInterface $notifier, UrlInterface $urlBuilder, SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory, InvoiceRepositoryInterface $invoiceRepository, ClientFactoryInterface $clientFactory, PendingCaptureInterfaceFactory $pendingCaptureFactory, AmazonCaptureDetailsResponseFactory $amazonCaptureDetailsResponseFactory, OrderPaymentRepositoryInterface $orderPaymentRepository, OrderRepositoryInterface $orderRepository, TransactionRepositoryInterface $transactionRepository, StoreManagerInterface $storeManager, PaymentManagement $paymentManagement, LoggerInterface $logger ) { $this->clientFactory = $clientFactory; $this->pendingCaptureFactory = $pendingCaptureFactory; $this->amazonCaptureDetailsResponseFactory = $amazonCaptureDetailsResponseFactory; $this->orderPaymentRepository = $orderPaymentRepository; $this->orderRepository = $orderRepository; $this->transactionRepository = $transactionRepository; $this->storeManager = $storeManager; $this->paymentManagement = $paymentManagement; $this->logger = $logger; parent::__construct($notifier, $urlBuilder, $searchCriteriaBuilderFactory, $invoiceRepository); } /** * {@inheritdoc} */ public function setThrowExceptions($throwExceptions) { $this->throwExceptions = $throwExceptions; return $this; } /** * {@inheritdoc} */ public function updateCapture($pendingCaptureId, AmazonCaptureDetails $captureDetails = null) { try { $pendingCapture = $this->pendingCaptureFactory->create(); $pendingCapture->getResource()->beginTransaction(); $pendingCapture->setLockOnLoad(true); $pendingCapture->load($pendingCaptureId); if ($pendingCapture->getCaptureId()) { $order = $this->orderRepository->get($pendingCapture->getOrderId()); $payment = $this->orderPaymentRepository->get($pendingCapture->getPaymentId()); $order->setPayment($payment); $order->setData(OrderInterface::PAYMENT, $payment); $storeId = $order->getStoreId(); $this->storeManager->setCurrentStore($storeId); if (null === $captureDetails) { $responseParser = $this->clientFactory->create($storeId)->getCaptureDetails( [ 'amazon_capture_id' => $pendingCapture->getCaptureId() ] ); $response = $this->amazonCaptureDetailsResponseFactory->create(['response' => $responseParser]); $captureDetails = $response->getDetails(); } $this->processUpdateCaptureResponse($captureDetails, $pendingCapture, $payment, $order); } $pendingCapture->getResource()->commit(); } catch (Exception $e) { $this->logger->error($e); $pendingCapture->getResource()->rollBack(); if ($this->throwExceptions) { throw $e; } } } protected function processUpdateCaptureResponse( AmazonCaptureDetails $details, PendingCaptureInterface $pendingCapture, OrderPaymentInterface $payment, OrderInterface $order ) { $status = $details->getStatus(); switch ($status->getState()) { case AmazonCaptureStatus::STATE_COMPLETED: $this->completePendingCapture($pendingCapture, $payment, $order); break; case AmazonCaptureStatus::STATE_DECLINED: $this->declinePendingCapture($pendingCapture, $payment, $order); break; } } protected function completePendingCapture( PendingCaptureInterface $pendingCapture, OrderPaymentInterface $payment, OrderInterface $order ) { $transactionId = $pendingCapture->getCaptureId(); $transaction = $this->paymentManagement->getTransaction($transactionId, $payment, $order); $invoice = $this->getInvoice($transactionId, $order); $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getGrandTotal()) .']'; } $message = __('Captured amount of %1 online', $formattedAmount); $this->getInvoiceAndSetPaid($transactionId, $order); $payment->setDataUsingMethod('base_amount_paid_online', $invoice->getBaseGrandTotal()); $this->setProcessing($order); $payment->addTransactionCommentsToOrder($transaction, $message); $order->save(); $this->paymentManagement->closeTransaction($transactionId, $payment, $order); $pendingCapture->delete(); } protected function declinePendingCapture( PendingCaptureInterface $pendingCapture, OrderPaymentInterface $payment, OrderInterface $order ) { $transactionId = $pendingCapture->getCaptureId(); $transaction = $this->paymentManagement->getTransaction($transactionId, $payment, $order); $invoice = $this->getInvoice($transactionId, $order); $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getGrandTotal()) .']'; } $message = __('Declined amount of %1 online', $formattedAmount); $this->getInvoiceAndSetCancelled($transactionId, $order); $this->setOnHold($order); $payment->addTransactionCommentsToOrder($transaction, $message); $order->save(); $this->paymentManagement->closeTransaction($transactionId, $payment, $order); $pendingCapture->delete(); $this->addCaptureDeclinedNotice($order); } } amazon-pay-module/Model/PaymentManagement/Authorization.php000077700000053616151323541140020147 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\PaymentManagement; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Api\Data\PendingAuthorizationInterfaceFactory; use Amazon\Payment\Model\Adapter\AmazonPaymentAdapter; use Amazon\Payment\Model\PaymentManagement; use Amazon\Payment\Domain\AmazonAuthorizationDetailsResponseFactory; use Amazon\Payment\Domain\AmazonGetOrderDetailsResponseFactory; use Amazon\Payment\Domain\AmazonOrderStatus; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetails; use Amazon\Payment\Domain\Details\AmazonOrderDetails; use Amazon\Payment\Domain\Validator\AmazonAuthorization; use Amazon\Payment\Exception\SoftDeclineException; use Exception; use Magento\Backend\Model\UrlInterface; use Magento\Framework\Api\SearchCriteriaBuilderFactory; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Notification\NotifierInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\OrderPaymentInterface; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Sales\Api\InvoiceRepositoryInterface; use Magento\Sales\Api\OrderPaymentRepositoryInterface; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Sales\Model\Order\Payment\Transaction; use Magento\Store\Model\StoreManagerInterface; use Psr\Log\LoggerInterface; use Amazon\Payment\Exception\TransactionTimeoutException; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Authorization extends AbstractOperation { /** * @var PendingAuthorizationInterfaceFactory */ private $pendingAuthorizationFactory; /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var AmazonAuthorizationDetailsResponseFactory */ private $amazonAuthorizationDetailsResponseFactory; /** * @var AmazonAuthorization */ private $amazonAuthorizationValidator; /** * @var OrderPaymentRepositoryInterface */ private $orderPaymentRepository; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var ManagerInterface */ private $eventManager; /** * @var AmazonGetOrderDetailsResponseFactory */ private $amazonGetOrderDetailsResponseFactory; /** * @var PaymentManagement */ private $paymentManagement; /** * @var LoggerInterface */ private $logger; /** * @var bool */ private $throwExceptions = false; private $amazonPaymentAdapter; /** * Authorization constructor. * * @param NotifierInterface $notifier * @param UrlInterface $urlBuilder * @param SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory * @param InvoiceRepositoryInterface $invoiceRepository * @param ClientFactoryInterface $clientFactory * @param PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory * @param AmazonAuthorizationDetailsResponseFactory $amazonAuthorizationDetailsResponseFactory * @param AmazonAuthorization $amazonAuthorizationValidator * @param OrderPaymentRepositoryInterface $orderPaymentRepository * @param OrderRepositoryInterface $orderRepository * @param ManagerInterface $eventManager * @param AmazonGetOrderDetailsResponseFactory $amazonGetOrderDetailsResponseFactory * @param PaymentManagement $paymentManagement * @param LoggerInterface $logger * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( NotifierInterface $notifier, UrlInterface $urlBuilder, SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory, InvoiceRepositoryInterface $invoiceRepository, ClientFactoryInterface $clientFactory, PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory, AmazonAuthorizationDetailsResponseFactory $amazonAuthorizationDetailsResponseFactory, AmazonAuthorization $amazonAuthorizationValidator, OrderPaymentRepositoryInterface $orderPaymentRepository, OrderRepositoryInterface $orderRepository, ManagerInterface $eventManager, AmazonGetOrderDetailsResponseFactory $amazonGetOrderDetailsResponseFactory, PaymentManagement $paymentManagement, LoggerInterface $logger, AmazonPaymentAdapter $adapter ) { $this->clientFactory = $clientFactory; $this->pendingAuthorizationFactory = $pendingAuthorizationFactory; $this->amazonAuthorizationDetailsResponseFactory = $amazonAuthorizationDetailsResponseFactory; $this->amazonAuthorizationValidator = $amazonAuthorizationValidator; $this->orderPaymentRepository = $orderPaymentRepository; $this->orderRepository = $orderRepository; $this->eventManager = $eventManager; $this->amazonGetOrderDetailsResponseFactory = $amazonGetOrderDetailsResponseFactory; $this->paymentManagement = $paymentManagement; $this->logger = $logger; $this->amazonPaymentAdapter = $adapter; parent::__construct($notifier, $urlBuilder, $searchCriteriaBuilderFactory, $invoiceRepository); } /** * {@inheritdoc} */ public function setThrowExceptions($throwExceptions) { $this->throwExceptions = $throwExceptions; return $this; } /** * {@inheritdoc} */ public function updateAuthorization( $pendingAuthorizationId, AmazonAuthorizationDetails $authorizationDetails = null, AmazonOrderDetails $orderDetails = null ) { try { $pendingAuthorization = $this->pendingAuthorizationFactory->create(); $pendingAuthorization->getResource()->beginTransaction(); $pendingAuthorization->setLockOnLoad(true); $pendingAuthorization->load($pendingAuthorizationId); if ($pendingAuthorization->getOrderId()) { if ($pendingAuthorization->isProcessed()) { $this->processNewAuthorization($pendingAuthorization, $orderDetails); } else { $this->processUpdateAuthorization($pendingAuthorization, $authorizationDetails); } } $pendingAuthorization->getResource()->commit(); } catch (Exception $e) { $this->logger->error($e); $pendingAuthorization->getResource()->rollBack(); if ($this->throwExceptions) { throw $e; } } } /** * Processes Authorization during cron * * @param PendingAuthorizationInterface $pendingAuthorization * @param AmazonAuthorizationDetails|null $authorizationDetails * @throws TransactionTimeoutException * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function processUpdateAuthorization( PendingAuthorizationInterface $pendingAuthorization, AmazonAuthorizationDetails $authorizationDetails = null ) { $order = $this->orderRepository->get($pendingAuthorization->getOrderId()); $payment = $this->orderPaymentRepository->get($pendingAuthorization->getPaymentId()); $order->setPayment($payment); $order->setData(OrderInterface::PAYMENT, $payment); $storeId = $order->getStoreId(); $authorizationId = $pendingAuthorization->getAuthorizationId(); if (null === $authorizationDetails) { $responseParser = $this->clientFactory->create($storeId)->getAuthorizationDetails( [ 'amazon_authorization_id' => $authorizationId ] ); $response = $this->amazonAuthorizationDetailsResponseFactory->create(['response' => $responseParser]); $authorizationDetails = $response->getDetails(); } $capture = $authorizationDetails->hasCapture(); $validation = $this->amazonAuthorizationValidator->validate($authorizationDetails); if (isset($validation['result'])) { if ($validation['result'] && !$authorizationDetails->isPending()) { $this->completePendingAuthorization($order, $payment, $pendingAuthorization, $capture); } else { if (!$validation['result']) { switch ($validation['reason']) { case 'temporary': $this->resubmitPendingAuthorization($order, $payment, $pendingAuthorization, $capture); break; case 'hard_decline': $this->hardDeclinePendingAuthorization($order, $payment, $pendingAuthorization, $capture); break; case 'soft_decline': $this->softDeclinePendingAuthorization($order, $payment, $pendingAuthorization, $capture); break; } } } } } /** * Updates pending authorization during cron job * * @param OrderInterface $order * @param OrderPaymentInterface $payment * @param PendingAuthorizationInterface $pendingAuthorization * @param $capture * @param TransactionInterface|null $newTransaction * @throws Exception * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function completePendingAuthorization( OrderInterface $order, OrderPaymentInterface $payment, PendingAuthorizationInterface $pendingAuthorization, $capture, TransactionInterface $newTransaction = null ) { $transactionId = ($capture) ? $pendingAuthorization->getCaptureId() : $pendingAuthorization->getAuthorizationId(); $this->setProcessing($order); if ($capture) { $invoice = $this->getInvoiceAndSetPaid($transactionId, $order); if (!$newTransaction) { $this->paymentManagement->closeTransaction($transactionId, $payment, $order); } else { $invoice->setTransactionId($newTransaction->getTxnId()); } $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getGrandTotal()) .']'; } $message = __('Captured amount of %1 online', $formattedAmount); $payment->setDataUsingMethod( 'base_amount_paid_online', $payment->formatAmount($invoice->getBaseGrandTotal()) ); } else { $formattedAmount = $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getAmountOrdered()) .']'; } $message = __('Authorized amount of %1', $formattedAmount); } $transaction = ($newTransaction) ?: $this->paymentManagement->getTransaction($transactionId, $payment, $order); $payment->addTransactionCommentsToOrder($transaction, $message); $pendingAuthorization->delete(); $order->save(); } /** * Handles reauthorization in the case of a soft failure * * @param OrderInterface $order * @param OrderPaymentInterface $payment * @param PendingAuthorizationInterface $pendingAuthorization * @param $capture * @throws Exception * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function resubmitPendingAuthorization( OrderInterface $order, OrderPaymentInterface $payment, PendingAuthorizationInterface $pendingAuthorization, $capture ) { $transactionId = ($capture) ? $pendingAuthorization->getCaptureId() : $pendingAuthorization->getAuthorizationId(); if ($capture) { $invoice = $this->getInvoice($transactionId, $order); $this->setPaymentReview($order); $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); } else { $formattedAmount = $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()); } $this->paymentManagement->closeTransaction($transactionId, $payment, $order); $this->processNewAuthorization($pendingAuthorization); $pendingAuthorization->setProcessed(true); $pendingAuthorization->save(); $order->save(); } /** * Handles authorization soft decline during cron * * @param OrderInterface $order * @param OrderPaymentInterface $payment * @param PendingAuthorizationInterface $pendingAuthorization * @param $capture * @throws Exception * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function softDeclinePendingAuthorization( OrderInterface $order, OrderPaymentInterface $payment, PendingAuthorizationInterface $pendingAuthorization, $capture ) { $transactionId = ($capture) ? $pendingAuthorization->getCaptureId() : $pendingAuthorization->getAuthorizationId(); if ($capture) { $invoice = $this->getInvoice($transactionId, $order); $this->setPaymentReview($order); $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getGrandTotal()) .']'; } } else { $formattedAmount = $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getAmountOrdered()) .']'; } } $message = __('Declined amount of %1 online', $formattedAmount); $transaction = $this->paymentManagement->getTransaction($transactionId, $payment, $order); $payment->addTransactionCommentsToOrder($transaction, $message); $this->paymentManagement->closeTransaction($transactionId, $payment, $order); $pendingAuthorization->setProcessed(true); $pendingAuthorization->save(); $order->save(); $this->eventManager->dispatch( 'amazon_payment_pending_authorization_soft_decline_after', [ 'order' => $order, 'pendingAuthorization' => $pendingAuthorization, ] ); } /** * Handles hard decline during cron * @param OrderInterface $order * @param OrderPaymentInterface $payment * @param PendingAuthorizationInterface $pendingAuthorization * @param $capture * @throws Exception * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function hardDeclinePendingAuthorization( OrderInterface $order, OrderPaymentInterface $payment, PendingAuthorizationInterface $pendingAuthorization, $capture ) { $transactionId = ($capture) ? $pendingAuthorization->getCaptureId() : $pendingAuthorization->getAuthorizationId(); if ($capture) { $invoice = $this->getInvoiceAndSetCancelled($transactionId, $order); $formattedAmount = $order->getBaseCurrency()->formatTxt($invoice->getBaseGrandTotal()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getGrandTotal()) .']'; } $this->addCaptureDeclinedNotice($order); } else { $formattedAmount = $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getAmountOrdered()) .']'; } } $message = __('Declined amount of %1 online', $formattedAmount); $this->setOnHold($order); $transaction = $this->paymentManagement->getTransaction($transactionId, $payment, $order); $payment->addTransactionCommentsToOrder($transaction, $message); $this->paymentManagement->closeTransaction($transactionId, $payment, $order); $pendingAuthorization->delete(); $order->save(); $this->eventManager->dispatch( 'amazon_payment_pending_authorization_hard_decline_after', [ 'order' => $order, 'pendingAuthorization' => $pendingAuthorization, ] ); } /** * Processes new authorization during cron * * @param PendingAuthorizationInterface $pendingAuthorization * @param AmazonOrderDetails|null $orderDetails * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function processNewAuthorization( PendingAuthorizationInterface $pendingAuthorization, AmazonOrderDetails $orderDetails = null ) { $order = $this->orderRepository->get($pendingAuthorization->getOrderId()); $payment = $this->orderPaymentRepository->get($pendingAuthorization->getPaymentId()); $order->setPayment($payment); $order->setData(OrderInterface::PAYMENT, $payment); $storeId = $order->getStoreId(); if (null === $orderDetails) { $responseParser = $this->clientFactory->create($storeId)->getOrderReferenceDetails( [ 'amazon_order_reference_id' => $order->getExtensionAttributes() ->getAmazonOrderReferenceId() ->getAmazonOrderReferenceId() ] ); $response = $this->amazonGetOrderDetailsResponseFactory->create(['response' => $responseParser]); $orderDetails = $response->getDetails(); } if (AmazonOrderStatus::STATE_OPEN == $orderDetails->getStatus()->getState()) { $capture = $pendingAuthorization->isCapture(); $this->requestNewAuthorization($order, $payment, $pendingAuthorization, $capture); } } /** * Attempts to request new authorization during cron for pending authorization items. * * @param OrderInterface $order * @param OrderPaymentInterface $payment * @param PendingAuthorizationInterface $pendingAuthorization * @param $capture * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function requestNewAuthorization( OrderInterface $order, OrderPaymentInterface $payment, PendingAuthorizationInterface $pendingAuthorization, $capture = false ) { try { if ($capture) { $invoice = $this->getInvoice($pendingAuthorization->getCaptureId(), $order); $baseAmount = $payment->formatAmount($invoice->getBaseGrandTotal()); } else { $baseAmount = $payment->formatAmount($payment->getBaseAmountAuthorized()); } $data = [ 'amazon_order_reference_id' => $order->getExtensionAttributes() ->getAmazonOrderReferenceId() ->getAmazonOrderReferenceId(), 'amount' => $baseAmount, 'currency_code' => $order->getOrderCurrencyCode() ]; $response = $this->amazonPaymentAdapter->authorize($data, $capture, 1); if ($response['response_code'] != 'TransactionTimedOut') { throw new Exception('Unexpected Authorization status for asynchronous authorization'); } $newAuthorization = $this->pendingAuthorizationFactory->create() ->setAuthorizationId($response['authorize_transaction_id']) ->setCapture($capture); if ($capture) { $newAuthorization->setCaptureId($response['capture_transaction_id']); $invoice->setTransactionId($response['capture_transaction_id']) ->save(); $payment->setTransactionId($response['capture_transaction_id']); $payment->setParentTransactionId($response['authorize_transaction_id']); $payment->addTransaction(Transaction::TYPE_CAPTURE, $invoice, true) ->save(); } else { $payment->setTransactionId($response['authorize_transaction_id']); $payment->addTransaction(Transaction::TYPE_AUTH, null, true) ->save(); } $payment->save(); $newAuthorization->save(); $pendingAuthorization->delete(); } catch (\Exception $e) { $this->hardDeclinePendingAuthorization($order, $payment, $pendingAuthorization, $capture); } } } amazon-pay-module/Model/PaymentManagement/AbstractOperation.php000077700000012034151323541140020720 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\PaymentManagement; use Magento\Backend\Model\UrlInterface; use Magento\Framework\Api\SearchCriteriaBuilderFactory; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Notification\NotifierInterface; use Magento\Payment\Model\InfoInterface as PaymentInfoInterface; use Magento\Sales\Api\Data\InvoiceInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\OrderPaymentInterface; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Sales\Api\InvoiceRepositoryInterface; use Magento\Sales\Api\OrderPaymentRepositoryInterface; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Payment\Transaction; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractOperation { /** * @var SearchCriteriaBuilderFactory */ private $searchCriteriaBuilderFactory; /** * @var UrlInterface */ private $urlBuilder; /** * @var NotifierInterface */ private $notifier; /** * @var InvoiceRepositoryInterface */ private $invoiceRepository; public function __construct( NotifierInterface $notifier, UrlInterface $urlBuilder, SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory, InvoiceRepositoryInterface $invoiceRepository ) { $this->notifier = $notifier; $this->urlBuilder = $urlBuilder; $this->searchCriteriaBuilderFactory = $searchCriteriaBuilderFactory; $this->invoiceRepository = $invoiceRepository; } protected function getInvoice($transactionId, OrderInterface $order) { $searchCriteriaBuilder = $this->searchCriteriaBuilderFactory->create(); $searchCriteriaBuilder->addFilter( InvoiceInterface::TRANSACTION_ID, $transactionId ); $searchCriteriaBuilder->addFilter( InvoiceInterface::ORDER_ID, $order->getId() ); $searchCriteria = $searchCriteriaBuilder ->setPageSize(1) ->setCurrentPage(1) ->create(); $invoiceList = $this->invoiceRepository->getList($searchCriteria); if (count($items = $invoiceList->getItems())) { $invoice = current($items); $invoice->setOrder($order); return $invoice; } throw new NoSuchEntityException(); } protected function getInvoiceAndSetPaid($transactionId, OrderInterface $order) { $invoice = $this->getInvoice($transactionId, $order); $invoice->pay(); $order->addRelatedObject($invoice); return $invoice; } protected function getInvoiceAndSetCancelled($transactionId, OrderInterface $order) { $invoice = $this->getInvoice($transactionId, $order); $invoice->cancel(); $order->addRelatedObject($invoice); return $invoice; } protected function setOnHold(OrderInterface $order) { $this->setOrderState($order, Order::STATE_HOLDED); } protected function setProcessing(OrderInterface $order) { $this->setOrderState($order, Order::STATE_PROCESSING); } protected function setPaymentReview(OrderInterface $order) { $this->setOrderState($order, Order::STATE_PAYMENT_REVIEW); } protected function setOrderState(OrderInterface $order, $state) { $status = $order->getConfig()->getStateDefaultStatus($state); $order->setState($state)->setStatus($status); } protected function addCaptureDeclinedNotice(OrderInterface $order) { $orderUrl = $this->urlBuilder->getUrl('sales/order/view', ['order_id' => $order->getId()]); $this->notifier->addNotice( __('Capture declined'), __('Capture declined for Order #%1', $order->getIncrementId()), $orderUrl ); } } amazon-pay-module/Model/PaymentManagement/.htaccess000077700000000177151323541140016366 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/PendingAuthorization.php000077700000014172151323541140016034 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Model\ResourceModel\PendingAuthorization as PendingAuthorizationResourceModel; use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\Context; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Registry; use Magento\Framework\Stdlib\DateTime\DateTimeFactory; use Magento\Sales\Api\Data\OrderInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingAuthorization extends AbstractModel implements PendingAuthorizationInterface { /** * @var DateTimeFactory */ private $dateFactory; /** * @var boolean */ private $lockOnLoad = false; /** * PendingCapture constructor. * * @param Context $context * @param Registry $registry * @param DateTimeFactory $dateFactory * @param AbstractResource|null $resource * @param AbstractDb|null $resourceCollection * @param array $data */ public function __construct( Context $context, Registry $registry, DateTimeFactory $dateFactory, AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [] ) { parent::__construct( $context, $registry, $resource, $resourceCollection, $data ); $this->dateFactory = $dateFactory; } /** * {@inheritDoc} */ protected function _construct() { $this->_init(PendingAuthorizationResourceModel::class); } /** * {@inheritDoc} */ public function getOrderId() { return $this->getData(PendingAuthorizationInterface::ORDER_ID); } /** * {@inheritDoc} */ public function setOrderId($orderId) { return $this->setData(PendingAuthorizationInterface::ORDER_ID, $orderId); } /** * {@inheritDoc} */ public function getAuthorizationId() { return $this->getData(PendingAuthorizationInterface::AUTHORIZATION_ID); } /** * {@inheritDoc} */ public function setAuthorizationId($authorizationId) { return $this->setData(PendingAuthorizationInterface::AUTHORIZATION_ID, $authorizationId); } /** * {@inheritDoc} */ public function getCaptureId() { return $this->getData(PendingAuthorizationInterface::CAPTURE_ID); } /** * {@inheritDoc} */ public function setCaptureId($captureId) { return $this->setData(PendingAuthorizationInterface::CAPTURE_ID, $captureId); } /** * {@inheritDoc} */ public function getPaymentId() { return $this->getData(PendingAuthorizationInterface::PAYMENT_ID); } /** * {@inheritDoc} */ public function setPaymentId($paymentId) { return $this->setData(PendingAuthorizationInterface::PAYMENT_ID, $paymentId); } /** * {@inheritDoc} */ public function isCapture() { return (bool)$this->getData(PendingAuthorizationInterface::CAPTURE); } /** * {@inheritDoc} */ public function setCapture($capture) { return $this->setData(PendingAuthorizationInterface::CAPTURE, $capture); } /** * {@inheritDoc} */ public function isProcessed() { return (bool)$this->getData(PendingAuthorizationInterface::PROCESSED); } /** * {@inheritDoc} */ public function setProcessed($processed) { return $this->setData(PendingAuthorizationInterface::PROCESSED, $processed); } /** * {@inheritDoc} */ public function setCreatedAt($createdAt) { return $this->setData(PendingAuthorizationInterface::CREATED_AT, $createdAt); } /** * {@inheritDoc} */ public function getCreatedAt() { return $this->getData(PendingAuthorizationInterface::CREATED_AT); } /** * {@inheritDoc} */ public function setUpdatedAt($updatedAt) { return $this->setData(PendingAuthorizationInterface::UPDATED_AT, $updatedAt); } /** * {@inheritDoc} */ public function getUpdatedAt() { return $this->getData(PendingAuthorizationInterface::UPDATED_AT); } /** * {@inheritDoc} */ public function setOrder(OrderInterface $order) { $this->setOrderId($order->getId()); $this->setPaymentId($order->getPayment()->getId()); return $this; } /** * {@inheritDoc} */ public function beforeSave() { if (! $this->getId()) { $this->setCreatedAt($this->dateFactory->create()->gmtDate()); } $this->setUpdatedAt($this->dateFactory->create()->gmtDate()); return parent::beforeSave(); } /** * {@inheritDoc} */ public function setLockOnLoad($lockOnLoad) { $this->lockOnLoad = $lockOnLoad; return $this; } /** * {@inheritDoc} */ public function hasLockOnLoad() { return $this->lockOnLoad; } } amazon-pay-module/Model/PendingRefund.php000077700000010443151323541140014414 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Model\ResourceModel\PendingRefund as PendingRefundResourceModel; use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\Context; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Registry; use Magento\Framework\Stdlib\DateTime\DateTimeFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingRefund extends AbstractModel implements PendingRefundInterface { /** * @var DateTimeFactory */ private $dateFactory; /** * @var boolean */ private $lockOnLoad = false; /** * @param Context $context * @param Registry $registry * @param DateTimeFactory $dateFactory * @param AbstractResource|null $resource * @param AbstractDb|null $resourceCollection * @param array $data */ public function __construct( Context $context, Registry $registry, DateTimeFactory $dateFactory, AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [] ) { parent::__construct( $context, $registry, $resource, $resourceCollection, $data ); $this->dateFactory = $dateFactory; } /** * {@inheritDoc} */ protected function _construct() { $this->_init(PendingRefundResourceModel::class); } /** * {@inheritDoc} */ public function getRefundId() { return $this->getData(PendingRefundInterface::REFUND_ID); } /** * {@inheritDoc} */ public function setRefundId($refundId) { return $this->setData(PendingRefundInterface::REFUND_ID, $refundId); } /** * {@inheritDoc} */ public function getOrderId() { return $this->getData(PendingRefundInterface::ORDER_ID); } /** * {@inheritDoc} */ public function setOrderId($orderId) { return $this->setData(PendingRefundInterface::ORDER_ID, $orderId); } /** * {@inheritDoc} */ public function getPaymentId() { return $this->getData(PendingRefundInterface::PAYMENT_ID); } /** * {@inheritDoc} */ public function setPaymentId($paymentId) { return $this->setData(PendingRefundInterface::PAYMENT_ID, $paymentId); } /** * {@inheritDoc} */ public function setCreatedAt($createdAt) { return $this->setData(PendingRefundInterface::CREATED_AT, $createdAt); } /** * {@inheritDoc} */ public function getCreatedAt() { return $this->getData(PendingRefundInterface::CREATED_AT); } /** * {@inheritDoc} */ public function beforeSave() { if (! $this->getId()) { $this->setCreatedAt($this->dateFactory->create()->gmtDate()); } return parent::beforeSave(); } /** * {@inheritDoc} */ public function setLockOnLoad($lockOnLoad) { $this->lockOnLoad = $lockOnLoad; return $this; } /** * {@inheritDoc} */ public function hasLockOnLoad() { return $this->lockOnLoad; } } amazon-pay-module/Model/OrderLink.php000077700000003747151323541140013566 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\OrderLinkInterface; use Amazon\Payment\Model\ResourceModel\OrderLink as OrderLinkResourceModel; use Magento\Framework\Model\AbstractModel; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderLink extends AbstractModel implements OrderLinkInterface { protected function _construct() { $this->_init(OrderLinkResourceModel::class); } /** * {@inheritDoc} */ public function setAmazonOrderReferenceId($amazonOrderReferenceId) { return $this->setData('amazon_order_reference_id', $amazonOrderReferenceId); } /** * {@inheritDoc} */ public function getAmazonOrderReferenceId() { return $this->getData('amazon_order_reference_id'); } /** * {@inheritDoc} */ public function setOrderId($orderId) { return $this->setData('order_id', $orderId); } /** * {@inheritDoc} */ public function getOrderId() { return $this->getData('order_id'); } } amazon-pay-module/Model/PendingCapture.php000077700000010541151323541140014573 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Amazon\Payment\Model\ResourceModel\PendingCapture as PendingCaptureResourceModel; use Magento\Framework\Data\Collection\AbstractDb; use Magento\Framework\Model\AbstractModel; use Magento\Framework\Model\Context; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Registry; use Magento\Framework\Stdlib\DateTime\DateTimeFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingCapture extends AbstractModel implements PendingCaptureInterface { /** * @var DateTimeFactory */ private $dateFactory; /** * @var boolean */ private $lockOnLoad = false; /** * PendingCapture constructor. * * @param Context $context * @param Registry $registry * @param DateTimeFactory $dateFactory * @param AbstractResource|null $resource * @param AbstractDb|null $resourceCollection * @param array $data */ public function __construct( Context $context, Registry $registry, DateTimeFactory $dateFactory, AbstractResource $resource = null, AbstractDb $resourceCollection = null, array $data = [] ) { parent::__construct( $context, $registry, $resource, $resourceCollection, $data ); $this->dateFactory = $dateFactory; } /** * {@inheritDoc} */ protected function _construct() { $this->_init(PendingCaptureResourceModel::class); } /** * {@inheritDoc} */ public function getCaptureId() { return $this->getData(PendingCaptureInterface::CAPTURE_ID); } /** * {@inheritDoc} */ public function setCaptureId($captureId) { return $this->setData(PendingCaptureInterface::CAPTURE_ID, $captureId); } /** * {@inheritDoc} */ public function getOrderId() { return $this->getData(PendingCaptureInterface::ORDER_ID); } /** * {@inheritDoc} */ public function setOrderId($orderId) { return $this->setData(PendingCaptureInterface::ORDER_ID, $orderId); } /** * {@inheritDoc} */ public function getPaymentId() { return $this->getData(PendingCaptureInterface::PAYMENT_ID); } /** * {@inheritDoc} */ public function setPaymentId($paymentId) { return $this->setData(PendingCaptureInterface::PAYMENT_ID, $paymentId); } /** * {@inheritDoc} */ public function setCreatedAt($createdAt) { return $this->setData(PendingCaptureInterface::CREATED_AT, $createdAt); } /** * {@inheritDoc} */ public function getCreatedAt() { return $this->getData(PendingCaptureInterface::CREATED_AT); } /** * {@inheritDoc} */ public function beforeSave() { if (! $this->getId()) { $this->setCreatedAt($this->dateFactory->create()->gmtDate()); } return parent::beforeSave(); } /** * {@inheritDoc} */ public function setLockOnLoad($lockOnLoad) { $this->lockOnLoad = $lockOnLoad; return $this; } /** * {@inheritDoc} */ public function hasLockOnLoad() { return $this->lockOnLoad; } } amazon-pay-module/Model/QuoteLinkManagement.php000077700000004555151323541140015603 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\QuoteLinkManagementInterface; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Magento\Quote\Api\Data\CartExtensionFactory; use Magento\Quote\Api\Data\CartInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class QuoteLinkManagement implements QuoteLinkManagementInterface { /** * @var CartExtensionFactory */ private $cartExtensionFactory; /** * @var QuoteLinkInterfaceFactory */ private $quoteLinkFactory; /** * @param CartExtensionFactory $cartExtensionFactory * @param QuoteLinkInterfaceFactory $quoteLinkFactory */ public function __construct( CartExtensionFactory $cartExtensionFactory, QuoteLinkInterfaceFactory $quoteLinkFactory ) { $this->cartExtensionFactory = $cartExtensionFactory; $this->quoteLinkFactory = $quoteLinkFactory; } /** * {@inheritDoc} */ public function setAmazonOrderReferenceIdExtensionAttribute(CartInterface $cart) { $cartExtension = ($cart->getExtensionAttributes()) ?: $this->cartExtensionFactory->create(); $amazonQuote = $this->quoteLinkFactory->create(); $amazonQuote->load($cart->getId(), 'quote_id'); if ($amazonQuote->getId()) { $cartExtension->setAmazonOrderReferenceId($amazonQuote); } $cart->setExtensionAttributes($cartExtension); } } amazon-pay-module/Model/OrderInformationManagement.php000077700000021777151323541140017156 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Core\Exception\AmazonServiceUnavailableException; use Amazon\Core\Helper\Data as CoreHelper; use Amazon\Core\Model\AmazonConfig; use Amazon\Payment\Gateway\Config\Config; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Amazon\Payment\Api\OrderInformationManagementInterface; use Amazon\Payment\Domain\AmazonSetOrderDetailsResponse; use Amazon\Payment\Domain\AmazonSetOrderDetailsResponseFactory; use Exception; use Magento\Checkout\Model\Session; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Exception\ValidatorException; use Magento\Quote\Model\Quote; use Magento\Store\Model\ScopeInterface; use AmazonPay\ResponseInterface; use Psr\Log\LoggerInterface; use Magento\Framework\UrlInterface; use Magento\Framework\App\ObjectManager; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderInformationManagement implements OrderInformationManagementInterface { /** * @var Session */ private $session; /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var CoreHelper */ private $coreHelper; /** * @var AmazonConfig */ private $amazonConfig; /** * @var AmazonSetOrderDetailsResponseFactory */ private $amazonSetOrderDetailsResponseFactory; /* * @var QuoteLinkInterfaceFactory */ private $quoteLinkFactory; /** * @var LoggerInterface */ private $logger; /** * @var Config */ private $config; /** * OrderInformationManagement constructor. * @param Session $session * @param ClientFactoryInterface $clientFactory * @param CoreHelper $coreHelper * @param AmazonConfig $amazonConfig * @param Config $config * @param AmazonSetOrderDetailsResponseFactory $amazonSetOrderDetailsResponseFactory * @param QuoteLinkInterfaceFactory $quoteLinkFactory * @param LoggerInterface $logger */ public function __construct( Session $session, ClientFactoryInterface $clientFactory, CoreHelper $coreHelper, AmazonConfig $amazonConfig, Config $config, AmazonSetOrderDetailsResponseFactory $amazonSetOrderDetailsResponseFactory, QuoteLinkInterfaceFactory $quoteLinkFactory, LoggerInterface $logger, UrlInterface $urlBuilder = null ) { $this->session = $session; $this->clientFactory = $clientFactory; $this->coreHelper = $coreHelper; $this->amazonConfig = $amazonConfig; $this->config = $config; $this->amazonSetOrderDetailsResponseFactory = $amazonSetOrderDetailsResponseFactory; $this->quoteLinkFactory = $quoteLinkFactory; $this->logger = $logger; $this->urlBuilder = $urlBuilder ?: ObjectManager::getInstance()->get(UrlInterface::class); } /** * {@inheritDoc} */ public function saveOrderInformation($amazonOrderReferenceId, $allowedConstraints = []) { try { $quote = $this->session->getQuote(); $storeId = $quote->getStoreId(); $this->validateCurrency($quote->getQuoteCurrencyCode()); $this->setReservedOrderId($quote); $storeName = $this->coreHelper->getStoreName(ScopeInterface::SCOPE_STORE, $storeId); $data = [ 'amazon_order_reference_id' => $amazonOrderReferenceId, 'amount' => $quote->getGrandTotal(), 'currency_code' => $quote->getQuoteCurrencyCode(), 'store_name' => $storeName, 'custom_information' => 'Magento Version : 2, ' . 'Plugin Version : ' . $this->coreHelper->getVersion() , 'platform_id' => $this->config->getValue('platform_id') ]; $responseParser = $this->clientFactory->create($storeId)->setOrderReferenceDetails($data); $response = $this->amazonSetOrderDetailsResponseFactory->create([ 'response' => $responseParser ]); $this->validateConstraints($response, $allowedConstraints); } catch (LocalizedException $e) { throw $e; } catch (Exception $e) { $this->logger->error($e); throw new AmazonServiceUnavailableException(); } } protected function validateCurrency($code) { if ($this->coreHelper->getCurrencyCode() !== $code && !$this->amazonConfig->canUseCurrency($code)) { throw new LocalizedException(__('The currency selected is not supported by Amazon Pay')); } } protected function validateConstraints(AmazonSetOrderDetailsResponse $response, $allowedConstraints) { foreach ($response->getConstraints() as $constraint) { if (! in_array($constraint->getId(), $allowedConstraints)) { throw new ValidatorException(__($constraint->getErrorMessage())); } } } protected function setReservedOrderId(Quote $quote) { if (! $quote->getReservedOrderId()) { $quote ->reserveOrderId() ->save(); } } /** * {@inheritDoc} */ public function confirmOrderReference($amazonOrderReferenceId, $storeId = null) { try { $response = $this->clientFactory->create($storeId)->confirmOrderReference( [ 'amazon_order_reference_id' => $amazonOrderReferenceId, 'success_url' => $this->urlBuilder->getUrl('amazonpayments/payment/completecheckout'), 'failure_url' => $this->urlBuilder->getUrl('amazonpayments/payment/completecheckout') ] ); $this->validateResponse($response); } catch (LocalizedException $e) { throw $e; } catch (Exception $e) { $this->logger->error($e); throw new AmazonServiceUnavailableException(); } } /** * {@inheritDoc} */ public function closeOrderReference($amazonOrderReferenceId, $storeId = null) { try { $response = $this->clientFactory->create($storeId)->closeOrderReference( [ 'amazon_order_reference_id' => $amazonOrderReferenceId ] ); $this->validateResponse($response); } catch (LocalizedException $e) { throw $e; } catch (Exception $e) { $this->logger->error($e); throw new AmazonServiceUnavailableException(); } } /** * {@inheritDoc} */ public function cancelOrderReference($amazonOrderReferenceId, $storeId = null) { try { $response = $this->clientFactory->create($storeId)->cancelOrderReference( [ 'amazon_order_reference_id' => $amazonOrderReferenceId ] ); $this->validateResponse($response); } catch (LocalizedException $e) { throw $e; } catch (Exception $e) { $this->logger->error($e); throw new AmazonServiceUnavailableException(); } } protected function validateResponse(ResponseInterface $response) { $data = $response->toArray(); if (200 != $data['ResponseStatus']) { throw new AmazonServiceUnavailableException(); } } /** * {@inheritDoc} */ public function removeOrderReference() { $quote = $this->session->getQuote(); if ($quote->getId()) { $quoteLink = $this->quoteLinkFactory->create()->load($quote->getId(), 'quote_id'); if ($quoteLink->getId()) { $quoteLink->delete(); } } } } amazon-pay-module/Model/QuoteLink.php000077700000005207151323541140013601 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\QuoteLinkInterface; use Amazon\Payment\Model\ResourceModel\QuoteLink as QuoteLinkResourceModel; use Magento\Framework\Model\AbstractModel; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class QuoteLink extends AbstractModel implements QuoteLinkInterface { protected function _construct() { $this->_init(QuoteLinkResourceModel::class); } /** * {@inheritDoc} */ public function setAmazonOrderReferenceId($amazonOrderReferenceId) { return $this->setData('amazon_order_reference_id', $amazonOrderReferenceId); } /** * {@inheritDoc} */ public function getAmazonOrderReferenceId() { return $this->getData('amazon_order_reference_id'); } /** * {@inheritDoc} */ public function setQuoteId($quoteId) { return $this->setData('quote_id', $quoteId); } /** * {@inheritDoc} */ public function getQuoteId() { return $this->getData('quote_id'); } /** * {@inheritDoc} */ public function setSandboxSimulationReference($sandboxSimulationReference) { return $this->setData('sandbox_simulation_reference', $sandboxSimulationReference); } /** * {@inheritDoc} */ public function getSandboxSimulationReference() { return $this->getData('sandbox_simulation_reference'); } /** * {@inheritDoc} */ public function setConfirmed($confirmed) { return $this->setData('confirmed', $confirmed); } /** * {@inheritDoc} */ public function isConfirmed() { return (bool) $this->getData('confirmed'); } } amazon-pay-module/Model/Method/AmazonLoginMethod.php000077700000004237151323541140016467 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\Method; use Amazon\Core\Helper\Data as AmazonCoreHelper; /** * Class AmazonLoginMethod * For display of Amazon Pay in payment method list * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonLoginMethod extends \Magento\Payment\Model\Method\AbstractMethod { const PAYMENT_METHOD_LOGIN_METHOD = 'amazonlogin'; /** * Payment method code * * @var string */ protected $_code = self::PAYMENT_METHOD_LOGIN_METHOD; /** * @var string */ protected $_formBlockType = 'Magento\Payment\Block\Form'; /** * Info instructions block path * * @var string */ protected $_infoBlockType = 'Magento\Payment\Block\Info\Instructions'; /** * Availability option * * @var bool */ protected $_isOffline = true; /** * Is active * * @param int|null $storeId * @return bool */ public function isActive($storeId = null) { return (bool)(int)$this->_scopeConfig->getValue( AmazonCoreHelper::AMAZON_ACTIVE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId ) && (bool)(int)$this->getConfigData('active', $storeId); } } amazon-pay-module/Model/Method/.htaccess000077700000000177151323541140014174 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/QueuedRefundUpdater.php000077700000014726151323541140015615 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Api\Data\PendingRefundInterfaceFactory; use Amazon\Payment\Domain\AmazonRefundDetailsResponseFactory; use Amazon\Payment\Domain\AmazonRefundStatus; use Amazon\Payment\Domain\Details\AmazonRefundDetails; use Magento\Framework\Notification\NotifierInterface; use Magento\Sales\Api\OrderPaymentRepositoryInterface; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Store\Model\StoreManagerInterface; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class QueuedRefundUpdater { /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var OrderPaymentRepositoryInterface */ private $orderPaymentRepository; /** * @var ClientFactoryInterface */ private $amazonHttpClientFactory; /** * @var AmazonRefundDetailsResponseFactory */ private $amazonRefundDetailsResponseFactory; /** * @var NotifierInterface */ private $adminNotifier; /** * @var PendingRefundInterfaceFactory */ private $pendingRefundFactory; /** * @var StoreManagerInterface */ private $storeManager; /** * @var LoggerInterface */ private $logger; /** * @var bool */ private $throwExceptions = false; /** * @param OrderRepositoryInterface $orderRepository * @param OrderPaymentRepositoryInterface $orderPaymentRepository * @param ClientFactoryInterface $amazonHttpClientFactory * @param AmazonRefundDetailsResponseFactory $amazonRefundDetailsResponseFactory * @param NotifierInterface $adminNotifier * @param PendingRefundInterfaceFactory $pendingRefundFactory * @param StoreManagerInterface $storeManager * @param LoggerInterface $logger */ public function __construct( OrderRepositoryInterface $orderRepository, OrderPaymentRepositoryInterface $orderPaymentRepository, ClientFactoryInterface $amazonHttpClientFactory, AmazonRefundDetailsResponseFactory $amazonRefundDetailsResponseFactory, NotifierInterface $adminNotifier, PendingRefundInterfaceFactory $pendingRefundFactory, StoreManagerInterface $storeManager, LoggerInterface $logger ) { $this->orderRepository = $orderRepository; $this->orderPaymentRepository = $orderPaymentRepository; $this->amazonHttpClientFactory = $amazonHttpClientFactory; $this->amazonRefundDetailsResponseFactory = $amazonRefundDetailsResponseFactory; $this->adminNotifier = $adminNotifier; $this->pendingRefundFactory = $pendingRefundFactory; $this->storeManager = $storeManager; $this->logger = $logger; } /** * {@inheritdoc} */ public function setThrowExceptions($throwExceptions) { $this->throwExceptions = $throwExceptions; return $this; } /** * @param int $pendingRefundId * * @return void */ public function checkAndUpdateRefund($pendingRefundId, AmazonRefundDetails $refundDetails = null) { try { $pendingRefund = $this->pendingRefundFactory->create(); $pendingRefund->getResource()->beginTransaction(); $pendingRefund->setLockOnLoad(true); $pendingRefund->load($pendingRefundId); if ($pendingRefund->getRefundId()) { $order = $this->orderRepository->get($pendingRefund->getOrderId()); $storeId = $order->getStoreId(); $this->storeManager->setCurrentStore($storeId); if (null === $refundDetails) { $responseParser = $this->amazonHttpClientFactory->create($storeId)->getRefundDetails([ 'amazon_refund_id' => $pendingRefund->getRefundId() ]); $response = $this->amazonRefundDetailsResponseFactory->create(['response' => $responseParser]); $refundDetails = $response->getDetails(); } $status = $refundDetails->getRefundStatus(); switch ($status->getState()) { case AmazonRefundStatus::STATE_COMPLETED: $pendingRefund->delete(); break; case AmazonRefundStatus::STATE_DECLINED: $this->triggerAdminNotificationForDeclinedRefund($pendingRefund); $pendingRefund->delete(); break; } } $pendingRefund->getResource()->commit(); } catch (\Exception $e) { $this->logger->error($e); $pendingRefund->getResource()->rollBack(); if ($this->throwExceptions) { throw $e; } } } /** * @param PendingRefundInterface $pendingRefund * * @return void */ protected function triggerAdminNotificationForDeclinedRefund(PendingRefundInterface $pendingRefund) { $this->adminNotifier->addMajor( 'Amazon Pay has declined a refund', "Refund ID {$pendingRefund->getRefundId()} for Order ID {$pendingRefund->getOrderId()} " . "has been declined by Amazon Pay." ); } } amazon-pay-module/Model/PaymentManagement.php000077700000015205151323541140015277 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model; use Amazon\Payment\Api\Data\PendingAuthorizationInterfaceFactory; use Amazon\Payment\Api\Data\PendingCaptureInterfaceFactory; use Amazon\Payment\Api\Data\PendingRefundInterfaceFactory; use Amazon\Payment\Domain\Details\AmazonAuthorizationDetails; use Amazon\Payment\Domain\Details\AmazonCaptureDetails; use Amazon\Payment\Domain\Details\AmazonRefundDetails; use Magento\Framework\Api\SearchCriteriaBuilderFactory; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Payment\Model\InfoInterface as PaymentInfoInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Sales\Api\OrderPaymentRepositoryInterface; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Sales\Api\TransactionRepositoryInterface; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PaymentManagement { /** * @var PendingCaptureInterfaceFactory */ private $pendingCaptureFactory; /** * @var PendingAuthorizationInterfaceFactory */ private $pendingAuthorizationFactory; /** * @var PendingRefundInterfaceFactory */ private $pendingRefundFactory; /** * @var SearchCriteriaBuilderFactory */ private $searchCriteriaBuilderFactory; /** * @var OrderPaymentRepositoryInterface */ private $orderPaymentRepository; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var TransactionRepositoryInterface */ private $transactionRepository; /** * PaymentManagement constructor. * * @param PendingCaptureInterfaceFactory $pendingCaptureFactory * @param PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory * @param PendingRefundInterfaceFactory $pendingRefundFactory * @param SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory * @param OrderPaymentRepositoryInterface $orderPaymentRepository * @param OrderRepositoryInterface $orderRepository * @param TransactionRepositoryInterface $transactionRepository */ public function __construct( PendingCaptureInterfaceFactory $pendingCaptureFactory, PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory, PendingRefundInterfaceFactory $pendingRefundFactory, SearchCriteriaBuilderFactory $searchCriteriaBuilderFactory, OrderPaymentRepositoryInterface $orderPaymentRepository, OrderRepositoryInterface $orderRepository, TransactionRepositoryInterface $transactionRepository ) { $this->pendingCaptureFactory = $pendingCaptureFactory; $this->pendingAuthorizationFactory = $pendingAuthorizationFactory; $this->pendingRefundFactory = $pendingRefundFactory; $this->searchCriteriaBuilderFactory = $searchCriteriaBuilderFactory; $this->orderPaymentRepository = $orderPaymentRepository; $this->orderRepository = $orderRepository; $this->transactionRepository = $transactionRepository; } /** * {@inheritdoc} */ public function queuePendingCapture(AmazonCaptureDetails $details, $paymentId, $orderId) { $this->pendingCaptureFactory->create() ->setCaptureId($details->getTransactionId()) ->setPaymentId($paymentId) ->setOrderId($orderId) ->save(); } /** * {@inheritdoc} */ public function queuePendingAuthorization(AmazonAuthorizationDetails $details, OrderInterface $order) { $pendingAuthorization = $this->pendingAuthorizationFactory->create() ->setAuthorizationId($details->getAuthorizeTransactionId()); if ($details->hasCapture()) { $pendingAuthorization->setCaptureId($details->getCaptureTransactionId()) ->setCapture(true); } $order->addRelatedObject($pendingAuthorization); } /** * {@inheritdoc} */ public function queuePendingRefund(AmazonRefundDetails $details, PaymentInfoInterface $payment) { $this->pendingRefundFactory->create() ->setRefundId($details->getRefundId()) ->setPaymentId($payment->getId()) ->setOrderId($payment->getOrder()->getId()) ->save(); } /** * {@inheritdoc} */ public function closeTransaction($transactionId, PaymentInfoInterface $payment, OrderInterface $order) { $this->getTransaction($transactionId, $payment, $order)->setIsClosed(1)->save(); } /** * {@inheritdoc} */ public function getTransaction($transactionId, PaymentInfoInterface $payment, OrderInterface $order) { $searchCriteriaBuilder = $this->searchCriteriaBuilderFactory->create(); $searchCriteriaBuilder->addFilter( TransactionInterface::TXN_ID, $transactionId ); $searchCriteriaBuilder->addFilter( TransactionInterface::ORDER_ID, $order->getId() ); $searchCriteriaBuilder->addFilter( TransactionInterface::PAYMENT_ID, $payment->getId() ); $searchCriteria = $searchCriteriaBuilder ->setPageSize(1) ->setCurrentPage(1) ->create(); $transactionList = $this->transactionRepository->getList($searchCriteria); if (count($items = $transactionList->getItems())) { $transaction = current($items); $transaction ->setPayment($payment) ->setOrder($order); return $transaction; } throw new NoSuchEntityException(); } } amazon-pay-module/Model/ResourceModel/PendingRefund/Collection.php000077700000003600151323541140021254 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel\PendingRefund; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Model\PendingRefund as PendingRefundModel; use Amazon\Payment\Model\ResourceModel\PendingRefund as PendingRefundResourceModel; use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Collection extends AbstractCollection { protected function _construct() { $this->_init(PendingRefundModel::class, PendingRefundResourceModel::class); } /** * @return \Generator */ public function getIdGenerator() { $this->_renderFilters()->_renderOrders()->_renderLimit(); $select = $this->getSelect(); $statement = $select->getConnection()->query($select, $this->_bindParams); while ($row = $statement->fetch()) { yield $row[PendingRefundInterface::ID]; } } } amazon-pay-module/Model/ResourceModel/PendingRefund/.htaccess000077700000000177151323541140020254 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/ResourceModel/PendingCapture/Collection.php000077700000003665151323541140021447 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel\PendingCapture; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Generator; use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Amazon\Payment\Model\PendingCapture as PendingCaptureModel; use Amazon\Payment\Model\ResourceModel\PendingCapture as PendingCaptureResourceModel; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Collection extends AbstractCollection { protected function _construct() { $this->_init(PendingCaptureModel::class, PendingCaptureResourceModel::class); } /** * Get ID generator * * @return Generator */ public function getIdGenerator() { $this->_renderFilters()->_renderOrders()->_renderLimit(); $select = $this->getSelect(); $statement = $select->getConnection()->query($select, $this->_bindParams); while ($row = $statement->fetch()) { yield $row[PendingCaptureInterface::ID]; } } } amazon-pay-module/Model/ResourceModel/PendingCapture/.htaccess000077700000000177151323541140020434 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/ResourceModel/PendingAuthorization/Collection.php000077700000004035151323541140022674 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel\PendingAuthorization; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Generator; use Magento\Framework\Api\SearchResultsInterface; use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Amazon\Payment\Model\PendingAuthorization as PendingAuthorizationModel; use Amazon\Payment\Model\ResourceModel\PendingAuthorization as PendingAuthorizationResourceModel; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Collection extends AbstractCollection { protected function _construct() { $this->_init(PendingAuthorizationModel::class, PendingAuthorizationResourceModel::class); } /** * Get ID generator * * @return Generator */ public function getIdGenerator() { $this->_renderFilters()->_renderOrders()->_renderLimit(); $select = $this->getSelect(); $statement = $select->getConnection()->query($select, $this->_bindParams); while ($row = $statement->fetch()) { yield $row[PendingAuthorizationInterface::ID]; } } } amazon-pay-module/Model/ResourceModel/PendingAuthorization/.htaccess000077700000000177151323541140021671 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/ResourceModel/PendingAuthorization.php000077700000003205151323541140020577 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingAuthorization extends AbstractDb { const TABLE_NAME = 'amazon_pending_authorization'; protected function _construct() { $this->_init(static::TABLE_NAME, PendingAuthorizationInterface::ID); } /** * {@inheritDoc} */ protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); $select->forUpdate($object->hasLockOnLoad()); return $select; } } amazon-pay-module/Model/ResourceModel/PendingRefund.php000077700000003375151323541140017172 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel; use Amazon\Payment\Api\Data\PendingRefundInterface; use Amazon\Payment\Setup\UpgradeSchema as AmazonSchemaHelper; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingRefund extends AbstractDb { const TABLE_NAME = AmazonSchemaHelper::PENDING_REFUND_TABLE_NAME; protected function _construct() { $this->_init(static::TABLE_NAME, PendingRefundInterface::ID); } /** * {@inheritDoc} */ protected function _getLoadSelect($field, $value, $object) { /** @var \Amazon\Payment\Model\PendingRefund $object */ $select = parent::_getLoadSelect($field, $value, $object); $select->forUpdate($object->hasLockOnLoad()); return $select; } } amazon-pay-module/Model/ResourceModel/OrderLink.php000077700000002440151323541140016323 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderLink extends AbstractDb { const TABLE_NAME = 'amazon_sales_order'; protected function _construct() { $this->_init(static::TABLE_NAME, 'entity_id'); } } amazon-pay-module/Model/ResourceModel/PendingCapture.php000077700000003155151323541140017346 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PendingCapture extends AbstractDb { const TABLE_NAME = 'amazon_pending_capture'; protected function _construct() { $this->_init(static::TABLE_NAME, PendingCaptureInterface::ID); } /** * {@inheritDoc} */ protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); $select->forUpdate($object->hasLockOnLoad()); return $select; } } amazon-pay-module/Model/ResourceModel/QuoteLink.php000077700000002432151323541140016346 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Model\ResourceModel; use Magento\Framework\Model\ResourceModel\Db\AbstractDb; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class QuoteLink extends AbstractDb { const TABLE_NAME = 'amazon_quote'; protected function _construct() { $this->_init(static::TABLE_NAME, 'entity_id'); } } amazon-pay-module/Model/ResourceModel/.htaccess000077700000000177151323541140015524 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Model/.htaccess000077700000000177151323541140012754 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/email/soft-declined-auth.html000077700000002423151323541140020337 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!--@subject Please update your payment information @--> {{template config_path="design/email/header_template"}} <p>{{trans "Valued customer"}},</p> <br> <p> {{trans "Thank you very much for your order at %storeName" storeName=$storeName}}. {{trans "Amazon Pay was not able to process your payment"}}. </p> <p> {{trans 'Please go to <a href="%amazonAccountUrl">%amazonAccountUrl</a> and update the payment information for your order' amazonAccountUrl=$amazonAccountUrl |raw}}. {{trans "Afterwards we will automatically request payment again from Amazon Pay and you will receive a confirmation email"}}. </p> <p>{{trans "Kind regards"}},</p> {{template config_path="design/email/footer_template"}} amazon-pay-module/view/frontend/email/hard-declined-auth.html000077700000001737151323541140020311 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!--@subject Please contact us about your order @--> {{template config_path="design/email/header_template"}} <p>{{trans "Valued customer"}},</p> <br> <p> {{trans "Unfortunately Amazon Pay declined the payment for your order in our online shop %storeName. Please contact us." storeName=$storeName}}. </p> <p>{{trans "Kind regards"}},</p> {{template config_path="design/email/footer_template"}} amazon-pay-module/view/frontend/email/.htaccess000077700000000177151323541140015574 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/templates/widget/.htaccess000077700000000177151323541140017766 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/templates/widget/resetpassword.phtml000077700000001061151323541140022134 0ustar00<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile /** @var \Amazon\Payment\Block\Widget\ResetPassword $block */ ?> <div class="field password-info"> <p> <?= $block->escapeHtml(__('If you created this account using Amazon Pay, you might not know your site password.')) ?><br /> <?= __('In order to reset your password, please <a href="%1">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page', $block->getLink()) ?> </p> </div> amazon-pay-module/view/frontend/templates/minicart-button.phtml000077700000004136151323541140021071 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /** * @var \Amazon\Payment\Block\Minicart\Button $block */ $config = ['buttonType' => 'PwA']; $tooltipConfig = ['activeClass' => '_active']; $jsonHelper = $this->helper(Magento\Framework\Json\Helper\Data::class); ?> <div id="minicart-amazon-pay-button" class="amazon-minicart-container"> <div class="amazon-divider"> <span><?= __('or') ?></span> </div> <div class="amazon-button-container"> <div class="amazon-button-container__cell"> <div id="PayWithAmazon-<?= /* @noEscape */ $block->getParentBlock()->getJsId() ?>" class="login-with-amazon" data-mage-init='{"Amazon_Payment/js/amazon-button":<?= /* @noEscape */ $jsonHelper->jsonEncode($config) ?>}'> </div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-mage-init='{"dropdown":<?= /* @noEscape */ $jsonHelper->jsonEncode($tooltipConfig) ?>}' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> </span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true"> <?= $block->escapeHtml(__('Are you an Amazon customer? ' . 'Pay now with address and payment details stored in your Amazon account.')); ?> </div> </div> </div> </div> </div> amazon-pay-module/view/frontend/templates/payment-link.phtml000077700000003066151323541140020363 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <div class="amazon-button-container centered-button"> <div class="amazon-button-container__cell"> <div id="PayWithAmazon-<?= /* @noEscape */ $block->getJsId() ?>" class="login-with-amazon" data-mage-init='{"amazonButton": {"buttonType": "PwA"}}'> </div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> </span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true"> <?= $block->escapeHtml(__('Are you an Amazon customer? ' . 'Pay now with address and payment details stored in your Amazon account.')); ?> </div> </div> </div> </div> amazon-pay-module/view/frontend/templates/.htaccess000077700000000177151323541140016503 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/templates/payment-link-product-page.phtml000077700000003621151323541140022750 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <?php /** @var \Amazon\Payment\Block\ProductPagePaymentLink $block */ ?> <div class="amazon-checkout-now"><?= __('Checkout now') ?></div> <div class="amazon-button-container centered-button"> <div class="amazon-button-container__cell"> <a href="javascript:;" class="amazon-addtoCart" id="amazon-addtoCart-<?= /* @noEscape */ $block->getJsId() ?>" data-mage-init='{"amazonProductAdd": {}}'> </a> <div id="PayWithAmazon-<?= /* @noEscape */ $block->getJsId() ?>" class="login-with-amazon" data-mage-init='{"amazonButton": {"buttonType": "PwA"}}'> </div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> </span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true"> <?= $block->escapeHtml(__('Are you an Amazon customer? ' . 'Pay now with address and payment details stored in your Amazon account.')); ?> </div> </div> </div> </div> amazon-pay-module/view/frontend/layout/catalog_product_view.xml000077700000002115151323541140021144 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="product.info.social"> <block class="Amazon\Payment\Block\ProductPagePaymentLink" name="amazon.pay.button.product" before="-" template="Amazon_Payment::payment-link-product-page.phtml" ifconfig="payment/amazon_payment/active" /> </referenceContainer> </body> </page> amazon-pay-module/view/frontend/layout/customer_account_edit.xml000077700000001166151323541140021327 0ustar00<?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <update handle="customer_account"/> <body> <referenceContainer name="form.additional.info"> <block class="Amazon\Payment\Block\Widget\ResetPassword" name="amazon.pay.password.reset" before="-" template="Amazon_Payment::widget/resetpassword.phtml" cacheable="false" /> </referenceContainer> </body> </page> amazon-pay-module/view/frontend/layout/checkout_index_index.xml000077700000041631151323541140021131 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="minicart"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="minicart_content" xsi:type="array"> <item name="children" xsi:type="array"> <item name="amazon_minicart_pay" xsi:type="array"> <item name="config" xsi:type="array"> <item name="componentDisabled" xsi:type="boolean">true</item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> <referenceBlock name="checkout.root"> <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="checkout" xsi:type="array"> <item name="children" xsi:type="array"> <item name="steps" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shipping-step" xsi:type="array"> <item name="children" xsi:type="array"> <item name="shippingAddress" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/shipping</item> <item name="children" xsi:type="array"> <item name="address-list" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/shipping-address/list</item> </item> <item name="shipping-address-fieldset" xsi:type="array"> <item name="children" xsi:type="array"> <item name="inline-form-manipulator" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/shipping-address/inline-form</item> </item> </item> </item> <item name="customer-email" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/form/element/email</item> <item name="children" xsi:type="array"> <item name="amazon-button-region" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">amazon-button-region</item> <item name="children" xsi:type="array"> <item name="amazon-button" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/checkout-button</item> <item name="sortOrder" xsi:type="string">0</item> <item name="displayArea" xsi:type="string">amazon-pay-button</item> <item name="config" xsi:type="array"> <item name="tooltip" xsi:type="string" translate="true">Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.</item> </item> <item name="children" xsi:type="array"> <item name="before-amazon-button" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">before-amazon-button</item> <item name="children" xsi:type="array"> <!-- before amazon button --> </item> </item> <item name="after-amazon-button" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">after-amazon-button</item> <item name="children" xsi:type="array"> <!-- after amazon button --> </item> </item> </item> </item> </item> </item> </item> </item> <item name="before-form" xsi:type="array"> <item name="children" xsi:type="array"> <item name="amazon-widget-address" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/checkout-widget-address</item> <item name="sortOrder" xsi:type="string">0</item> <item name="displayArea" xsi:type="string">amazon-widget-address</item> <item name="children" xsi:type="array"> <item name="before-widget-address" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">before-widget-address</item> <item name="children" xsi:type="array"> <!-- before amazon address widget --> <item name="amazon-checkout-revert" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/checkout-revert</item> </item> </item> </item> <item name="after-widget-address" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">after-widget-address</item> <item name="children" xsi:type="array"> <!-- after amazon address widget --> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> <item name="billing-step" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="children" xsi:type="array"> <item name="payment" xsi:type="array"> <item name="children" xsi:type="array"> <item name="beforeMethods" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="children" xsi:type="array"> <item name="amazon-sandbox-simulator" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/checkout-sandbox-simulator</item> <item name="sortOrder" xsi:type="string">0</item> <item name="children" xsi:type="array"> <item name="before-sandbox-simulator" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">before-sandbox-simulator</item> <item name="children" xsi:type="array"> <!-- before amazon sandbox simulator --> </item> </item> <item name="after-sandbox-simulator" xsi:type="array"> <item name="component" xsi:type="string">uiComponent</item> <item name="displayArea" xsi:type="string">after-sandbox-simulator</item> <item name="children" xsi:type="array"> <!-- after amazon sandbox simulator --> </item> </item> </item> </item> </item> </item> <item name="renders" xsi:type="array"> <!-- merge payment method renders here --> <item name="children" xsi:type="array"> <item name="amazon_payment" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/payment/amazon-pay</item> <item name="config" xsi:type="array"> <item name="tooltip" xsi:type="string" translate="true">Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.</item> </item> <item name="methods" xsi:type="array"> <item name="amazon_payment" xsi:type="array"> <item name="isBillingAddressRequired" xsi:type="boolean">true</item> </item> </item> </item> <item name="amazonlogin" xsi:type="array"> <item name="component" xsi:type="string">Amazon_Payment/js/view/payment/amazonlogin</item> <item name="methods" xsi:type="array"> <item name="amazonlogin" xsi:type="array"> <item name="isBillingAddressRequired" xsi:type="boolean">true</item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </item> </argument> </arguments> </referenceBlock> </body> </page> amazon-pay-module/view/frontend/layout/.htaccess000077700000000177151323541140016022 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/requirejs-config.js000077700000002546151323541140016523 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ var config = { map: { '*': { amazonCore: 'Amazon_Payment/js/amazon-core', amazonWidgetsLoader: 'Amazon_Payment/js/amazon-widgets-loader', amazonButton: 'Amazon_Payment/js/amazon-button', amazonProductAdd: 'Amazon_Payment/js/amazon-product-add', amazonPaymentConfig: 'Amazon_Payment/js/model/amazonPaymentConfig', sjcl: 'Amazon_Payment/js/lib/sjcl.min' } }, config: { mixins: { 'Amazon_Payment/js/action/place-order': { 'Amazon_Payment/js/model/place-order-mixin': true }, 'Magento_Tax/js/view/checkout/summary/grand-total': { 'Amazon_Payment/js/view/checkout/summary/grand-total-mixin': true } } } }; amazon-pay-module/view/frontend/web/js/lib/sjcl.min.js000077700000061024151323541140016717 0ustar00// jscs:disable "use strict";var sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message};this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message};this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message};this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message};this.message=a}}}; "undefined"!==typeof module&&module.exports&&(module.exports=sjcl);"function"===typeof define&&define([],function(){return sjcl}); sjcl.cipher.aes=function(a){this.s[0][0][0]||this.O();var b,c,d,e,g=this.s[0][4],f=this.s[1];b=a.length;var h=1;if(4!==b&&6!==b&&8!==b)throw new sjcl.exception.invalid("invalid aes key size");this.b=[d=a.slice(0),e=[]];for(a=b;a<4*b+28;a++){c=d[a-1];if(0===a%b||8===b&&4===a%b)c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[c&255],0===a%b&&(c=c<<8^c>>>24^h<<24,h=h<<1^283*(h>>7));d[a]=d[a-b]^c}for(b=0;a;b++,a--)c=d[b&3?a:a-4],e[b]=4>=a||4>b?c:f[0][g[c>>>24]]^f[1][g[c>>16&255]]^f[2][g[c>>8&255]]^f[3][g[c& 255]]}; sjcl.cipher.aes.prototype={encrypt:function(a){return u(this,a,0)},decrypt:function(a){return u(this,a,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var a=this.s[0],b=this.s[1],c=a[4],d=b[4],e,g,f,h=[],l=[],k,m,n,p;for(e=0;0x100>e;e++)l[(h[e]=e<<1^283*(e>>7))^e]=e;for(g=f=0;!c[g];g^=k||1,f=l[f]||1)for(n=f^f<<1^f<<2^f<<3^f<<4,n=n>>8^n&255^99,c[g]=n,d[n]=g,m=h[e=h[k=h[g]]],p=0x1010101*m^0x10001*e^0x101*k^0x1010100*g,m=0x101*h[n]^0x1010100*n,e=0;4>e;e++)a[e][g]=m=m<<24^m>>>8,b[e][n]=p=p<<24^p>>>8;for(e= 0;5>e;e++)a[e]=a[e].slice(0),b[e]=b[e].slice(0)}}; function u(a,b,c){if(4!==b.length)throw new sjcl.exception.invalid("invalid aes block size");var d=a.b[c],e=b[0]^d[0],g=b[c?3:1]^d[1],f=b[2]^d[2];b=b[c?1:3]^d[3];var h,l,k,m=d.length/4-2,n,p=4,r=[0,0,0,0];h=a.s[c];a=h[0];var q=h[1],t=h[2],w=h[3],x=h[4];for(n=0;n<m;n++)h=a[e>>>24]^q[g>>16&255]^t[f>>8&255]^w[b&255]^d[p],l=a[g>>>24]^q[f>>16&255]^t[b>>8&255]^w[e&255]^d[p+1],k=a[f>>>24]^q[b>>16&255]^t[e>>8&255]^w[g&255]^d[p+2],b=a[b>>>24]^q[e>>16&255]^t[g>>8&255]^w[f&255]^d[p+3],p+=4,e=h,g=l,f=k;for(n= 0;4>n;n++)r[c?3&-n:n]=x[e>>>24]<<24^x[g>>16&255]<<16^x[f>>8&255]<<8^x[b&255]^d[p++],h=e,e=g,g=f,f=b,b=h;return r} sjcl.bitArray={bitSlice:function(a,b,c){a=sjcl.bitArray.$(a.slice(b/32),32-(b&31)).slice(1);return void 0===c?a:sjcl.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=sjcl.bitArray.getPartial(c);return 32===d?a.concat(b):sjcl.bitArray.$(b,d,c|0,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0=== b?0:32*(b-1)+sjcl.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;b=b&31;0<c&&b&&(a[c-1]=sjcl.bitArray.partial(b,a[c-1]&2147483648>>b-1,1));return a},partial:function(a,b,c){return 32===a?b:(c?b|0:b<<32-a)+0x10000000000*a},getPartial:function(a){return Math.round(a/0x10000000000)||32},equal:function(a,b){if(sjcl.bitArray.bitLength(a)!==sjcl.bitArray.bitLength(b))return!1;var c=0,d;for(d=0;d<a.length;d++)c|=a[d]^b[d];return 0=== c},$:function(a,b,c,d){var e;e=0;for(void 0===d&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;e=a.length?a[a.length-1]:0;a=sjcl.bitArray.getPartial(e);d.push(sjcl.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1));return d},i:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&0xff00|(c&0xff00)<<8|c<<24;return a}}; sjcl.codec.utf8String={fromBits:function(a){var b="",c=sjcl.bitArray.bitLength(a),d,e;for(d=0;d<c/8;d++)0===(d&3)&&(e=a[d/4]),b+=String.fromCharCode(e>>>24),e<<=8;return decodeURIComponent(escape(b))},toBits:function(a){a=unescape(encodeURIComponent(a));var b=[],c,d=0;for(c=0;c<a.length;c++)d=d<<8|a.charCodeAt(c),3===(c&3)&&(b.push(d),d=0);c&3&&b.push(sjcl.bitArray.partial(8*(c&3),d));return b}}; sjcl.codec.hex={fromBits:function(a){var b="",c;for(c=0;c<a.length;c++)b+=((a[c]|0)+0xf00000000000).toString(16).substr(4);return b.substr(0,sjcl.bitArray.bitLength(a)/4)},toBits:function(a){var b,c=[],d;a=a.replace(/\s|0x/g,"");d=a.length;a=a+"00000000";for(b=0;b<a.length;b+=8)c.push(parseInt(a.substr(b,8),16)^0);return sjcl.bitArray.clamp(c,4*d)}}; sjcl.codec.base32={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",X:"0123456789ABCDEFGHIJKLMNOPQRSTUV",BITS:32,BASE:5,REMAINING:27,fromBits:function(a,b,c){var d=sjcl.codec.base32.BASE,e=sjcl.codec.base32.REMAINING,g="",f=0,h=sjcl.codec.base32.B,l=0,k=sjcl.bitArray.bitLength(a);c&&(h=sjcl.codec.base32.X);for(c=0;g.length*d<k;)g+=h.charAt((l^a[c]>>>f)>>>e),f<d?(l=a[c]<<d-f,f+=e,c++):(l<<=d,f-=d);for(;g.length&7&&!b;)g+="=";return g},toBits:function(a,b){a=a.replace(/\s|=/g,"").toUpperCase();var c=sjcl.codec.base32.BITS, d=sjcl.codec.base32.BASE,e=sjcl.codec.base32.REMAINING,g=[],f,h=0,l=sjcl.codec.base32.B,k=0,m,n="base32";b&&(l=sjcl.codec.base32.X,n="base32hex");for(f=0;f<a.length;f++){m=l.indexOf(a.charAt(f));if(0>m){if(!b)try{return sjcl.codec.base32hex.toBits(a)}catch(p){}throw new sjcl.exception.invalid("this isn't "+n+"!");}h>e?(h-=e,g.push(k^m>>>h),k=m<<c-h):(h+=d,k^=m<<c-h)}h&56&&g.push(sjcl.bitArray.partial(h&56,k,1));return g}}; sjcl.codec.base32hex={fromBits:function(a,b){return sjcl.codec.base32.fromBits(a,b,1)},toBits:function(a){return sjcl.codec.base32.toBits(a,1)}}; sjcl.codec.base64={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,g=sjcl.codec.base64.B,f=0,h=sjcl.bitArray.bitLength(a);c&&(g=g.substr(0,62)+"-_");for(c=0;6*d.length<h;)d+=g.charAt((f^a[c]>>>e)>>>26),6>e?(f=a[c]<<6-e,e+=26,c++):(f<<=6,e-=6);for(;d.length&3&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c=[],d,e=0,g=sjcl.codec.base64.B,f=0,h;b&&(g=g.substr(0,62)+"-_");for(d=0;d<a.length;d++){h=g.indexOf(a.charAt(d)); if(0>h)throw new sjcl.exception.invalid("this isn't base64!");26<e?(e-=26,c.push(f^h>>>e),f=h<<32-e):(e+=6,f^=h<<32-e)}e&56&&c.push(sjcl.bitArray.partial(e&56,f,1));return c}};sjcl.codec.base64url={fromBits:function(a){return sjcl.codec.base64.fromBits(a,1,1)},toBits:function(a){return sjcl.codec.base64.toBits(a,1)}};sjcl.hash.sha256=function(a){this.b[0]||this.O();a?(this.F=a.F.slice(0),this.A=a.A.slice(0),this.l=a.l):this.reset()};sjcl.hash.sha256.hash=function(a){return(new sjcl.hash.sha256).update(a).finalize()}; sjcl.hash.sha256.prototype={blockSize:512,reset:function(){this.F=this.Y.slice(0);this.A=[];this.l=0;return this},update:function(a){"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));var b,c=this.A=sjcl.bitArray.concat(this.A,a);b=this.l;a=this.l=b+sjcl.bitArray.bitLength(a);for(b=512+b&-512;b<=a;b+=512)v(this,c.splice(0,16));return this},finalize:function(){var a,b=this.A,c=this.F,b=sjcl.bitArray.concat(b,[sjcl.bitArray.partial(1,1)]);for(a=b.length+2;a&15;a++)b.push(0);b.push(Math.floor(this.l/ 4294967296));for(b.push(this.l|0);b.length;)v(this,b.splice(0,16));this.reset();return c},Y:[],b:[],O:function(){function a(a){return 0x100000000*(a-Math.floor(a))|0}var b=0,c=2,d;a:for(;64>b;c++){for(d=2;d*d<=c;d++)if(0===c%d)continue a;8>b&&(this.Y[b]=a(Math.pow(c,.5)));this.b[b]=a(Math.pow(c,1/3));b++}}}; function v(a,b){var c,d,e,g=b.slice(0),f=a.F,h=a.b,l=f[0],k=f[1],m=f[2],n=f[3],p=f[4],r=f[5],q=f[6],t=f[7];for(c=0;64>c;c++)16>c?d=g[c]:(d=g[c+1&15],e=g[c+14&15],d=g[c&15]=(d>>>7^d>>>18^d>>>3^d<<25^d<<14)+(e>>>17^e>>>19^e>>>10^e<<15^e<<13)+g[c&15]+g[c+9&15]|0),d=d+t+(p>>>6^p>>>11^p>>>25^p<<26^p<<21^p<<7)+(q^p&(r^q))+h[c],t=q,q=r,r=p,p=n+d|0,n=m,m=k,k=l,l=d+(k&m^n&(k^m))+(k>>>2^k>>>13^k>>>22^k<<30^k<<19^k<<10)|0;f[0]=f[0]+l|0;f[1]=f[1]+k|0;f[2]=f[2]+m|0;f[3]=f[3]+n|0;f[4]=f[4]+p|0;f[5]=f[5]+r|0;f[6]= f[6]+q|0;f[7]=f[7]+t|0} sjcl.mode.ccm={name:"ccm",G:[],listenProgress:function(a){sjcl.mode.ccm.G.push(a)},unListenProgress:function(a){a=sjcl.mode.ccm.G.indexOf(a);-1<a&&sjcl.mode.ccm.G.splice(a,1)},fa:function(a){var b=sjcl.mode.ccm.G.slice(),c;for(c=0;c<b.length;c+=1)b[c](a)},encrypt:function(a,b,c,d,e){var g,f=b.slice(0),h=sjcl.bitArray,l=h.bitLength(c)/8,k=h.bitLength(f)/8;e=e||64;d=d||[];if(7>l)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(g=2;4>g&&k>>>8*g;g++);g<15-l&&(g=15-l);c=h.clamp(c, 8*(15-g));b=sjcl.mode.ccm.V(a,b,c,d,e,g);f=sjcl.mode.ccm.C(a,f,c,b,e,g);return h.concat(f.data,f.tag)},decrypt:function(a,b,c,d,e){e=e||64;d=d||[];var g=sjcl.bitArray,f=g.bitLength(c)/8,h=g.bitLength(b),l=g.clamp(b,h-e),k=g.bitSlice(b,h-e),h=(h-e)/8;if(7>f)throw new sjcl.exception.invalid("ccm: iv must be at least 7 bytes");for(b=2;4>b&&h>>>8*b;b++);b<15-f&&(b=15-f);c=g.clamp(c,8*(15-b));l=sjcl.mode.ccm.C(a,l,c,k,e,b);a=sjcl.mode.ccm.V(a,l.data,c,d,e,b);if(!g.equal(l.tag,a))throw new sjcl.exception.corrupt("ccm: tag doesn't match"); return l.data},na:function(a,b,c,d,e,g){var f=[],h=sjcl.bitArray,l=h.i;d=[h.partial(8,(b.length?64:0)|d-2<<2|g-1)];d=h.concat(d,c);d[3]|=e;d=a.encrypt(d);if(b.length)for(c=h.bitLength(b)/8,65279>=c?f=[h.partial(16,c)]:0xffffffff>=c&&(f=h.concat([h.partial(16,65534)],[c])),f=h.concat(f,b),b=0;b<f.length;b+=4)d=a.encrypt(l(d,f.slice(b,b+4).concat([0,0,0])));return d},V:function(a,b,c,d,e,g){var f=sjcl.bitArray,h=f.i;e/=8;if(e%2||4>e||16<e)throw new sjcl.exception.invalid("ccm: invalid tag length"); if(0xffffffff<d.length||0xffffffff<b.length)throw new sjcl.exception.bug("ccm: can't deal with 4GiB or more data");c=sjcl.mode.ccm.na(a,d,c,e,f.bitLength(b)/8,g);for(d=0;d<b.length;d+=4)c=a.encrypt(h(c,b.slice(d,d+4).concat([0,0,0])));return f.clamp(c,8*e)},C:function(a,b,c,d,e,g){var f,h=sjcl.bitArray;f=h.i;var l=b.length,k=h.bitLength(b),m=l/50,n=m;c=h.concat([h.partial(8,g-1)],c).concat([0,0,0]).slice(0,4);d=h.bitSlice(f(d,a.encrypt(c)),0,e);if(!l)return{tag:d,data:[]};for(f=0;f<l;f+=4)f>m&&(sjcl.mode.ccm.fa(f/ l),m+=n),c[3]++,e=a.encrypt(c),b[f]^=e[0],b[f+1]^=e[1],b[f+2]^=e[2],b[f+3]^=e[3];return{tag:d,data:h.clamp(b,k)}}}; sjcl.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,d,e,g){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid("ocb iv must be 128 bits");var f,h=sjcl.mode.ocb2.S,l=sjcl.bitArray,k=l.i,m=[0,0,0,0];c=h(a.encrypt(c));var n,p=[];d=d||[];e=e||64;for(f=0;f+4<b.length;f+=4)n=b.slice(f,f+4),m=k(m,n),p=p.concat(k(c,a.encrypt(k(c,n)))),c=h(c);n=b.slice(f);b=l.bitLength(n);f=a.encrypt(k(c,[0,0,0,b]));n=l.clamp(k(n.concat([0,0,0]),f),b);m=k(m,k(n.concat([0,0,0]),f));m=a.encrypt(k(m,k(c,h(c)))); d.length&&(m=k(m,g?d:sjcl.mode.ocb2.pmac(a,d)));return p.concat(l.concat(n,l.clamp(m,e)))},decrypt:function(a,b,c,d,e,g){if(128!==sjcl.bitArray.bitLength(c))throw new sjcl.exception.invalid("ocb iv must be 128 bits");e=e||64;var f=sjcl.mode.ocb2.S,h=sjcl.bitArray,l=h.i,k=[0,0,0,0],m=f(a.encrypt(c)),n,p,r=sjcl.bitArray.bitLength(b)-e,q=[];d=d||[];for(c=0;c+4<r/32;c+=4)n=l(m,a.decrypt(l(m,b.slice(c,c+4)))),k=l(k,n),q=q.concat(n),m=f(m);p=r-32*c;n=a.encrypt(l(m,[0,0,0,p]));n=l(n,h.clamp(b.slice(c),p).concat([0, 0,0]));k=l(k,n);k=a.encrypt(l(k,l(m,f(m))));d.length&&(k=l(k,g?d:sjcl.mode.ocb2.pmac(a,d)));if(!h.equal(h.clamp(k,e),h.bitSlice(b,r)))throw new sjcl.exception.corrupt("ocb: tag doesn't match");return q.concat(h.clamp(n,p))},pmac:function(a,b){var c,d=sjcl.mode.ocb2.S,e=sjcl.bitArray,g=e.i,f=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=g(h,d(d(h)));for(c=0;c+4<b.length;c+=4)h=d(h),f=g(f,a.encrypt(g(h,b.slice(c,c+4))));c=b.slice(c);128>e.bitLength(c)&&(h=g(h,d(h)),c=e.concat(c,[-2147483648,0,0,0]));f=g(f,c); return a.encrypt(g(d(g(h,d(h))),f))},S:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}}; sjcl.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var g=b.slice(0);b=sjcl.bitArray;d=d||[];a=sjcl.mode.gcm.C(!0,a,g,d,c,e||128);return b.concat(a.data,a.tag)},decrypt:function(a,b,c,d,e){var g=b.slice(0),f=sjcl.bitArray,h=f.bitLength(g);e=e||128;d=d||[];e<=h?(b=f.bitSlice(g,h-e),g=f.bitSlice(g,0,h-e)):(b=g,g=[]);a=sjcl.mode.gcm.C(!1,a,g,d,c,e);if(!f.equal(a.tag,b))throw new sjcl.exception.corrupt("gcm: tag doesn't match");return a.data},ka:function(a,b){var c,d,e,g,f,h=sjcl.bitArray.i;e=[0,0, 0,0];g=b.slice(0);for(c=0;128>c;c++){(d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,g));f=0!==(g[3]&1);for(d=3;0<d;d--)g[d]=g[d]>>>1|(g[d-1]&1)<<31;g[0]>>>=1;f&&(g[0]^=-0x1f000000)}return e},j:function(a,b,c){var d,e=c.length;b=b.slice(0);for(d=0;d<e;d+=4)b[0]^=0xffffffff&c[d],b[1]^=0xffffffff&c[d+1],b[2]^=0xffffffff&c[d+2],b[3]^=0xffffffff&c[d+3],b=sjcl.mode.gcm.ka(b,a);return b},C:function(a,b,c,d,e,g){var f,h,l,k,m,n,p,r,q=sjcl.bitArray;n=c.length;p=q.bitLength(c);r=q.bitLength(d);h=q.bitLength(e); f=b.encrypt([0,0,0,0]);96===h?(e=e.slice(0),e=q.concat(e,[1])):(e=sjcl.mode.gcm.j(f,[0,0,0,0],e),e=sjcl.mode.gcm.j(f,e,[0,0,Math.floor(h/0x100000000),h&0xffffffff]));h=sjcl.mode.gcm.j(f,[0,0,0,0],d);m=e.slice(0);d=h.slice(0);a||(d=sjcl.mode.gcm.j(f,h,c));for(k=0;k<n;k+=4)m[3]++,l=b.encrypt(m),c[k]^=l[0],c[k+1]^=l[1],c[k+2]^=l[2],c[k+3]^=l[3];c=q.clamp(c,p);a&&(d=sjcl.mode.gcm.j(f,h,c));a=[Math.floor(r/0x100000000),r&0xffffffff,Math.floor(p/0x100000000),p&0xffffffff];d=sjcl.mode.gcm.j(f,d,a);l=b.encrypt(e); d[0]^=l[0];d[1]^=l[1];d[2]^=l[2];d[3]^=l[3];return{tag:q.bitSlice(d,0,g),data:c}}};sjcl.misc.hmac=function(a,b){this.W=b=b||sjcl.hash.sha256;var c=[[],[]],d,e=b.prototype.blockSize/32;this.w=[new b,new b];a.length>e&&(a=b.hash(a));for(d=0;d<e;d++)c[0][d]=a[d]^909522486,c[1][d]=a[d]^1549556828;this.w[0].update(c[0]);this.w[1].update(c[1]);this.R=new b(this.w[0])}; sjcl.misc.hmac.prototype.encrypt=sjcl.misc.hmac.prototype.mac=function(a){if(this.aa)throw new sjcl.exception.invalid("encrypt on already updated hmac called!");this.update(a);return this.digest(a)};sjcl.misc.hmac.prototype.reset=function(){this.R=new this.W(this.w[0]);this.aa=!1};sjcl.misc.hmac.prototype.update=function(a){this.aa=!0;this.R.update(a)};sjcl.misc.hmac.prototype.digest=function(){var a=this.R.finalize(),a=(new this.W(this.w[1])).update(a).finalize();this.reset();return a}; sjcl.misc.pbkdf2=function(a,b,c,d,e){c=c||1E3;if(0>d||0>c)throw sjcl.exception.invalid("invalid params to pbkdf2");"string"===typeof a&&(a=sjcl.codec.utf8String.toBits(a));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));e=e||sjcl.misc.hmac;a=new e(a);var g,f,h,l,k=[],m=sjcl.bitArray;for(l=1;32*k.length<(d||1);l++){e=g=a.encrypt(m.concat(b,[l]));for(f=1;f<c;f++)for(g=a.encrypt(g),h=0;h<g.length;h++)e[h]^=g[h];k=k.concat(e)}d&&(k=m.clamp(k,d));return k}; sjcl.prng=function(a){this.c=[new sjcl.hash.sha256];this.m=[0];this.P=0;this.H={};this.N=0;this.U={};this.Z=this.f=this.o=this.ha=0;this.b=[0,0,0,0,0,0,0,0];this.h=[0,0,0,0];this.L=void 0;this.M=a;this.D=!1;this.K={progress:{},seeded:{}};this.u=this.ga=0;this.I=1;this.J=2;this.ca=0x10000;this.T=[0,48,64,96,128,192,0x100,384,512,768,1024];this.da=3E4;this.ba=80}; sjcl.prng.prototype={randomWords:function(a,b){var c=[],d;d=this.isReady(b);var e;if(d===this.u)throw new sjcl.exception.notReady("generator isn't seeded");if(d&this.J){d=!(d&this.I);e=[];var g=0,f;this.Z=e[0]=(new Date).valueOf()+this.da;for(f=0;16>f;f++)e.push(0x100000000*Math.random()|0);for(f=0;f<this.c.length&&(e=e.concat(this.c[f].finalize()),g+=this.m[f],this.m[f]=0,d||!(this.P&1<<f));f++);this.P>=1<<this.c.length&&(this.c.push(new sjcl.hash.sha256),this.m.push(0));this.f-=g;g>this.o&&(this.o= g);this.P++;this.b=sjcl.hash.sha256.hash(this.b.concat(e));this.L=new sjcl.cipher.aes(this.b);for(d=0;4>d&&(this.h[d]=this.h[d]+1|0,!this.h[d]);d++);}for(d=0;d<a;d+=4)0===(d+1)%this.ca&&y(this),e=z(this),c.push(e[0],e[1],e[2],e[3]);y(this);return c.slice(0,a)},setDefaultParanoia:function(a,b){if(0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b)throw"Setting paranoia=0 will ruin your security; use it only for testing";this.M=a},addEntropy:function(a,b,c){c=c||"user"; var d,e,g=(new Date).valueOf(),f=this.H[c],h=this.isReady(),l=0;d=this.U[c];void 0===d&&(d=this.U[c]=this.ha++);void 0===f&&(f=this.H[c]=0);this.H[c]=(this.H[c]+1)%this.c.length;switch(typeof a){case "number":void 0===b&&(b=1);this.c[f].update([d,this.N++,1,b,g,1,a|0]);break;case "object":c=Object.prototype.toString.call(a);if("[object Uint32Array]"===c){e=[];for(c=0;c<a.length;c++)e.push(a[c]);a=e}else for("[object Array]"!==c&&(l=1),c=0;c<a.length&&!l;c++)"number"!==typeof a[c]&&(l=1);if(!l){if(void 0=== b)for(c=b=0;c<a.length;c++)for(e=a[c];0<e;)b++,e=e>>>1;this.c[f].update([d,this.N++,2,b,g,a.length].concat(a))}break;case "string":void 0===b&&(b=a.length);this.c[f].update([d,this.N++,3,b,g,a.length]);this.c[f].update(a);break;default:l=1}if(l)throw new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string");this.m[f]+=b;this.f+=b;h===this.u&&(this.isReady()!==this.u&&A("seeded",Math.max(this.o,this.f)),A("progress",this.getProgress()))},isReady:function(a){a=this.T[void 0!== a?a:this.M];return this.o&&this.o>=a?this.m[0]>this.ba&&(new Date).valueOf()>this.Z?this.J|this.I:this.I:this.f>=a?this.J|this.u:this.u},getProgress:function(a){a=this.T[a?a:this.M];return this.o>=a?1:this.f>a?1:this.f/a},startCollectors:function(){if(!this.D){this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)};if(window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector, !1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else if(document.attachEvent)document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector);else throw new sjcl.exception.bug("can't attach event"); this.D=!0}},stopCollectors:function(){this.D&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove", this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.D=!1)},addEventListener:function(a,b){this.K[a][this.ga++]=b},removeEventListener:function(a,b){var c,d,e=this.K[a],g=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&g.push(d);for(c=0;c<g.length;c++)d=g[c],delete e[d]},la:function(){C(1)},oa:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(d){c=b=0}0!=b&&0!=c&&sjcl.random.addEntropy([b,c],2,"mouse");C(0)},qa:function(a){a= a.touches[0]||a.changedTouches[0];sjcl.random.addEntropy([a.pageX||a.clientX,a.pageY||a.clientY],1,"touch");C(0)},ma:function(){C(2)},ea:function(a){a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z;if(window.orientation){var b=window.orientation;"number"===typeof b&&sjcl.random.addEntropy(b,1,"accelerometer")}a&&sjcl.random.addEntropy(a,2,"accelerometer");C(0)}}; function A(a,b){var c,d=sjcl.random.K[a],e=[];for(c in d)d.hasOwnProperty(c)&&e.push(d[c]);for(c=0;c<e.length;c++)e[c](b)}function C(a){"undefined"!==typeof window&&window.performance&&"function"===typeof window.performance.now?sjcl.random.addEntropy(window.performance.now(),a,"loadtime"):sjcl.random.addEntropy((new Date).valueOf(),a,"loadtime")}function y(a){a.b=z(a).concat(z(a));a.L=new sjcl.cipher.aes(a.b)} function z(a){for(var b=0;4>b&&(a.h[b]=a.h[b]+1|0,!a.h[b]);b++);return a.L.encrypt(a.h)}function B(a,b){return function(){b.apply(a,arguments)}}sjcl.random=new sjcl.prng(6); a:try{var D,E,F,G;if(G="undefined"!==typeof module&&module.exports){var H;try{H=require("crypto")}catch(a){H=null}G=E=H}if(G&&E.randomBytes)D=E.randomBytes(128),D=new Uint32Array((new Uint8Array(D)).buffer),sjcl.random.addEntropy(D,1024,"crypto['randomBytes']");else if("undefined"!==typeof window&&"undefined"!==typeof Uint32Array){F=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(F);else if(window.msCrypto&&window.msCrypto.getRandomValues)window.msCrypto.getRandomValues(F); else break a;sjcl.random.addEntropy(F,1024,"crypto['getRandomValues']")}}catch(a){"undefined"!==typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(a))} sjcl.json={defaults:{v:1,iter:1E3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},ja:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json,g=e.g({iv:sjcl.random.randomWords(4,0)},e.defaults),f;e.g(g,c);c=g.adata;"string"===typeof g.salt&&(g.salt=sjcl.codec.base64.toBits(g.salt));"string"===typeof g.iv&&(g.iv=sjcl.codec.base64.toBits(g.iv));if(!sjcl.mode[g.mode]||!sjcl.cipher[g.cipher]||"string"===typeof a&&100>=g.iter||64!==g.ts&&96!==g.ts&&128!==g.ts||128!==g.ks&&192!==g.ks&&0x100!==g.ks||2>g.iv.length|| 4<g.iv.length)throw new sjcl.exception.invalid("json encrypt: invalid parameters");"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,g),a=f.key.slice(0,g.ks/32),g.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.publicKey&&(f=a.kem(),g.kemtag=f.tag,a=f.key.slice(0,g.ks/32));"string"===typeof b&&(b=sjcl.codec.utf8String.toBits(b));"string"===typeof c&&(g.adata=c=sjcl.codec.utf8String.toBits(c));f=new sjcl.cipher[g.cipher](a);e.g(d,g);d.key=a;g.ct="ccm"===g.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&& b instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.encrypt(f,b,g.iv,c,g.ts):sjcl.mode[g.mode].encrypt(f,b,g.iv,c,g.ts);return g},encrypt:function(a,b,c,d){var e=sjcl.json,g=e.ja.apply(e,arguments);return e.encode(g)},ia:function(a,b,c,d){c=c||{};d=d||{};var e=sjcl.json;b=e.g(e.g(e.g({},e.defaults),b),c,!0);var g,f;g=b.adata;"string"===typeof b.salt&&(b.salt=sjcl.codec.base64.toBits(b.salt));"string"===typeof b.iv&&(b.iv=sjcl.codec.base64.toBits(b.iv));if(!sjcl.mode[b.mode]||!sjcl.cipher[b.cipher]||"string"=== typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&0x100!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)throw new sjcl.exception.invalid("json decrypt: invalid parameters");"string"===typeof a?(f=sjcl.misc.cachedPbkdf2(a,b),a=f.key.slice(0,b.ks/32),b.salt=f.salt):sjcl.ecc&&a instanceof sjcl.ecc.elGamal.secretKey&&(a=a.unkem(sjcl.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32));"string"===typeof g&&(g=sjcl.codec.utf8String.toBits(g));f=new sjcl.cipher[b.cipher](a);g="ccm"=== b.mode&&sjcl.arrayBuffer&&sjcl.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?sjcl.arrayBuffer.ccm.decrypt(f,b.ct,b.iv,b.tag,g,b.ts):sjcl.mode[b.mode].decrypt(f,b.ct,b.iv,g,b.ts);e.g(d,b);d.key=a;return 1===c.raw?g:sjcl.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=sjcl.json;return e.ia(a,e.decode(b),c,d)},encode:function(a){var b,c="{",d="";for(b in a)if(a.hasOwnProperty(b)){if(!b.match(/^[a-z0-9]+$/i))throw new sjcl.exception.invalid("json encode: invalid property name");c+=d+'"'+ b+'":';d=",";switch(typeof a[b]){case "number":case "boolean":c+=a[b];break;case "string":c+='"'+escape(a[b])+'"';break;case "object":c+='"'+sjcl.codec.base64.fromBits(a[b],0)+'"';break;default:throw new sjcl.exception.bug("json encode: unsupported type");}}return c+"}"},decode:function(a){a=a.replace(/\s/g,"");if(!a.match(/^\{.*\}$/))throw new sjcl.exception.invalid("json decode: this isn't json!");a=a.replace(/^\{|\}$/g,"").split(/,/);var b={},c,d;for(c=0;c<a.length;c++){if(!(d=a[c].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i)))throw new sjcl.exception.invalid("json decode: this isn't json!"); null!=d[3]?b[d[2]]=parseInt(d[3],10):null!=d[4]?b[d[2]]=d[2].match(/^(ct|adata|salt|iv)$/)?sjcl.codec.base64.toBits(d[4]):unescape(d[4]):null!=d[5]&&(b[d[2]]="true"===d[5])}return b},g:function(a,b,c){void 0===a&&(a={});if(void 0===b)return a;for(var d in b)if(b.hasOwnProperty(d)){if(c&&void 0!==a[d]&&a[d]!==b[d])throw new sjcl.exception.invalid("required parameter overridden");a[d]=b[d]}return a},sa:function(a,b){var c={},d;for(d in a)a.hasOwnProperty(d)&&a[d]!==b[d]&&(c[d]=a[d]);return c},ra:function(a, b){var c={},d;for(d=0;d<b.length;d++)void 0!==a[b[d]]&&(c[b[d]]=a[b[d]]);return c}};sjcl.encrypt=sjcl.json.encrypt;sjcl.decrypt=sjcl.json.decrypt;sjcl.misc.pa={};sjcl.misc.cachedPbkdf2=function(a,b){var c=sjcl.misc.pa,d;b=b||{};d=b.iter||1E3;c=c[a]=c[a]||{};d=c[d]=c[d]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):sjcl.random.randomWords(2,0)};c=void 0===b.salt?d.firstSalt:b.salt;d[c]=d[c]||sjcl.misc.pbkdf2(a,c,b.iter);return{key:d[c].slice(0),salt:c.slice(0)}}; amazon-pay-module/view/frontend/web/js/lib/.htaccess000077700000000177151323541140016444 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/amazon-core.js000077700000011145151323541140016646 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'jquery', 'ko', 'mage/url', 'amazonPaymentConfig', 'Magento_Ui/js/model/messageList', 'amazonWidgetsLoader', 'jquery/jquery-storageapi', 'mage/cookies' ], function ($, ko, url, amazonPaymentConfig, messageList) { 'use strict'; var amazonDefined = ko.observable(false), amazonLoginError = ko.observable(false), accessToken = ko.observable(null), // Match region config to amazon.Login.Region regions = {'us': 'NA', 'de': 'EU', 'uk': 'EU', 'jp': 'APAC'}, sandboxMode, region; accessToken($.mage.cookies.get('amazon_Login_accessToken')); var initAmazonLogin = function () { amazon.Login.setClientId(amazonPaymentConfig.getValue('clientId')); //eslint-disable-line no-undef amazon.Login.setSandboxMode(amazonPaymentConfig.getValue('isSandboxEnabled', false)); //eslint-disable-line no-undef amazon.Login.setRegion(regions[amazonPaymentConfig.getValue('region')]); //eslint-disable-line no-undef amazon.Login.setUseCookie(true); //eslint-disable-line no-undef doLogoutOnFlagCookie(); //eslint-disable-line no-use-before-define amazonDefined(true); }; if (typeof amazon === 'undefined') { window.onAmazonLoginReady = initAmazonLogin; } else { initAmazonLogin(); } // Widgets.js ready callback window.onAmazonPaymentsReady = function() { $(window).trigger('OffAmazonPayments'); }; /** * Log user out of amazon */ function amazonLogout() { $.mage.cookies.clear('amazon_Login_accessToken'); $.ajax({ url: url.build('amazon/logout'), context: this }).always(function () { if (amazonDefined()) { amazon.Login.logout(); //eslint-disable-line no-undef } else { var logout = amazonDefined.subscribe(function (defined) { //eslint-disable-line vars-on-top if (defined) { amazon.Login.logout(); // eslint-disable-line no-undef logout.dispose(); //remove subscribe } }); } }); } /** * Check if login error / logout cookies are present */ function doLogoutOnFlagCookie() { var errorFlagCookie = 'amz_auth_err', amazonLogoutCookie = 'amz_auth_logout'; //eslint-disable-next-line no-use-before-define $.cookieStorage.isSet(errorFlagCookie) ? amazonLogoutThrowError(errorFlagCookie) : false; //eslint-disable-next-line no-use-before-define $.cookieStorage.isSet(amazonLogoutCookie) ? amazonLogoutThrowError(amazonLogoutCookie) : false; } /** * Handle deletion of cookie and log user out if present */ function amazonLogoutThrowError(cookieToRemove) { amazonLogout(); document.cookie = cookieToRemove + '=; Path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; amazonLoginError(true); } function handleWidgetError(error) { console.log('OffAmazonPayments.Widgets', error.getErrorCode(), error.getErrorMessage()); switch (error.getErrorCode()) { case 'BuyerSessionExpired': messageList.addErrorMessage({message: $.mage.__('Your Amazon session has expired. Please sign in again by clicking the Amazon Pay Button.')}); var storage = require('Amazon_Payment/js/model/storage'); //TODO: clean up this circular dependency storage.amazonlogOut(); break; case 'ITP': // ITP errors are how handled within the widget code break; default: messageList.addErrorMessage({message: $.mage.__(error.getErrorMessage())}); } } return { /** * Log user out of Amazon */ AmazonLogout: amazonLogout, amazonDefined: amazonDefined, accessToken: accessToken, amazonLoginError: amazonLoginError, handleWidgetError: handleWidgetError }; }); amazon-pay-module/view/frontend/web/js/action/place-order.js000077700000010340151323541140020101 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( [ 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/model/url-builder', 'mage/storage', 'mage/url', 'Magento_Checkout/js/model/error-processor', 'Magento_Customer/js/model/customer', 'Magento_Checkout/js/model/full-screen-loader', 'Amazon_Payment/js/model/storage', 'Amazon_Payment/js/model/amazonPaymentConfig', 'Magento_Customer/js/customer-data' ], function (quote, urlBuilder, storage, url, errorProcessor, customer, fullScreenLoader, amazonStorage, amazonPaymentConfig, customerData) { 'use strict'; return function (paymentData, redirectOnSuccess) { var serviceUrl, payload; redirectOnSuccess = redirectOnSuccess !== false; /** Checkout for guest and registered customer. */ if (!customer.isLoggedIn()) { serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/set-payment-information', { quoteId: quote.getQuoteId() }); payload = { confirmOrder: true, cartId: quote.getQuoteId(), email: quote.guestEmail, paymentMethod: paymentData, billingAddress: quote.billingAddress() }; } else { serviceUrl = urlBuilder.createUrl('/carts/mine/set-payment-information', {}); payload = { confirmOrder: true, cartId: quote.getQuoteId(), paymentMethod: paymentData, billingAddress: quote.billingAddress() }; } fullScreenLoader.startLoader(); customerData.invalidate(['cart']); if(amazonPaymentConfig.getValue('scaRegions').indexOf(amazonPaymentConfig.getValue('region')) !== -1) { console.log('SCA enabled for region: ' + amazonPaymentConfig.getValue('region')); return OffAmazonPayments.initConfirmationFlow(amazonPaymentConfig.getValue('merchantId'), amazonStorage.getOrderReference(), function(confirmationFlow) { return storage.post( serviceUrl, JSON.stringify(payload) ).done( function () { confirmationFlow.success(); } ).fail( function (response) { confirmationFlow.error(); errorProcessor.process(response); amazonStorage.amazonDeclineCode(response.responseJSON.code); fullScreenLoader.stopLoader(true); } ); }); } else { console.log('SCA disabled for region: ' + amazonPaymentConfig.getValue('region')); return storage.post( serviceUrl, JSON.stringify(payload) ).done( function () { if(redirectOnSuccess) { window.location.replace(url.build('amazonpayments/payment/completecheckout/?AuthenticationStatus=Success')); } } ).fail( function (response) { errorProcessor.process(response); amazonStorage.amazonDeclineCode(response.responseJSON.code); fullScreenLoader.stopLoader(true); } ); } }; } ); amazon-pay-module/view/frontend/web/js/action/.htaccess000077700000000177151323541140017153 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/action/populate-shipping-address.js000077700000004332151323541140023003 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( [ 'jquery', 'Magento_Checkout/js/model/address-converter', 'Magento_Checkout/js/model/quote', 'uiRegistry', 'Magento_Checkout/js/checkout-data', 'Magento_Checkout/js/model/checkout-data-resolver', 'Amazon_Payment/js/model/storage' ], function ($, addressConverter, quote, registry, checkoutData, checkoutDataResolver, amazonStorage) { 'use strict'; /** * Populate shipping address form in shipping step from quote model * */ function populateShippingForm() { var shippingAddressData = checkoutData.getShippingAddressFromData(); registry.async('checkoutProvider')(function (checkoutProvider) { checkoutProvider.set( 'shippingAddress', $.extend({}, checkoutProvider.get('shippingAddress'), shippingAddressData) ); }); checkoutDataResolver.resolveShippingAddress(); } /** * Populate shipping address form in shipping step from quote model * @private */ return function () { //check to see if user is logged out of amazon (otherwise shipping form won't be in DOM) if (!amazonStorage.isAmazonAccountLoggedIn) { populateShippingForm(); } //subscribe to logout and trigger shippingform population when logged out. amazonStorage.isAmazonAccountLoggedIn.subscribe(function (loggedIn) { if (!loggedIn) { populateShippingForm(); } }); }; } ); amazon-pay-module/view/frontend/web/js/view/checkout/summary/grand-total-mixin.js000077700000000762151323541140024250 0ustar00/*global define*/ define([ 'Amazon_Payment/js/model/storage' ], function (amazonStorage) { 'use strict'; return function (GrandTotal) { return GrandTotal.extend({ /** * @return {Boolean} */ isBaseGrandTotalDisplayNeeded: function () { if (!amazonStorage.isAmazonAccountLoggedIn()) { return this._super(); } return false; } }); } }); amazon-pay-module/view/frontend/web/js/view/checkout/summary/.htaccess000077700000000177151323541140022152 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/checkout/.htaccess000077700000000177151323541140020455 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/notification.js000077700000001651151323541140020074 0ustar00/*global define*/ define( [ 'jquery', 'underscore', 'ko', 'uiComponent', 'Amazon_Payment/js/model/storage', 'uiRegistry' ], function ( $, _, ko, Component, amazonStorage, registry ) { 'use strict'; return Component.extend( { defaults: { template: 'Amazon_Payment/notification' }, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, chargeOnOrder: ko.observable(registry.get('amazonPayment').chargeOnOrder), isEuPaymentRegion: ko.observable(registry.get('amazonPayment').isEuPaymentRegion), /** * Init */ initialize: function () { this._super(); } } ); } ); amazon-pay-module/view/frontend/web/js/view/checkout-button.js000077700000001532151323541140020522 0ustar00/*global define*/ define( [ 'jquery', 'uiComponent', 'ko', 'Magento_Customer/js/model/customer', 'Amazon_Payment/js/model/storage' ], function ( $, Component, ko, customer, amazonStorage ) { 'use strict'; return Component.extend( { defaults: { template: 'Amazon_Payment/checkout-button' }, isCustomerLoggedIn: customer.isLoggedIn, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isPwaVisible: amazonStorage.isPwaVisible, /** * Init */ initialize: function () { this._super(); } } ); } ); amazon-pay-module/view/frontend/web/js/view/checkout-widget-address.js000077700000017540151323541140022123 0ustar00/*global define*/ define( [ 'jquery', 'uiComponent', 'ko', 'Magento_Customer/js/model/customer', 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/action/select-shipping-address', 'Magento_Checkout/js/model/shipping-rate-processor/new-address', 'Magento_Checkout/js/action/set-shipping-information', 'Amazon_Payment/js/model/storage', 'amazonCore', 'Magento_Checkout/js/model/shipping-service', 'Magento_Checkout/js/model/address-converter', 'mage/storage', 'Magento_Checkout/js/model/full-screen-loader', 'Magento_Checkout/js/model/error-processor', 'Magento_Checkout/js/model/url-builder', 'Magento_Checkout/js/checkout-data', 'Magento_Checkout/js/model/checkout-data-resolver', 'uiRegistry', 'Amazon_Payment/js/messages' ], function ( $, Component, ko, customer, quote, selectShippingAddress, shippingProcessor, setShippingInformationAction, amazonStorage, amazonCore, shippingService, addressConverter, storage, fullScreenLoader, errorProcessor, urlBuilder, checkoutData, checkoutDataResolver, registry, amazonMessages ) { 'use strict'; var self; return Component.extend({ defaults: { template: 'Amazon_Payment/checkout-widget-address' }, options: { sellerId: registry.get('amazonPayment').merchantId, addressWidgetDOMId: 'addressBookWidgetDiv', widgetScope: registry.get('amazonPayment').loginScope }, isCustomerLoggedIn: customer.isLoggedIn, amazonCustomerEmail: amazonStorage.amazonCustomerEmail, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isAmazonEnabled: ko.observable(registry.get('amazonPayment').isPwaEnabled), rates: shippingService.getShippingRates(), /** * Init */ initialize: function () { self = this; this._super(); // Update checkoutUrl for step-navigator if orderReferenceId is set (e.g. InvaldPaymentMethod) if (amazonStorage.orderReferenceId()) { window.checkoutConfig.checkoutUrl += '?orderReferenceId=' + amazonStorage.orderReferenceId() } }, /** * Call when component template is rendered */ initAddressWidget: function () { if(amazonStorage.amazonDefined()) { self.renderAddressWidget(); } else { var subscription = amazonStorage.amazonDefined.subscribe(function (defined) { //eslint-disable-line vars-on-top if (defined) { self.renderAddressWidget(); subscription.dispose(); } }); } }, /** * render Amazon address Widget */ renderAddressWidget: function () { new OffAmazonPayments.Widgets.AddressBook({ // eslint-disable-line no-undef sellerId: self.options.sellerId, scope: self.options.widgetScope, /** * Order reference creation callback */ onOrderReferenceCreate: function (orderReference) { var orderid = amazonStorage.orderReferenceId() || orderReference.getAmazonOrderReferenceId(); amazonStorage.setOrderReference(orderid); }, /** * Address select callback */ onAddressSelect: function () { // orderReference self.getShippingAddressFromAmazon(); }, displayMode: self.isShippingAddressReadOnly() ? 'Read' : '', design: { designMode: 'responsive' }, /** * Error callback */ onError: amazonCore.handleWidgetError }).bind(self.options.addressWidgetDOMId); amazonMessages.displayMessages(); }, /** * Get shipping address from Amazon API */ getShippingAddressFromAmazon: function () { var serviceUrl, payload; amazonStorage.isShippingMethodsLoading(true); shippingService.isLoading(true); serviceUrl = urlBuilder.createUrl('/amazon-shipping-address/:amazonOrderReference', { amazonOrderReference: amazonStorage.getOrderReference() }), payload = { addressConsentToken: amazonStorage.getAddressConsentToken() }; storage.put( serviceUrl, JSON.stringify(payload) ).done( function (data) { var amazonAddress = data.shift(), addressData = addressConverter.formAddressDataToQuoteAddress(amazonAddress), i; //if telephone is blank set it to 00000000 so it passes the required validation addressData.telephone = !addressData.telephone ? '0000000000' : addressData.telephone; //fill in blank street fields if ($.isArray(addressData.street)) { for (i = addressData.street.length; i <= 2; i++) { addressData.street[i] = ''; } } checkoutData.setShippingAddressFromData( addressConverter.quoteAddressToFormAddressData(addressData) ); checkoutDataResolver.resolveEstimationAddress(); amazonStorage.isAmazonShippingAddressSelected(true); } ).fail( function (response) { errorProcessor.process(response); //remove shipping loader and set shipping rates to 0 on a fail shippingService.setShippingRates([]); amazonStorage.isShippingMethodsLoading(false); if (self.isShippingAddressReadOnly()) { shippingService.isLoading(false); $('.checkout-shipping-method').hide(); } } ); }, /** * Get Amazon Order Reference ID */ getAmazonOrderReference: function () { return amazonStorage.getOrderReference(); }, /** * Get Amazon Address Consent Token */ getAddressConsentToken: function () { return amazonStorage.getAddressConsentToken(); }, /** * Is shipping widget set to read-only (orderReferenceId already set?) */ isShippingAddressReadOnly: function() { return (amazonStorage.orderReferenceId()); }, /** * Continue to payment (e.g. if shipping address is read-only) */ continuePayment: function() { window.location = window.checkoutConfig.checkoutUrl + '#payment'; } }); } ); amazon-pay-module/view/frontend/web/js/view/checkout-revert.js000077700000003343151323541140020520 0ustar00/*global define*/ define( [ 'jquery', 'underscore', 'ko', 'uiComponent', 'Amazon_Payment/js/model/storage', 'mage/storage', 'Magento_Checkout/js/model/error-processor', 'Magento_Checkout/js/model/url-builder', 'Magento_Checkout/js/model/full-screen-loader', 'uiRegistry' ], function ( $, _, ko, Component, amazonStorage, storage, errorProcessor, urlBuilder, fullScreenLoader, registry ) { 'use strict'; return Component.extend({ defaults: { template: 'Amazon_Payment/checkout-revert' }, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isAmazonEnabled: ko.observable(registry.get('amazonPayment').isPwaEnabled), /** * Init */ initialize: function () { this._super(); }, /** * Revert checkout */ revertCheckout: function () { var serviceUrl = urlBuilder.createUrl('/amazon/order-ref', {}); fullScreenLoader.startLoader(); storage.delete( serviceUrl ).done( function () { amazonStorage.amazonlogOut(); fullScreenLoader.stopLoader(); } ).fail( function (response) { fullScreenLoader.stopLoader(); errorProcessor.process(response); } ); } }); } ); amazon-pay-module/view/frontend/web/js/view/shipping.js000077700000004571151323541140017233 0ustar00/*global define*/ define( [ 'jquery', 'Magento_Checkout/js/view/shipping', 'Magento_Customer/js/model/customer', 'Amazon_Payment/js/model/storage', 'Amazon_Payment/js/messages' ], function ( $, Component, customer, amazonStorage, amazonMessages ) { 'use strict'; return Component.extend({ noShippingAddressSelectedMsg: 'No shipping address has been selected for this order, please try to refresh the page or add a new shipping address in the Address Book widget.', /** * Initialize shipping */ initialize: function () { this._super(); this.isNewAddressAdded(amazonStorage.isAmazonAccountLoggedIn()); amazonStorage.isAmazonAccountLoggedIn.subscribe(function (value) { this.isNewAddressAdded(value); }, this); return this; }, /** * Validate guest email */ validateGuestEmail: function () { var loginFormSelector = 'form[data-role=email-with-possible-login]'; $(loginFormSelector).validation(); return $(loginFormSelector + ' input[type=email]').valid(); }, /** * Overridden validateShippingInformation for Amazon Pay to bypass validation * * @inheritDoc */ validateShippingInformation: function () { if (!amazonStorage.isAmazonAccountLoggedIn()) { return this._super(); } if (!customer.isLoggedIn()) { if (!(amazonStorage.isAmazonShippingAddressSelected() && this.validateGuestEmail())) { amazonMessages.addMessage('error', this.noShippingAddressSelectedMsg); amazonMessages.displayMessages(); return false; } } if (!(amazonStorage.isAmazonShippingAddressSelected())) { amazonMessages.addMessage('error', this.noShippingAddressSelectedMsg); amazonMessages.displayMessages(); return false; } return true; } }); } ); amazon-pay-module/view/frontend/web/js/view/form/element/email.js000077700000002746151323541140021077 0ustar00define([ 'jquery', 'Magento_Checkout/js/view/form/element/email', 'Magento_Customer/js/customer-data', 'Magento_Checkout/js/model/quote', 'Magento_Checkout/js/checkout-data', 'mage/validation' ], function ($, Component, customerData, quote, checkoutData) { 'use strict'; /** * Get Amazon customer email */ function getAmazonCustomerEmail() { // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (window.checkoutConfig.hasOwnProperty('amazonLogin') && typeof window.checkoutConfig.amazonLogin.amazon_customer_email === 'string' ) { return window.checkoutConfig.amazonLogin.amazon_customer_email; } // jscs:enable requireCamelCaseOrUpperCaseIdentifiers return ''; } return Component.extend({ defaults: { email: checkoutData.getInputFieldEmailValue() || getAmazonCustomerEmail(), template: 'Amazon_Payment/form/element/email' }, /** * Init email validator */ initialize: function () { this._super(); if (this.email()) { if ($.validator.methods['validate-email'].call(this, this.email())) { quote.guestEmail = this.email(); checkoutData.setValidatedEmailValue(this.email()); } checkoutData.setInputFieldEmailValue(this.email()); } return this; } }); }); amazon-pay-module/view/frontend/web/js/view/form/element/.htaccess000077700000000177151323541140021244 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/form/.htaccess000077700000000177151323541140017613 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/payment/method-renderer/amazonlogin.js000077700000001344151323541140024464 0ustar00define( [ 'Magento_Checkout/js/view/payment/default', 'Amazon_Payment/js/model/storage', ], function ( Component, amazonStorage ) { 'use strict'; return Component.extend( { defaults: { template: 'Amazon_Payment/payment/amazonlogin' }, getCode: function () { return 'amazonlogin'; }, isActive: function () { return true; }, isPwaVisible: function () { return amazonStorage.isPwaVisible && amazonStorage.isAmazonEnabled; } } ); } ); amazon-pay-module/view/frontend/web/js/view/payment/method-renderer/.htaccess000077700000000177151323541140023411 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/payment/method-renderer/amazon-payment-widget.js000077700000020165151323541140026371 0ustar00define( [ 'jquery', 'Magento_Checkout/js/view/payment/default', 'ko', 'Magento_Customer/js/model/customer', 'Magento_Customer/js/customer-data', 'Magento_Checkout/js/model/quote', 'Amazon_Payment/js/model/storage', 'amazonCore', 'mage/storage', 'Magento_Checkout/js/model/full-screen-loader', 'Amazon_Payment/js/action/place-order', 'Magento_Checkout/js/action/get-totals', 'Magento_Checkout/js/model/error-processor', 'Magento_Checkout/js/model/address-converter', 'Magento_Checkout/js/action/select-billing-address', 'Magento_Checkout/js/model/payment/additional-validators', 'Magento_Checkout/js/model/url-builder', 'amazonPaymentConfig', 'uiRegistry', 'Amazon_Payment/js/messages' ], function ( $, Component, ko, customer, customerData, quote, amazonStorage, amazonCore, storage, fullScreenLoader, placeOrderAction, getTotalsAction, errorProcessor, addressConverter, selectBillingAddress, additionalValidators, urlBuilder, amazonPaymentConfig, registry, amazonMessages ) { 'use strict'; var countryData = customerData.get('directory-data'); return Component.extend({ defaults: { template: 'Amazon_Payment/payment/amazon-payment-widget', paymentWidgetDOMId: 'walletWidgetDiv', presentmentDOMId: 'tr.totals.charge', apInputDOMId: '#amazon_payment', customerEmail: '#customer-email' }, isCustomerLoggedIn: customer.isLoggedIn, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isPwaVisible: amazonStorage.isPwaVisible, shippingAddress: quote.shippingAddress, billingAddress: quote.billingAddress, isPlaceOrderDisabled: amazonStorage.isPlaceOrderDisabled, /** * Inits */ initialize: function () { this._super(); }, /** * Init payment widget */ initPaymentWidget: function () { var $amazonPayment = $(this.apInputDOMId); this.initDefaultValues(); this.renderPaymentWidget(); $amazonPayment.trigger('click'); //activate Amazon Pay method on render $amazonPayment.trigger('rendered'); }, /** * Init potentially asynchronous values */ initDefaultValues: function () { registry.get('amazonPayment', function (amazonPayment) { this.widgetScope = amazonPayment.loginScope; this.sellerId = amazonPayment.merchantId; this.presentmentCurrency = amazonPayment.presentmentCurrency; this.useMultiCurrency = amazonPayment.useMultiCurrency; }.bind(this)); }, /** * render Amazon Pay Widget */ renderPaymentWidget: function () { var widget = new OffAmazonPayments.Widgets.Wallet({ // eslint-disable-line no-undef sellerId: this.sellerId, scope: this.widgetScope, amazonOrderReferenceId: amazonStorage.getOrderReference(), /** * Payment select callback */ onPaymentSelect: function () { // orderReference amazonStorage.isPlaceOrderDisabled(true); this.setBillingAddressFromAmazon(); }.bind(this), design: { designMode: 'responsive' }, /** * Error callback */ onError: amazonCore.handleWidgetError }); if (this.useMultiCurrency) { widget.setPresentmentCurrency(this.presentmentCurrency); $(this.presentmentDOMId).hide(); } else { $(this.presentmentDOMId).show(); } widget.bind(this.paymentWidgetDOMId); amazonMessages.displayMessages(); }, /** * Return payment code */ getCode: function () { return 'amazon_payment'; }, /** * Is widget active? */ isActive: function () { return true; }, /** * Return country name */ getCountryName: function (countryId) { return countryData()[countryId] !== undefined ? countryData()[countryId].name : ''; }, /** * Check if country name set */ checkCountryName: function (countryId) { return countryData()[countryId] !== undefined; }, /** * Save billing address */ setBillingAddressFromAmazon: function () { var serviceUrl = urlBuilder.createUrl('/amazon-billing-address/:amazonOrderReference', { amazonOrderReference: amazonStorage.getOrderReference() }), payload = { addressConsentToken: amazonStorage.getAddressConsentToken() }; fullScreenLoader.startLoader(); storage.put( serviceUrl, JSON.stringify(payload) ).done( function (data) { var amazonAddress = data.shift(), addressData; addressData = addressConverter.formAddressDataToQuoteAddress(amazonAddress); addressData.telephone = !addressData.telephone ? '0000000000' : addressData.telephone; selectBillingAddress(addressData); amazonStorage.isPlaceOrderDisabled(false); if (window.checkoutConfig.amazonLogin.amazon_customer_email) { var customerField = $(this.customerEmail).val(); if (!customerField) { $(this.customerEmail).val(window.checkoutConfig.amazonLogin.amazon_customer_email); } } } ).fail( function (response) { errorProcessor.process(response); } ).always( function () { fullScreenLoader.stopLoader(); } ); }, /** * Return Magento billing object */ getData: function () { return { 'method': this.item.method, 'additional_data': { 'sandbox_simulation_reference': amazonStorage.sandboxSimulationReference() } }; }, /** * Save order */ placeOrder: function (data, event) { var placeOrder; if (event) { event.preventDefault(); } if (this.validate() && additionalValidators.validate()) { this.isPlaceOrderActionAllowed(false); placeOrder = placeOrderAction(this.getData(), this.redirectAfterPlaceOrder); $.when(placeOrder).fail(function () { this.isPlaceOrderActionAllowed(true); }.bind(this)).done(this.afterPlaceOrder.bind(this)); return true; } return false; } }); } ); amazon-pay-module/view/frontend/web/js/view/payment/amazon-pay.js000077700000000633151323541140021136 0ustar00define([ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' ], function ( Component, rendererList ) { 'use strict'; rendererList.push( { type: 'amazon_payment', component: 'Amazon_Payment/js/view/payment/method-renderer/amazon-payment-widget' } ); /** Add view logic here if needed */ return Component.extend({}); }); amazon-pay-module/view/frontend/web/js/view/payment/amazonlogin.js000077700000000717151323541140021403 0ustar00define( [ 'uiComponent', 'Magento_Checkout/js/model/payment/renderer-list' ], function ( Component, rendererList ) { 'use strict'; rendererList.push( { type: 'amazonlogin', component: 'Amazon_Payment/js/view/payment/method-renderer/amazonlogin' } ); // Add view logic here if needed return Component.extend({}); } ); amazon-pay-module/view/frontend/web/js/view/payment/list.js000077700000012102151323541140020027 0ustar00define([ 'jquery', 'underscore', 'ko', 'Magento_Checkout/js/view/payment/list', 'Magento_Checkout/js/model/payment/method-list', 'Magento_Checkout/js/model/checkout-data-resolver', 'Magento_Checkout/js/model/address-converter', 'Magento_Checkout/js/model/quote', 'Amazon_Payment/js/action/populate-shipping-address', 'Amazon_Payment/js/model/storage' ], function ( $, _, ko, Component, paymentMethods, checkoutDataResolver, addressConverter, quote, populateShippingAddress, amazonStorage ) { 'use strict'; var self; return Component.extend({ /** * Initialize view. * * @returns {Component} Chainable. */ initialize: function () { self = this; amazonStorage.isAmazonAccountLoggedIn.subscribe(function (value) { if (!value) { this._reloadPaymentMethods(); } }, this); this._hidePaymentMethodsOnLoad(); //hide methods on load //subscribe to payment methods to remove other payment methods from render list paymentMethods.subscribe(function (changes) { checkoutDataResolver.resolvePaymentMethod(); //remove renderer for "deleted" payment methods _.each(changes, function (change) { if (this._shouldRemovePaymentMethod(change.value.method)) { this.removeRenderer(change.value.method); change.status = 'deleted'; } }, this); }, this, 'arrayChange'); this._setupDeclineHandler(); this._super(); return this; }, /** * Check if a payment method is applicable with Amazon Pay * @param {String} method * @returns {Boolean} * @private */ _shouldRemovePaymentMethod: function (method) { return amazonStorage.isAmazonAccountLoggedIn() && method !== 'amazon_payment' && method !== 'free'; }, /** * handle decline codes * @private */ _setupDeclineHandler: function () { amazonStorage.amazonDeclineCode.subscribe(function (declined) { switch (declined) { //hard decline case 4273: //populate shipping form populateShippingAddress(); amazonStorage.amazonlogOut(); this._reloadPaymentMethods(); amazonStorage.amazonDeclineCode(false); break; //soft decline case 7638: amazonStorage.isPlaceOrderDisabled(true); this._reInitializeAmazonWalletWidget(); this._hideEditableOptions(); amazonStorage.amazonDeclineCode(false); break; default: amazonStorage.amazonDeclineCode(false); break; } }, this); }, /** * When payment methods exist on load hook into widget render to remove when widget has rendered * @private */ _hidePaymentMethodsOnLoad: function () { if (paymentMethods().length > 0) { //if the payment methods are already set $(document).on('rendered', '#amazon_payment', function () { _.each(paymentMethods(), function (payment) { if (this._shouldRemovePaymentMethod(payment.method)) { this.removeRenderer(payment.method); } }, self); }); } }, /** * reload payment methods on decline * @private */ _reloadPaymentMethods: function () { _.each(paymentMethods(), function (paymentMethodData) { if (paymentMethodData.method === 'amazon_payment' && !amazonStorage.isAmazonAccountLoggedIn()) { this.removeRenderer(paymentMethodData.method); } else { this.createRenderer(paymentMethodData); } }, this); }, /** * re-intialises Amazon wallet widget * @private */ _reInitializeAmazonWalletWidget: function () { var child = this.getChild('amazon_payment'); if (child) { child.renderPaymentWidget(); } }, /** * hides editable content and links to prevent unexptect behaviour * @private */ _hideEditableOptions: function () { $('.payment-option.discount-code', '#payment').remove(); $('.action-edit', '.shipping-information').remove(); $('.opc-progress-bar-item._complete', '.opc-progress-bar').addClass('lock-step'); } }); }); amazon-pay-module/view/frontend/web/js/view/payment/.htaccess000077700000000177151323541140020325 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/shipping-address/inline-form.js000077700000002517151323541140023073 0ustar00define([ 'uiComponent', 'ko', 'Amazon_Payment/js/model/storage' ], function (Component, ko, amazonStorage) { 'use strict'; return Component.extend({ defaults: { template: 'Amazon_Payment/shipping-address/inline-form', formSelector: 'co-shipping-form', accountFormSelector: 'customer-email-fieldset' }, /** * Init inline form */ initObservable: function () { this._super(); amazonStorage.isAmazonAccountLoggedIn.subscribe(this.hideInlineForm, this); return this; }, /** * Show/hide inline form depending on Amazon login status */ manipulateInlineForm: function () { this.hideInlineForm(amazonStorage.isAmazonAccountLoggedIn()); }, /** * Show/hide inline form */ hideInlineForm: function(hide) { var shippingForm = document.getElementById(this.formSelector); var accountForm = document.getElementById(this.accountFormSelector); if (shippingForm) { shippingForm.style.display = hide ? 'none' : 'block'; } if (accountForm) { accountForm.parentElement.style.display = hide ? 'none' : 'block'; } } }); }); amazon-pay-module/view/frontend/web/js/view/shipping-address/list.js000077700000001120151323541140021614 0ustar00define([ 'Magento_Checkout/js/view/shipping-address/list', 'Magento_Customer/js/model/address-list', 'Amazon_Payment/js/model/storage', 'ko' ], function (Component, addressList, amazonStorage, ko) { 'use strict'; return Component.extend({ /** * Init address list */ initObservable: function () { this._super(); this.visible = ko.computed(function () { return addressList().length > 0 && !amazonStorage.isAmazonAccountLoggedIn(); }); return this; } }); }); amazon-pay-module/view/frontend/web/js/view/shipping-address/.htaccess000077700000000177151323541140022114 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/.htaccess000077700000000177151323541140016650 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/view/checkout-sandbox-simulator.js000077700000001670151323541140022665 0ustar00/*global define*/ define( [ 'jquery', 'uiComponent', 'ko', 'Amazon_Payment/js/model/storage', 'uiRegistry' ], function ( $, Component, ko, amazonStorage, registry ) { 'use strict'; return Component.extend({ defaults: { template: 'Amazon_Payment/checkout-sandbox-simulator' }, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, isSandboxEnabled: ko.observable(registry.get('amazonPayment').isSandboxEnabled), sandboxSimulationReference: amazonStorage.sandboxSimulationReference, sandboxSimulationOptions: ko.observableArray(registry.get('amazonPayment').sandboxSimulationOptions), /** * Init */ initialize: function () { this._super(); } }); } ); amazon-pay-module/view/frontend/web/js/amazon-product-add.js000077700000003675151323541140020135 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'jquery', 'Magento_Customer/js/customer-data', 'amazonCore' ], function ($, customerData) { 'use strict'; var _this, addedViaAmazon = false; $.widget('amazon.AmazonProductAdd', { options: { addToCartForm: '#product_addtocart_form' }, /** * Create triggers */ _create: function () { _this = this; this.setupTriggers(); }, /** * Setup triggers when item added to cart if amazon pay button pressed */ setupTriggers: function () { this.cart = customerData.get('cart'); //subscribe to add to cart event this.cart.subscribe(function () { //only trigger the amazon button click if the user has chosen to add to cart via this method if (addedViaAmazon) { addedViaAmazon = false; $('.login-with-amazon img').trigger('click'); } }, this); //setup binds for click $('.amazon-addtoCart').on('click', function () { if ($(_this.options.addToCartForm).valid()) { addedViaAmazon = true; $(_this.options.addToCartForm).submit(); } }); } }); return $.amazon.AmazonProductAdd; }); amazon-pay-module/view/frontend/web/js/amazon-widgets-loader.js000077700000001435151323541140020631 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define(['uiRegistry'], function(registry) { 'use strict'; registry.get('amazonPayment', function (amazonPayment) { // Load external Widgets.js require([amazonPayment.widgetUrl]); }); }); amazon-pay-module/view/frontend/web/js/messages.js000077700000003725151323541140016247 0ustar00/** * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( [ 'jquery', 'Amazon_Payment/js/model/storage', 'Magento_Theme/js/view/messages', 'Magento_Ui/js/model/messageList' ], function( $, amazonStorage, messagesFactory, messageList ) { 'use strict'; return { defaults: {}, isAmazonAccountLoggedIn: amazonStorage.isAmazonAccountLoggedIn, /* * Magento's core Checkout module removes the "messages" block from the layout, * so we display them on checkout using the messageList API. */ displayMessages: function () { if(this.isAmazonAccountLoggedIn()) { var messagesComponent = messagesFactory(); messagesComponent.cookieMessages.forEach(function(message) { if(message.type == 'error') { messageList.addErrorMessage({message: $.mage.__($("<textarea/>").html(message.text).text())}); } }); } }, addMessage: function (type, messageText) { var messageComponent = messagesFactory(); if (type === 'error') { messageList.addErrorMessage({message: $.mage.__($("<textarea/>").html(messageText).text())}); } } } } ); amazon-pay-module/view/frontend/web/js/model/place-order-mixin.js000077700000002313151323541140021047 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /*jshint browser:true jquery:true*/ /*global alert*/ define([ 'jquery', 'mage/utils/wrapper', 'Magento_CheckoutAgreements/js/model/agreements-assigner' ], function ($, wrapper, agreementsAssigner) { 'use strict'; return function (placeOrderAction) { /** Override default place order action and add agreement_ids to request */ return wrapper.wrap(placeOrderAction, function (originalAction, paymentData, redirectOnSuccess, messageContainer) { agreementsAssigner(paymentData); return originalAction(paymentData, redirectOnSuccess, messageContainer); }); }; }); amazon-pay-module/view/frontend/web/js/model/storage.js000077700000011502151323541140017174 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( [ 'jquery', 'ko', 'amazonCore', 'amazonPaymentConfig' ], function ( $, ko, amazonCore, amazonPaymentConfig ) { 'use strict'; var isAmazonAccountLoggedIn = ko.observable(false), isAmazonEnabled = ko.observable(amazonPaymentConfig.getValue('isPwaEnabled')), orderReferenceId = ko.observable(amazonPaymentConfig.getValue('orderReferenceId')), orderReference, addressConsentToken = amazonCore.accessToken, //eslint-disable-next-line no-use-before-define amazonLoginError = amazonCore.amazonLoginError.subscribe(setAmazonLoggedOutIfLoginError), amazonDeclineCode = ko.observable(false), sandboxSimulationReference = ko.observable('default'), isPlaceOrderDisabled = ko.observable(false), isShippingMethodsLoading = ko.observable(false), isAmazonShippingAddressSelected = ko.observable(false), isQuoteDirty = ko.observable(amazonPaymentConfig.getValue('isQuoteDirty')), isPwaVisible = ko.computed(function () { return isAmazonEnabled() && !isQuoteDirty(); }), isAmazonCartInValid = ko.computed(function () { return isAmazonAccountLoggedIn() && isQuoteDirty(); }), isLoginRedirectPage = $('body').hasClass('amazon-login-login-processauthhash'), amazonCustomerEmail = ko.computed(function () { // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (window.hasOwnProperty('checkoutConfig') && window.checkoutConfig.hasOwnProperty('amazonLogin') && typeof window.checkoutConfig.amazonLogin.amazon_customer_email === 'string' ) { return window.checkoutConfig.amazonLogin.amazon_customer_email; } // jscs:enable requireCamelCaseOrUpperCaseIdentifiers return ''; }); /** * Log out amazon user */ function amazonLogOut() { amazonCore.AmazonLogout(); this.isAmazonAccountLoggedIn(false); } /** * Set login error if logged out */ function setAmazonLoggedOutIfLoginError(isLoggedOut) { if (isLoggedOut === true) { isAmazonAccountLoggedIn(false); amazonLoginError.dispose(); } } /** if Amazon cart contents are invalid log user out **/ isAmazonCartInValid.subscribe(function (isCartInValid) { if (isCartInValid) { amazonLogOut(); } }); verifyAmazonLoggedIn(); setAmazonLoggedOutIfLoginError(amazonCore.amazonLoginError()); /** * Verifies amazon user is logged in */ function verifyAmazonLoggedIn() { isAmazonAccountLoggedIn(!!amazonCore.accessToken()); } return { isAmazonAccountLoggedIn: isAmazonAccountLoggedIn, isAmazonEnabled: isAmazonEnabled, orderReferenceId: orderReferenceId, amazonDeclineCode: amazonDeclineCode, sandboxSimulationReference: sandboxSimulationReference, isPlaceOrderDisabled: isPlaceOrderDisabled, isShippingMethodsLoading: isShippingMethodsLoading, isAmazonShippingAddressSelected: isAmazonShippingAddressSelected, isQuoteDirty: isQuoteDirty, isPwaVisible: isPwaVisible, amazonlogOut: amazonLogOut, amazonDefined: amazonCore.amazonDefined, amazonCustomerEmail: amazonCustomerEmail, /** * Set order reference */ setOrderReference: function (or) { orderReference = or; }, /** * Get order reference */ getOrderReference: function () { return this.orderReferenceId() || orderReference; }, /** * Get address consent token */ getAddressConsentToken: function () { return addressConsentToken(); } }; } ); amazon-pay-module/view/frontend/web/js/model/.htaccess000077700000000177151323541140016776 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/model/amazonPaymentConfig.js000077700000002405151323541140021503 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define( ['uiRegistry'], function (registry) { 'use strict'; var config = registry.get('amazonPayment') || {}; return { /** * Get config value */ getValue: function (key, defaultValue) { if (config.hasOwnProperty(key)) { return config[key]; } else if (defaultValue !== undefined) { return defaultValue; } }, /** * Is amazonPayment defined? */ isDefined: function () { return registry.get('amazonPayment') !== undefined; } }; } ); amazon-pay-module/view/frontend/web/js/.htaccess000077700000000177151323541140015676 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/js/amazon-button.js000077700000015333151323541140017234 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ define([ 'jquery', 'Magento_Customer/js/customer-data', 'Magento_Customer/js/section-config', 'Amazon_Payment/js/model/amazonPaymentConfig', 'amazonCsrf', 'Magento_Checkout/js/model/full-screen-loader', 'modernizr/modernizr', 'amazonCore', 'uiRegistry', 'mage/cookies' ], function ($, customerData, sectionConfig, amazonPaymentConfig, amazonCsrf, fullScreenLoader) { 'use strict'; var _this; if (amazonPaymentConfig.isDefined()) { $.widget('amazon.AmazonButton', { options: { merchantId: null, buttonType: 'LwA', buttonColor: 'Gold', buttonSize: 'medium', redirectUrl: null, loginPostUrl: null }, /** * Create button */ _create: function () { _this = this; this._verifyAmazonConfig(); if (typeof OffAmazonPayments === 'undefined') { // async render $(window).on('OffAmazonPayments', $.proxy(function () { this._renderAmazonButton(); }, this)); } else { this._renderAmazonButton(); } }, /** * Verify if checkout config is available * @private */ _verifyAmazonConfig: function () { if (amazonPaymentConfig.isDefined()) { this.options.merchantId = amazonPaymentConfig.getValue('merchantId'); this.options.buttonType = this.options.buttonType === 'LwA' ? amazonPaymentConfig.getValue('buttonTypeLwa') : amazonPaymentConfig.getValue('buttonTypePwa'); this.options.buttonColor = amazonPaymentConfig.getValue('buttonColor'); this.options.buttonSize = amazonPaymentConfig.getValue('buttonSize'); this.options.redirectUrl = amazonPaymentConfig.getValue('redirectUrl'); this.options.loginPostUrl = amazonPaymentConfig.getValue('loginPostUrl'); this.options.loginScope = amazonPaymentConfig.getValue('loginScope'); this.options.buttonLanguage = amazonPaymentConfig.getValue('displayLanguage'); } }, /** * Validate CSRF cookie and redirect to HTTPS */ secureHttpsCallback: function (event) { var sections = sectionConfig.getAffectedSections(_this.options.loginPostUrl); if (!event.state || !amazonCsrf.isValid(event.state)) { window.location = amazonPaymentConfig.getValue('customerLoginPageUrl'); return window.location; } // jscs:disable requireCamelCaseOrUpperCaseIdentifiers if (!event.access_token || !!event.error) { window.location = amazonPaymentConfig.getValue('customerLoginPageUrl'); return window.location; } if (sections) { customerData.invalidate(sections); } $.mage.cookies.set('amazon_Login_accessToken', event.access_token); window.location = _this.options.redirectUrl + '?access_token=' + event.access_token; // jscs:enable requireCamelCaseOrUpperCaseIdentifiers }, /** * Use popup or redirect URI * * @return {String} */ _popupCallback: function () { return _this.usePopUp() ? _this.secureHttpsCallback : amazonPaymentConfig.getValue('oAuthHashRedirectUrl'); }, /** * Are touch events available * (Supports both v2 and v3 Modernizr) * @returns {Boolean} * @private */ _touchSupported: function () { //eslint-disable-next-line no-undef return Modernizr.touch !== undefined ? Modernizr.touch : Modernizr.touchevents; }, /** * Should we use the pop up login flow? * - are we on an HTTPS page (required for popup) * - confirm we are not on the product detail page (items are added asynchronously to the cart, * hence popups will be blocked) * - confirm we are not using a touch device (redirect provides a better mobile experience) * @returns {Boolean} * @public */ usePopUp: function () { return window.location.protocol === 'https:' && !$('body').hasClass('catalog-product-view') && !this._touchSupported(); }, /** * onAmazonPaymentsReady * @private */ _renderAmazonButton: function () { OffAmazonPayments.Button(this.element[0].id, this.options.merchantId, { //eslint-disable-line no-undef type: this.options.buttonType, color: this.options.buttonColor, size: this.options.buttonSize, language: this.options.buttonLanguage, /** * Authorization callback */ authorization: function () { //eslint-disable-next-line no-undef amazon.Login.authorize(_this._getLoginOptions(), _this._popupCallback()); } }); $('.amazon-button-container .field-tooltip').fadeIn(); }, /** * Build login options * @returns {{scope: *, popup: *, state: *}} * @private */ _getLoginOptions: function () { return { scope: this.options.loginScope, popup: this.usePopUp(), state: amazonCsrf.generateNewValue() }; } }); return $.amazon.AmazonButton; } }); amazon-pay-module/view/frontend/web/template/checkout-revert.html000077700000001546151323541140021300 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko if: (isAmazonEnabled) --> <!-- ko if: (isAmazonAccountLoggedIn) --> <a href="javascript:;" data-bind="click: revertCheckout" class="revert-checkout"> <!-- ko i18n: 'Return to standard checkout' --><!--/ko--> </a> <!--/ko--> <!--/ko--> amazon-pay-module/view/frontend/web/template/notification.html000077700000001523151323541140020647 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko if: (isAmazonAccountLoggedIn) --> <!-- ko if: (chargeOnOrder) --> <!-- ko if: (isEuPaymentRegion) --> <div class="message success"><span data-bind="text: message"></span></div> <!-- /ko --> <!-- /ko --> <!-- /ko --> amazon-pay-module/view/frontend/web/template/checkout-sandbox-simulator.html000077700000005617151323541140023447 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko foreach: getRegion('before-sandbox-simulator') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> <!-- ko if: (isAmazonAccountLoggedIn) --> <!-- ko if: (isSandboxEnabled) --> <div class="amazon-sandbox-simulator payment-option _collapsible" data-bind="mageInit: {'collapsible':{'openedState': '_active'}}"> <div class="payment-option-title field choice" data-role="title"> <span class="action action-toggle" id="amazon-sandbox-simulator-heading" role="heading" aria-level="2"> <!-- ko i18n: 'Simulate Payment Scenarios'--><!-- /ko --> </span> </div> <div class="payment-option-content" data-role="content"> <div class="amazon-sandbox-simulator-scenarios" data-bind="foreach: sandboxSimulationOptions"> <div data-bind="attr: {class: 'field choice amazon-sandbox-simulator-scenario amazon-sandbox-simulator-scenario-' + $index()}"> <div class="control"> <input type="radio" class="radio" data-bind=" checkedValue: simulationValue, checked: $parent.sandboxSimulationReference, attr: { name: 'amazon-sandbox-simulator-scenario-' + $index(), id: 'amazon-sandbox-simulator-scenario-' + $index(), 'aria-labelledby': 'amazon-sandbox-simulator-scenario-' + $index() }"/> <label class="label" data-bind=" attr: { id: 'amazon-sandbox-simulator-scenario-' + $index() + '-label', for: 'amazon-sandbox-simulator-scenario-' + $index() }"> <span data-bind="i18n: labelText"></span> </label> </div> </div> </div> </div> </div> <!--/ko--> <!--/ko--> <!-- ko foreach: getRegion('after-sandbox-simulator') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> amazon-pay-module/view/frontend/web/template/form/element/email.html000077700000007104151323541140021645 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko foreach: getRegion('amazon-button-region') --> <!-- ko template: getTemplate() --><!-- /ko --> <!-- /ko --> <!-- ko ifnot: isCustomerLoggedIn() --> <!-- ko foreach: getRegion('before-login-form') --> <!-- ko template: getTemplate() --><!-- /ko --> <!-- /ko --> <form class="form form-login" data-role="email-with-possible-login" data-bind="submit:login" method="post"> <fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading"> <div class="field required"> <label class="label" for="customer-email"> <span data-bind="i18n: 'Email Address'"></span> </label> <div class="control _with-tooltip"> <input class="input-text" type="email" data-bind=" textInput: email, hasFocus: emailFocused" name="username" data-validate="{required:true, 'validate-email':true}" id="customer-email" /> <!-- ko template: 'ui/form/element/helper/tooltip' --><!-- /ko --> <span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span> </div> </div> <!--Hidden fields --> <fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible"> <div class="field"> <label class="label" for="customer-password"> <span data-bind="i18n: 'Password'"></span> </label> <div class="control"> <input class="input-text" placeholder="Password" type="password" name="password" id="customer-password" data-validate="{required:true}" autocomplete="off"/> <span class="note" data-bind="i18n: 'You already have an account with us. Sign in or continue as guest.'"></span> </div> </div> <!-- ko foreach: getRegion('additional-login-form-fields') --> <!-- ko template: getTemplate() --><!-- /ko --> <!-- /ko --> <div class="actions-toolbar"> <input name="context" type="hidden" value="checkout" /> <div class="primary"> <button type="submit" class="action login primary" data-action="checkout-method-login"><span data-bind="i18n: 'Login'"></span></button> </div> <div class="secondary"> <a class="action remind" data-bind="attr: { href: forgotPasswordUrl }"> <span data-bind="i18n: 'Forgot Your Password?'"></span> </a> </div> </div> </fieldset> <!--Hidden fields --> </fieldset> </form> <!-- /ko --> amazon-pay-module/view/frontend/web/template/form/element/.htaccess000077700000000177151323541140021471 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/template/form/.htaccess000077700000000177151323541140020040 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/template/checkout-widget-address.html000077700000003207151323541140022673 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko foreach: getRegion('before-widget-address') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> <!-- ko if: (isAmazonAccountLoggedIn) --> <label class="label" for="amazon-email-address"> <span data-bind="i18n: 'Email Address:'"></span> </label> <span id="amazon-email-address" data-bind="text: amazonCustomerEmail" /> <div class="amazon-widget-container"> <div id="addressBookWidgetDiv" class="amazon-widget amazon-widget--address" data-bind="afterRender: initAddressWidget"></div> </div> <div class="methods-shipping" data-bind="visible: isShippingAddressReadOnly()"> <div class="actions-toolbar"> <button id="amazon-continue-payment" data-role="opc-continue" type="submit" class="button action primary" data-bind="click: continuePayment"> <span data-bind="i18n: 'Next'"></span> </button> </div> </div> <!--/ko--> <!-- ko foreach: getRegion('after-widget-address') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> amazon-pay-module/view/frontend/web/template/payment/amazon-payment-widget.html000077700000005264151323541140024065 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko if: (isPwaVisible) --> <!-- ko if: (isAmazonAccountLoggedIn) --> <div class="payment-method amazon-payment-method" data-bind="css: {'_active': (getCode() == isChecked())}"> <div class="payment-method-title field choice"> <input type="radio" name="payment[method]" class="radio" data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/> <label data-bind="attr: {'for': getCode()}" class="label"><span data-bind="text: getTitle()"></span></label> </div> <div class="payment-method-content"> <!-- ko foreach: getRegion('messages') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> <div class="amazon-widget-container"> <div id="walletWidgetDiv" class="amazon-widget amazon-widget--payment" data-bind="afterRender: initPaymentWidget"></div> </div> <div class="checkout-agreements-block"> <!-- ko foreach: $parent.getRegion('before-place-order') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> </div> <div class="actions-toolbar"> <div class="primary"> <button class="action primary checkout" type="submit" data-bind=" click: placeOrder, attr: {title: $t('Place Order')}, css: {disabled: isPlaceOrderDisabled()}, enable: (getCode() == isChecked()) " disabled> <span data-bind="i18n: 'Place Order'"></span> </button> </div> </div> </div> </div> <!--/ko--> <!--/ko--> amazon-pay-module/view/frontend/web/template/payment/amazonlogin.html000077700000004254151323541140022160 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <if args="isPwaVisible()"> <div class="payment-method" css="_active : (getCode() == isChecked())"> <div class="payment-method-title field choice"> <input type="radio" name="payment[method]" class="radio" ko-checked="isChecked" ko-value="getCode()" attr="{'id': getCode()}, click: selectPaymentMethod, visible: isRadioButtonVisible()"/> <label attr="for : getCode()" class="label"><span text="getTitle()"></span></label> </div> <div class="payment-method-content"> <div class="amazon-button-container" data-bind="visible: true"> <div class="amazon-button-container__cell"> <div id="PayWithAmazon" class="login-with-amazon" data-bind="mageInit: {'amazonButton':{'buttonType': 'PwA'}}"></div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true"> <translate args="'Securely login into our website using your existing Amazon details.'" /> </div> </div> </div> </div> </div> </div> </if> amazon-pay-module/view/frontend/web/template/payment/.htaccess000077700000000177151323541140020552 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/template/shipping-address/.htaccess000077700000000177151323541140022341 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/template/shipping-address/inline-form.html000077700000000072151323541140023642 0ustar00<div data-bind="afterRender: manipulateInlineForm"></div> amazon-pay-module/view/frontend/web/template/checkout-button.html000077700000003546151323541140021306 0ustar00<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <!-- ko foreach: getRegion('before-amazon-button') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> <div class="amazon-express-title" data-bind="i18n: 'Express Checkout', visible: !isAmazonAccountLoggedIn() && isPwaVisible()"></div> <div class="amazon-button-container" data-bind="visible: !isAmazonAccountLoggedIn() && isPwaVisible()"> <div class="amazon-button-container__cell"> <div class="login-with-amazon" data-bind="attr: {id: 'PayWithAmazon_' + displayArea}, mageInit: {'amazonButton':{'buttonType': 'PwA'}}"></div> </div> <div class="amazon-button-container__cell"> <div class="field-tooltip toggle"> <span class="field-tooltip-action action-help" data-bind="mageInit: {'dropdown':{'activeClass': '_active'}}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> <div class="field-tooltip-content" data-target="dropdown" aria-hidden="true" data-bind="text: tooltip"></div> </div> </div> </div> <div class="amazon-divider" data-bind="visible: !isAmazonAccountLoggedIn() && isPwaVisible()"> <span data-bind="i18n: 'or continue with Standard Checkout'"></span> </div> <!-- ko foreach: getRegion('after-amazon-button') --> <!-- ko template: getTemplate() --><!-- /ko --> <!--/ko--> amazon-pay-module/view/frontend/web/template/.htaccess000077700000000177151323541140017075 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/css/source/_module.less000077700000012315151323541140020065 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ & when (@media-common = true) { .amazon-divider { border-bottom: 1px solid #cccccc; line-height: 0.1em; margin: 18px 0 20px; text-align: center; max-width: 500px; span { background: #fff; padding:0 5px; } } /** mini cart styling **/ .product-social-links, .amazon-minicart-container { width: 100%; display: block; text-align: center; .amazon-button-container { display: inline-block; margin: 0px; } .field-tooltip { .field-tooltip-content { top: 38px; left: -245px; &:before { border: none; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid #666666; top: -10px; left: 244px; } &:after { border: none; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid #f4f4f4; top: -8px; left: 244px; } } } } .product-social-links { .amazon-button-container { margin-bottom: 30px; display: block; } } .amazon-checkout-now { border-top: 1px solid #c1c1c1; padding-top: 10px; margin-bottom: 10px; } .amazon-addtoCart { display: block; width: 100%; height: 100%; position: absolute; left: 0; top: 0; } .revert-checkout { margin-top: 20px; margin-bottom: 20px; display: block; } .centered-button { text-align: center; display: inline-block; .catalog-product-view & { display: table; } } .checkout-payment-method { .amazon-sandbox-simulator { .lib-css(border-bottom, @checkout-payment-option-title__border); .payment-option-title { border-top: none; padding-top: 0; } .amazon-sandbox-simulator-scenario { margin-bottom: 10px; } } } .checkout-methods-items { .amazon-minicart-container { .amazon-divider { display: none; } } .centered-button { margin-bottom: 0; @media all and (max-width: @screen__m) { width: auto; } } .field-tooltip { display: none; .field-tooltip-content { @abs-checkout-tooltip-content-position-top(); @media all and (max-width: @screen__m) { @right-shift: 56px; right: -@right-shift; top: 38px; left: auto; &:before, &:after { right: @right-shift; } } } } } .amazon-widget { max-width: 400px; height: 228px; } .amazon-widget--address { margin-top: 20px; } .amazon-addresses { margin-top: 20px; .amazon-address { margin-bottom: 20px; } } #checkout-step-shipping { .amazon-divider { margin: 40px 0; } } .checkout-payment-method { .amazon-payment-method { .payment-method-title { visibility: hidden; //hide the title for Amazon Pay methods only padding-bottom: 0; } } } /** Prevent movement after a soft decline to other payment steps **/ .opc-progress-bar-item._complete.lock-step { cursor: none; pointer-events: none; } } @media all and (max-width: @screen__m) { .amazon-minicart-container { .amazon-button-container { width: auto; } } } .media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) { .checkout-payment-method { .amazon-sandbox-simulator { .lib-css(border-top, @checkout-payment-option-title__border); } } } .media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) { .amazon-addresses { &:extend(.abs-add-clearfix-desktop all); .amazon-address { &:extend(.abs-blocks-2columns all); margin-bottom: 0; } } } amazon-pay-module/view/frontend/web/css/source/.htaccess000077700000000177151323541140017352 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/css/.htaccess000077700000000177151323541140016052 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/web/.htaccess000077700000000177151323541140015262 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/frontend/.htaccess000077700000000177151323541140014505 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/view/.htaccess000077700000000177151323541140012666 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/i18n/es_AR.csv000077700000010476151323541140012406 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/es_CL.csv000077700000010476151323541140012402 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/es_PA.csv000077700000010476151323541140012404 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/it_IT.csv000077700000010557151323541140012425 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Stato imprevisto per l'autorizzazione Amazon Pay. Stato: %1; Codice motivo: %2" "Amazon capture declined : %1","Amazon Pay ha negato l'acquisizione. Codice motivo: %1" "Amazon capture invalid state : %1 with reason %2","Stato imprevisto per l'acquisizione Amazon Pay. Stato: %1; Codice motivo: %2" "Amazon refund invalid state : %1 with reason %2","Stato imprevisto per il rimborso Amazon Pay. Stato: %1; Codice motivo: %2" "the country for your address is not allowed for this store","Il paese associato al tuo indirizzo non è supportato su questo sito." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Non è possibile utilizzare Amazon Pay per questo ordine. Seleziona un altro metodo di pagamento." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Si è verificato un problema con il metodo di pagamento selezionato sul tuo account Amazon. Seleziona un altro metodo di pagamento." "The currency selected is not supported by Amazon Pay","La valuta selezionata non è supportata da Amazon Pay su questo sito." "Captured amount of %1 online","Importo acquisito di %1 online." "Declined amount of %1 online","L'acquisizione online dell'importo di %1 è stata negata." "Capture declined","Acquisizione negata" "Capture declined for Order <a href=""%2"">#%1</a>","Acquisizione negata per l'ordine <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","L'acquisizione è in attesa di autorizzazione da parte del gateway di pagamento. Riprova più tardi." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Impossibile trovare l'opzione config ""multiline_count"" dell'attributo ""street"" dell'indirizzo del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Sei un cliente Amazon? Paga ora utilizzando l'indirizzo e i dati di pagamento memorizzati nel tuo account Amazon." "Simulate Payment Scenarios","Simula scenari di pagamento" "Amazon could not process your request.","Il servizio Amazon Pay non ha potuto elaborare la tua richiesta. Riprova." "Please select a payment method.","Seleziona un metodo di pagamento." "Your session has expired, please reload the page and try again.","La sessione è scaduta. Ricarica la pagina e riprova." "Return to standard checkout","Ritorna al tuo checkout originale" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Si è verificato un problema con il pagamento. L'ordine non è stato effettuato, pertanto non ti è stato addebitato alcun importo." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Si è verificato un problema con il metodo di pagamento. Per effettuare l'ordine, prova con un altro metodo di pagamento." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","La vostra transazione con Amazon Pay e in fase di validazione. Vi informeremo del risultato della transazione a breve." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Per resettare la tua password, per favore <a href=""%1"">Esci</a> dal tuo account e seleziona “Hai dimenticato la password?" dalla pagina di Accesso" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Il metodo di pagamento selezionato non è disponibile per questa transazione. Per favore selezionarne o aggiungerne un altro nel wallet widget." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Non è stato selezionato nessun metodo di pagamento per questo ordine. Per favore ricaricare la pagina o aggiungere un nuovo metodo di pagamento nel wallet widget." "The order failed due to a technical error, please select another payment method or contact our support.","Non è stato possibile processare l’ordine a causa di un problema tecnico. Per favore selezionare un altro metodo di pagamento o contattare il supporto." "or continue with Standard Checkout","o continua con il Checkout Standard" amazon-pay-module/i18n/es_MX.csv000077700000010476151323541140012430 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/de_CH.csv000077700000010521151323541140012346 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Autorisierung. Status: %1; Ursachencode: %2" "Amazon capture declined : %1","Capture wurde von Amazon Pay abgelehnt. Ursachencode: %1" "Amazon capture invalid state : %1 with reason %2","Unerwarteter Status für Amazon Pay-Capture. Status: %1; Ursachencode: %2" "Amazon refund invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Erstattung. Status: %1; Ursachencode: %2" "the country for your address is not allowed for this store","Das mit Ihrer Adresse verknüpfte Land ist für diese Website nicht zulässig." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Leider können Sie ""Amazon Pay"" für diese Bestellung nicht verwenden. Wählen Sie eine andere Zahlungsweise aus." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Leider ist bei der ausgewählten Zahlungsweise ein Problem in Ihrem Amazon-Kundenkonto aufgetreten. Wählen Sie eine andere Zahlungsweise aus." "The currency selected is not supported by Amazon Pay","Die ausgewählte Währung wird von Amazon Pay auf dieser Website nicht unterstützt." "Captured amount of %1 online","Online erfasster Betrag ist %1." "Declined amount of %1 online","Online-Capture für Betrag %1 wurde abgelehnt." "Capture declined","Capture abgelehnt" "Capture declined for Order <a href=""%2"">#%1</a>","Capture abgelehnt für Bestellung <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Genehmigung vom Zahlungsgateway für Capture ist ausstehend. Bitte überprüfen Sie es später erneut." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Die Konfiguration ""multiline_count"" für das Attribut ""street"" der Kundenadresse konnte nicht gefunden werden." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Sind Sie Kunde bei Amazon? Verwenden Sie für die Bezahlung die Adresse und Zahlungsdetails, die in Ihrem Amazon-Kundenkonto gespeichert sind." "Simulate Payment Scenarios","Zahlungsszenarien simulieren" "Amazon could not process your request.","Amazon Pay konnte Ihre Anfrage nicht bearbeiten. Bitte versuchen Sie es noch einmal." "Please select a payment method.","Wählen Sie eine Zahlungsweise aus." "Your session has expired, please reload the page and try again.","Ihre Sitzung ist abgelaufen. Bitte laden Sie die Seite erneut und versuchen Sie es noch einmal." "Return to standard checkout","Zum Standard Checkout zurückkehren" "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Mit dieser Zahlungsart ist ein Problem aufgetreten. Um Ihre Bestellung abzuschließen, wählen Sie bitte eine andere aus." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Ihre Zahlung mit Amazon Pay ist derzeit noch in Prufung. Bitte beachten Sie, dass wir uns mit Ihnen in Kurze per Email in Verbindung setzen werden, falls noch Unklarheiten bestehen sollten." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Fall Sie ihr Passwort zurücksetzen möchten, <a href=""%1"">loggen Sie sich bitte aus</a> und klicken Sie auf der Anmeldeseite auf “Passwort vergessen”" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Die gewählte Zahlmethode ist für diese Transaktion nicht verfügbar. Bitte wählen Sie eine andere oder fügen Sie eine neue Zahlmethode hinzu." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Für diese Bestellung wurde kein Zahlungsmittel ausgewählt, bitte versuchen Sie, die Seite zu aktualisieren oder ein neues Zahlungsmittel hinzuzufügen." "The order failed due to a technical error, please select another payment method or contact our support.","Die Bestellung ist aufgrund eines technischen Fehlers fehlgeschlagen, bitte wählen Sie eine andere Zahlungsmethode oder kontaktieren Sie unseren Support." "or continue with Standard Checkout","oder verwenden Sie den Standard Checkout" amazon-pay-module/i18n/fr_CA.csv000077700000010740151323541140012361 0ustar00 "Amazon authorize invalid state : %1 with reason %2","État imprévu pour l'autorisation d'Amazon Pay. État : %1 ; code du motif : %2" "Amazon capture declined : %1","Amazon Pay a rejeté la saisie. Code du motif : %1" "Amazon capture invalid state : %1 with reason %2","État imprévu pour la saisie d'Amazon Pay. État : %1 ; code du motif : %2" "Amazon refund invalid state : %1 with reason %2","État imprévu pour le remboursement d'Amazon Pay. État : %1 ; code du motif : %2" "the country for your address is not allowed for this store","Le pays associé à votre adresse n'est pas autorisé pour ce site." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Nous sommes désolés, mais vous ne pouvez pas utiliser Amazon Pay pour cette commande. Sélectionnez un autre mode paiement." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Nous sommes désolés, mais un problème s'est produit avec le mode de paiement sélectionné sur votre compte Amazon. Sélectionnez un autre mode paiement." "The currency selected is not supported by Amazon Pay","La devise sélectionnée n'est pas prise en charge par Amazon Pay sur ce site." "Captured amount of %1 online","Montant de %1 saisi en ligne." "Declined amount of %1 online","La saisie en ligne du montant de %1 a été rejetée." "Capture declined","Saisie rejetée" "Capture declined for Order <a href=""%2"">#%1</a>","Saisie rejetée pour la commande <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Saisie en attente d'approbation du portail de paiement. Veuillez réessayer ultérieurement." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Impossible de trouver la configuration « multiline_count » de l'attribut « rue » de l'adresse du client." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Vous êtes client Amazon ? Payez désormais avec les informations de paiement et les coordonnées stockées dans votre compte Amazon." "Simulate Payment Scenarios","Simuler des scénarios de paiement" "Amazon could not process your request.","Amazon Pay n'a pas pu traiter votre demande. Veuillez réessayer." "Please select a payment method.","Sélectionnez un mode de paiement." "Your session has expired, please reload the page and try again.","Votre session a expiré. Actualisez la page et réessayez." "Return to standard checkout","Revenir à la commande standard" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Un problème s’est produit avec votre paiement. Votre commande n'a pas été passée et vous n'avez pas été débité." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Un problème est survenu avec votre moyen de paiement. Pour passer votre commande, essayez un autre moyen de paiement." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Votre transaction avec Amazon Pay est en cours de validation. Vous serez informe prochainement de son suivi." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Pour réinitialiser votre mot de passe, veuillez-vous <a href=""%1"">Déconnexion</a> et cliquer sur “Mot de passe oublié?” depuis la page de connexion" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Le mode de paiement sélectionné n'est pas disponible pour cette transaction. Veuillez en sélectionner un autre ou ajouter un nouveau mode de paiement au widget de portefeuille." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Aucun instrument de paiement n'a été sélectionné pour cette commande, veuillez essayer de rafraîchir la page ou d'ajouter un nouvel instrument de paiement dans le widget de portefeuille." "The order failed due to a technical error, please select another payment method or contact our support.","La commande a échoué en raison d'une erreur technique, veuillez sélectionner un autre mode de paiement ou contacter notre support." "or continue with Standard Checkout","ou continuer avec le Checkout Standard" amazon-pay-module/i18n/es_PE.csv000077700000010476151323541140012410 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/es_CR.csv000077700000010476151323541140012410 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/en_US.csv000077700000024724151323541140012427 0ustar00"--","--" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station." "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","A store account for this email address already exists. Please enter your store account password to log in without leaving the store." "Access Key Id","Access Key Id" "Action is not available","Action is not available" "Advanced","Advanced" "Allowed IPs","Allowed IPs" "Allowed Javascript Origins","Allowed Javascript Origins" "Allowed Return URLs","Allowed Return URLs" "Amazon authorize invalid state : %1 with reason %2","Unexpected state for the Amazon Pay authoriziation. State: %1, Reason code: %2" "Amazon capture declined : %1","Amazon Pay declined the capture. Reason code: %1" "Amazon capture invalid state : %1 with reason %2","Unexpected state for the Amazon Pay capture. State: %1, Reason code: %2" "Amazon could not process your request.","Amazon Pay could not process your request. Please try again." "Amazon refund invalid state : %1 with reason %2","Unexpected state for the Amazon Pay refund. State: %1, Reason code: %2" "Amazon Pay","Amazon Pay" "Amazon Pay button in minicart","Amazon Pay button in minicart" "Amazon Pay button is visible on Product Page","Amazon Pay button is visible on Product Page" "Amazon Pay Logo","Amazon Pay Logo" "Amazon Pay refund successful.","Amazon Pay refund successful." "An unsupported currency is currently selected. Please review our configuration guide.","An unsupported currency is currently selected. Please review our configuration guide." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account." "Asynchronous","Asynchronous" "Authorization Mode","Authorization Mode" "Authorization soft decline","Authorization soft decline" "Authorization hard decline","Authorization hard decline" "Authorization timed out","Authorization timed out" "Button Color","Button Color" "Button Display Language","Button Display Language" "Button Size","Button Size" "Capture declined","Capture declined" "Capture pending","Capture pending" "Captured amount of %1 online","Captured amount of %1 online." "Capture declined for Order <a href=""%2"">#%1</a>","Capture declined for Order <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Capture pending approval from the payment gateway. Please check back later." "Charge on Order","Charge on Order" "Charge on Shipment","Charge on Shipment" "click here to display the categories","click here to display the categories" "Client Id","Client Id" "Client Secret","Client Secret" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients." "Continue as Guest","Continue as Guest" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Could not find the ""multiline_count"" config of the ""street"" Customer address attribute." "Credentials,Credentials" "Credentials JSON","Credentials JSON" "Dark Gray","Dark Gray" "Data Polling via Cron Job","Data Polling via Cron Job" "Declined amount of %1 online","Online Capture of amount %1 was declined." "Developer Options","Developer Options" "Enable Amazon Pay","Enable Amazon Pay" "Enable Login with Amazon","Enable Login with Amazon" "Euro Region","Euro Region" "Error processing Amazon Login","Error processing Amazon Login" "Excluded Categories","Excluded Categories" "Extra Large","Extra Large" "Forgot Your Password?","Forgot Your Password?" "Frontend","Frontend" "General","General" "Get started with account registration","Get started with account registration" "Gold","Gold" "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin." "Instant Payment Notifications","Instant Payment Notifications" "Is Packing Stations Terms Validation Enabled","Is Packing Stations Terms Validation Enabled" "I've already setup Pay with Amazon, I want to edit my settings","I've already setup Amazon Pay, I want to edit my settings" "Japan","Japan" "Large","Large" "Light Gray","Light Gray" "Logging","Logging" "Login / Pay","Login / Pay" "Login with Amazon","Login with Amazon" "Login with Amazon / Amazon Pay","Login with Amazon / Amazon Pay" "Login with Amazon available in authentication popup","Login with Amazon available in authentication popup" "Medium","Medium" "Merchant Id","Merchant Id" "Module version","Module version" "My account is ready, I need to connect it to Magento","My account is ready, I need to connect it to Magento" "New Order Status","New Order Status" "No Simulation","No Simulation" "Ok","Ok" "Options","Options" "or","or" "Packing Stations Terms","Packing Stations Terms" "Password","Password" "Paste JSON credentials here","Paste JSON credentials here" "Payment Action","Payment Action" "Payment Region","Payment Region" "Please select a payment method.","Please select a payment method." "Refund declined","Refund declined" "* Required Fields","* Required Fields" "Return to standard checkout","Return to standard checkout" "Sales Exclusions","Sales Exclusions" "Sales Options","Sales Options" "Sandbox","Sandbox" "Save Credentials","Save Credentials" "Secret Access Key","Secret Access Key" "Securely login into our website using your existing Amazon details.","Securely login to our website using your existing Amazon details." "Simulate Payment Scenarios","Simulate Payment Scenarios" "Small","Small" "Synchronous","Synchronous" "Synchronous if Possible","Synchronous if Possible" "Successfully cancelled Amazon Pay","Successfully cancelled Amazon Pay" "The ""Amazon Pay"" button will not be available for products of the selected categories.","The ""Amazon Pay"" button will not be available for products of the selected categories." "the country for your address is not allowed for this store","The country associated with your address is not allowed for this store." "The currency selected is not supported by Amazon Pay","The currency selected is not supported by Amazon Pay on this store." "the email address for your Amazon account is invalid","The email address for your Amazon account is invalid." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","There has been a problem with the selected payment method on your Amazon account. Please choose another one." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method." "United Kingdom","United Kingdom" "United States","United States" "Update Mechanism","Update Mechanism" "Updating your config with new keys, please wait...","Updating your config with new keys, please wait..." "Valid JSON credentials are required.","Valid JSON credentials are required." "Welcome back!","Welcome back!" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop." "You will be registering for a %1 account based on the base currency of your shop (%2).","You will be registering for a %1 account based on the base currency of your shop (%2)." "Your session has expired, please reload the page and try again.","Your session has expired, please reload the page and try again." "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","There was a problem with your payment. Your order hasn't been placed, and you haven't been charged." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Something's wrong with your payment method. To place your order, try another." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget." "The order failed due to a technical error, please select another payment method or contact our support.","The order failed due to a technical error, please select another payment method or contact our support." "or continue with Standard Checkout","or continue with Standard Checkout" amazon-pay-module/i18n/de_AT.csv000077700000010521151323541140012360 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Autorisierung. Status: %1; Ursachencode: %2" "Amazon capture declined : %1","Capture wurde von Amazon Pay abgelehnt. Ursachencode: %1" "Amazon capture invalid state : %1 with reason %2","Unerwarteter Status für Amazon Pay-Capture. Status: %1; Ursachencode: %2" "Amazon refund invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Erstattung. Status: %1; Ursachencode: %2" "the country for your address is not allowed for this store","Das mit Ihrer Adresse verknüpfte Land ist für diese Website nicht zulässig." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Leider können Sie ""Amazon Pay"" für diese Bestellung nicht verwenden. Wählen Sie eine andere Zahlungsweise aus." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Leider ist bei der ausgewählten Zahlungsweise ein Problem in Ihrem Amazon-Kundenkonto aufgetreten. Wählen Sie eine andere Zahlungsweise aus." "The currency selected is not supported by Amazon Pay","Die ausgewählte Währung wird von Amazon Pay auf dieser Website nicht unterstützt." "Captured amount of %1 online","Online erfasster Betrag ist %1." "Declined amount of %1 online","Online-Capture für Betrag %1 wurde abgelehnt." "Capture declined","Capture abgelehnt" "Capture declined for Order <a href=""%2"">#%1</a>","Capture abgelehnt für Bestellung <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Genehmigung vom Zahlungsgateway für Capture ist ausstehend. Bitte überprüfen Sie es später erneut." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Die Konfiguration ""multiline_count"" für das Attribut ""street"" der Kundenadresse konnte nicht gefunden werden." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Sind Sie Kunde bei Amazon? Verwenden Sie für die Bezahlung die Adresse und Zahlungsdetails, die in Ihrem Amazon-Kundenkonto gespeichert sind." "Simulate Payment Scenarios","Zahlungsszenarien simulieren" "Amazon could not process your request.","Amazon Pay konnte Ihre Anfrage nicht bearbeiten. Bitte versuchen Sie es noch einmal." "Please select a payment method.","Wählen Sie eine Zahlungsweise aus." "Your session has expired, please reload the page and try again.","Ihre Sitzung ist abgelaufen. Bitte laden Sie die Seite erneut und versuchen Sie es noch einmal." "Return to standard checkout","Zum Standard Checkout zurückkehren" "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Mit dieser Zahlungsart ist ein Problem aufgetreten. Um Ihre Bestellung abzuschließen, wählen Sie bitte eine andere aus." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Ihre Zahlung mit Amazon Pay ist derzeit noch in Prufung. Bitte beachten Sie, dass wir uns mit Ihnen in Kurze per Email in Verbindung setzen werden, falls noch Unklarheiten bestehen sollten." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Fall Sie ihr Passwort zurücksetzen möchten, <a href=""%1"">loggen Sie sich bitte aus</a> und klicken Sie auf der Anmeldeseite auf “Passwort vergessen”" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Die gewählte Zahlmethode ist für diese Transaktion nicht verfügbar. Bitte wählen Sie eine andere oder fügen Sie eine neue Zahlmethode hinzu." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Für diese Bestellung wurde kein Zahlungsmittel ausgewählt, bitte versuchen Sie, die Seite zu aktualisieren oder ein neues Zahlungsmittel hinzuzufügen." "The order failed due to a technical error, please select another payment method or contact our support.","Die Bestellung ist aufgrund eines technischen Fehlers fehlgeschlagen, bitte wählen Sie eine andere Zahlungsmethode oder kontaktieren Sie unseren Support." "or continue with Standard Checkout","oder verwenden Sie den Standard Checkout" amazon-pay-module/i18n/es_CO.csv000077700000010476151323541140012405 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/fr_FR.csv000077700000010740151323541140012405 0ustar00 "Amazon authorize invalid state : %1 with reason %2","État imprévu pour l'autorisation d'Amazon Pay. État : %1 ; code du motif : %2" "Amazon capture declined : %1","Amazon Pay a rejeté la saisie. Code du motif : %1" "Amazon capture invalid state : %1 with reason %2","État imprévu pour la saisie d'Amazon Pay. État : %1 ; code du motif : %2" "Amazon refund invalid state : %1 with reason %2","État imprévu pour le remboursement d'Amazon Pay. État : %1 ; code du motif : %2" "the country for your address is not allowed for this store","Le pays associé à votre adresse n'est pas autorisé pour ce site." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Nous sommes désolés, mais vous ne pouvez pas utiliser Amazon Pay pour cette commande. Sélectionnez un autre mode paiement." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Nous sommes désolés, mais un problème s'est produit avec le mode de paiement sélectionné sur votre compte Amazon. Sélectionnez un autre mode paiement." "The currency selected is not supported by Amazon Pay","La devise sélectionnée n'est pas prise en charge par Amazon Pay sur ce site." "Captured amount of %1 online","Montant de %1 saisi en ligne." "Declined amount of %1 online","La saisie en ligne du montant de %1 a été rejetée." "Capture declined","Saisie rejetée" "Capture declined for Order <a href=""%2"">#%1</a>","Saisie rejetée pour la commande <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Saisie en attente d'approbation du portail de paiement. Veuillez réessayer ultérieurement." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Impossible de trouver la configuration « multiline_count » de l'attribut « rue » de l'adresse du client." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Vous êtes client Amazon ? Payez désormais avec les informations de paiement et les coordonnées stockées dans votre compte Amazon." "Simulate Payment Scenarios","Simuler des scénarios de paiement" "Amazon could not process your request.","Amazon Pay n'a pas pu traiter votre demande. Veuillez réessayer." "Please select a payment method.","Sélectionnez un mode de paiement." "Your session has expired, please reload the page and try again.","Votre session a expiré. Actualisez la page et réessayez." "Return to standard checkout","Revenir à la commande standard" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Un problème s’est produit avec votre paiement. Votre commande n'a pas été passée et vous n'avez pas été débité." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Un problème est survenu avec votre moyen de paiement. Pour passer votre commande, essayez un autre moyen de paiement." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Votre transaction avec Amazon Pay est en cours de validation. Vous serez informe prochainement de son suivi." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Pour réinitialiser votre mot de passe, veuillez-vous <a href=""%1"">Déconnexion</a> et cliquer sur “Mot de passe oublié?” depuis la page de connexion" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Le mode de paiement sélectionné n'est pas disponible pour cette transaction. Veuillez en sélectionner un autre ou ajouter un nouveau mode de paiement au widget de portefeuille." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Aucun instrument de paiement n'a été sélectionné pour cette commande, veuillez essayer de rafraîchir la page ou d'ajouter un nouvel instrument de paiement dans le widget de portefeuille." "The order failed due to a technical error, please select another payment method or contact our support.","La commande a échoué en raison d'une erreur technique, veuillez sélectionner un autre mode de paiement ou contacter notre support." "or continue with Standard Checkout","ou continuer avec le Checkout Standard" amazon-pay-module/i18n/en_GB.csv000077700000007262151323541140012366 0ustar00"Amazon authorize invalid state : %1 with reason %2","Unexpected state for the Amazon Pay authorization. State: %1, Reason code: %2" "Amazon capture declined : %1","Amazon Pay declined the capture. Reason code: %1" "Amazon capture invalid state : %1 with reason %2","Unexpected state for the Amazon Pay capture. State: %1, Reason code: %2" "Amazon refund invalid state : %1 with reason %2","Unexpected state for the Amazon Pay refund. State: %1, Reason code: %2" "the country for your address is not allowed for this store","The country associated with your address is not allowed for this store." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","There has been a problem with the selected payment method on your Amazon account. Please choose another one." "The currency selected is not supported by Amazon Pay","The currency selected is not supported by Amazon Pay on this store." "Captured amount of %1 online","Captured amount of %1 online." "Declined amount of %1 online","Online Capture of amount %1 was declined." "Capture declined","Capture declined" "Capture declined for Order <a href=""%2"">#%1</a>","Capture declined for Order <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Capture pending approval from the payment gateway. Please check back later." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Could not find the ""multiline_count"" config of the ""street"" Customer address attribute." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account." "Simulate Payment Scenarios","Simulate Payment Scenarios" "Amazon could not process your request.","Amazon Pay could not process your request. Please try again." "Please select a payment method.","Please select a payment method." "Your session has expired, please reload the page and try again.","Your session has expired, please reload the page and try again." "Return to standard checkout","Return to standard checkout" "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget." "The order failed due to a technical error, please select another payment method or contact our support.","The order failed due to a technical error, please select another payment method or contact our support." "or continue with Standard Checkout","or continue with Standard Checkout" amazon-pay-module/i18n/.htaccess000077700000000177151323541140012473 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/i18n/es_VE.csv000077700000010476151323541140012416 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/de_DE.csv000077700000011100151323541140012336 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Autorisierung. Status: %1; Ursachencode: %2" "Amazon capture declined : %1","Capture wurde von Amazon Pay abgelehnt. Ursachencode: %1" "Amazon capture invalid state : %1 with reason %2","Unerwarteter Status für Amazon Pay-Capture. Status: %1; Ursachencode: %2" "Amazon refund invalid state : %1 with reason %2","Unerwarteter Status für die Amazon Pay-Erstattung. Status: %1; Ursachencode: %2" "the country for your address is not allowed for this store","Das mit Ihrer Adresse verknüpfte Land ist für diese Website nicht zulässig." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Leider können Sie ""Amazon Pay"" für diese Bestellung nicht verwenden. Wählen Sie eine andere Zahlungsweise aus." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Leider ist bei der ausgewählten Zahlungsweise ein Problem in Ihrem Amazon-Kundenkonto aufgetreten. Wählen Sie eine andere Zahlungsweise aus." "The currency selected is not supported by Amazon Pay","Die ausgewählte Währung wird von Amazon Pay auf dieser Website nicht unterstützt." "Captured amount of %1 online","Online erfasster Betrag ist %1." "Declined amount of %1 online","Online-Capture für Betrag %1 wurde abgelehnt." "Capture declined","Capture abgelehnt" "Capture declined for Order <a href=""%2"">#%1</a>","Capture abgelehnt für Bestellung <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Genehmigung vom Zahlungsgateway für Capture ist ausstehend. Bitte überprüfen Sie es später erneut." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Die Konfiguration ""multiline_count"" für das Attribut ""street"" der Kundenadresse konnte nicht gefunden werden." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Sind Sie Kunde bei Amazon? Verwenden Sie für die Bezahlung die Adresse und Zahlungsdetails, die in Ihrem Amazon-Kundenkonto gespeichert sind." "Simulate Payment Scenarios","Zahlungsszenarien simulieren" "Amazon could not process your request.","Amazon Pay konnte Ihre Anfrage nicht bearbeiten. Bitte versuchen Sie es noch einmal." "Please select a payment method.","Wählen Sie eine Zahlungsweise aus." "Your session has expired, please reload the page and try again.","Ihre Sitzung ist abgelaufen. Bitte laden Sie die Seite erneut und versuchen Sie es noch einmal." "Return to standard checkout","Zum Standard Checkout zurückkehren" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Beim Zahlungsvorgang ist ein Problem aufgetreten. Ihre Bestellung wurde nicht aufgegeben und Ihr Konto nicht belastet." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Mit dieser Zahlungsart ist ein Problem aufgetreten. Um Ihre Bestellung abzuschließen, wählen Sie bitte eine andere aus." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Ihre Zahlung mit Amazon Pay ist derzeit noch in Prufung. Bitte beachten Sie, dass wir uns mit Ihnen in Kurze per Email in Verbindung setzen werden, falls noch Unklarheiten bestehen sollten." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Fall Sie ihr Passwort zurücksetzen möchten, <a href=""%1"">loggen Sie sich bitte aus</a> und klicken Sie auf der Anmeldeseite auf “Passwort vergessen”" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Die gewählte Zahlmethode ist für diese Transaktion nicht verfügbar. Bitte wählen Sie eine andere oder fügen Sie eine neue Zahlmethode hinzu." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Für diese Bestellung wurde kein Zahlungsmittel ausgewählt, bitte versuchen Sie, die Seite zu aktualisieren oder ein neues Zahlungsmittel hinzuzufügen." "The order failed due to a technical error, please select another payment method or contact our support.","Die Bestellung ist aufgrund eines technischen Fehlers fehlgeschlagen, bitte wählen Sie eine andere Zahlungsmethode oder kontaktieren Sie unseren Support." "or continue with Standard Checkout","oder verwenden Sie den Standard Checkout" amazon-pay-module/i18n/es_ES.csv000077700000010476151323541140012413 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Estado inesperado de la autorización de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon capture declined : %1","Amazon Pay ha rechazado la captura. Código de motivo: %1" "Amazon capture invalid state : %1 with reason %2","Estado inesperado de la captura de Amazon Pay. Estado: %1; Código de motivo: %2" "Amazon refund invalid state : %1 with reason %2","Estado inesperado del reembolso de Amazon Pay. Estado: %1; Código de motivo: %2" "the country for your address is not allowed for this store","Este sitio web no admite el país asociado a tu dirección." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Lo sentimos, no es posible utilizar Amazon Pay para este pedido. Elige otro método de pago." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Lo sentimos, se ha producido un problema con el método de pago seleccionado en tu cuenta de Amazon. Elige otro método de pago." "The currency selected is not supported by Amazon Pay","Amazon Pay no admite la divisa seleccionada en este sitio web." "Captured amount of %1 online","Importe capturado por Internet de %1." "Declined amount of %1 online","Se ha rechazado el importe capturado por Internet de %1." "Capture declined","Captura rechazada" "Capture declined for Order <a href=""%2"">#%1</a>","Captura rechazada para el pedido <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","La captura está pendiente de autorización por parte de la plataforma de pago. Vuelve a comprobarlo más tarde." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","No se ha podido encontrar la configuración ""multiline_count"" del atributo ""street"" de la dirección del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","¿Eres cliente de Amazon? Ahora puedes pagar utilizando la dirección y los datos de pago almacenados en tu cuenta de Amazon." "Simulate Payment Scenarios","Simular casos de pago" "Amazon could not process your request.","Amazon Pay no ha podido procesar tu solicitud. Vuelve a intentarlo." "Please select a payment method.","Selecciona un método de pago." "Your session has expired, please reload the page and try again.","Tu sesión ha caducado. Actualiza la página e inténtalo de nuevo." "Return to standard checkout","Vuelva a su checkout estándar" "Amazon Pay was unable to authenticate the payment instrument. Please try again, or use a different payment method.","Se ha producido un problema con el pago. Tu pedido no se ha confirmado y no se te ha cargado ningún importe." "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Se ha producido un error con tu método de pago. Para confirmar tu pedido, prueba con otro método de pago." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","Tu transaccion con Amazon Pay se esta verificando. Te informaremos tan pronto como sea posible." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Para restablecer tu contraseña, <a href=""%1"">cierra la sesión</a> y pulsa “¿Has olvidado tu contraseña?” en la pagina de acceso." "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","El método de pago seleccionado no está disponible para esta transacción. Por favor, seleccione otro o introducza uno nuevo en el recuadro Metodo de pago." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","No ha sido seleccionado un método de pago para este pedido. Por favor, refresque la página o introduzca uno nuevo en el recuadro Metodo de pago." "The order failed due to a technical error, please select another payment method or contact our support.","El pedido no ha sido procesado debido a un error técnico. Por favor, seleccione otro método de pago o contacte nuestro servicio de soporte al cliente." "or continue with Standard Checkout","o continúa con el Checkout Standard" amazon-pay-module/i18n/it_CH.csv000077700000010163151323541140012374 0ustar00 "Amazon authorize invalid state : %1 with reason %2","Stato imprevisto per l'autorizzazione Amazon Pay. Stato: %1; Codice motivo: %2" "Amazon capture declined : %1","Amazon Pay ha negato l'acquisizione. Codice motivo: %1" "Amazon capture invalid state : %1 with reason %2","Stato imprevisto per l'acquisizione Amazon Pay. Stato: %1; Codice motivo: %2" "Amazon refund invalid state : %1 with reason %2","Stato imprevisto per il rimborso Amazon Pay. Stato: %1; Codice motivo: %2" "the country for your address is not allowed for this store","Il paese associato al tuo indirizzo non è supportato su questo sito." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Non è possibile utilizzare Amazon Pay per questo ordine. Seleziona un altro metodo di pagamento." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","Si è verificato un problema con il metodo di pagamento selezionato sul tuo account Amazon. Seleziona un altro metodo di pagamento." "The currency selected is not supported by Amazon Pay","La valuta selezionata non è supportata da Amazon Pay su questo sito." "Captured amount of %1 online","Importo acquisito di %1 online." "Declined amount of %1 online","L'acquisizione online dell'importo di %1 è stata negata." "Capture declined","Acquisizione negata" "Capture declined for Order <a href=""%2"">#%1</a>","Acquisizione negata per l'ordine <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","L'acquisizione è in attesa di autorizzazione da parte del gateway di pagamento. Riprova più tardi." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Impossibile trovare l'opzione config ""multiline_count"" dell'attributo ""street"" dell'indirizzo del cliente." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Sei un cliente Amazon? Paga ora utilizzando l'indirizzo e i dati di pagamento memorizzati nel tuo account Amazon." "Simulate Payment Scenarios","Simula scenari di pagamento" "Amazon could not process your request.","Il servizio Amazon Pay non ha potuto elaborare la tua richiesta. Riprova." "Please select a payment method.","Seleziona un metodo di pagamento." "Your session has expired, please reload the page and try again.","La sessione è scaduta. Ricarica la pagina e riprova." "Return to standard checkout","Ritorna al tuo checkout originale" "The SCA challenge was not completed successfully. Please try again, or use a different payment method.","Si è verificato un problema con il metodo di pagamento. Per effettuare l'ordine, prova con un altro metodo di pagamento." "Your transaction with Amazon Pay is currently being validated. Please be aware that we will inform you shortly as needed.","La vostra transazione con Amazon Pay e in fase di validazione. Vi informeremo del risultato della transazione a breve." "In order to reset your password, please <a href=""%1"">Sign Out</a> and click on “Forgot Your Password?” from the Sign In page","Per resettare la tua password, per favore <a href=""%1"">Esci</a> dal tuo account e seleziona “Hai dimenticato la password?" dalla pagina di Accesso" "The selected payment method is not available for this transaction. Please select another one or add a new payment method to the wallet widget.","Il metodo di pagamento selezionato non è disponibile per questa transazione. Per favore selezionarne o aggiungerne un altro nel wallet widget." "No payment instrument has been selected for this order, please try to refresh the page or add a new payment instrument in the wallet widget.","Non è stato selezionato nessun metodo di pagamento per questo ordine. Per favore ricaricare la pagina o aggiungere un nuovo metodo di pagamento nel wallet widget." "The order failed due to a technical error, please select another payment method or contact our support.","Non è stato possibile processare l’ordine a causa di un problema tecnico. Per favore selezionare un altro metodo di pagamento o contattare il supporto." "or continue with Standard Checkout","o continua con il Checkout Standard" amazon-pay-module/etc/events.xml000077700000004636151323541140012723 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="sales_order_load_after"> <observer name="amazon_payment_load_order" instance="Amazon\Payment\Observer\LoadOrder" /> </event> <event name="amazon_payment_authorize_before"> <observer name="amazon_payment_sandbox_simulation_authorization" instance="Amazon\Payment\Observer\SandboxSimulation" /> </event> <event name="amazon_payment_capture_before"> <observer name="amazon_payment_sandbox_simulation_capture" instance="Amazon\Payment\Observer\SandboxSimulation" /> </event> <event name="amazon_payment_refund_before"> <observer name="amazon_payment_sandbox_simulation_refund" instance="Amazon\Payment\Observer\SandboxSimulation" /> </event> <event name="payment_method_assign_data_amazon_payment"> <observer name="amazon_payment_gateway_data_assign" instance="Amazon\Payment\Observer\DataAssignObserver" /> </event> <event name="checkout_submit_before"> <observer name="amazon_payment_ignore_billing_address_validation" instance="Amazon\Payment\Observer\IgnoreBillingAddressValidation" /> </event> <event name="amazon_payment_pending_authorization_soft_decline_after"> <observer name="amazon_payment_soft_decline_email" instance="Amazon\Payment\Observer\SoftDeclinedEmailSender" /> </event> <event name="amazon_payment_pending_authorization_hard_decline_after"> <observer name="amazon_payment_hard_decline_email" instance="Amazon\Payment\Observer\HardDeclinedEmailSender" /> </event> <event name="sales_order_payment_capture"> <observer name="amazon_payment_order_payment_capture" instance="Amazon\Payment\Observer\OrderPaymentCapture" /> </event> </config> amazon-pay-module/etc/frontend/events.xml000077700000002074151323541140014534 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="shortcut_buttons_container"> <observer name="amazon_buttons" instance="Amazon\Payment\Observer\AddAmazonButton"/> </event> <event name="kco_override_load_checkout"> <observer name="amazon_core_klarna_kco_override" instance="Amazon\Payment\Observer\KlarnaKcoOverride" /> </event> </config> amazon-pay-module/etc/frontend/routes.xml000077700000001635151323541140014553 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="amazon_payments" frontName="amazonpayments"> <module name="Amazon_Payment" /> </route> </router> </config> amazon-pay-module/etc/frontend/di.xml000077700000002621151323541140013622 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Amazon\Payment\Block\Minicart\Button"> <arguments> <argument name="data" xsi:type="array"> <item name="template" xsi:type="string">Amazon_Payment::minicart-button.phtml</item> <item name="alias" xsi:type="string">amazon.button.mini-cart</item> </argument> <argument name="payment" xsi:type="object">Amazon\Payment\Gateway\Config\Config</argument> </arguments> </type> <type name="Magento\Checkout\Block\Checkout\LayoutProcessor"> <plugin name="amazon_payment_checkout_processor" type="Amazon\Payment\Plugin\CheckoutProcessor" /> </type> </config> amazon-pay-module/etc/frontend/.htaccess000077700000000177151323541140014306 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/etc/webapi.xml000077700000003060151323541140012654 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd"> <route url="/V1/amazon-shipping-address/:amazonOrderReferenceId" method="PUT"> <service class="Amazon\Payment\Api\AddressManagementInterface" method="getShippingAddress"/> <resources> <resource ref="anonymous" /> </resources> </route> <route url="/V1/amazon-billing-address/:amazonOrderReferenceId" method="PUT"> <service class="Amazon\Payment\Api\AddressManagementInterface" method="getBillingAddress"/> <resources> <resource ref="anonymous" /> </resources> </route> <route url="/V1/amazon/order-ref" method="DELETE"> <service class="Amazon\Payment\Api\OrderInformationManagementInterface" method="removeOrderReference"/> <resources> <resource ref="anonymous" /> </resources> </route> </routes> amazon-pay-module/etc/csp_whitelist.xml000077700000021252151323541140014271 0ustar00<?xml version="1.0" encoding="UTF-8"?> <csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd"> <policies> <policy id="connect-src"> <values> <value id="amazon_com" type="host">*.amazon.com</value> <value id="amazon_co_uk" type="host">*.amazon.co.uk</value> <value id="amazon_co_jp" type="host">*.amazon.co.jp</value> <value id="amazon_jp" type="host">*.amazon.jp</value> <value id="amazon_it" type="host">*.amazon.it</value> <value id="amazon_fr" type="host">*.amazon.fr</value> <value id="amazon_es" type="host">*.amazon.es</value> <value id="amazon_de" type="host">*.amazon.de</value> <value id="amazonpay_com" type="host">*.amazonpay.com</value> <value id="amazonpay_co_uk" type="host">*.amazonpay.co.uk</value> <value id="amazonpay_co_jp" type="host">*.amazonpay.co.jp</value> <value id="amazonpay_jp" type="host">*.amazonpay.jp</value> <value id="amazonpay_it" type="host">*.amazonpay.it</value> <value id="amazonpay_fr" type="host">*.amazonpay.fr</value> <value id="amazonpay_es" type="host">*.amazonpay.es</value> <value id="amazonpay_de" type="host">*.amazonpay.de</value> <value id="amazonservices_com" type="host">mws.amazonservices.com</value> <value id="amazonservices_co_uk" type="host">mws.amazonservices.co.uk</value> <value id="amazonservices_co_jp" type="host">mws.amazonservices.co.jp</value> <value id="amazonservices_jp" type="host">mws.amazonservices.jp</value> <value id="amazonservices_it" type="host">mws.amazonservices.it</value> <value id="amazonservices_fr" type="host">mws.amazonservices.fr</value> <value id="amazonservices_es" type="host">mws.amazonservices.es</value> <value id="amazonservices_de" type="host">mws.amazonservices.de</value> </values> </policy> <policy id="script-src"> <values> <value id="amazon_payment_widget_com" type="host">*.payments-amazon.com</value> <value id="amazon_payment_widget_co_uk" type="host">*.payments-amazon.co.uk</value> <value id="amazon_payment_widget_co_jp" type="host">*.payments-amazon.co.jp</value> <value id="amazon_payment_widget_jp" type="host">*.payments-amazon.jp</value> <value id="amazon_payment_widget_it" type="host">*.payments-amazon.it</value> <value id="amazon_payment_widget_fr" type="host">*.payments-amazon.fr</value> <value id="amazon_payment_widget_es" type="host">*.payments-amazon.es</value> <value id="amazon_payment_widget_de" type="host">*.payments-amazon.de</value> </values> </policy> <policy id="img-src"> <values> <value id="amazon_cloudfront01" type="host">d3sbl0c71oxeok.cloudfront.net</value> <value id="amazon_cloudfront02" type="host">dhkkzdfmpzvap.cloudfront.net</value> <value id="amazon_cloudfront03" type="host">d2bpzs5y44q6e0.cloudfront.net</value> <value id="amazon_cloudfront04" type="host">d37shgu97oizpd.cloudfront.net</value> <value id="amazon_cloudfront05" type="host">d1zlqll3enr74n.cloudfront.net</value> <value id="amazon_cloudfront06" type="host">d1jynp0fpwn93a.cloudfront.net</value> <value id="amazon_cloudfront07" type="host">d2cb3tokgpwh3v.cloudfront.net</value> <value id="amazon_cloudfront08" type="host">d1re8bfxx3pw6e.cloudfront.net</value> <value id="amazon_cloudfront09" type="host">d35u8xwkxs8vpe.cloudfront.net</value> <value id="amazon_cloudfront10" type="host">d13s9xffygp5o.cloudfront.net</value> <value id="amazon_cloudfront11" type="host">d388nbw0dwi1jm.cloudfront.net</value> <value id="amazon_cloudfront12" type="host">d11p2vtu3dppaw.cloudfront.net</value> <value id="amazon_cloudfront13" type="host">d3r89hiip86hka.cloudfront.net</value> <value id="amazon_cloudfront14" type="host">dc7snq0c8ipyk.cloudfront.net</value> <value id="amazon_cloudfront15" type="host">d5c7kvljggzso.cloudfront.net</value> <value id="amazon_cloudfront16" type="host">d2h8yg3ypfzua1.cloudfront.net</value> <value id="amazon_cloudfront17" type="host">d1b556x7apj5fb.cloudfront.net</value> <value id="amazon_cloudfront18" type="host">draz1ib3z71v2.cloudfront.net</value> <value id="amazon_cloudfront19" type="host">dr6hdp4s5yzfc.cloudfront.net</value> <value id="amazon_cloudfront20" type="host">d2bomicxw8p7ii.cloudfront.net</value> <value id="amazon_cloudfront21" type="host">d3aypcdgvjnnam.cloudfront.net</value> <value id="amazon_cloudfront22" type="host">d2a3iuf10348gy.cloudfront.net</value> <value id="ssl_images_amazon_com" type="host">*.ssl-images-amazon.com</value> <value id="ssl_images_amazon_co_uk" type="host">*.ssl-images-amazon.co.uk</value> <value id="ssl_images_amazon_co_jp" type="host">*.ssl-images-amazon.co.jp</value> <value id="ssl_images_amazon_jp" type="host">*.ssl-images-amazon.jp</value> <value id="ssl_images_amazon_it" type="host">*.ssl-images-amazon.it</value> <value id="ssl_images_amazon_fr" type="host">*.ssl-images-amazon.fr</value> <value id="ssl_images_amazon_es" type="host">*.ssl-images-amazon.es</value> <value id="ssl_images_amazon_de" type="host">*.ssl-images-amazon.de</value> <value id="media_amazon_com" type="host">*.media-amazon.com</value> <value id="media_amazon_co_uk" type="host">*.media-amazon.co.uk</value> <value id="media_amazon_co_jp" type="host">*.media-amazon.co.jp</value> <value id="media_amazon_jp" type="host">*.media-amazon.jp</value> <value id="media_amazon_it" type="host">*.media-amazon.it</value> <value id="media_amazon_fr" type="host">*.media-amazon.fr</value> <value id="media_amazon_es" type="host">*.media-amazon.es</value> <value id="media_amazon_de" type="host">*.media-amazon.de</value> </values> </policy> <policy id="form-action"> <values> <value id="amazon_com" type="host">*.amazon.com</value> <value id="amazon_co_uk" type="host">*.amazon.co.uk</value> <value id="amazon_co_jp" type="host">*.amazon.co.jp</value> <value id="amazon_jp" type="host">*.amazon.jp</value> <value id="amazon_it" type="host">*.amazon.it</value> <value id="amazon_fr" type="host">*.amazon.fr</value> <value id="amazon_es" type="host">*.amazon.es</value> <value id="amazon_de" type="host">*.amazon.de</value> </values> </policy> <policy id="frame-src"> <values> <value id="amazon_com" type="host">*.amazon.com</value> <value id="amazon_co_uk" type="host">*.amazon.co.uk</value> <value id="amazon_co_jp" type="host">*.amazon.co.jp</value> <value id="amazon_jp" type="host">*.amazon.jp</value> <value id="amazon_it" type="host">*.amazon.it</value> <value id="amazon_fr" type="host">*.amazon.fr</value> <value id="amazon_es" type="host">*.amazon.es</value> <value id="amazon_de" type="host">*.amazon.de</value> <value id="amazon_payment_widget_com" type="host">*.payments-amazon.com</value> <value id="amazon_payment_widget_co_uk" type="host">*.payments-amazon.co.uk</value> <value id="amazon_payment_widget_co_jp" type="host">*.payments-amazon.co.jp</value> <value id="amazon_payment_widget_jp" type="host">*.payments-amazon.jp</value> <value id="amazon_payment_widget_it" type="host">*.payments-amazon.it</value> <value id="amazon_payment_widget_fr" type="host">*.payments-amazon.fr</value> <value id="amazon_payment_widget_es" type="host">*.payments-amazon.es</value> <value id="amazon_payment_widget_de" type="host">*.payments-amazon.de</value> </values> </policy> </policies> </csp_whitelist> amazon-pay-module/etc/amazon_error_mapping.xml000077700000012552151323541140015624 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/error_mapping.xsd"> <message_list> <message code="AmazonRejected" translate="true">Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.</message> <message code="ProcessingFailure" translate="true">Processing Failure - unable to authorize transaction.</message> <message code="BillingAgreementConstraintsExist" translate="true">Unable to authorize transaction.</message> <message code="PaymentMethodNotUpdated" translate="true">Buyer did not specify valid Amazon Wallet payment method.</message> <message code="DuplicateReferenceId" translate="true">Duplicate reference or payment amount already authorized.</message> <message code="DuplicateRequest" translate="true">Duplicate reference or payment amount already authorized.</message> <message code="PeriodicAmountExceeded" translate="true">Duplicate reference or payment amount already authorized.</message> <message code="InvalidAddress" translate="true">Invalid values passed in request.</message> <message code="InvalidParameterValue" translate="true">Invalid values passed in request.</message> <message code="OrderReferenceCountExceeded" translate="true">You have attempted to create more than the maximum allowed limit of one Order Reference object on a Billing Agreement object that is in the Draft State.</message> <message code="TransactionTimedOut" translate="true">Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.</message> <message code="TransactionCountExceeded" translate="true">Number of authorizations, captures or refunds has exceeded allowed limits.</message> <message code="TransactionAmountExceeded" translate="true">Number of authorizations, captures or refunds has exceeded allowed limits.</message> <message code="InvalidSandboxSimulationSpecified" translate="true">Invalid operation for sandbox environment.</message> <message code="InvalidAddressConsentToken" translate="true">Request has an invalid signature.</message> <message code="MissingAuthenticationToken" translate="true">Request has an invalid signature.</message> <message code="InvalidOrderReferenceId" translate="true">Order reference ID is invalid.</message> <message code="InvalidTransactionId" translate="true">Invalid transaction identifier.</message> <message code="InvalidAccountStatus" translate="true">Specified seller account is not authorized to execute this request.</message> <message code="UnauthorizedAccess" translate="true">Specified seller account is not authorized to execute this request.</message> <message code="ConstraintsExist" translate="true">Order Reference submitted in this request has constraints and cannot be confirmed.</message> <message code="InvalidBillingAgreementStatus" translate="true">Billing Agreement object cannot be modified.</message> <message code="BillingAgreementNotModifiable" translate="true">Billing Agreement object cannot be modified.</message> <message code="CaptureNotRefundable" translate="true">Capture not refundable.</message> <message code="Declined" translate="true">Capture not refundable.</message> <message code="InvalidAuthorizationStatus" translate="true">You have attempted to capture or close an authorization for an Authorization object that is in a state where a capture or close is not allowed.</message> <message code="InvalidCancelAttempt" translate="true">Billing Agreement object cannot closed or canceled.</message> <message code="InvalidCloseAttempt" translate="true">Billing Agreement object cannot closed or canceled.</message> <message code="InvalidOrderReferenceStatus" translate="true">You have attempted to call an operation on an Order Reference object that is in a state where that operation is not allowed.</message> <message code="InternalServerError" translate="true">There was an unknown error in the service.</message> <message code="RequestThrottled" translate="true">Request rejected because request rate is higher than allocated throttling limits.</message> <message code="ServiceUnavailable" translate="true">The service is temporarily unavailable. Please try again later.</message> <message code="PaymentMethodNotAllowed" translate="true">Invalid payment method - please select a different payment method.</message> <message code="InvalidPaymentMethod" translate="true">There has been a problem with the selected payment method on your Amazon account. Please choose another one.</message> </message_list> </mapping> amazon-pay-module/etc/crontab.xml000077700000002524151323541140013041 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd"> <group id="default"> <job name="get_amazon_capture_updates" instance="Amazon\Payment\Cron\GetAmazonCaptureUpdates" method="execute"> <schedule>*/5 * * * *</schedule> </job> <job name="get_amazon_authorization_updates" instance="Amazon\Payment\Cron\GetAmazonAuthorizationUpdates" method="execute"> <schedule>*/5 * * * *</schedule> </job> <job name="amazon_payments_process_queued_refunds" instance="Amazon\Payment\Cron\ProcessAmazonRefunds" method="execute"> <schedule>*/5 * * * *</schedule> </job> </group> </config> amazon-pay-module/etc/module.xml000077700000001673151323541140012702 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Amazon_Payment" setup_version="4.2.0" > <sequence> <module name="Amazon_Core"/> <module name="Amazon_Login"/> </sequence> </module> </config> amazon-pay-module/etc/extension_attributes.xml000077700000003344151323541140015674 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\CartInterface"> <attribute code="amazon_order_reference_id" type="Amazon\Payment\Api\Data\QuoteLinkInterface"> <join reference_table="amazon_quote" reference_field="quote_id" join_on_field="entity_id"> <field>amazon_order_reference_id</field> <field>quote_id</field> <field>sandbox_simulation_reference</field> <field>confirmed</field> </join> </attribute> </extension_attributes> <extension_attributes for="Magento\Sales\Api\Data\OrderInterface"> <attribute code="amazon_order_reference_id" type="Amazon\Payment\Api\Data\OrderLinkInterface"> <join reference_table="amazon_sales_order" reference_field="order_id" join_on_field="entity_id"> <field>amazon_order_reference_id</field> <field>order_id</field> </join> </attribute> </extension_attributes> </config> amazon-pay-module/etc/di.xml000077700000043135151323541140012010 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <!-- Payment Method Facade configuration --> <virtualType name="AmazonFacade" type="Magento\Payment\Model\Method\Adapter"> <arguments> <argument name="code" xsi:type="const">Amazon\Payment\Gateway\Config\Config::CODE</argument> <argument name="formBlockType" xsi:type="string">Magento\Payment\Block\Form</argument> <argument name="infoBlockType" xsi:type="string">Magento\Payment\Block\Info</argument> <argument name="valueHandlerPool" xsi:type="object">AmazonValueHandlerPool</argument> <argument name="validatorPool" xsi:type="object">AmazonValidatorPool</argument> <argument name="commandPool" xsi:type="object">AmazonCommandPool</argument> </arguments> </virtualType> <!-- Amazon validators infrastructure --> <virtualType name="AmazonCountryValidator" type="Magento\Payment\Gateway\Validator\CountryValidator"> <arguments> <argument name="config" xsi:type="object">Amazon\Payment\Gateway\Config\Config</argument> </arguments> </virtualType> <virtualType name="AmazonValidatorPool" type="Magento\Payment\Gateway\Validator\ValidatorPool"> <arguments> <argument name="validators" xsi:type="array"> <item name="country" xsi:type="string">AmazonCountryValidator</item> </argument> </arguments> </virtualType> <!-- Amazon error code mapper --> <virtualType name="Amazon\Payment\Gateway\ErrorMapper\VirtualConfigReader" type="Magento\Payment\Gateway\ErrorMapper\VirtualConfigReader"> <arguments> <argument name="fileName" xsi:type="string">amazon_error_mapping.xml</argument> </arguments> </virtualType> <virtualType name="Amazon\Payment\Gateway\ErrorMapper\VirtualMappingData" type="Magento\Payment\Gateway\ErrorMapper\MappingData"> <arguments> <argument name="reader" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualConfigReader</argument> <argument name="cacheId" xsi:type="string">amazon_error_mapper</argument> </arguments> </virtualType> <virtualType name="Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper" type="Magento\Payment\Gateway\ErrorMapper\ErrorMessageMapper"> <arguments> <argument name="messageMapping" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualMappingData</argument> </arguments> </virtualType> <!-- Logger, initialized with Amazon Config --> <virtualType name="AmazonLogger" type="Magento\Payment\Model\Method\Logger"> <arguments> <argument name="config" xsi:type="object">AmazonGatewayConfig</argument> </arguments> </virtualType> <!-- Commands infrastructure --> <virtualType name="AmazonCommandPool" type="Magento\Payment\Gateway\Command\CommandPool"> <arguments> <argument name="commands" xsi:type="array"> <item name="authorize" xsi:type="string">AmazonAuthorizeCommand</item> <item name="capture" xsi:type="string">AmazonCaptureStrategyCommand</item> <item name="sale" xsi:type="string">AmazonSaleCommand</item> <item name="settlement" xsi:type="string">AmazonSettlementCommand</item> <item name="void" xsi:type="string">AmazonVoidCommand</item> <item name="cancel" xsi:type="string">AmazonVoidCommand</item> <item name="refund" xsi:type="string">AmazonRefundCommand</item> </argument> </arguments> </virtualType> <virtualType name="AmazonCaptureStrategyCommand" type="Amazon\Payment\Gateway\Command\CaptureStrategyCommand"> <arguments> <argument name="commandPool" xsi:type="object">AmazonCommandPool</argument> </arguments> </virtualType> <!-- Configuration reader --> <virtualType name="AmazonGatewayConfig" type="Amazon\Payment\Gateway\Config\Config"> </virtualType> <virtualType name="AmazonCommandManager" type="Magento\Payment\Gateway\Command\CommandManager"> <arguments> <argument name="commandPool" xsi:type="object">AmazonCommandPool</argument> </arguments> </virtualType> <type name="Magento\Payment\Gateway\Command\CommandManagerPool"> <arguments> <argument name="executors" xsi:type="array"> <item name="amazon_payment" xsi:type="string">AmazonCommandManager</item> </argument> </arguments> </type> <virtualType name="AmazonAuthorizationValidators" type="Magento\Payment\Gateway\Validator\ValidatorComposite"> <arguments> <argument name="validators" xsi:type="array"> <item name="contraints" xsi:type="string">Amazon\Payment\Gateway\Validator\ConstraintValidator</item> <item name="authcodes" xsi:type="string">Amazon\Payment\Gateway\Validator\AuthorizationValidator</item> </argument> </arguments> </virtualType> <!-- Authorize command --> <virtualType name="AmazonAuthorizeCommand" type="Amazon\Payment\Gateway\Command\AmazonAuthCommand"> <arguments> <argument name="requestBuilder" xsi:type="object">Amazon\Payment\Gateway\Request\AuthorizationRequestBuilder</argument> <argument name="handler" xsi:type="object">Amazon\Payment\Gateway\Response\CompleteAuthHandler</argument> <argument name="transferFactory" xsi:type="object">Amazon\Payment\Gateway\Http\TransferFactory</argument> <argument name="validator" xsi:type="object">AmazonAuthorizationValidators</argument> <argument name="client" xsi:type="object">Amazon\Payment\Gateway\Http\Client\AuthorizeClient</argument> <argument name="errorMessageMapper" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper</argument> </arguments> </virtualType> <type name="Amazon\Payment\Gateway\Request\AuthorizationRequestBuilder"> <arguments> <argument name="config" xsi:type="object">AmazonGatewayConfig</argument> </arguments> </type> <!-- Authorize and Capture command --> <virtualType name="AmazonSaleCommand" type="Amazon\Payment\Gateway\Command\AmazonAuthCommand"> <arguments> <argument name="requestBuilder" xsi:type="object">Amazon\Payment\Gateway\Request\AuthorizationRequestBuilder</argument> <argument name="handler" xsi:type="object">Amazon\Payment\Gateway\Response\CompleteSaleHandler</argument> <argument name="transferFactory" xsi:type="object">Amazon\Payment\Gateway\Http\TransferFactory</argument> <argument name="validator" xsi:type="object">AmazonAuthorizationValidators</argument> <argument name="client" xsi:type="object">Amazon\Payment\Gateway\Http\Client\CaptureClient</argument> <argument name="errorMessageMapper" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper</argument> </arguments> </virtualType> <!-- Capture settlement command --> <virtualType name="AmazonSettlementCommand" type="Amazon\Payment\Gateway\Command\AmazonAuthCommand"> <arguments> <argument name="requestBuilder" xsi:type="object">Amazon\Payment\Gateway\Request\SettlementRequestBuilder</argument> <argument name="handler" xsi:type="object">Amazon\Payment\Gateway\Response\SettlementHandler</argument> <argument name="transferFactory" xsi:type="object">Amazon\Payment\Gateway\Http\TransferFactory</argument> <argument name="validator" xsi:type="object">AmazonAuthorizationValidators</argument> <argument name="client" xsi:type="object">Amazon\Payment\Gateway\Http\Client\SettlementClient</argument> <argument name="errorMessageMapper" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper</argument> </arguments> </virtualType> <!-- Refund Command --> <virtualType name="AmazonRefundCommand" type="Magento\Payment\Gateway\Command\GatewayCommand"> <arguments> <argument name="requestBuilder" xsi:type="object">Amazon\Payment\Gateway\Request\RefundRequestBuilder</argument> <argument name="handler" xsi:type="object">Amazon\Payment\Gateway\Response\RefundHandler</argument> <argument name="transferFactory" xsi:type="object">Amazon\Payment\Gateway\Http\TransferFactory</argument> <argument name="validator" xsi:type="object">Amazon\Payment\Gateway\Validator\AuthorizationValidator</argument> <argument name="client" xsi:type="object">Amazon\Payment\Gateway\Http\Client\RefundClient</argument> <argument name="errorMessageMapper" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper</argument> </arguments> </virtualType> <!-- Void command --> <virtualType name="AmazonVoidCommand" type="Magento\Payment\Gateway\Command\GatewayCommand"> <arguments> <argument name="requestBuilder" xsi:type="object">Amazon\Payment\Gateway\Request\VoidRequestBuilder</argument> <argument name="handler" xsi:type="object">Amazon\Payment\Gateway\Response\VoidHandler</argument> <argument name="transferFactory" xsi:type="object">Amazon\Payment\Gateway\Http\TransferFactory</argument> <argument name="validator" xsi:type="object">Amazon\Payment\Gateway\Validator\AuthorizationValidator</argument> <argument name="client" xsi:type="object">Amazon\Payment\Gateway\Http\Client\VoidClient</argument> <argument name="errorMessageMapper" xsi:type="object">Amazon\Payment\Gateway\ErrorMapper\VirtualErrorMessageMapper</argument> </arguments> </virtualType> <!-- Void Request --> <type name="Amazon\Payment\Gateway\Request\VoidRequestBuilder"> <arguments> <argument name="config" xsi:type="object">AmazonGatewayConfig</argument> </arguments> </type> <!-- Value handlers infrastructure --> <virtualType name="AmazonValueHandlerPool" type="Magento\Payment\Gateway\Config\ValueHandlerPool"> <arguments> <argument name="handlers" xsi:type="array"> <item name="default" xsi:type="string">AmazonConfigValueHandler</item> </argument> </arguments> </virtualType> <virtualType name="AmazonConfigValueHandler" type="Magento\Payment\Gateway\Config\ConfigValueHandler"> <arguments> <argument name="configInterface" xsi:type="object">AmazonGatewayConfig</argument> </arguments> </virtualType> <type name="Amazon\Payment\Block\Info"> <arguments> <argument name="config" xsi:type="object">AmazonGatewayConfig</argument> </arguments> </type> <!-- end gateway config --> <preference for="Amazon\Payment\Api\OrderInformationManagementInterface" type="Amazon\Payment\Model\OrderInformationManagement"/> <preference for="Amazon\Payment\Api\AddressManagementInterface" type="Amazon\Payment\Model\AddressManagement"/> <preference for="Amazon\Payment\Api\QuoteLinkManagementInterface" type="Amazon\Payment\Model\QuoteLinkManagement"/> <preference for="Amazon\Payment\Api\Data\QuoteLinkInterface" type="Amazon\Payment\Model\QuoteLink"/> <preference for="Amazon\Payment\Api\Data\OrderLinkInterface" type="Amazon\Payment\Model\OrderLink"/> <preference for="Amazon\Payment\Api\Data\PendingCaptureInterface" type="Amazon\Payment\Model\PendingCapture"/> <preference for="Amazon\Payment\Api\Data\PendingAuthorizationInterface" type="Amazon\Payment\Model\PendingAuthorization"/> <preference for="Amazon\Payment\Api\Data\PendingRefundInterface" type="Amazon\Payment\Model\PendingRefund"/> <preference for="Amazon\Payment\Ipn\IpnHandlerFactoryInterface" type="Amazon\Payment\Ipn\IpnHandlerFactory"/> <preference for="AmazonPay\IpnHandlerInterface" type="Amazon\Payment\Ipn\IpnHandler"/> <preference for="Amazon\Payment\Api\Ipn\CompositeProcessorInterface" type="Amazon\Payment\Model\Ipn\CompositeProcessor"/> <type name="Magento\Quote\Api\CartRepositoryInterface"> <plugin name="amazon_payment_quote_repository" type="Amazon\Payment\Plugin\QuoteRepository" sortOrder="1"/> </type> <type name="Magento\Checkout\Api\ShippingInformationManagementInterface"> <plugin name="amazon_payment_shipping_information_management" type="Amazon\Payment\Plugin\ShippingInformationManagement" sortOrder="1"/> </type> <type name="Magento\Quote\Api\Data\PaymentInterface"> <plugin name="amazon_payment_additional_information" type="Amazon\Payment\Plugin\AdditionalInformation"/> </type> <type name="Amazon\Payment\Model\Method\AmazonLoginMethod"> <plugin name="disable_amazon_payment_method" type="Amazon\Payment\Plugin\DisableAmazonPaymentMethod" sortOrder="10" disabled="false"/> </type> <type name="Magento\Quote\Model\PaymentMethodManagement"> <plugin name="confirm_order_reference_on_payment_details_save" type="Amazon\Payment\Plugin\ConfirmOrderReference" sortOrder="10" disabled="false"/> </type> <type name="Amazon\Payment\Cron\ProcessAmazonRefunds"> <arguments> <argument name="paymentManagement" xsi:type="object">Amazon\Payment\Model\PaymentManagement\Proxy</argument> </arguments> </type> <type name="Amazon\Payment\Cron\GetAmazonCaptureUpdates"> <arguments> <argument name="paymentManagement" xsi:type="object">Amazon\Payment\Model\PaymentManagement\Proxy</argument> </arguments> </type> <type name="Amazon\Payment\Model\QueuedRefundUpdater"> <arguments> <argument name="adminNotifier" xsi:type="object">Magento\Framework\Notification\NotifierInterface\Proxy</argument> </arguments> </type> <type name="Amazon\Payment\Api\Ipn\CompositeProcessorInterface"> <arguments> <argument name="processors" xsi:type="array"> <item name="captureprocessor" xsi:type="object">Amazon\Payment\Model\Ipn\CaptureProcessor\Proxy</item> <item name="authorizationprocessor" xsi:type="object">Amazon\Payment\Model\Ipn\AuthorizationProcessor\Proxy</item> <item name="orderprocessor" xsi:type="object">Amazon\Payment\Model\Ipn\OrderProcessor\Proxy</item> <item name="refundprocessor" xsi:type="object">Amazon\Payment\Model\Ipn\RefundProcessor\Proxy</item> </argument> </arguments> </type> <type name="Amazon\Core\Logger\IpnLogger"> <arguments> <argument name="name" xsi:type="string">amazonIpnLogger</argument> <argument name="handlers" xsi:type="array"> <item name="debug" xsi:type="object">Amazon\Core\Logger\Handler\Ipn</item> </argument> </arguments> </type> <type name="Amazon\Payment\Ipn\IpnHandlerFactoryInterface"> <arguments> <argument name="logger" xsi:type="object">Amazon\Core\Logger\IpnLogger</argument> </arguments> </type> <type name="Amazon\Core\Logger\ExceptionLogger"> <arguments> <argument name="logger" xsi:type="object">Amazon\Core\Logger\Logger</argument> </arguments> </type> <type name="Magento\Framework\Webapi\ErrorProcessor"> <plugin name="amazon_payment_webapi_error_processor" type="Amazon\Payment\Plugin\WebapiErrorProcessor" sortOrder="1"/> </type> <type name="Amazon\Payment\Gateway\Config\Config"> <arguments> <argument name="methodCode" xsi:type="const">Amazon\Payment\Gateway\Config\Config::CODE</argument> </arguments> </type> <type name="Amazon\Payment\Helper\Shortcut\Validator"> <arguments> <argument name="amazonConfig" xsi:type="object">Amazon\Payment\Gateway\Config\Config</argument> </arguments> </type> <type name="Magento\ScalableCheckout\Console\Command\SplitQuote"> <arguments> <argument name="tables" xsi:type="array"> <item name="amazon_quote" xsi:type="string">amazon_quote</item> </argument> </arguments> </type> <type name="Amazon\Payment\Model\ResourceModel\QuoteLink"> <arguments> <argument name="connectionName" xsi:type="string">checkout</argument> </arguments> </type> <type name="Magento\ScalableOms\Console\Command\SplitSales"> <arguments> <argument name="tables" xsi:type="array"> <item name="amazon_sales_order" xsi:type="string">amazon_sales_order</item> </argument> </arguments> </type> <type name="Amazon\Payment\Model\ResourceModel\OrderLink"> <arguments> <argument name="connectionName" xsi:type="string">sales</argument> </arguments> </type> <!-- Order comments for currency differences --> <type name="Magento\Sales\Model\Order\Payment"> <plugin name="amazon_pay_order_payment" type="Amazon\Payment\Plugin\OrderCurrencyComment" /> </type> </config> amazon-pay-module/etc/.htaccess000077700000000177151323541140012467 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/etc/payment.xml000077700000002014151323541140013060 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd"> <methods> <method name="amazon_payment"> <allow_multiple_address>0</allow_multiple_address> </method> <method name="amazonlogin"> <allow_multiple_address>0</allow_multiple_address> </method> </methods> </payment> amazon-pay-module/etc/email_templates.xml000077700000002142151323541140014552 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd"> <template id="amazon_payments_auth_soft_decline" label="Soft-declined Authorization" file="soft-declined-auth.html" type="html" module="Amazon_Payment" area="frontend"/> <template id="amazon_payments_auth_hard_decline" label="Hard-declined Authorization" file="hard-declined-auth.html" type="html" module="Amazon_Payment" area="frontend"/> </config> amazon-pay-module/etc/config.xml000077700000005352151323541140012660 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <payment> <amazonlogin> <active>0</active> <model>Amazon\Payment\Model\Method\AmazonLoginMethod</model> <order_status>pending</order_status> <title>Amazon Pay</title> <allowspecific>0</allowspecific> </amazonlogin> <amazon_payment> <active>0</active> <is_gateway>1</is_gateway> <title>Amazon Pay</title> <sort_order>1</sort_order> <model>AmazonFacade</model> <order_status>processing</order_status> <payment_action>authorize</payment_action> <can_authorize>1</can_authorize> <can_capture>1</can_capture> <can_capture_partial>1</can_capture_partial> <can_void>1</can_void> <can_cancel>1</can_cancel> <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice> <can_refund>1</can_refund> <can_use_checkout>1</can_use_checkout> <packstation_terms>Packstation,Pack-Station,Pack Station,PO Box,Post Office box,Locker</packstation_terms> <lwa_enabled>0</lwa_enabled> <authorization_mode>synchronous</authorization_mode> <update_mechanism>polling</update_mechanism> <pwa_pp_button_is_visible>1</pwa_pp_button_is_visible> <minicart_button_is_visible>1</minicart_button_is_visible> <button_type>full</button_type> <button_color>Gold</button_color> <button_size>medium</button_size> <logging>1</logging> <platform_id>AUGT0HMCLQVX1</platform_id> <hard_decline_code>4273</hard_decline_code> <soft_decline_code>7638</soft_decline_code> <sca_regions>de,uk</sca_regions> </amazon_payment> </payment> </default> </config> amazon-pay-module/LICENSE000077700000026136151323541140011126 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. amazon-pay-module/Plugin/CheckoutProcessor.php000077700000005774151323541140015542 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Amazon\Core\Helper\Data; use Magento\Checkout\Model\Session; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CheckoutProcessor { /** * @var Data */ private $amazonHelper; /** * @var Session */ private $checkoutSession; /** * CheckoutProcessor constructor. * * @param Data $amazonHelper * @param Session $checkoutSession */ public function __construct( Data $amazonHelper, Session $checkoutSession ) { $this->amazonHelper = $amazonHelper; $this->checkoutSession = $checkoutSession; } /** * Checkout LayoutProcessor after process plugin. * * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $processor * @param array $jsLayout * @return array * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterProcess(\Magento\Checkout\Block\Checkout\LayoutProcessor $processor, $jsLayout) { $quote = $this->checkoutSession->getQuote(); $shippingConfig = &$jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] ['children']['shippingAddress']; $paymentConfig = &$jsLayout['components']['checkout']['children']['steps']['children']['billing-step'] ['children']['payment']; if (!$quote->isVirtual() && $this->amazonHelper->isPwaEnabled()) { $paymentConfig['children']['payments-list']['component'] = 'Amazon_Payment/js/view/payment/list'; } else { unset($shippingConfig['children']['customer-email']['children']['amazon-button-region']); unset($shippingConfig['children']['before-form']['children']['amazon-widget-address']); unset($paymentConfig['children']['renders']['children']['amazon_payment']); unset($paymentConfig['children']['beforeMethods']['children']['amazon-sandbox-simulator']); unset($paymentConfig['children']['payments-list']['children']['amazon_payment-form']); } return $jsLayout; } } amazon-pay-module/Plugin/ShippingInformationManagement.php000077700000010264151323541140020047 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Amazon\Payment\Api\OrderInformationManagementInterface; use Amazon\Payment\Domain\AmazonConstraint; use Closure; use Magento\Checkout\Api\Data\ShippingInformationInterface; use Magento\Checkout\Api\ShippingInformationManagementInterface; use Magento\Quote\Api\CartRepositoryInterface; use Amazon\Login\Helper\Session as LoginSessionHelper; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ShippingInformationManagement { /** * @var CartRepositoryInterface */ private $cartRepository; /** * @var OrderInformationManagementInterface */ private $orderInformationManagement; /** * @var LoginSessionHelper */ private $loginSessionHelper; /** * ShippingInformationManagement constructor. * * @param LoginSessionHelper $loginSessionHelper * @param OrderInformationManagementInterface $orderInformationManagement * @param CartRepositoryInterface $cartRepository */ public function __construct( LoginSessionHelper $loginSessionHelper, OrderInformationManagementInterface $orderInformationManagement, CartRepositoryInterface $cartRepository ) { $this->loginSessionHelper = $loginSessionHelper; $this->cartRepository = $cartRepository; $this->orderInformationManagement = $orderInformationManagement; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeSaveAddressInformation( ShippingInformationManagementInterface $subject, $cartId, ShippingInformationInterface $shippingInformation ) { $return = [$cartId, $shippingInformation]; $quote = $this->cartRepository->getActive($cartId); /* Grand total is 0, skip rest of the plugin */ if ($quote->getGrandTotal() <= 0) { return $return; } // Add Amazon Order Reference ID only when logged in using Amazon Account $amazonCustomer = $this->loginSessionHelper->getAmazonCustomer(); if (!$amazonCustomer) { return $return; } if (!$quote->getExtensionAttributes()->getAmazonOrderReferenceId()) { return $return; } $amazonOrderReferenceId = $quote->getExtensionAttributes() ->getAmazonOrderReferenceId() ->getAmazonOrderReferenceId(); if ($amazonOrderReferenceId) { $this->orderInformationManagement->saveOrderInformation( $amazonOrderReferenceId, [ AmazonConstraint::PAYMENT_PLAN_NOT_SET_ID, AmazonConstraint::PAYMENT_METHOD_NOT_ALLOWED_ID ] ); } /* * Magento\Quote\Model\Quote::setShippingAddress merges into the existing shipping address, * rather than replacing it. Because not all addresses have a region_id, make sure that * the region_id is explicitly emptied, to prevent the old one being used. */ $shippingAddress = $shippingInformation->getShippingAddress(); if (!$shippingAddress->hasData('region_id')) { $shippingAddress->setRegionId(""); } return $return; } } amazon-pay-module/Plugin/AdditionalInformation.php000077700000003310151323541140016333 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Magento\Quote\Model\Quote\Payment; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AdditionalInformation { const KEY_SANDBOX_SIMULATION_REFERENCE = 'sandbox_simulation_reference'; protected $additionalKeys = [ self::KEY_SANDBOX_SIMULATION_REFERENCE ]; public function afterGetAdditionalInformation(Payment $subject, $result) { if (is_array($result)) { foreach ($this->additionalKeys as $additionalKey) { if (! array_key_exists($additionalKey, $result) && $subject->hasData($additionalKey)) { $result[$additionalKey] = $subject->getDataUsingMethod($additionalKey); } } } return $result; } } amazon-pay-module/Plugin/ConfirmOrderReference.php000077700000010576151323541140016301 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Amazon\Core\Exception\AmazonWebapiException; use Amazon\Payment\Api\Data\QuoteLinkInterface; use Magento\Checkout\Model\Session; use Magento\Checkout\Api\PaymentInformationManagementInterface; use Magento\Quote\Api\PaymentMethodManagementInterface; use Amazon\Payment\Model\Adapter\AmazonPaymentAdapter; use Amazon\Payment\Model\OrderInformationManagement; use Magento\Quote\Api\Data\PaymentInterface; use Magento\Quote\Api\Data\AddressInterface; use Magento\Framework\Webapi\Rest\Request; use Magento\Framework\Exception\LocalizedException; use Amazon\Payment\Gateway\Config\Config as GatewayConfig; use Magento\Quote\Api\CartRepositoryInterface; /** * Class ConfirmOrderReference * * Confirm the OrderReference when payment details are saved * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ConfirmOrderReference { /** * @var Session */ private $checkoutSession; /** * @var Request */ private $request; /** * @var OrderInformationManagement */ private $orderInformationManagement; /** * @var CartRepositoryInterface */ private $quoteRepository; /** * ConfirmOrderReference constructor. * @param Session $checkoutSession * @param Request $request * @param OrderInformationManagement $orderInformationManagement * @param CartRepositoryInterface $quoteRepository */ public function __construct( Session $checkoutSession, Request $request, OrderInformationManagement $orderInformationManagement, CartRepositoryInterface $quoteRepository ) { $this->checkoutSession = $checkoutSession; $this->request = $request; $this->orderInformationManagement = $orderInformationManagement; $this->quoteRepository = $quoteRepository; } /** * @return boolean */ protected function canConfirmOrderReference() { $data = $this->request->getRequestData(); return !empty($data['confirmOrder']); } /** * @param PaymentMethodManagementInterface $subject * @param $result * @param $cartId * @param PaymentInterface $paymentMethod * @param AddressInterface|null $billingAddress * @return mixed * @throws \Magento\Framework\Exception\LocalizedException */ public function afterSet( PaymentMethodManagementInterface $subject, $result, $cartId, PaymentInterface $paymentMethod ) { if ($paymentMethod->getMethod() == GatewayConfig::CODE) { $quote = $this->quoteRepository->get($cartId); $quoteExtensionAttributes = $quote->getExtensionAttributes(); if ($quoteExtensionAttributes && $quoteExtensionAttributes->getAmazonOrderReferenceId()) { $amazonOrderReferenceId = $quoteExtensionAttributes ->getAmazonOrderReferenceId() ->getAmazonOrderReferenceId(); if (!$this->checkoutSession->getData('is_amazon_suspended')) { $this->orderInformationManagement->saveOrderInformation($amazonOrderReferenceId); } if ($this->canConfirmOrderReference()) { $this->orderInformationManagement->confirmOrderReference( $amazonOrderReferenceId, $quote->getStoreId() ); } } } return $result; } } amazon-pay-module/Plugin/DisableAmazonPaymentMethod.php000077700000003000151323541140017261 0ustar00<?php /** * Created by PhpStorm. * User: miche * Date: 7/24/2018 * Time: 9:53 AM */ namespace Amazon\Payment\Plugin; use Magento\Checkout\Model\Session; /** * Class DisableAmazonPaymentMethod * Plugin removes Amazon Payment Method if cart contains only virtual products. * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class DisableAmazonPaymentMethod { /** * @var Session */ private $checkoutSession; /** * DisableAmazonPaymentMethod constructor. * @param Session $checkoutSession */ public function __construct( Session $checkoutSession ) { $this->checkoutSession = $checkoutSession; } /** * @param \Amazon\Payment\Model\Method\AmazonLoginMethod $subject * @param $result * @return bool */ public function afterIsAvailable( \Amazon\Payment\Model\Method\AmazonLoginMethod $subject, $result ) { /** @var \Magento\Quote\Model\Quote $quote */ $quote = $this->checkoutSession->getQuote(); if ($quote->isVirtual()) { return false; } return $result; // return default result } } amazon-pay-module/Plugin/QuoteRepository.php000077700000005772151323541140015270 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Amazon\Core\Helper\Data; use Amazon\Payment\Api\QuoteLinkManagementInterface; use Magento\Quote\Api\CartRepositoryInterface; use Magento\Quote\Api\Data\CartInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class QuoteRepository { /** * @var QuoteLinkManagementInterface */ private $quoteLinkManagement; /** * @var Data */ private $coreHelper; public function __construct( QuoteLinkManagementInterface $quoteLinkManagement, Data $coreHelper ) { $this->quoteLinkManagement = $quoteLinkManagement; $this->coreHelper = $coreHelper; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGet(CartRepositoryInterface $cartRepository, CartInterface $cart) { if ($this->coreHelper->isPwaEnabled()) { $this->quoteLinkManagement->setAmazonOrderReferenceIdExtensionAttribute($cart); } return $cart; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetForCustomer(CartRepositoryInterface $cartRepository, CartInterface $cart) { if ($this->coreHelper->isPwaEnabled()) { $this->quoteLinkManagement->setAmazonOrderReferenceIdExtensionAttribute($cart); } return $cart; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetActive(CartRepositoryInterface $cartRepository, CartInterface $cart) { if ($this->coreHelper->isPwaEnabled()) { $this->quoteLinkManagement->setAmazonOrderReferenceIdExtensionAttribute($cart); } return $cart; } /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetActiveForCustomer(CartRepositoryInterface $cartRepository, CartInterface $cart) { if ($this->coreHelper->isPwaEnabled()) { $this->quoteLinkManagement->setAmazonOrderReferenceIdExtensionAttribute($cart); } return $cart; } } amazon-pay-module/Plugin/.htaccess000077700000000177151323541140013152 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Plugin/WebapiErrorProcessor.php000077700000002747151323541140016213 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Amazon\Core\Exception\AmazonWebapiException; use Magento\Framework\Webapi\ErrorProcessor; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class WebapiErrorProcessor { /** * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeMaskException(ErrorProcessor $subject, \Exception $e) { $previous = $e->getPrevious(); if ($previous && $previous instanceof AmazonWebapiException) { return [$previous]; } return null; } } amazon-pay-module/Plugin/OrderCurrencyComment.php000077700000006056151323541140016200 0ustar00<?php /** * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Plugin; use Magento\Framework\Phrase; use Magento\Sales\Model\Order\Payment; use Amazon\Payment\Gateway\Config\Config; /** * Class OrderCurrencyComment * @package Amazon\Payment\Plugin * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderCurrencyComment { /** * @param Payment $subject * @param $messagePrependTo * @return array|null */ public function beforePrependMessage(Payment $subject, $messagePrependTo) { if ($subject->getMethod() == Config::CODE) { $order = $subject->getOrder(); if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { if ($subject->getOrder()->getPayment()->getCreditmemo()) { $displayCurrencyAmount = $subject->getCreditmemo()->getGrandTotal(); } else { $displayCurrencyAmount = $subject->getOrder()->getPayment()->getAmazonDisplayInvoiceAmount() ?: $subject->getAmountOrdered(); } $messagePrependTo = __( $messagePrependTo->getText(), $order->getBaseCurrency() ->formatTxt($messagePrependTo->getArguments()[0]) .' ['. $order->formatPriceTxt($displayCurrencyAmount) .']' ); return [$messagePrependTo]; } } return null; } /** * @param Payment $subject * @param $result * @return string */ public function afterFormatPrice(Payment $subject, $result) { if ($subject->getMethod() == Config::CODE) { $order = $subject->getOrder(); if (($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode() && $subject->getMessage() instanceof Phrase && $subject->getMessage()->getText() == 'Canceled order online') || strpos($subject->getTransactionId(), '-void') !== FALSE ) { return $result .' ['. $order->formatPriceTxt($subject->getCreditmemo()->getGrandTotal()) .']'; } } return $result; } } amazon-pay-module/Block/Minicart/Button.php000077700000011002151323541140014667 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Block\Minicart; use Magento\Checkout\Model\Session; use Amazon\Payment\Helper\Data; use Amazon\Core\Helper\Data as AmazonCoreHelper; use Amazon\Payment\Gateway\Config\Config; use Magento\Paypal\Block\Express\InContext; use Magento\Framework\View\Element\Template; use Magento\Catalog\Block\ShortcutInterface; use Magento\Framework\Locale\ResolverInterface; use Magento\Framework\View\Element\Template\Context; use Magento\Framework\App\Request\Http; /** * Class Button * * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Button extends Template implements ShortcutInterface { const ALIAS_ELEMENT_INDEX = 'alias'; const CART_BUTTON_ELEMENT_INDEX = 'add_to_cart_selector'; /** * @var bool */ private $isMiniCart = false; /** * @var ResolverInterface */ private $localeResolver; /** * @var Data */ private $mainHelper; /** * @var Config */ private $payment; /** * @var Session */ private $session; /** * @var AmazonCoreHelper */ private $coreHelper; /** * @var Http */ private $request; /** * Button constructor. * * @param Context $context * @param ResolverInterface $localeResolver * @param Data $mainHelper * @param Session $session * @param Config $payment * @param AmazonCoreHelper $coreHelper * @param Http $request * @param array $data */ public function __construct( Context $context, ResolverInterface $localeResolver, Data $mainHelper, Session $session, Config $payment, AmazonCoreHelper $coreHelper, Http $request, array $data = [] ) { parent::__construct($context, $data); $this->localeResolver = $localeResolver; $this->mainHelper = $mainHelper; $this->payment = $payment; $this->session = $session; $this->coreHelper = $coreHelper; $this->request = $request; $this->payment->setMethodCode($this->payment::CODE); } /** * @return bool */ protected function shouldRender() { if ($this->getIsCart() && $this->payment->isActive($this->session->getQuote()->getStoreId())) { return true; } return $this->coreHelper->isPayButtonAvailableInMinicart() && $this->payment->isActive($this->session->getQuote()->getStoreId()) && $this->isMiniCart; } /** * @inheritdoc */ protected function _toHtml() { if (!$this->shouldRender()) { return ''; } return parent::_toHtml(); } protected function _isOnCartPage() { return $this->request->getFullActionName() == 'checkout_cart_index'; } /** * @return string */ public function getAddToCartSelector() { return $this->getData(self::CART_BUTTON_ELEMENT_INDEX); } /** * @return string */ public function getImageUrl() { return $this->config->getExpressCheckoutInContextImageUrl( $this->localeResolver->getLocale() ); } /** * Get shortcut alias * * @return string */ public function getAlias() { return $this->getData(self::ALIAS_ELEMENT_INDEX); } /** * @param bool $isCatalog * @return $this */ public function setIsInCatalogProduct($isCatalog) { $this->isMiniCart = !$isCatalog; return $this; } } amazon-pay-module/Block/Minicart/.htaccess000077700000000177151323541140014514 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Block/Widget/ResetPassword.php000077700000004232151323541140015705 0ustar00<?php /** * Created by PhpStorm. * User: Michele * Date: 5/3/2018 * Time: 11:07 AM */ namespace Amazon\Payment\Block\Widget; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; use Magento\Customer\Model\Url; use Magento\Customer\Model\Session; use Amazon\Login\Api\CustomerLinkRepositoryInterface; use Amazon\Core\Helper\Data; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ResetPassword extends Template { private $urlModel; private $session; private $customerLink; private $coreHelper; public function __construct( Context $context, Url $urlModel, Session $session, CustomerLinkRepositoryInterface $customerLink, Data $coreHelper, array $data = [] ) { parent::__construct($context, $data); $this->urlModel = $urlModel; $this->session = $session; $this->customerLink = $customerLink; $this->coreHelper = $coreHelper; } protected function _prepareLayout() { parent::_prepareLayout(); if (!$this->getTemplate()) { $this->setTemplate('widget/resetpassword.phtml'); } return $this; } public function displayAmazonInfo() { $id = $this->session->getCustomer()->getId(); $amazon = $this->customerLink->get($id); if ($amazon && $amazon->getAmazonId()) { return true; } return false; } public function getLink() { $url = $this->urlModel->getLogoutUrl(); return $url; } /** * @return string */ protected function _toHtml() { if (!$this->coreHelper->isLoginButtonEnabled()) { return ''; } return parent::_toHtml(); } } amazon-pay-module/Block/Widget/.htaccess000077700000000177151323541140014171 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Block/ProductPagePaymentLink.php000077700000005753151323541140016257 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Block; use Amazon\Core\Helper\CategoryExclusion; use Amazon\Core\Helper\Data; use Magento\Catalog\Model\Product; use Magento\ConfigurableProduct\Model\Product\Type\Configurable; use Magento\Framework\Registry; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ProductPagePaymentLink extends PaymentLink { /** * @var CategoryExclusion */ protected $categoryExclusionHelper; /** * @var Registry */ private $registry; /** * @param Context $context * @param Data $coreHelper * @param CategoryExclusion $categoryExclusionHelper * @param Registry $registry * @param array $data */ public function __construct( Context $context, Data $coreHelper, CategoryExclusion $categoryExclusionHelper, Registry $registry, array $data = [] ) { parent::__construct($context, $coreHelper, $categoryExclusionHelper, $data); $this->registry = $registry; } /** * {@inheritdoc} */ protected function _toHtml() { if (! $this->coreHelper->isPwaButtonVisibleOnProductPage()) { return ''; } /** @var \Magento\Catalog\Model\Product $product */ $product = $this->registry->registry('product'); if ($product instanceof Product && $this->categoryExclusionHelper->productHasExcludedCategory($product) ) { return ''; } // check for product stock and/or saleability // configurable products if ($product->getTypeId() == Configurable::TYPE_CODE) { if (!$product->isSaleable()) { return ''; } } // other product types else { if ($product->isInStock() == 0 || !$product->isSaleable()) { return ''; } } return parent::_toHtml(); } } amazon-pay-module/Block/PaymentLink.php000077700000004314151323541140014111 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Block; use Amazon\Core\Helper\CategoryExclusion; use Amazon\Core\Helper\Data; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; use Magento\Catalog\Model\Product; /** * @api * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PaymentLink extends Template { /** * @var Data */ protected $coreHelper; /** * @var CategoryExclusion */ protected $categoryExclusionHelper; /** * @param Context $context * @param Data $coreHelper * @param CategoryExclusion $categoryExclusionHelper * @param array $data */ public function __construct( Context $context, Data $coreHelper, CategoryExclusion $categoryExclusionHelper, array $data = [] ) { parent::__construct($context, $data); $this->coreHelper = $coreHelper; $this->categoryExclusionHelper = $categoryExclusionHelper; } /** * {@inheritdoc} */ protected function _toHtml() { if (! $this->coreHelper->isPaymentButtonEnabled() || $this->categoryExclusionHelper->isQuoteDirty()) { return ''; } return parent::_toHtml(); } } amazon-pay-module/Block/.htaccess000077700000000177151323541140012746 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Observer/OrderPaymentCapture.php000077700000003173151323541140016352 0ustar00<?php /** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * Class OrderPaymentCapture * @package Amazon\Payment\Observer * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderPaymentCapture implements ObserverInterface { /** * @param Observer $observer */ public function execute(Observer $observer) { $payment = $observer->getPayment(); $invoice = $observer->getInvoice(); // set custom invoice amount on the payment in the display currency, as Magento does everything on the base currency $payment->setAmazonDisplayInvoiceAmount($invoice->getGrandTotal()); } } amazon-pay-module/Observer/SandboxSimulation.php000077700000013443151323541140016061 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Amazon\Core\Helper\Data; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Payment\Model\InfoInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SandboxSimulation implements ObserverInterface { /** * @var Data */ private $coreHelper; /** * @var QuoteLinkInterfaceFactory */ private $quoteLinkFactory; /** * @param Data $coreHelper * @param QuoteLinkInterfaceFactory $quoteLinkFactory */ public function __construct( Data $coreHelper, QuoteLinkInterfaceFactory $quoteLinkFactory ) { $this->coreHelper = $coreHelper; $this->quoteLinkFactory = $quoteLinkFactory; } public function execute(Observer $observer) { if ($this->coreHelper->isSandboxEnabled()) { $context = $observer->getEvent()->getContext(); $payment = $observer->getEvent()->getPayment(); $simulationReference = $this->getSimulationReference($payment); if (! empty($simulationReference)) { $simulationString = $this->getSimulationString($simulationReference, $context); if (! empty($simulationString)) { $requestParameter = $this->getRequestParameter($context); $observer->getTransport()->addData([$requestParameter => $simulationString]); $this->clearSimulationReference($payment); } } } } protected function clearSimulationReference(InfoInterface $payment) { $additionalInformation = $payment->getAdditionalInformation(); if (is_array($additionalInformation) && isset($additionalInformation['sandbox_simulation_reference'])) { unset($additionalInformation['sandbox_simulation_reference']); $payment->setAdditionalInformation($additionalInformation); } $quoteLink = $this->getQuoteLink($payment); if ($quoteLink->getSandboxSimulationReference()) { $quoteLink->setSandboxSimulationReference(null)->save(); } } /** * @param $payment * @return string */ protected function getSimulationReference($payment) { $simulationReference = $this->getSimulationReferenceFromPayment($payment); $quoteLink = $this->getQuoteLink($payment); if ($simulationReference) { $quoteLink->setSandboxSimulationReference($simulationReference)->save(); } else { $simulationReference = $quoteLink->getSandboxSimulationReference(); } return $simulationReference; } /** * @param $payment * @return string */ protected function getSimulationReferenceFromPayment($payment) { $simulationReference = null; $additionalInformation = $payment->getAdditionalInformation(); if (is_array($additionalInformation) && array_key_exists('sandbox_simulation_reference', $additionalInformation) ) { $simulationReference = $additionalInformation['sandbox_simulation_reference']; } return $simulationReference; } /** * @param $payment * @return \Amazon\Payment\Api\Data\QuoteLinkInterface */ protected function getQuoteLink($payment) { $quoteId = $payment->getOrder()->getQuoteId(); $quoteLink = $this->quoteLinkFactory->create(); $quoteLink->load($quoteId, 'quote_id'); return $quoteLink; } /** * @return array */ protected function getRequestParameters() { $requestParameters = [ 'authorization' => 'seller_authorization_note', 'authorization_capture' => 'seller_authorization_note', 'capture' => 'seller_capture_note', 'refund' => 'seller_refund_note' ]; return $requestParameters; } /** * @param string $context * @return string */ protected function getRequestParameter($context) { $requestParameter = null; $requestParameters = $this->getRequestParameters(); if (array_key_exists($context, $requestParameters)) { $requestParameter = $requestParameters[$context]; } return $requestParameter; } /** * @param string $simulationReference * @param string|null $context * @return string */ protected function getSimulationString($simulationReference, $context = null) { $simulationString = null; $simulationStrings = $this->coreHelper->getSandboxSimulationStrings($context); if (array_key_exists($simulationReference, $simulationStrings)) { $simulationString = $simulationStrings[$simulationReference]; } return $simulationString; } } amazon-pay-module/Observer/DataAssignObserver.php000077700000004253151323541140016143 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Magento\Framework\Event\Observer; use Magento\Payment\Observer\AbstractDataAssignObserver; use Magento\Quote\Api\Data\PaymentInterface; use Amazon\Payment\Plugin\AdditionalInformation; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class DataAssignObserver extends AbstractDataAssignObserver { /** * @var array */ private $additionalInformationList = [ AdditionalInformation::KEY_SANDBOX_SIMULATION_REFERENCE ]; /** * @param Observer $observer * @return void */ public function execute(Observer $observer) { $data = $this->readDataArgument($observer); $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA); if (!is_array($additionalData)) { return; } $paymentInfo = $this->readPaymentModelArgument($observer); foreach ($this->additionalInformationList as $additionalInformationKey) { if (isset($additionalData[$additionalInformationKey])) { $paymentInfo->setAdditionalInformation( $additionalInformationKey, $additionalData[$additionalInformationKey] ); } } } } amazon-pay-module/Observer/KlarnaKcoOverride.php000077700000003642151323541140015763 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Event\Observer; use Amazon\Core\Helper\Data; use Amazon\Login\Helper\Session; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class KlarnaKcoOverride implements ObserverInterface { /** * @var Data */ private $coreHelper; /** * @var Session */ private $sessionHelper; /** * @param Data $coreHelper * @param Session $sessionHelper */ public function __construct( Data $coreHelper, Session $sessionHelper ) { $this->coreHelper = $coreHelper; $this->sessionHelper = $sessionHelper; } public function execute(Observer $observer) { if ($this->coreHelper->isPwaEnabled() && $this->sessionHelper->isAmazonLoggedIn()) { // Force customer to use default (Amazon) checkout $observer->getOverrideObject()->setForceDisabled(true); } } } amazon-pay-module/Observer/SoftDeclinedEmailSender.php000077700000003226151323541140017070 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Amazon\Payment\Helper\Email; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SoftDeclinedEmailSender implements ObserverInterface { /** * @var Email */ private $emailHelper; /** * SoftDeclinedEmailSender constructor. * * @param Email $emailHelper */ public function __construct(Email $emailHelper) { $this->emailHelper = $emailHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { $this->emailHelper->sendAuthorizationSoftDeclinedEmail($observer->getOrder()); } } amazon-pay-module/Observer/HardDeclinedEmailSender.php000077700000003226151323541140017033 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Amazon\Payment\Helper\Email; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class HardDeclinedEmailSender implements ObserverInterface { /** * @var Email */ private $emailHelper; /** * SoftDeclinedEmailSender constructor. * * @param Email $emailHelper */ public function __construct(Email $emailHelper) { $this->emailHelper = $emailHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { $this->emailHelper->sendAuthorizationHardDeclinedEmail($observer->getOrder()); } } amazon-pay-module/Observer/LoadOrder.php000077700000007250151323541140014270 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Amazon\Core\Helper\Data; use Amazon\Payment\Api\Data\OrderLinkInterfaceFactory; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Sales\Api\Data\OrderExtensionFactory; use Magento\Sales\Api\Data\OrderInterface; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Amazon\Payment\Model\Adapter\AmazonPaymentAdapter; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class LoadOrder implements ObserverInterface { /** * @var OrderExtensionFactory */ private $orderExtensionFactory; /** * @var OrderLinkInterfaceFactory */ private $orderLinkFactory; /** * @var Data */ private $coreHelper; private $quoteLinkFactory; private $adapter; public function __construct( OrderExtensionFactory $orderExtensionFactory, OrderLinkInterfaceFactory $orderLinkFactory, Data $coreHelper, QuoteLinkInterfaceFactory $quoteLinkFactory, AmazonPaymentAdapter $adapter ) { $this->orderExtensionFactory = $orderExtensionFactory; $this->orderLinkFactory = $orderLinkFactory; $this->coreHelper = $coreHelper; $this->quoteLinkFactory = $quoteLinkFactory; $this->adapter = $adapter; } public function execute(Observer $observer) { if ($this->coreHelper->isPwaEnabled()) { $order = $observer->getOrder(); $this->setAmazonOrderReferenceIdExtensionAttribute($order); } } protected function setAmazonOrderReferenceIdExtensionAttribute(OrderInterface $order) { $orderExtension = ($order->getExtensionAttributes()) ?: $this->orderExtensionFactory->create(); if ($order->getId()) { $amazonOrder = $this->orderLinkFactory->create(); $amazonOrder->load($order->getId(), 'order_id'); if ($amazonOrder->getId()) { $orderExtension->setAmazonOrderReferenceId($amazonOrder); } else { if ($order->getQuoteId()) { $quoteLink = $this->quoteLinkFactory->create(); $quoteLink->load($order->getQuoteId(), 'quote_id'); if ($quoteLink->getAmazonOrderReferenceId()) { $amazonOrder->setAmazonOrderReferenceId($quoteLink->getAmazonOrderReferenceId()) ->setOrderId($order->getId()) ->save(); $this->adapter->setOrderAttributes($order->getStoreId(), $quoteLink->getAmazonOrderReferenceId(), $order->getIncrementId()); } } } } $order->setExtensionAttributes($orderExtension); } } amazon-pay-module/Observer/AddAmazonButton.php000077700000005564151323541140015455 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Event\Observer; use Amazon\Core\Helper\Data; use Amazon\Payment\Helper\Shortcut\Factory as ShortcutFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AddAmazonButton implements ObserverInterface { /** * @var Data */ private $coreHelper; /** * @var ShortcutFactory */ private $shortcutFactory; /** * @param Data $coreHelper * @param ShortcutFactory $shortcutFactory */ public function __construct( Data $coreHelper, ShortcutFactory $shortcutFactory ) { $this->coreHelper = $coreHelper; $this->shortcutFactory = $shortcutFactory; } public function execute(Observer $observer) { /** @var \Magento\Catalog\Block\ShortcutButtons $shortcutButtons */ $shortcutButtons = $observer->getEvent()->getContainer(); if ($this->coreHelper->isPwaEnabled() && $this->coreHelper->isCurrentCurrencySupportedByAmazon()) { $params = [ 'shortcutValidator' => $this->shortcutFactory->create($observer->getEvent()->getCheckoutSession()), ]; $params['checkoutSession'] = $observer->getEvent()->getCheckoutSession(); /** @var \Magento\Framework\View\Element\Template $shortcut */ $shortcut = $shortcutButtons->getLayout()->createBlock( \Amazon\Payment\Block\Minicart\Button::class, '', $params ); $shortcut->setIsInCatalogProduct( $observer->getEvent()->getIsCatalogProduct() )->setShowOrPosition( $observer->getEvent()->getOrPosition() ); $shortcut->setIsCart(get_class($shortcutButtons) == \Magento\Checkout\Block\QuoteShortcutButtons::class); $shortcutButtons->addShortcut($shortcut); } } } amazon-pay-module/Observer/.htaccess000077700000000177151323541140013503 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Observer/IgnoreBillingAddressValidation.php000077700000003112151323541140020453 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Observer; use Amazon\Payment\Gateway\Config\Config as AmazonPayment; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IgnoreBillingAddressValidation implements ObserverInterface { public function execute(Observer $observer) { $quote = $observer->getEvent()->getQuote(); if (AmazonPayment::CODE === $quote->getPayment()->getMethod()) { $quote->getBillingAddress()->setShouldIgnoreValidation(true); $quote->getShippingAddress()->setShouldIgnoreValidation(true); } } } amazon-pay-module/Setup/UpgradeData.php000077700000004752151323541140014113 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Setup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\UpgradeDataInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class UpgradeData implements UpgradeDataInterface { /** * @var EavSetupFactory */ private $eavSetupFactory; /** * @param EavSetupFactory $eavSetupFactory */ public function __construct(EavSetupFactory $eavSetupFactory) { $this->eavSetupFactory = $eavSetupFactory; } public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { if (version_compare($context->getVersion(), '1.5.0', '<')) { $this->upgradeAddressStreetMultiline($setup); } } /** * @throws LocalizedException * @return void */ private function upgradeAddressStreetMultiline(ModuleDataSetupInterface $setup) { $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $row = $eavSetup->getAttribute('customer_address', 'street', 'multiline_count'); if ($row === false || ! is_numeric($row)) { throw new LocalizedException(__('Could not find the "multiline_count" config of the "street" ' . 'Customer address attribute.')); } if ($row < 3) { $eavSetup->updateAttribute('customer_address', 'street', 'multiline_count', 3); } } } amazon-pay-module/Setup/UpgradeSchema.php000077700000030200151323541140014425 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Setup; use Amazon\Payment\Api\Data\PendingAuthorizationInterface; use Amazon\Payment\Api\Data\PendingCaptureInterface; use Amazon\Payment\Model\ResourceModel\OrderLink; use Amazon\Payment\Model\ResourceModel\PendingAuthorization; use Amazon\Payment\Model\ResourceModel\PendingCapture; use Amazon\Payment\Model\ResourceModel\QuoteLink; use Amazon\Payment\Api\Data\PendingRefundInterface; use Magento\Eav\Setup\EavSetup; use Magento\Framework\App\ObjectManager; use Magento\Framework\DB\Adapter\AdapterInterface; use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Sales\Api\Data\TransactionInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class UpgradeSchema implements UpgradeSchemaInterface { const PENDING_REFUND_TABLE_NAME = 'amazon_pending_refund'; /** * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { if (version_compare($context->getVersion(), '1.4.0', '<')) { $table = $setup->getConnection()->newTable($setup->getTable(PendingCapture::TABLE_NAME)); $table ->addColumn( PendingCaptureInterface::ID, Table::TYPE_INTEGER, null, [ 'identity' => true, 'unsigned' => true, 'primary' => true, 'nullable' => false ] ) ->addColumn( PendingCaptureInterface::CAPTURE_ID, Table::TYPE_TEXT, 255, [ 'nullable' => false ] ) ->addColumn( PendingCaptureInterface::CREATED_AT, Table::TYPE_DATETIME, null, [ 'nullable' => false ] ) ->addIndex( $setup->getIdxName( PendingCapture::TABLE_NAME, [PendingCaptureInterface::CAPTURE_ID], AdapterInterface::INDEX_TYPE_UNIQUE ), [PendingCaptureInterface::CAPTURE_ID], ['type' => AdapterInterface::INDEX_TYPE_UNIQUE] ); $setup->getConnection()->createTable($table); } if (version_compare($context->getVersion(), '1.7.0', '<')) { $this->addColumnsToPendingCaptureQueue($setup); } if (version_compare($context->getVersion(), '1.8.0', '<')) { $this->createPendingAuthorizationQueueTable($setup); } if (version_compare($context->getVersion(), '1.9.0', '<')) { $this->createPendingRefundTable($setup); } if (version_compare($context->getVersion(), '1.10.0', '<')) { $this->addColumnsToPendingAuthorizationQueue($setup); } if (version_compare($context->getVersion(), '1.11.0', '<')) { $this->addCaptureColumnsToPendingAuthorizationQueue($setup); } } private function addCaptureColumnsToPendingAuthorizationQueue(SchemaSetupInterface $setup) { $setup->getConnection()->addColumn( $setup->getTable(PendingAuthorization::TABLE_NAME), PendingAuthorizationInterface::CAPTURE, [ 'unsigned' => true, 'nullable' => true, 'default' => 0, 'type' => Table::TYPE_SMALLINT, 'comment' => 'Initial authorization has capture' ] ); $setup->getConnection()->addColumn( $setup->getTable(PendingAuthorization::TABLE_NAME), PendingAuthorizationInterface::CAPTURE_ID, [ 'nullable' => true, 'type' => Table::TYPE_TEXT, 'length' => 255, 'comment' => 'Initial authorization capture id' ] ); } private function addColumnsToPendingAuthorizationQueue(SchemaSetupInterface $setup) { $setup->getConnection()->addColumn( $setup->getTable(PendingAuthorization::TABLE_NAME), PendingAuthorizationInterface::PROCESSED, [ 'unsigned' => true, 'nullable' => true, 'default' => 0, 'type' => Table::TYPE_SMALLINT, 'comment' => 'Initial authorization processed' ] ); } private function addColumnsToPendingCaptureQueue(SchemaSetupInterface $setup) { $setup->getConnection()->addColumn( $setup->getTable(PendingCapture::TABLE_NAME), 'order_id', [ 'unsigned' => true, 'nullable' => false, 'type' => Table::TYPE_INTEGER, 'comment' => 'order id' ] ); $setup->getConnection()->addColumn( $setup->getTable(PendingCapture::TABLE_NAME), 'payment_id', [ 'unsigned' => true, 'nullable' => false, 'type' => Table::TYPE_INTEGER, 'comment' => 'payment id' ] ); $setup->getConnection()->dropIndex( $setup->getTable(PendingCapture::TABLE_NAME), $setup->getIdxName( PendingCapture::TABLE_NAME, [PendingCaptureInterface::CAPTURE_ID], AdapterInterface::INDEX_TYPE_UNIQUE ) ); $pendingColumns = [ PendingCaptureInterface::ORDER_ID, PendingCaptureInterface::PAYMENT_ID, PendingCaptureInterface::CAPTURE_ID ]; $setup->getConnection()->addIndex( $setup->getTable(PendingCapture::TABLE_NAME), $setup->getIdxName( PendingCapture::TABLE_NAME, $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ), $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ); } private function createPendingAuthorizationQueueTable(SchemaSetupInterface $setup) { $table = $setup->getConnection()->newTable($setup->getTable(PendingAuthorization::TABLE_NAME)); $table ->addColumn( PendingAuthorizationInterface::ID, Table::TYPE_INTEGER, null, [ 'identity' => true, 'unsigned' => true, 'primary' => true, 'nullable' => false ] ) ->addColumn( PendingAuthorizationInterface::ORDER_ID, Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false ] ) ->addColumn( PendingAuthorizationInterface::PAYMENT_ID, Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false ] ) ->addColumn( PendingAuthorizationInterface::AUTHORIZATION_ID, Table::TYPE_TEXT, 255, [ 'nullable' => true ] ) ->addColumn( PendingAuthorizationInterface::CREATED_AT, Table::TYPE_DATETIME, null, [ 'nullable' => false ] ) ->addColumn( PendingAuthorizationInterface::UPDATED_AT, Table::TYPE_DATETIME, null, [ 'nullable' => true ] ); $setup->getConnection()->createTable($table); $pendingColumns = [ PendingAuthorizationInterface::ORDER_ID, PendingAuthorizationInterface::PAYMENT_ID, PendingAuthorizationInterface::AUTHORIZATION_ID ]; $setup->getConnection()->addIndex( $setup->getTable(PendingAuthorization::TABLE_NAME), $setup->getIdxName( PendingAuthorization::TABLE_NAME, $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ), $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ); } private function createPendingRefundTable(SchemaSetupInterface $setup) { $setup->getConnection()->dropTable(static::PENDING_REFUND_TABLE_NAME); $table = $setup->getConnection()->newTable($setup->getTable(static::PENDING_REFUND_TABLE_NAME)); $table ->addColumn( PendingRefundInterface::ID, Table::TYPE_INTEGER, null, [ 'identity' => true, 'unsigned' => true, 'primary' => true, 'nullable' => false ] ) ->addColumn( PendingRefundInterface::REFUND_ID, Table::TYPE_TEXT, 255, [ 'nullable' => false ] ) ->addColumn( PendingRefundInterface::CREATED_AT, Table::TYPE_DATETIME, null, [ 'nullable' => false ] ) ->addColumn( PendingRefundInterface::ORDER_ID, Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false, 'comment' => 'order id' ] ) ->addColumn( PendingRefundInterface::PAYMENT_ID, Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false, 'comment' => 'payment id' ] ); $setup->getConnection()->createTable($table); $pendingColumns = [ PendingRefundInterface::ORDER_ID, PendingRefundInterface::PAYMENT_ID, PendingRefundInterface::REFUND_ID, ]; $indexName = $setup->getConnection()->getIndexName( $setup->getTable(static::PENDING_REFUND_TABLE_NAME), $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ); $setup->getConnection()->addIndex( $setup->getTable(static::PENDING_REFUND_TABLE_NAME), $indexName, $pendingColumns, AdapterInterface::INDEX_TYPE_UNIQUE ); } } amazon-pay-module/Setup/.htaccess000077700000000177151323541140013014 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Helper/Data.php000077700000003172151323541140012715 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Framework\Module\ModuleListInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Data extends AbstractHelper { const MODULE_CODE = 'Amazon_Payment'; /** * @var ModuleListInterface */ private $moduleList; /** * Data constructor. * * @param Context $context * @param ModuleListInterface $moduleList */ public function __construct(Context $context, ModuleListInterface $moduleList) { parent::__construct($context); $this->moduleList = $moduleList; } } amazon-pay-module/Helper/Email.php000077700000010775151323541140013102 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper; use Amazon\Core\Helper\Data as AmazonCoreHelper; use Magento\Framework\App\Area; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Sales\Model\Order; use Magento\Framework\Mail\Template\TransportBuilderFactory; use Magento\Store\Model\ScopeInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Email extends AbstractHelper { /** * @var TransportBuilderFactory */ private $emailTransportBuilderFactory; /** * @var AmazonCoreHelper */ private $amazonCoreHelper; /** * @param Context $context * @param TransportBuilderFactory $emailTransportBuilderFactory * @param AmazonCoreHelper $amazonCoreHelper */ public function __construct( Context $context, TransportBuilderFactory $emailTransportBuilderFactory, AmazonCoreHelper $amazonCoreHelper ) { parent::__construct($context); $this->emailTransportBuilderFactory = $emailTransportBuilderFactory; $this->amazonCoreHelper = $amazonCoreHelper; } /** * @param Order $order * * @return void */ public function sendAuthorizationSoftDeclinedEmail(Order $order) { $emailTransportBuilder = $this->emailTransportBuilderFactory->create(); $emailTransportBuilder->addTo($order->getCustomerEmail(), $order->getCustomerName()); $emailTransportBuilder->setFrom('general'); $emailTransportBuilder->setTemplateIdentifier('amazon_payments_auth_soft_decline'); $emailTransportBuilder->setTemplateOptions( [ 'area' => Area::AREA_FRONTEND, 'store' => $order->getStoreId() ] ); $paymentRegionByOrderStore = $this->amazonCoreHelper->getPaymentRegion( ScopeInterface::SCOPE_STORE, $order->getStoreId() ); $storeName = $this->amazonCoreHelper->getStoreName(ScopeInterface::SCOPE_STORE, $order->getStoreId()); if (!$storeName) { $storeName = $this->amazonCoreHelper->getStoreFrontName($order->getStoreId()); } $vars = [ 'amazonAccountUrl' => $this->amazonCoreHelper ->getAmazonAccountUrlByPaymentRegion($paymentRegionByOrderStore), 'storeName' => $storeName, ]; $emailTransportBuilder->setTemplateVars($vars); $emailTransportBuilder->getTransport()->sendMessage(); } /** * @param Order $order * * @return void */ public function sendAuthorizationHardDeclinedEmail(Order $order) { $emailTransportBuilder = $this->emailTransportBuilderFactory->create(); $storeName = $this->amazonCoreHelper->getStoreName(ScopeInterface::SCOPE_STORE, $order->getStoreId()); if (!$storeName) { $storeName = $this->amazonCoreHelper->getStoreFrontName($order->getStoreId()); } $emailTransportBuilder->addTo($order->getCustomerEmail(), $order->getCustomerName()); $emailTransportBuilder->setFrom('general'); $emailTransportBuilder->setTemplateIdentifier('amazon_payments_auth_hard_decline'); $emailTransportBuilder->setTemplateOptions( [ 'area' => Area::AREA_FRONTEND, 'store' => $order->getStoreId() ] ); $vars = [ 'storeName' => $storeName, ]; $emailTransportBuilder->setTemplateVars($vars); $emailTransportBuilder->getTransport()->sendMessage(); } } amazon-pay-module/Helper/Shortcut/ValidatorInterface.php000077700000001513151323541140017422 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper\Shortcut; interface ValidatorInterface { /** * Validates shortcut * * @param string $code * @param bool $isInCatalog * @return bool */ public function validate($code, $isInCatalog); } amazon-pay-module/Helper/Shortcut/CheckoutValidator.php000077700000006732151323541140017277 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper\Shortcut; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CheckoutValidator implements ValidatorInterface { /** * @var \Magento\Checkout\Model\Session */ private $_checkoutSession; /** * @var \Magento\Payment\Helper\Data */ private $_paymentData; /** * @var Validator */ private $_shortcutValidator; /** * @param \Magento\Checkout\Model\Session $checkoutSession * @param Validator $shortcutValidator * @param \Magento\Payment\Helper\Data $paymentData */ public function __construct( \Magento\Checkout\Model\Session $checkoutSession, Validator $shortcutValidator, \Magento\Payment\Helper\Data $paymentData ) { $this->_checkoutSession = $checkoutSession; $this->_paymentData = $paymentData; $this->_shortcutValidator = $shortcutValidator; } /** * Validates shortcut * * @param string $code * @param bool $isInCatalog * @return bool */ public function validate($code, $isInCatalog) { return $this->_shortcutValidator->isContextAvailable($code, $isInCatalog) && $this->_shortcutValidator->isPriceOrSetAvailable($isInCatalog) && $this->isMethodQuoteAvailable($code, $isInCatalog) && $this->isQuoteSummaryValid($isInCatalog); } /** * Checks payment method and quote availability * * @param string $paymentCode * @param bool $isInCatalog * @return bool */ public function isMethodQuoteAvailable($paymentCode, $isInCatalog) { $quote = $isInCatalog ? null : $this->_checkoutSession->getQuote(); // check payment method availability /** @var \Magento\Payment\Model\Method\AbstractMethod $methodInstance */ $methodInstance = $this->_paymentData->getMethodInstance($paymentCode); if (!$methodInstance->isAvailable($quote)) { return false; } return true; } /** * Validates minimum quote amount and zero grand total * * @param bool $isInCatalog * @return bool */ public function isQuoteSummaryValid($isInCatalog) { $quote = $isInCatalog ? null : $this->_checkoutSession->getQuote(); // validate minimum quote amount and validate quote for zero grandtotal if (null !== $quote && (!$quote->validateMinimumAmount() || !$quote->getGrandTotal())) { return false; } return true; } } amazon-pay-module/Helper/Shortcut/Validator.php000077700000012641151323541140015605 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper\Shortcut; /** * @SuppressWarnings(PHPMD.UnusedPrivateField) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Validator implements ValidatorInterface { /** * @var \Amazon\Payment\Gateway\Config\Config */ private $amazonConfig; /** * @var \Magento\Framework\Registry */ private $registry; /** * @var \Magento\Catalog\Model\ProductTypes\ConfigInterface */ private $productTypeConfig; /** * @var \Magento\Payment\Helper\Data */ private $paymentData; /** * @var \Amazon\Core\Helper\CategoryExclusion */ private $categoryExclusionHelper; /** * Validator constructor. * * @param \Amazon\Payment\Gateway\Config\Config $amazonConfig * @param \Magento\Framework\Registry $registry * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig * @param \Magento\Payment\Helper\Data $paymentData * @param \Amazon\Core\Helper\CategoryExclusion $categoryExclusionHelper */ public function __construct( \Amazon\Payment\Gateway\Config\Config $amazonConfig, \Magento\Framework\Registry $registry, \Magento\Catalog\Model\ProductTypes\ConfigInterface $productTypeConfig, \Magento\Payment\Helper\Data $paymentData, \Amazon\Core\Helper\CategoryExclusion $categoryExclusionHelper ) { $this->amazonConfig = $amazonConfig; $this->registry = $registry; $this->productTypeConfig = $productTypeConfig; $this->paymentData = $paymentData; $this->categoryExclusionHelper = $categoryExclusionHelper; } /** * Validates shortcut * * @param string $code * @param bool $isInCatalog * @return bool */ public function validate($code, $isInCatalog) { return $this->isContextAvailable($code, $isInCatalog) && $this->isPriceOrSetAvailable($isInCatalog) && $this->isMethodAvailable($code); } /** * Checks visibility of context (cart or product page) * * @param string $paymentCode Payment method code * @param bool $isInCatalog * @return bool */ public function isContextAvailable($paymentCode, $isInCatalog) { $this->amazonConfig->setMethodCode($this->amazonConfig::CODE); // check visibility on product page if ($isInCatalog && $this->amazonConfig->getValue('pwa_pp_button_is_visible')) { $currentProduct = $this->registry->registry('current_product'); if ($currentProduct !== null) { if ($this->categoryExclusionHelper->productHasExcludedCategory($currentProduct)) { return false; } } else { if ($this->categoryExclusionHelper->isQuoteDirty()) { return false; } } return true; } return false; } /** * Check is product available depending on final price or type set(configurable) * * @param bool $isInCatalog * @return bool */ public function isPriceOrSetAvailable($isInCatalog) { if ($isInCatalog) { // Show PayPal shortcut on a product view page only if product has nonzero price /** @var $currentProduct \Magento\Catalog\Model\Product */ $currentProduct = $this->registry->registry('current_product'); if ($currentProduct !== null) { $productPrice = (double)$currentProduct->getFinalPrice(); $typeInstance = $currentProduct->getTypeInstance(); if (empty($productPrice) && !$this->productTypeConfig->isProductSet($currentProduct->getTypeId()) && !$typeInstance->canConfigure($currentProduct) ) { return false; } } } return true; } /** * Checks payment method and quote availability * * @param string $paymentCode * @return bool */ public function isMethodAvailable($paymentCode) { // check payment method availability /** @var \Magento\Payment\Model\Method\AbstractMethod $methodInstance */ $methodInstance = $this->paymentData->getMethodInstance($paymentCode); if (!$methodInstance->isAvailable()) { return false; } return true; } } amazon-pay-module/Helper/Shortcut/Factory.php000077700000004074151323541140015270 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper\Shortcut; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Factory { /** * Default validator */ const DEFAULT_VALIDATOR = \Amazon\Payment\Helper\Shortcut\Validator::class; /** * Checkout validator */ const CHECKOUT_VALIDATOR = \Amazon\Payment\Helper\Shortcut\CheckoutValidator::class; /** * @var \Magento\Framework\ObjectManagerInterface */ private $_objectManager; /** * @param \Magento\Framework\ObjectManagerInterface $objectManager */ public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager) { $this->_objectManager = $objectManager; } /** * @param mixed $parameter * @return \Amazon\Payment\Helper\Shortcut\ValidatorInterface */ public function create($parameter = null) { $instanceName = self::DEFAULT_VALIDATOR; if (is_object($parameter) && $parameter instanceof \Magento\Checkout\Model\Session) { $instanceName = self::CHECKOUT_VALIDATOR; } return $this->_objectManager->create($instanceName); } } amazon-pay-module/Helper/Shortcut/.htaccess000077700000000177151323541140014746 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Helper/Address.php000077700000014257151323541140013437 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Helper; use Amazon\Core\Api\Data\AmazonAddressInterface; use Amazon\Core\Domain\AmazonAddress; use Magento\Customer\Api\Data\AddressInterface; use Magento\Customer\Api\Data\AddressInterfaceFactory; use Magento\Customer\Api\Data\RegionInterfaceFactory; use Magento\Directory\Model\RegionFactory; use Magento\Framework\App\Config\ScopeConfigInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Address { /** * @var AddressInterfaceFactory */ private $addressFactory; /** * @var RegionFactory */ private $regionFactory; /** * @var RegionInterfaceFactory */ private $regionDataFactory; /** * @var ScopeConfigInterface */ private $scopeConfig; public function __construct( AddressInterfaceFactory $addressFactory, RegionFactory $regionFactory, RegionInterfaceFactory $regionDataFactory, ScopeConfigInterface $config ) { $this->addressFactory = $addressFactory; $this->regionFactory = $regionFactory; $this->regionDataFactory = $regionDataFactory; $this->scopeConfig = $config; } /** * Convert Amazon Address to Magento Address * * @param AmazonAddressInterface $amazonAddress * * @return AddressInterface */ public function convertToMagentoEntity(AmazonAddressInterface $amazonAddress) { $addressLinesAllowed = (int)$this->scopeConfig->getValue( 'customer/address/street_lines', \Magento\Store\Model\ScopeInterface::SCOPE_STORE ); $address = $this->addressFactory->create(); $address->setFirstname($amazonAddress->getFirstName()); $address->setLastname($amazonAddress->getLastName()); $address->setCity($amazonAddress->getCity()); $address->setPostcode($amazonAddress->getPostCode()); $address->setTelephone($amazonAddress->getTelephone()); $address->setCountryId($this->getCountryId($amazonAddress)); $company = !empty($amazonAddress->getCompany()) ? $amazonAddress->getCompany() : ''; $address->setCompany($company); /* * The number of lines in a street address is configurable via 'customer/address/street_lines'. * To avoid discarding information, we'll concatenate additional lines so that they fit within the configured * address length. */ $lines = []; for ($i = 1; $i <= 4; $i++) { $line = (string) $amazonAddress->getLine($i); if ($i <= $addressLinesAllowed) { $lines[] = $line; } else { $lines[count($lines)-1] = trim($lines[count($lines)-1] . ' ' . $line); } } $address->setStreet(array_values($lines)); if ($amazonAddress->getState()) { $address->setRegion($this->getRegionData($amazonAddress, $address->getCountryId())); } return $address; } protected function getCountryId(AmazonAddressInterface $amazonAddress) { return strtoupper($amazonAddress->getCountryCode()); } protected function getRegionData(AmazonAddressInterface $amazonAddress, $countryId) { $region = $this->regionFactory->create(); $regionData = $this->regionDataFactory->create(); $region->loadByCode($amazonAddress->getState(), $countryId); if (! $region->getId()) { $region->loadByName($amazonAddress->getState(), $countryId); } if ($region->getId()) { $regionData ->setRegionId($region->getId()) ->setRegionCode($region->getCode()) ->setRegion($region->getDefaultName()); } else { $regionData->setRegion($amazonAddress->getState()); } return $regionData; } /** * Convert Magento address to array for json encode * * @param AddressInterface $address * * @return array */ public function convertToArray(AddressInterface $address) { $data = [ AddressInterface::CITY => $address->getCity(), AddressInterface::FIRSTNAME => $address->getFirstname(), AddressInterface::LASTNAME => $address->getLastname(), AddressInterface::COUNTRY_ID => $address->getCountryId(), AddressInterface::STREET => $address->getStreet(), AddressInterface::POSTCODE => $address->getPostcode(), AddressInterface::COMPANY => $address->getCompany(), AddressInterface::TELEPHONE => null, AddressInterface::REGION => null, AddressInterface::REGION_ID => null, 'region_code' => null ]; if ($address->getTelephone()) { $data[AddressInterface::TELEPHONE] = $address->getTelephone(); } if ($address->getRegion()) { $data[AddressInterface::REGION] = $address->getRegion()->getRegion(); if ($address->getRegion()->getRegionId()) { $data[AddressInterface::REGION_ID] = $address->getRegion()->getRegionId(); $data['region_code'] = $address->getRegion()->getRegionCode(); } } return $data; } } amazon-pay-module/Helper/.htaccess000077700000000177151323541140013133 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/composer.json000077700000002014151323541140012630 0ustar00{ "name": "amzn/amazon-pay-module", "description": "Amazon Pay module", "type": "magento2-module", "version": "4.2.0", "abandoned": "amzn/amazon-pay-v2-magento-2-module", "license": [ "Apache-2.0" ], "require": { "php": "~7.3.0||~7.4.0", "amzn/amazon-pay-and-login-with-amazon-core-module": "^4.2.0", "amzn/login-with-amazon-module": "^4.2.0", "magento/framework": "*", "magento/module-customer": "*", "magento/module-eav": "*", "magento/module-sales": "*", "magento/module-quote": "*", "magento/module-payment": "*", "magento/module-backend": "*", "magento/module-store": "*", "magento/module-checkout": "*", "magento/module-catalog": "*", "magento/module-paypal": "*", "magento/module-directory": "*" }, "suggest": { "magento/module-customer": "*", "magento/module-scalable-checkout": "*", "magento/module-scalable-oms": "*" }, "autoload": { "files": ["registration.php"], "psr-4": { "Amazon\\Payment\\": "" } } } amazon-pay-module/Exception/AuthorizationExpiredException.php000077700000002363151323541140020624 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Exception; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizationExpiredException extends \Exception { public function __construct($message = '', $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); } } amazon-pay-module/Exception/CapturePendingException.php000077700000002355151323541140017354 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Exception; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CapturePendingException extends \Exception { public function __construct($message = '', $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); } } amazon-pay-module/Exception/SoftDeclineException.php000077700000002455151323541140016644 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Exception; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SoftDeclineException extends LocalizedException { public function __construct(Phrase $phrase, \Exception $cause = null) { parent::__construct($phrase, $cause); } } amazon-pay-module/Exception/HardDeclineException.php000077700000002455151323541140016607 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Exception; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class HardDeclineException extends LocalizedException { public function __construct(Phrase $phrase, \Exception $cause = null) { parent::__construct($phrase, $cause); } } amazon-pay-module/Exception/TransactionTimeoutException.php000077700000002466151323541140020303 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Exception; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Phrase; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class TransactionTimeoutException extends HardDeclineException { public function __construct(Phrase $phrase, \Exception $cause = null) { parent::__construct($phrase, $cause); } } amazon-pay-module/Exception/.htaccess000077700000000177151323541140013652 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/.htaccess000077700000000177151323541140011714 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Config/Config.php000077700000006540151323541140014642 0ustar00<?php /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Amazon\Payment\Gateway\Config; /** * Class Config * @package Amazon\Payment\Gateway\Config * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Config extends \Magento\Payment\Gateway\Config\Config { const CODE = 'amazon_payment'; const KEY_ACTIVE = 'active'; /** * @var \Amazon\Core\Model\AmazonConfig */ protected $amazonConfig; /** * @var \Magento\Framework\App\RequestInterface */ protected $request; /** * @var \Magento\Sales\Api\OrderRepositoryInterface */ protected $orderRepository; /** * Config constructor. * @param \Amazon\Core\Model\AmazonConfig $amazonConfig * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\App\RequestInterface $request * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository */ public function __construct( \Amazon\Core\Model\AmazonConfig $amazonConfig, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\RequestInterface $request, \Magento\Sales\Api\OrderRepositoryInterface $orderRepository ) { $this->amazonConfig = $amazonConfig; $this->request = $request; $this->orderRepository = $orderRepository; parent::__construct($scopeConfig, self::CODE); } /** * @param int|null $storeId * @return boolean */ protected function canCapturePartial($storeId = null) { // get the order store id if not provided if (empty($storeId)) { $orderId = $this->request->getParam('order_id'); if ($orderId) { $order = $this->orderRepository->get($orderId); $storeId = $order->getStoreId(); } } $region = $this->amazonConfig->getPaymentRegion(\Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId); switch ($region) { case 'de': case 'uk': $result = false; break; default: $result = parent::getValue('can_capture_partial', $storeId); break; } return $result; } /** * Gets Payment configuration status. * * @param int|null $storeId * @return bool */ public function isActive($storeId = null) { return (bool) $this->getValue(self::KEY_ACTIVE, $storeId); } /** * @param string $field * @param int|null $storeId * @return mixed */ public function getValue($field, $storeId = null) { switch ($field) { case 'can_capture_partial': $result = $this->canCapturePartial($storeId); break; default: $result = parent::getValue($field, $storeId); break; } return $result; } } amazon-pay-module/Gateway/Config/.htaccess000077700000000177151323541140014522 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Http/Client/RefundClient.php000077700000007764151323541140016760 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; use Magento\Payment\Gateway\Http\ClientInterface; use Magento\Payment\Gateway\Http\TransferInterface; use Magento\Payment\Model\Method\Logger; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Domain\AmazonRefundResponseFactory; /** * Class RefundClient * Amazon Pay refund client * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class RefundClient implements ClientInterface { const SUCCESS_CODES = ['Open', 'Closed', 'Completed', 'Pending']; /** * @var ClientFactoryInterface */ private $clientFactory; /** * @var Logger */ private $logger; /** * @var AmazonRefundResponseFactory */ private $refundResponseFactory; /** * RefundClient constructor. * * @param Logger $logger * @param ClientFactoryInterface $clientFactory * @param AmazonRefundResponseFactory $refundResponseFactory */ public function __construct( Logger $logger, ClientFactoryInterface $clientFactory, AmazonRefundResponseFactory $refundResponseFactory ) { $this->refundResponseFactory = $refundResponseFactory; $this->logger = $logger; $this->clientFactory = $clientFactory; } /** * @inheritdoc */ public function placeRequest(TransferInterface $transferObject) { $data = $transferObject->getBody(); $log = [ 'request' => $transferObject->getBody(), 'client' => static::class ]; $response = []; try { $response = $this->process($data); } catch (\Exception $e) { $message = __($e->getMessage() ?: "Something went wrong during Gateway request."); $log['error'] = $message; $this->logger->debug($log); } finally { $log['response'] = (array)$response; $this->logger->debug($log); } return $response; } /** * @inheritdoc */ protected function process(array $data) { $store_id = $data['store_id']; unset($data['store_id']); $response = [ 'status' => false ]; try { $client = $this->clientFactory->create($store_id); $responseParser = $client->refund($data); $refundResponse = $this->refundResponseFactory->create(['response' => $responseParser]); $refund = $refundResponse->getDetails(); } catch (\Exception $e) { $log['error'] = $e->getMessage(); $this->logger->debug($log); } $response['state'] = $refund->getRefundStatus()->getState(); if (in_array($refund->getRefundStatus()->getState(), self::SUCCESS_CODES)) { $response['status'] = true; $response['refund_id'] = $refund->getRefundId(); } else { $response['response_code'] = $refund->getRefundStatus()->getReasonCode(); } // Gateway expects response to be in form of array return $response; } } amazon-pay-module/Gateway/Http/Client/AuthorizeClient.php000077700000003136151323541140017474 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; /** * Class Client * Amazon Pay authorization gateway client * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizeClient extends AbstractClient { /** * @inheritdoc */ protected function process(array $data) { $response = $this->adapter->authorize($data, false); if (!$response['attempts'] && $response['auth_mode'] != 'synchronous' && isset($response['response_code']) && $response['response_code'] == 'TransactionTimedOut') { $response = $this->adapter->authorize($data, false, $attempts = 1); } return $response; } } amazon-pay-module/Gateway/Http/Client/AbstractClient.php000077700000006345151323541140017272 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; use Magento\Payment\Gateway\Http\ClientInterface; use Magento\Payment\Gateway\Http\TransferInterface; use Magento\Payment\Model\Method\Logger; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Amazon\Payment\Model\Adapter\AmazonPaymentAdapter; /** * Class AbstractClient * Base class for gateway client classes */ /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ abstract class AbstractClient implements ClientInterface { /** * @var SubjectReader */ protected $subjectReader; /** * @var Logger */ protected $logger; /** * @var ClientFactoryInterface */ protected $clientFactory; /** * @var Data */ protected $coreHelper; /** * @var AmazonPaymentAdapter */ protected $adapter; /** * AbstractClient constructor. * @param Logger $logger * @param ClientFactoryInterface $clientFactory * @param SubjectReader $subjectReader * @param Data $coreHelper * @param AmazonPaymentAdapter $adapter */ public function __construct( Logger $logger, ClientFactoryInterface $clientFactory, SubjectReader $subjectReader, Data $coreHelper, AmazonPaymentAdapter $adapter ) { $this->subjectReader = $subjectReader; $this->clientFactory = $clientFactory; $this->logger = $logger; $this->coreHelper = $coreHelper; $this->adapter = $adapter; } /** * @inheritdoc */ public function placeRequest(TransferInterface $transferObject) { $data = $transferObject->getBody(); $log = [ 'request' => $transferObject->getBody(), 'client' => static::class ]; $response = []; try { $response = $this->process($data); } catch (\Exception $e) { $message = $e->getMessage() ? $e->getMessage() : "Something went wrong during Gateway request."; $log['error'] = $message; $this->logger->debug($log); } return $response; } /** * Process http request * * @param array $data */ abstract protected function process(array $data); } amazon-pay-module/Gateway/Http/Client/SettlementClient.php000077700000005413151323541140017646 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; /** * Class SettlementClient * Amazon Pay capture client * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SettlementClient extends AbstractClient { /** * @inheritdoc */ protected function process(array $data) { $response = []; // check to see if authorization is still valid if ($this->adapter->checkAuthorizationStatus($data)) { $captureData = [ 'amazon_authorization_id' => $data['amazon_authorization_id'], 'capture_amount' => $data['capture_amount'], 'currency_code' => $data['currency_code'], 'capture_reference_id' => $data['amazon_order_reference_id'] . '-C' . time() ]; if (isset($data['seller_note'])) { $captureData['seller_capture_note'] = $data['seller_note']; } $response = $this->adapter->completeCapture($captureData, $data['store_id'], $data['amazon_order_reference_id']); $response['reauthorized'] = false; } else { // if invalid - reauthorize and capture $captureData = [ 'amazon_order_reference_id' => $data['amazon_order_reference_id'], 'amount' => $data['capture_amount'], 'currency_code' => $data['currency_code'], 'store_name' => $data['store_name'], 'custom_information' => $data['custom_information'], 'platform_id' => $data['platform_id'] ]; if (isset($data['seller_note'])) { $captureData['seller_authorization_note'] = $data['seller_note']; } $response = $this->adapter->authorize($data, true); $response['reauthorized'] = true; } return $response; } } amazon-pay-module/Gateway/Http/Client/.htaccess000077700000000177151323541140015452 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Http/Client/CaptureClient.php000077700000003124151323541140017122 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; /** * Class Client * Amazon Pay gateway capture client * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CaptureClient extends AbstractClient { /** * @inheritdoc */ protected function process(array $data) { $response = $this->adapter->authorize($data, true); if (!$response['attempts'] && $response['auth_mode'] != 'synchronous' && isset($response['response_code']) && $response['response_code'] == 'TransactionTimedOut') { $response = $this->adapter->authorize($data, true, $attempts = 1); } return $response; } } amazon-pay-module/Gateway/Http/Client/VoidClient.php000077700000003540151323541140016422 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http\Client; /** * Class VoidClient * Amazon Pay client for gateway cancel and void * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class VoidClient extends AbstractClient { /** * @inheritdoc */ protected function process(array $data) { $store_id = $data['store_id']; unset($data['store_id']); $response = [ 'status' => false ]; $client = $this->clientFactory->create($store_id); $responseParser = $client->cancelOrderReference($data); if ($responseParser->response['Status'] == 200) { // Gateway expects response to be in form of array $response['status'] = true; } else { $log['error'] = __('VoidClient - Unable to Close/Cancel order - bad status response.'); $this->logger->debug($log); } return $response; } } amazon-pay-module/Gateway/Http/TransferFactory.php000077700000003445151323541140016264 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Http; use Magento\Payment\Gateway\Http\TransferBuilder; use Magento\Payment\Gateway\Http\TransferFactoryInterface; use Magento\Payment\Gateway\Http\TransferInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class TransferFactory implements TransferFactoryInterface { /** * @var TransferBuilder */ private $transferBuilder; /** * @param TransferBuilder $transferBuilder */ public function __construct( TransferBuilder $transferBuilder ) { $this->transferBuilder = $transferBuilder; } /** * Builds gateway transfer object * * @param array $request * @return TransferInterface */ public function create(array $request) { return $this->transferBuilder ->setBody($request) ->build(); } } amazon-pay-module/Gateway/Http/.htaccess000077700000000177151323541140014234 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Request/SettlementRequestBuilder.php000077700000013411151323541140020657 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Request; use Amazon\Payment\Gateway\Config\Config; use Magento\Payment\Gateway\Request\BuilderInterface; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Magento\Payment\Model\Method\Logger; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Quote\Api\CartRepositoryInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SettlementRequestBuilder implements BuilderInterface { /** * @var Config */ private $config; /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var CartRepositoryInterface */ private $quoteRepository; /** * SettlementRequestBuilder constructor. * * @param Config $config * @param OrderRepositoryInterface $orderRepository * @param CartRepositoryInterface $quoteRepository * @param SubjectReader $subjectReader * @param Data $coreHelper * @param Logger $logger */ public function __construct( Config $config, OrderRepositoryInterface $orderRepository, CartRepositoryInterface $quoteRepository, SubjectReader $subjectReader, Data $coreHelper, Logger $logger ) { $this->config = $config; $this->orderRepository = $orderRepository; $this->quoteRepository = $quoteRepository; $this->coreHelper = $coreHelper; $this->subjectReader = $subjectReader; $this->logger = $logger; } /** * @param \Magento\Sales\Model\Order\Payment $payment * @return \Magento\Sales\Model\Order\Invoice */ protected function getCurrentInvoice($payment) { $result = null; $order = $payment->getOrder(); foreach ($order->getInvoiceCollection() as $invoice) { if (!$invoice->getId()) { $result = $invoice; break; } } return $result; } /** * @param \Magento\Sales\Model\Order\Payment $payment * @return string */ protected function getSellerNote($payment) { $result = ''; $invoice = $this->getCurrentInvoice($payment); if ($invoice && $invoice->getComments()) { foreach ($invoice->getComments() as $comment) { if ($comment->getComment()) { $result = $comment->getComment(); break; } } } return $result; } /** * @param array $buildSubject * @return array * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function build(array $buildSubject) { $data = []; $paymentDO = $this->subjectReader->readPayment($buildSubject); $orderDO = $paymentDO->getOrder(); $order = $paymentDO->getPayment()->getOrder(); $payment = $paymentDO->getPayment(); $currencyCode = $order->getOrderCurrencyCode(); if ($payment->getAmazonDisplayInvoiceAmount()) { $total = $payment->getAmazonDisplayInvoiceAmount(); } else { $total = $payment->getAmountOrdered(); } if ($buildSubject['multicurrency']['multicurrency']) { $currencyCode = $buildSubject['multicurrency']['order_currency']; $total = $buildSubject['multicurrency']['total']; } if (isset($buildSubject['amazon_order_id']) && $buildSubject['amazon_order_id']) { $data = [ 'amazon_authorization_id' => $paymentDO->getPayment()->getParentTransactionId(), 'capture_amount' => $total, 'currency_code' => $currencyCode, 'amazon_order_reference_id' => $buildSubject['amazon_order_id'], 'store_id' => $buildSubject['multicurrency']['store_id'], 'store_name' => $buildSubject['multicurrency']['store_name'], 'custom_information' => 'Magento Version : 2, ' . 'Plugin Version : ' . $this->coreHelper->getVersion(), 'platform_id' => $this->config->getValue('platform_id'), 'request_payment_authorization' => false ]; if (isset($buildSubject['request_payment_authorization']) && $buildSubject['request_payment_authorization']) { $data['request_payment_authorization'] = true; } } if ($this->coreHelper->isSandboxEnabled('store', $orderDO->getStoreId())) { $data['seller_note'] = $this->getSellerNote($paymentDO->getPayment()); } return $data; } } amazon-pay-module/Gateway/Request/AuthorizationRequestBuilder.php000077700000013736151323541140021405 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Request; use Magento\Payment\Gateway\ConfigInterface; use Magento\Payment\Gateway\Request\BuilderInterface; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Amazon\Core\Model\AmazonConfig; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\DataObject; use Amazon\Payment\Plugin\AdditionalInformation; use Amazon\Core\Helper\CategoryExclusion; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizationRequestBuilder implements BuilderInterface { /** * @var ConfigInterface */ private $config; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var AmazonConfig */ private $amazonConfig; /** * @var ManagerInterface */ private $eventManager; /** * @var CategoryExclusion */ private $categoryExclusion; /** * AuthorizationRequestBuilder constructor. * * @param ConfigInterface $config * @param SubjectReader $subjectReader * @param Data $coreHelper * @param AmazonConfig $amazonConfig * @param ManagerInterface $eventManager * @param CategoryExclusion $categoryExclusion */ public function __construct( ConfigInterface $config, SubjectReader $subjectReader, Data $coreHelper, AmazonConfig $amazonConfig, ManagerInterface $eventManager, CategoryExclusion $categoryExclusion ) { $this->config = $config; $this->coreHelper = $coreHelper; $this->amazonConfig = $amazonConfig; $this->subjectReader = $subjectReader; $this->eventManager = $eventManager; $this->categoryExclusion = $categoryExclusion; } /** * Builds ENV request * * @param array $buildSubject * @return array */ public function build(array $buildSubject) { $data = []; $paymentDO = $this->subjectReader->readPayment($buildSubject); $payment = $paymentDO->getPayment(); $orderDO = $paymentDO->getOrder(); $storeId = $orderDO->getStoreId(); $storeName = ''; $currencyCode = $payment->getOrder()->getOrderCurrencyCode(); if ($payment->getAmazonDisplayInvoiceAmount()) { $total = $payment->getAmazonDisplayInvoiceAmount(); } else { $total = $payment->getAmountOrdered(); } // capture sale or new auth/capture for partial capture if (isset($buildSubject['multicurrency']) && $buildSubject['multicurrency']['multicurrency']) { $currencyCode = $buildSubject['multicurrency']['order_currency']; $total = $buildSubject['multicurrency']['total']; $storeName = $buildSubject['multicurrency']['store_name']; $storeId = $buildSubject['multicurrency']['store_id']; } else { // auth has not happened for this order yet if ($this->amazonConfig->useMultiCurrency($storeId)) { $quote = $this->subjectReader->getQuote(); $total = $quote->getGrandTotal(); $currencyCode = $quote->getQuoteCurrencyCode(); } } if (isset($buildSubject['amazon_order_id']) && $buildSubject['amazon_order_id']) { $amazonId = $buildSubject['amazon_order_id']; } else { $quote = $this->subjectReader->getQuote(); if (!$quote->getReservedOrderId()) { try { $quote->reserveOrderId()->save(); } catch (\Exception $e) { $this->logger->debug($e->getMessage()); } } $storeName = $quote->getStore()->getName(); $amazonId = $this->subjectReader->getAmazonId(); } if ($amazonId) { $data = [ 'amazon_order_reference_id' => $amazonId, 'amount' => $total, 'currency_code' => $currencyCode, 'store_name' => $storeName, 'custom_information' => 'Magento Version : 2, ' . 'Plugin Version : ' . $this->coreHelper->getVersion(), 'platform_id' => $this->config->getValue('platform_id'), 'request_payment_authorization' => true ]; } if ($this->coreHelper->isSandboxEnabled('store', $storeId)) { $data['additional_information'] = $payment->getAdditionalInformation(AdditionalInformation::KEY_SANDBOX_SIMULATION_REFERENCE); $transport = new DataObject($data); $this->eventManager->dispatch( 'amazon_payment_authorize_before', [ 'context' => 'authorization', 'payment' => $paymentDO->getPayment(), 'transport' => $transport ] ); $data = $transport->getData(); } return $data; } } amazon-pay-module/Gateway/Request/RefundRequestBuilder.php000077700000010107151323541140017755 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Request; use Magento\Payment\Gateway\Request\BuilderInterface; use Magento\Framework\App\ProductMetadata; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Magento\Sales\Api\OrderRepositoryInterface; use Amazon\Payment\Gateway\Data\Order\OrderAdapterFactory; /** * Class RefundRequestBuilder * Builds refund request for Amazon Pay * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class RefundRequestBuilder implements BuilderInterface { /** * @var ProductMetadata */ private $productMetaData; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var OrderAdapterFactory */ private $orderAdapterFactory; /** * RefundRequestBuilder constructor. * * @param ProductMetadata $productMetadata * @param SubjectReader $subjectReader * @param Data $coreHelper * @param OrderRepositoryInterface $orderRepository * @param OrderAdapterFactory $orderAdapterFactory */ public function __construct( ProductMetaData $productMetadata, SubjectReader $subjectReader, Data $coreHelper, OrderRepositoryInterface $orderRepository, OrderAdapterFactory $orderAdapterFactory ) { $this->coreHelper = $coreHelper; $this->productMetaData = $productMetadata; $this->subjectReader = $subjectReader; $this->orderRepository = $orderRepository; $this->orderAdapterFactory = $orderAdapterFactory; } /** * @param array $buildSubject * @return array */ public function build(array $buildSubject) { $data = []; $paymentDO = $this->subjectReader->readPayment($buildSubject); $payment = $paymentDO->getPayment(); $orderDO = $paymentDO->getOrder(); $currencyCode = $payment->getOrder()->getOrderCurrencyCode(); $total = $payment->getCreditMemo()->getGrandTotal(); $storeId = $orderDO->getStoreId(); // The magento order adapter doesn't expose everything we need to send a request to the AP API so we // need to use our own version with the details we need exposed in custom methods. $orderAdapter = $this->orderAdapterFactory->create( ['order' => $payment->getOrder()] ); $amazonId = $orderAdapter->getAmazonOrderID(); $multicurrency = $orderAdapter->getMulticurrencyDetails($total); if ($multicurrency['multicurrency']) { $currencyCode = $multicurrency['order_currency']; $total = $multicurrency['total']; $storeId = $multicurrency['store_id']; } if ($amazonId) { $data = [ 'amazon_capture_id' => $payment->getParentTransactionId(), 'refund_reference_id' => $amazonId . '-R' . time(), 'refund_amount' => $total, 'currency_code' => $currencyCode, 'store_id' => $storeId ]; } return $data; } } amazon-pay-module/Gateway/Request/VoidRequestBuilder.php000077700000005745151323541140017447 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Request; use Magento\Payment\Gateway\Request\BuilderInterface; use Magento\Framework\App\ProductMetadata; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Magento\Sales\Api\OrderRepositoryInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class VoidRequestBuilder implements BuilderInterface { /** * @var ProductMetadata */ private $productMetaData; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * VoidRequestBuilder constructor. * * @param ProductMetadata $productMetadata * @param SubjectReader $subjectReader * @param Data $coreHelper * @param OrderRepositoryInterface $orderRepository */ public function __construct( ProductMetaData $productMetadata, SubjectReader $subjectReader, Data $coreHelper, OrderRepositoryInterface $orderRepository ) { $this->coreHelper = $coreHelper; $this->productMetaData = $productMetadata; $this->subjectReader = $subjectReader; $this->orderRepository = $orderRepository; } /** * Builds ENV request * * @param array $buildSubject * @return array */ public function build(array $buildSubject) { $data = []; $paymentDO = $this->subjectReader->readPayment($buildSubject); $orderDO = $paymentDO->getOrder(); $order = $this->orderRepository->get($orderDO->getId()); if ($order) { $quoteLink = $this->subjectReader->getQuoteLink($order->getQuoteId()); if ($quoteLink) { $data = [ 'store_id' => $order->getStoreId(), 'amazon_order_reference_id' => $quoteLink->getAmazonOrderReferenceId() ]; } } return $data; } } amazon-pay-module/Gateway/Request/.htaccess000077700000000177151323541140014745 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Command/CaptureStrategyCommand.php000077700000015403151323541140020231 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Command; use Magento\Payment\Gateway\CommandInterface; use Magento\Payment\Gateway\Command\CommandPoolInterface; use Magento\Sales\Api\Data\OrderPaymentInterface; use Magento\Payment\Gateway\Helper\ContextHelper; use Magento\Sales\Api\TransactionRepositoryInterface; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\Api\FilterBuilder; use Magento\Sales\Api\Data\TransactionInterface; use Magento\Framework\App\ObjectManager; use Amazon\Core\Helper\Data; use Amazon\Core\Logger\ExceptionLogger; use Amazon\Payment\Gateway\Data\Order\OrderAdapterFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CaptureStrategyCommand implements CommandInterface { const SALE = 'sale'; const CAPTURE = 'settlement'; const PARTIAL_CAPTURE = 'partial_capture'; /** * @var CommandPoolInterface */ private $commandPool; /** * @var TransactionRepositoryInterface */ private $transactionRepository; /** * @var SearchCriteriaBuilder */ private $searchCriteriaBuilder; /** * @var FilterBuilder */ private $filterBuilder; /** * @var OrderAdapterFactory */ private $orderAdapterFactory; /** * @var Data */ private $coreHelper; /** * @var ExceptionLogger */ private $exceptionLogger; /** * CaptureStrategyCommand constructor. * * @param CommandPoolInterface $commandPool * @param TransactionRepositoryInterface $transactionRepository * @param SearchCriteriaBuilder $searchCriteriaBuilder * @param FilterBuilder $filterBuilder * @param Data $coreHelper * @param OrderAdapterFactory $orderAdapterFactory * @param ExceptionLogger $exceptionLogger */ public function __construct( CommandPoolInterface $commandPool, TransactionRepositoryInterface $transactionRepository, SearchCriteriaBuilder $searchCriteriaBuilder, FilterBuilder $filterBuilder, Data $coreHelper, OrderAdapterFactory $orderAdapterFactory, ExceptionLogger $exceptionLogger = null ) { $this->commandPool = $commandPool; $this->transactionRepository = $transactionRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; $this->filterBuilder = $filterBuilder; $this->coreHelper = $coreHelper; $this->orderAdapterFactory = $orderAdapterFactory; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); } /** * @inheritdoc */ public function execute(array $commandSubject) { try { if (isset($commandSubject['payment'])) { $paymentDO = $commandSubject['payment']; $paymentInfo = $paymentDO->getPayment(); // The magento order adapter doesn't expose everything we need to send a request to the AP API so we // need to use our own version with the details we need exposed in custom methods. $orderAdapter = $this->orderAdapterFactory->create( ['order' => $paymentInfo->getOrder()] ); $commandSubject['partial_capture'] = false; $commandSubject['amazon_order_id'] = $orderAdapter->getAmazonOrderID(); $commandSubject['multicurrency'] = $orderAdapter->getMulticurrencyDetails($commandSubject['amount']); ContextHelper::assertOrderPayment($paymentInfo); $command = $this->getCommand($paymentInfo); if ($command) { if ($command == self::PARTIAL_CAPTURE) { $commandSubject['partial_capture'] = true; $command = self::SALE; } $this->commandPool->get($command)->execute($commandSubject); } } } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } /** * Get execution command name - if there's an authorization, this is just a settlement, if not, could be * a partial capture situation where we need to completely auth and capture again against the same order * * @param OrderPaymentInterface $payment * @return string */ private function getCommand(OrderPaymentInterface $payment) { $isCaptured = $this->captureTransactionExists($payment); // If an authorization exists, we're going to settle it with a capture if (!$isCaptured && $payment->getAuthorizationTransaction()) { return self::CAPTURE; } // Item has already been captured - need to reauthorize and capture (partial capture) if ($isCaptured) { return self::PARTIAL_CAPTURE; } // We're in a situation where we need a reauth and capture. return self::SALE; } /** * Check if capture transaction already exists * * @param OrderPaymentInterface $payment * @return bool */ private function captureTransactionExists(OrderPaymentInterface $payment) { $this->searchCriteriaBuilder->addFilters( [ $this->filterBuilder ->setField('payment_id') ->setValue($payment->getId()) ->create(), ] ); $this->searchCriteriaBuilder->addFilters( [ $this->filterBuilder ->setField('txn_type') ->setValue(TransactionInterface::TYPE_CAPTURE) ->create(), ] ); $searchCriteria = $this->searchCriteriaBuilder->create(); $count = $this->transactionRepository->getList($searchCriteria)->getTotalCount(); return (boolean)$count; } } amazon-pay-module/Gateway/Command/.htaccess000077700000000177151323541140014673 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Command/AmazonAuthCommand.php000077700000015567151323541140017165 0ustar00<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Amazon\Payment\Gateway\Command; use Magento\Payment\Gateway\CommandInterface; use Magento\Payment\Gateway\ErrorMapper\ErrorMessageMapperInterface; use Magento\Payment\Gateway\Http\ClientInterface; use Magento\Payment\Gateway\Http\TransferFactoryInterface; use Magento\Payment\Gateway\Request\BuilderInterface; use Magento\Payment\Gateway\Response\HandlerInterface; use Magento\Payment\Gateway\Validator\ResultInterface; use Magento\Payment\Gateway\Validator\ValidatorInterface; use Psr\Log\LoggerInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Event\ManagerInterface; use Magento\Framework\App\ObjectManager; use Amazon\Core\Exception\AmazonWebapiException; use Amazon\Core\Logger\ExceptionLogger; use Amazon\Payment\Gateway\Config\Config; /** * Class AmazonAuthCommand * * Enables customized error handling for Amazon Payment * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAuthCommand implements CommandInterface { /** * @var BuilderInterface */ private $requestBuilder; /** * @var TransferFactoryInterface */ private $transferFactory; /** * @var ClientInterface */ private $client; /** * @var HandlerInterface */ private $handler; /** * @var ValidatorInterface */ private $validator; /** * @var LoggerInterface */ private $logger; /** * @var ErrorMessageMapperInterface */ private $errorMessageMapper; /** * @var Config */ private $config; /** * @var ExceptionLogger */ private $exceptionLogger; /** * @param BuilderInterface $requestBuilder * @param TransferFactoryInterface $transferFactory * @param ClientInterface $client * @param LoggerInterface $logger * @param HandlerInterface $handler * @param ValidatorInterface $validator * @param ErrorMessageMapperInterface|null $errorMessageMapper * @param Config $config * @param ExceptionLogger $exceptionLogger; */ public function __construct( BuilderInterface $requestBuilder, TransferFactoryInterface $transferFactory, ClientInterface $client, LoggerInterface $logger, HandlerInterface $handler = null, ValidatorInterface $validator = null, ErrorMessageMapperInterface $errorMessageMapper = null, Config $config, ExceptionLogger $exceptionLogger = null ) { $this->requestBuilder = $requestBuilder; $this->transferFactory = $transferFactory; $this->client = $client; $this->handler = $handler; $this->validator = $validator; $this->logger = $logger; $this->errorMessageMapper = $errorMessageMapper; $this->config = $config; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); } /** * Executes command basing on business object * * @param array $commandSubject * @return \Magento\Payment\Gateway\Command\ResultInterface|null|void * @throws AmazonWebapiException * @throws \Magento\Payment\Gateway\Http\ClientException * @throws \Magento\Payment\Gateway\Http\ConverterException */ public function execute(array $commandSubject) { try { $isTimeout = 0; $transferO = $this->transferFactory->create( $this->requestBuilder->build($commandSubject) ); $response = $this->client->placeRequest($transferO); if ($this->validator !== null) { $result = $this->validator->validate( array_merge($commandSubject, ['response' => $response]) ); if (!$result->isValid()) { // when Amazon Pay is set to receive asynchronous calls, we need to allow timeouts to pass validation and // flag the handler to save the order for later processing. $auth_mode = ''; if (isset($response['auth_mode'])) { $auth_mode = $response['auth_mode']; } $isTimeout = $this->processErrors($result, $auth_mode); } } $response['timeout'] = $isTimeout; if ($isTimeout) { $response['status'] = true; } if ($this->handler) { $this->handler->handle( $commandSubject, $response ); } } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } /** * Tries to map error messages from validation result and logs processed message. * Throws an exception with mapped message or default error. * * @throws AmazonWebapiException */ private function processErrors(ResultInterface $result, $mode = '') { $isDecline = false; $isTimeout = false; $code = false; $messages = []; foreach ($result->getFailsDescription() as $failPhrase) { $message = (string)$failPhrase; if ($this->errorMessageMapper !== null) { $mapped = (string)$this->errorMessageMapper->getMessage($message); if (!empty($mapped) && !in_array($mapped, $messages)) { $messages[] = $mapped; } } $this->logger->critical('Payment Error: ' . $message . ': ' . $mapped); if ($message == 'AmazonRejected' || $message == 'TransactionTimedOut') { $code = (int)$this->config->getValue('hard_decline_code'); $isDecline = true; } elseif ($message == 'InvalidPaymentMethod' || $message == 'Declined') { $code = (int)$this->config->getValue('soft_decline_code'); } if ($mode == 'synchronous_possible' && $message == 'TransactionTimedOut') { $isTimeout = true; $isDecline = false; } } if ($isTimeout) { return true; } throw new AmazonWebapiException( !empty($messages) ? __(implode(PHP_EOL, $messages)) : __('Transaction has been declined. Please try again later.'), $code ); return $false; } } amazon-pay-module/Gateway/Data/Order/OrderAdapter.php000077700000013657151323541140016537 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Data\Order; use Magento\Payment\Gateway\Data\Order\AddressAdapterFactory; use Magento\Payment\Gateway\Data\AddressAdapterInterface; use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Sales\Model\Order; use Amazon\Core\Model\AmazonConfig; use Amazon\Core\Helper\Data; /** * Class OrderAdapter * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class OrderAdapter implements OrderAdapterInterface { /** * @var Order */ private $order; /** * @var AddressAdapter */ private $addressAdapterFactory; /** * @var Data */ private $coreHelper; /** * @var AmazonConfig */ private $config; /** * OrderAdapter constructor. * * @param Order $order * @param AddressAdapterFactory $addressAdapterFactory * @param Data $coreHelper * @param \Amazon\Core\Model\AmazonConfig $config */ public function __construct( Order $order, \Magento\Payment\Gateway\Data\Order\AddressAdapterFactory $addressAdapterFactory, Data $coreHelper, AmazonConfig $config ) { $this->order = $order; $this->addressAdapterFactory = $addressAdapterFactory; $this->coreHelper = $coreHelper; $this->config = $config; } /** * Returns currency code * * @return string */ public function getCurrencyCode() { return $this->order->getBaseCurrencyCode(); } /** * Returns order increment id * * @return string */ public function getOrderIncrementId() { return $this->order->getIncrementId(); } /** * Returns customer ID * * @return int|null */ public function getCustomerId() { return $this->order->getCustomerId(); } /** * Returns billing address * * @return AddressAdapterInterface|null */ public function getBillingAddress() { if ($this->order->getBillingAddress()) { return $this->addressAdapterFactory->create( ['address' => $this->order->getBillingAddress()] ); } return null; } /** * Returns shipping address * * @return AddressAdapterInterface|null */ public function getShippingAddress() { if ($this->order->getShippingAddress()) { return $this->addressAdapterFactory->create( ['address' => $this->order->getShippingAddress()] ); } return null; } /** * Returns order store id * * @return int */ public function getStoreId() { return $this->order->getStoreId(); } /** * Returns order id * * @return int */ public function getId() { return $this->order->getEntityId(); } /** * Returns order grand total amount * * @return float|null */ public function getGrandTotalAmount() { return $this->order->getBaseGrandTotal(); } /** * Returns list of line items in the cart * * @return \Magento\Sales\Api\Data\OrderItemInterface[] */ public function getItems() { return $this->order->getItems(); } /** * Gets the remote IP address for the order. * * @return string|null Remote IP address. */ public function getRemoteIp() { return $this->order->getRemoteIp(); } /** * Gets order currency code and amount if Amazon multi-currency was used. * @param $amount * @return array */ public function getMulticurrencyDetails($amount) { $values = ['multicurrency' => false]; if ($this->config->useMultiCurrency()) { $invoices = $this->order->getInvoiceCollection(); foreach ($invoices->getItems() as $key => $invoice) { $baseTotal = $invoice->getBaseGrandTotal(); // compare numeric values to make sure we have the right invoice // (could have an invoice for each item during partial capture). if (bccomp($baseTotal, (float)$amount) == 0) { $values = [ 'multicurrency' => true, 'order_currency' => $invoice->getOrderCurrencyCode(), 'total' => $invoice->getGrandTotal() ]; break; } } } $values['store_name'] = $this->order->getStoreName(); $values['store_id'] = $this->order->getStoreId(); return $values; } /** * Returns current Amazon Order Reference ID * @return string */ public function getAmazonOrderID() { $orderID = ''; if (!empty($this->order->getExtensionAttributes()->getAmazonOrderReferenceId())) { $orderID = $this->order->getExtensionAttributes()->getAmazonOrderReferenceId()->getAmazonOrderReferenceId(); } return $orderID; } } amazon-pay-module/Gateway/Data/Order/.htaccess000077700000000177151323541140015241 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Data/.htaccess000077700000000177151323541140014166 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Validator/ConstraintValidator.php000077700000004404151323541140020144 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Validator; use Magento\Payment\Gateway\Validator\AbstractValidator; use Magento\Payment\Gateway\Validator\ResultInterface; use Amazon\Payment\Gateway\Http\Client\Client; use Amazon\Payment\Domain\AmazonConstraint; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ConstraintValidator extends AbstractValidator { /** * Performs validation of result code * * @param array $validationSubject * @return ResultInterface */ public function validate(array $validationSubject) { $response = $validationSubject['response']; if (isset($response['constraints']) && $response['constraints']) { $constraint = $response['constraints'][0]; return $this->createResult( false, [$this->getConstraint($constraint)] ); } // if no constraints found, continue to other validators for more specific errors return $this->createResult( true, ['status' => isset($response['status']) ? $response['status'] : __('No constraints detected.')] ); } /** * @param AmazonConstraint $constraint * @return string */ private function getConstraint(AmazonConstraint $constraint) { return $constraint->getId(); } } amazon-pay-module/Gateway/Validator/.htaccess000077700000000177151323541140015242 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Validator/AuthorizationValidator.php000077700000005130151323541140020655 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Validator; use Magento\Payment\Gateway\Validator\AbstractValidator; use Magento\Payment\Gateway\Validator\ResultInterface; use Amazon\Payment\Domain\AmazonConstraint; /** * Class AuthorizationValidator * Validates authorization calls during gateway payment * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizationValidator extends AbstractValidator { /** * Performs validation of result code * * @param array $validationSubject * @return ResultInterface */ public function validate(array $validationSubject) { $messages = []; $response = $validationSubject['response']; if (isset($response['sandbox']) && $response['sandbox']) { $bits = explode(':', $response['sandbox']); $messages[] = $bits[count($bits) - 1]; return $this->createResult(false, $messages); } if (isset($response['status']) && $response['status']) { return $this->createResult( true, ['status' => $response['status']] ); } if (isset($response['response_code']) && $response['response_code']) { $messages[] = $response['response_code']; } elseif (isset($response['constraints']) && $response['constraints']) { $messages[] = $this->getConstraint($response['constraints'][0]); } return $this->createResult(false, $messages); } /** * @param AmazonConstraint $constraint * @return string */ private function getConstraint(AmazonConstraint $constraint) { return $constraint->getId(); } } amazon-pay-module/Gateway/Helper/SubjectReader.php000077700000007335151323541140016174 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Helper; use Magento\Checkout\Model\Session; use Amazon\Payment\Api\Data\QuoteLinkInterfaceFactory; use Amazon\Core\Helper\Data; use Magento\Quote\Model\Quote; use Magento\Payment\Gateway\Helper; use Magento\Payment\Gateway\Data\PaymentDataObjectInterface; /** * Class SubjectReader * Consolidates commonly used calls * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SubjectReader { /** * @var QuoteLinkInterfaceFactory */ private $quoteLinkFactory; /** * @var Session */ private $checkoutSession; /** * @var Data */ private $coreHelper; /** * SubjectReader constructor. * * @param Session $checkoutSession * @param QuoteLinkInterfaceFactory $quoteLinkInterfaceFactory * @param Data $coreHelper */ public function __construct( Session $checkoutSession, QuoteLinkInterfaceFactory $quoteLinkInterfaceFactory, Data $coreHelper ) { $this->quoteLinkFactory = $quoteLinkInterfaceFactory; $this->checkoutSession = $checkoutSession; $this->coreHelper = $coreHelper; } /** * Reads payment from subject * * @param array $subject * @return PaymentDataObjectInterface */ public function readPayment(array $subject) { return Helper\SubjectReader::readPayment($subject); } /** * Reads amount from subject * * @param array $subject * @return mixed */ public function readAmount(array $subject) { return Helper\SubjectReader::readAmount($subject); } /** * Gets quote from current checkout session and returns store ID * * @return int */ public function getStoreId() { $quote = $this->getQuote(); return $quote->getStoreId(); } /** * Get unique Amazon ID for order from custom table * * @return mixed */ public function getAmazonId() { $quoteLink = $this->getQuoteLink(); return $quoteLink->getAmazonOrderReferenceId(); } /** * @return \Magento\Quote\Model\Quote */ public function getQuote() { return $this->checkoutSession->getQuote(); } /** * @return \Amazon\Payment\Model\QuoteLink */ public function getQuoteLink($quote_id = '') { $quoteLink = $this->quoteLinkFactory->create(); if (!$quote_id) { $quote = $this->getQuote(); $quoteLink->load($quote->getId(), 'quote_id'); } else { $quoteLink->load($quote_id, 'quote_id'); } return $quoteLink; } /** * @return \Magento\Sales\Model\Order */ public function getOrder() { return $this->checkoutSession->getLastRealOrder(); } } amazon-pay-module/Gateway/Helper/.htaccess000077700000000177151323541140014534 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/.htaccess000077700000000177151323541140013315 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-module/Gateway/Response/CompleteAuthHandler.php000077700000006475151323541140017725 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Response; use Magento\Payment\Gateway\Response\HandlerInterface; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Amazon\Payment\Api\Data\PendingAuthorizationInterfaceFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CompleteAuthHandler implements HandlerInterface { /** * @var Data */ private $coreHelper; /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var PendingAuthorizationInterfaceFactory */ private $pendingAuthorizationFactory; /** * CompleteAuthHandler constructor. * * @param Logger $logger * @param SubjectReader $subjectReader * @param PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory * @param Data $coreHelper */ public function __construct( Logger $logger, SubjectReader $subjectReader, PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory, Data $coreHelper ) { $this->logger = $logger; $this->subjectReader = $subjectReader; $this->coreHelper = $coreHelper; $this->pendingAuthorizationFactory = $pendingAuthorizationFactory; } /** * @param array $handlingSubject * @param array $response * @throws \Exception */ public function handle(array $handlingSubject, array $response) { $paymentDO = $this->subjectReader->readPayment($handlingSubject); $payment = $paymentDO->getPayment(); $order = $this->subjectReader->getOrder(); if ($response['status']) { $payment->setTransactionId($response['authorize_transaction_id']); if ($response['timeout']) { $payment->setIsTransactionPending(true); $order->setState(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW)->setStatus(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW); $this->pendingAuthorizationFactory->create() ->setAuthorizationId($response['authorize_transaction_id']) ->save(); } $payment->setIsTransactionClosed(false); $quoteLink = $this->subjectReader->getQuoteLink(); $quoteLink->setConfirmed(true)->save(); } } } amazon-pay-module/Gateway/Response/CompleteSaleHandler.php000077700000007260151323541140017701 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Response; use Magento\Payment\Gateway\Response\HandlerInterface; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Gateway\Helper\SubjectReader; use Amazon\Core\Helper\Data; use Amazon\Payment\Api\Data\PendingAuthorizationInterfaceFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CompleteSaleHandler implements HandlerInterface { /** * @var Data */ private $coreHelper; /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var PendingAuthorizationInterfaceFactory */ private $pendingAuthorizationFactory; /** * CompleteAuthHandler constructor. * * @param Logger $logger * @param SubjectReader $subjectReader * @param PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory * @param Data $coreHelper */ public function __construct( Logger $logger, SubjectReader $subjectReader, PendingAuthorizationInterfaceFactory $pendingAuthorizationFactory, Data $coreHelper ) { $this->logger = $logger; $this->subjectReader = $subjectReader; $this->coreHelper = $coreHelper; $this->pendingAuthorizationFactory = $pendingAuthorizationFactory; } /** * @param array $handlingSubject * @param array $response * @throws \Exception */ public function handle(array $handlingSubject, array $response) { $paymentDO = $this->subjectReader->readPayment($handlingSubject); $payment = $paymentDO->getPayment(); if ($response['status']) { $payment->setTransactionId($response['capture_transaction_id']); $payment->setParentTransactionId($response['authorize_transaction_id']); if ($response['timeout']) { $order = $this->subjectReader->getOrder(); $this->pendingAuthorizationFactory->create() ->setAuthorizationId($response['authorize_transaction_id']) ->setCaptureId($response['capture_transaction_id']) ->setCapture(true) ->save(); $payment->setIsTransactionPending(true); $order->setState($order::STATE_PAYMENT_REVIEW)->setStatus($order::STATE_PAYMENT_REVIEW); $payment->setIsTransactionClosed(false); } else { $payment->setIsTransactionClosed(true); } if (!isset($handlingSubject['partial_capture']) || !$handlingSubject['partial_capture']) { $quoteLink = $this->subjectReader->getQuoteLink(); $quoteLink->setConfirmed(true)->save(); } } } } amazon-pay-module/Gateway/Response/RefundHandler.php000077700000007110151323541140016541 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Response; use Magento\Payment\Gateway\Response\HandlerInterface; use Amazon\Core\Helper\Data; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Gateway\Helper\SubjectReader; use Magento\Framework\Message\ManagerInterface; use Amazon\Payment\Api\Data\PendingRefundInterfaceFactory; /** * Class RefundHandler * Handles refund behavior for Amazon Pay * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class RefundHandler implements HandlerInterface { /** * @var ManagerInterface */ private $messageManager; /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * @var PendingRefundInterfaceFactory */ private $pendingRefundFactory; /** * RefundHandler constructor. * * @param Logger $logger * @param SubjectReader $subjectReader * @param Data $coreHelper * @param ManagerInterface $messageManager * @param PendingRefundInterfaceFactory $pendingRefundFactory */ public function __construct( Logger $logger, SubjectReader $subjectReader, Data $coreHelper, ManagerInterface $messageManager, PendingRefundInterfaceFactory $pendingRefundFactory ) { $this->logger = $logger; $this->subjectReader = $subjectReader; $this->coreHelper = $coreHelper; $this->messageManager = $messageManager; $this->pendingRefundFactory = $pendingRefundFactory; } /** * @param array $handlingSubject * @param array $response */ public function handle(array $handlingSubject, array $response) { if (isset($response['status']) && !$response['status']) { $this->messageManager->addErrorMessage( __('The refund amount or the Amazon Order ID is incorrect.') ); } else { $paymentDO = $this->subjectReader->readPayment($handlingSubject); $payment = $paymentDO->getPayment(); $payment->setTransactionId($response['refund_id']); if ($response['state'] == 'Pending') { $this->pendingRefundFactory->create() ->setRefundId($response['refund_id']) ->setPaymentId($payment->getEntityId()) ->setOrderId($payment->getOrder()->getId()) ->save(); } $this->messageManager->addSuccessMessage(__('Amazon Pay refund successful.')); } } } amazon-pay-module/Gateway/Response/SettlementHandler.php000077700000010223151323541140017441 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Response; use Magento\Payment\Gateway\Response\HandlerInterface; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Api\Data\PendingCaptureInterfaceFactory; use Amazon\Payment\Gateway\Helper\SubjectReader; use Magento\Sales\Api\OrderRepositoryInterface; use Magento\Quote\Api\CartRepositoryInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SettlementHandler implements HandlerInterface { /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var PendingCaptureInterfaceFactory */ private $pendingCaptureFactory; /** * @var OrderRepositoryInterface */ private $orderRepository; /** * @var CartRepositoryInterface */ private $quoteRepository; /** * SettlementHandler constructor. * * @param Logger $logger * @param SubjectReader $subjectReader * @param PendingCaptureInterfaceFactory $pendingCaptureFactory * @param OrderRepositoryInterface $orderRepository * @param CartRepositoryInterface $quoteRepository */ public function __construct( Logger $logger, SubjectReader $subjectReader, PendingCaptureInterfaceFactory $pendingCaptureFactory, OrderRepositoryInterface $orderRepository, CartRepositoryInterface $quoteRepository ) { $this->logger = $logger; $this->subjectReader = $subjectReader; $this->pendingCaptureFactory = $pendingCaptureFactory; $this->orderRepository = $orderRepository; $this->quoteRepository = $quoteRepository; } /** * @param array $handlingSubject * @param array $response */ public function handle(array $handlingSubject, array $response) { $paymentDO = $this->subjectReader->readPayment($handlingSubject); $payment = $paymentDO->getPayment(); // if reauthorized, treat as end of auth + capture process if ($response['reauthorized']) { if ($response['status']) { $orderDO = $paymentDO->getOrder(); $order = $this->orderRepository->get($orderDO->getId()); $payment->setTransactionId($response['capture_transaction_id']); $payment->setParentTransactionId($response['authorize_transaction_id']); $payment->setIsTransactionClosed(true); $quote = $this->quoteRepository->get($order->getQuoteId()); $quoteLink = $this->subjectReader->getQuoteLink($quote->getId()); $quoteLink->setConfirmed(true)->save(); } } else { if ($response['pending']) { $this->pendingCaptureFactory->create() ->setCaptureId($response['transaction_id']) ->setOrderId($paymentDO->getOrder()->getId()) ->setPaymentId($payment->getId()) ->save(); $payment->setIsTransactionPending(true); $payment->setIsTransactionClosed(false); } // finish capture $payment->setTransactionId($response['transaction_id']); } } } amazon-pay-module/Gateway/Response/VoidHandler.php000077700000005142151323541140016222 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Payment\Gateway\Response; use Magento\Payment\Gateway\Response\HandlerInterface; use Amazon\Core\Helper\Data; use Magento\Payment\Model\Method\Logger; use Amazon\Payment\Gateway\Helper\SubjectReader; use Magento\Framework\Message\ManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class VoidHandler implements HandlerInterface { /** * @var ManagerInterface */ private $messageManager; /** * @var Logger */ private $logger; /** * @var SubjectReader */ private $subjectReader; /** * @var Data */ private $coreHelper; /** * RefundHandler constructor. * * @param Logger $logger * @param SubjectReader $subjectReader * @param Data $coreHelper * @param $messageManager */ public function __construct( Logger $logger, SubjectReader $subjectReader, Data $coreHelper, ManagerInterface $messageManager ) { $this->logger = $logger; $this->subjectReader = $subjectReader; $this->coreHelper = $coreHelper; $this->messageManager = $messageManager; } /** * @param array $handlingSubject * @param array $response */ public function handle(array $handlingSubject, array $response) { if (isset($response['status']) && !$response['status']) { $this->messageManager->addErrorMessage( __('Unable to cancel the order or the Amazon Order ID is incorrect.') ); } else { $this->messageManager->addSuccessMessage(__('Successfully cancelled Amazon Pay.')); } } } amazon-pay-module/Gateway/Response/.htaccess000077700000000177151323541140015113 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>.htaccess000077700000000177151323541140006355 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Domain/AmazonCustomerFactory.php000077700000005110151323541140023355 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Core\Api\Data\AmazonNameInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManagerInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Escaper; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCustomerFactory { /** * @var ObjectManagerInterface */ private $objectManager = null; /** * @var AmazonNameFactory */ private $amazonNameFactory; /** * @var Escaper */ private $escaper; /** * AmazonCustomerFactory constructor. * * @param ObjectManagerInterface $objectManager * @param AmazonNameFactory $amazonNameFactory * @param Escaper $escaper */ public function __construct( ObjectManagerInterface $objectManager, AmazonNameFactory $amazonNameFactory, Escaper $escaper ) { $this->objectManager = $objectManager; $this->amazonNameFactory = $amazonNameFactory; $this->escaper = $escaper; } /** * @param array $data * @return AmazonCustomer */ public function create(array $data = []) { $amazonName = $this->amazonNameFactory ->create(['name' => $this->escaper->escapeHtml($data['name']), 'country' => $this->escaper->escapeHtml($data['country'])]); $data[AmazonNameInterface::FIRST_NAME] = $amazonName->getFirstName(); $data[AmazonNameInterface::LAST_NAME] = $amazonName->getLastName(); return $this->objectManager->create(AmazonCustomer::class, ['data' => $data]); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonAddressDecoratorJp.php000077700000006214151323541140023754 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonAddressInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAddressDecoratorJp implements AmazonAddressInterface { /** * @var AmazonAddressInterface */ private $amazonAddress; /** * @param AmazonAddressInterface $amazonAddress */ public function __construct( AmazonAddressInterface $amazonAddress ) { $this->amazonAddress = $amazonAddress; } /** * {@inheritdoc} */ public function getLines() { return $this->amazonAddress->getLines(); } /** * {@inheritdoc} */ public function getCompany() { return $this->amazonAddress->getCompany(); } /** * {@inheritdoc} */ public function getFirstName() { return $this->amazonAddress->getFirstName(); } /** * {@inheritdoc} */ public function getLastName() { return $this->amazonAddress->getLastName(); } /** * {@inheritdoc} */ public function getCity() { return $this->amazonAddress->getCity() ?? '-'; } /** * {@inheritdoc} */ public function getState() { return $this->amazonAddress->getState(); } /** * {@inheritdoc} */ public function getPostCode() { return $this->amazonAddress->getPostCode(); } /** * {@inheritdoc} */ public function getCountryCode() { return $this->amazonAddress->getCountryCode(); } /** * {@inheritdoc} */ public function getTelephone() { return $this->amazonAddress->getTelephone(); } /** * {@inheritdoc} */ public function getLine($lineNumber) { $lines = $this->getLines(); if (isset($lines[$lineNumber-1])) { return $lines[$lineNumber-1]; } return null; } /** * {@inheritdoc} */ public function shiftLines($times) { return $this->amazonAddress->shiftLines($times); } /** * {@inheritdoc} */ public function setCompany($company) { return $this->amazonAddress->setCompany($company); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonNameFactory.php000077700000006475151323541140022453 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonNameInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManagerInterface; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonNameFactory { /** * @var AmazonNameInterface */ private $amazonName; /** * @var ObjectManagerInterface */ private $objectManager = null; /** * @var array */ private $perCountryNameHandlers; /** * @param ObjectManagerInterface $objectManager * @param AmazonNameInterface $amazonName * @param array $perCountryNameHandlers Per-country custom handlers of incoming name data. * The key as an "ISO 3166-1 alpha-2" country code and * the value as an FQCN of a child of AmazonAddress. */ public function __construct( ObjectManagerInterface $objectManager, AmazonNameInterface $amazonName, array $perCountryNameHandlers = [] ) { $this->objectManager = $objectManager; $this->amazonName = $amazonName; $this->perCountryNameHandlers = $perCountryNameHandlers; } /** * @param array $data * @return AmazonName * @throws LocalizedException */ public function create(array $data = []) { $nameParts = explode(' ', trim($data['name']), 2); $data[AmazonNameInterface::FIRST_NAME] = $nameParts[0]; $data[AmazonNameInterface::LAST_NAME] = $nameParts[1] ?? '.'; $amazonName = $this->objectManager->create(AmazonName::class, ['data' => $data]); $countryCode = strtoupper($data['country']); if (empty($this->nameDecoratorPool[$countryCode])) { return $amazonName; } $amazonName = $this->objectManager->create( $this->nameDecoratorPool[$countryCode], [ 'amazonName' => $amazonName, ] ); if (!$amazonName instanceof AmazonNameInterface) { throw new LocalizedException( __( 'Address country handler %1 must be of type %2', [$this->nameDecoratorPool[$countryCode], AmazonName::class] ) ); } return $amazonName; } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonName.php000077700000002650151323541140021112 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonNameInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonName extends \Magento\Framework\DataObject implements AmazonNameInterface { /** * {@inheritdoc} */ public function getFirstName() { return $this->getData(self::FIRST_NAME); } /** * {@inheritdoc} */ public function getLastName() { return $this->getData(self::LAST_NAME); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonCustomer.php000077700000003434151323541140022034 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonCustomerInterface; use Amazon\Core\Api\Data\AmazonNameInterface; use Magento\Framework\Api\AbstractSimpleObject; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonCustomer extends \Magento\Framework\DataObject implements AmazonCustomerInterface { /** * {@inheritdoc} */ public function getEmail() { return $this->getData('email'); } /** * {@inheritdoc} */ public function getId() { return $this->getData('id'); } /** * {@inheritdoc} */ public function getFirstName() { return $this->getData(AmazonNameInterface::FIRST_NAME); } /** * {@inheritdoc} */ public function getLastName() { return $this->getData(AmazonNameInterface::LAST_NAME); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonNameDecoratorJp.php000077700000003610151323541140023244 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonNameInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonNameDecoratorJp implements AmazonNameInterface { /** * @var AmazonNameInterface */ private $amazonName; /** * @param AmazonNameInterface $amazonName */ public function __construct(AmazonNameInterface $amazonName) { $this->amazonName = $amazonName; } /** * @inheritdoc */ public function getFirstName() { return $this->convertKana($this->amazonName->getLastName()); } /** * @inheritdoc */ public function getLastName() { return $this->convertKana($this->amazonName->getFirstName()); } /** * Convert to UTF-8 Kana * * @param $string * * @return string */ private function convertKana($string) { return mb_convert_kana($string, 's', 'utf-8'); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonAddress.php000077700000006630151323541140021621 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonAddressInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAddress extends \Magento\Framework\DataObject implements AmazonAddressInterface { /** * {@inheritdoc} */ public function getFirstName() { return $this->getData(AmazonAddressInterface::FIRST_NAME); } /** * {@inheritdoc} */ public function getLastName() { return $this->getData(AmazonAddressInterface::LAST_NAME); } /** * {@inheritdoc} */ public function getLines() { return $this->getData(AmazonAddressInterface::LINES); } /** * {@inheritdoc} */ public function getLine($lineNumber) { if (isset($this->getData(AmazonAddressInterface::LINES)[$lineNumber])) { return $this->getData(AmazonAddressInterface::LINES)[$lineNumber]; } return null; } /** * {@inheritdoc} */ public function shiftLines($times = 1) { while ($times > 0) { $lines = $this->getData(AmazonAddressInterface::LINES); for ($i = 1; $i <= count($lines); $i++) { $lines[$i] = isset($lines[$i + 1]) ? $lines[$i + 1] : ''; } $this->setData(AmazonAddressInterface::LINES, $lines); $times--; } return $this->getLines(); } /** * {@inheritdoc} */ public function getCity() { return $this->getData(AmazonAddressInterface::CITY); } /** * {@inheritdoc} */ public function getState() { return $this->getData(AmazonAddressInterface::STATE_OR_REGION); } /** * {@inheritdoc} */ public function getPostCode() { return $this->getData(AmazonAddressInterface::POSTAL_CODE); } /** * {@inheritdoc} */ public function getCountryCode() { return $this->getData(AmazonAddressInterface::COUNTRY_CODE); } /** * {@inheritdoc} */ public function getTelephone() { return $this->getData(AmazonAddressInterface::TELEPHONE); } /** * {@inheritdoc} */ public function getCompany() { return $this->getData(AmazonAddressInterface::COMPANY); } /** * {@inheritdoc} */ public function setCompany($company) { $this->setData(AmazonAddressInterface::COMPANY, $company); return $this->getCompany(); } } amazon-pay-and-login-with-amazon-core-module/Domain/AmazonAddressDecoratorDe.php000077700000012377151323541140023742 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonAddressInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAddressDecoratorDe implements AmazonAddressInterface { /** * @var AmazonAddressInterface */ private $amazonAddress; /** * @param AmazonAddressInterface $amazonAddress */ public function __construct(AmazonAddressInterface $amazonAddress) { $this->amazonAddress = $amazonAddress; } /** * @return array */ public function getLines() { $line1 = (string) $this->amazonAddress->getLine(1); $line2 = (string) $this->amazonAddress->getLine(2); $line3 = (string) $this->amazonAddress->getLine(3); $lines = []; switch (true) { case !empty($line3): $lines = [$line3]; $firstTwoLines = $line1 . ' ' . $line2; if ($this->isPOBox($line1, $firstTwoLines)) { $lines[] = $firstTwoLines; } break; case !empty($line2): $lines = [$line2]; if ($this->isPOBox($line1, $line1)) { $lines[] = $line1; } break; case !empty($line1): $lines = [$line1]; break; } return $lines; } /** * @return string */ public function getCompany() { $line1 = (string) $this->amazonAddress->getLine(1); $line2 = (string) $this->amazonAddress->getLine(2); $line3 = (string) $this->amazonAddress->getLine(3); $company = $this->amazonAddress->getCompany(); switch (true) { case !empty($line3): $firstTwoLines = $line1 . ' ' . $line2; if (!$this->isPOBox($line1, $firstTwoLines)) { $company = $firstTwoLines; $this->amazonAddress->setCompany($company); $this->amazonAddress->shiftLines(2); } break; case !empty($line2): if (!$this->isPOBox($line1, $line1)) { $company = $line1; $this->amazonAddress->setCompany($company); $this->amazonAddress->shiftLines(); } break; } return $company; } /** * {@inheritdoc} */ public function getFirstName() { return $this->amazonAddress->getFirstName(); } /** * {@inheritdoc} */ public function getLastName() { return $this->amazonAddress->getLastName(); } /** * {@inheritdoc} */ public function getCity() { return $this->amazonAddress->getCity(); } /** * {@inheritdoc} */ public function getState() { return $this->amazonAddress->getState(); } /** * {@inheritdoc} */ public function getPostCode() { return $this->amazonAddress->getPostCode(); } /** * {@inheritdoc} */ public function getCountryCode() { return $this->amazonAddress->getCountryCode(); } /** * {@inheritdoc} */ public function getTelephone() { return $this->amazonAddress->getTelephone(); } /** * Returns true if strings contain address. * * @param string $line1 * @param string $line2 * @return bool */ private function isPOBox($line1, $line2) { return is_numeric($line1) || $this->isPackstationAddress($line2); } /** * @link https://en.wikipedia.org/wiki/Packstation * @param string $address * @return bool */ private function isPackstationAddress($address) { return stripos($address, 'packstation') !== false; } /** * Get an address line * * @param int $lineNumber * * @return null|string */ public function getLine($lineNumber) { return $this->amazonAddress->getLine($lineNumber); } /** * {@inheritdoc} */ public function shiftLines($times) { return $this->amazonAddress->shiftLines($times); } /** * {@inheritdoc} */ public function setCompany($company) { return $this->amazonAddress->setCompany($company); } } amazon-pay-and-login-with-amazon-core-module/Domain/.htaccess000077700000000177151323541140020153 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Domain/AmazonAddressFactory.php000077700000011562151323541140023151 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Domain; use Amazon\Core\Api\Data\AmazonAddressInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\ObjectManagerInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Escaper; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonAddressFactory { /** * @var ObjectManagerInterface */ private $objectManager = null; /** * @var AmazonAddressInterface[] */ private $addressDecoratorPool; /** * @var AmazonNameFactory */ private $amazonNameFactory; /** * AmazonAddressFactory constructor. * * @param ObjectManagerInterface $objectManager * @param AmazonNameFactory $amazonNameFactory * @param null $escaper Deprecated, do not remove for backward compatibility * @param array $addressDecoratorPool Per-country custom decorators of incoming address data. * The key as an "ISO 3166-1 alpha-2" country code and * the value as an FQCN of a child of AmazonAddress. */ public function __construct( ObjectManagerInterface $objectManager, AmazonNameFactory $amazonNameFactory, $escaper = null, array $addressDecoratorPool = [] ) { $this->objectManager = $objectManager; $this->amazonNameFactory = $amazonNameFactory; $this->addressDecoratorPool = $addressDecoratorPool; } /** * @param array $responseData * * @return AmazonAddressInterface * @throws LocalizedException */ public function create(array $responseData = []): AmazonAddressInterface { $address = $responseData['address']; $amazonName = $this->amazonNameFactory->create( [ 'name' => $address['Name'], 'country' => $address['CountryCode']] ); $data = [ AmazonAddressInterface::POSTAL_CODE => isset($address['PostalCode']) ? $address['PostalCode'] : '', AmazonAddressInterface::COUNTRY_CODE => $address['CountryCode'], AmazonAddressInterface::TELEPHONE => isset($address['Phone']) ? $address['Phone'] : '', AmazonAddressInterface::STATE_OR_REGION => isset($address['StateOrRegion']) ? $address['StateOrRegion'] : '', AmazonAddressInterface::FIRST_NAME => $amazonName->getFirstName(), AmazonAddressInterface::LAST_NAME => $amazonName->getLastName(), AmazonAddressInterface::LINES => $this->getLines($address) ]; if (isset($address['City'])) { $data[AmazonAddressInterface::CITY] = $address['City']; } $amazonAddress = $this->objectManager->create(AmazonAddress::class, ['data' => $data]); $countryCode = strtoupper($address['CountryCode']); if (empty($this->addressDecoratorPool[$countryCode])) { return $amazonAddress; } $amazonAddress = $this->objectManager->create( $this->addressDecoratorPool[$countryCode], [ 'amazonAddress' => $amazonAddress, ] ); if (!$amazonAddress instanceof AmazonAddressInterface) { throw new LocalizedException( __( 'Address country handler %1 must be of type %2', [$this->addressDecoratorPool[$countryCode], AmazonAddress::class] ) ); } return $amazonAddress; } /** * Returns address lines. * * @param array $responseData * @return array */ private function getLines(array $responseData = []): array { $lines = []; for ($i = 1; $i <= 3; $i++) { if (isset($responseData['AddressLine' . $i]) && $responseData['AddressLine' . $i]) { $lines[$i] = $responseData['AddressLine' . $i]; } } return $lines; } } amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/Simplepath/Poll.php000077700000006004151323541140024726 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Controller\Adminhtml\Simplepath; use Magento\Backend\App\Action\Context; use Magento\Backend\Controller\Adminhtml\System; use Magento\Framework\App\ObjectManager; use Amazon\Core\Logger\ExceptionLogger; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Poll extends System { /** * @var \Amazon\Core\Model\Config\SimplePath */ private $simplePath; /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ private $scopeConfig; /** * @var \Magento\Framework\Controller\Result\JsonFactory */ private $jsonResultFactory; /** * @var \Amazon\Core\Logger\ExceptionLogger */ private $exceptionLogger; public function __construct( Context $context, \Amazon\Core\Model\Config\SimplePath $simplePath, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory, \Amazon\Core\Logger\ExceptionLogger $exceptionLogger = null ) { parent::__construct($context); $this->simplePath = $simplePath; $this->scopeConfig = $scopeConfig; $this->jsonResultFactory = $jsonResultFactory; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); } /** * Detect whether Amazon credentials are set (polled by Ajax) */ public function execute() { try { // Keypair is destroyed when credentials are saved $shouldRefresh = !($this->scopeConfig->getValue( \Amazon\Core\Model\Config\SimplePath::CONFIG_XML_PATH_PUBLIC_KEY, 'default', 0 )); if ($shouldRefresh) { $this->simplePath->autoEnable(); } $result = $this->jsonResultFactory->create(); $result->setData((int)$shouldRefresh); return $result; } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } } amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/Simplepath/.htaccess000077700000000177151323541140025112 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/Download/ClientLog.php000077700000004727151323541140025353 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Controller\Adminhtml\Download; use Magento\Backend\App\Action\Context; use Magento\Backend\Controller\Adminhtml\System; use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\Exception\NotFoundException; /** * Class ClientLog * Enables custom client log file to be accessed via an admin link * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ClientLog extends System { /** * @var FileFactory */ private $fileFactory; /** * ClientLog constructor. * @param Context $context * @param FileFactory $fileFactory */ public function __construct( Context $context, FileFactory $fileFactory ) { $this->fileFactory = $fileFactory; parent::__construct($context); } /** * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface * @throws NotFoundException */ public function execute() { $filePath = $this->getFilePath(); $fileName = basename((string)$filePath); try { return $this->fileFactory->create( $fileName, [ 'type' => 'filename', 'value' => $filePath ] ); } catch (\Exception $e) { throw new NotFoundException($e->getMessage()); } } /** * @return string */ private function getFilePath() { return \Amazon\Core\Logger\Handler\Client::FILENAME; } } amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/Download/IpnLog.php000077700000004710151323541140024653 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Controller\Adminhtml\Download; use Magento\Backend\App\Action\Context; use Magento\Backend\Controller\Adminhtml\System; use Magento\Framework\App\Response\Http\FileFactory; use Magento\Framework\Exception\NotFoundException; /** * Class IpnLog * Enables custom IPN log file to be accessed via an admin link * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IpnLog extends System { /** * @var FileFactory */ private $fileFactory; /** * IpnLog constructor. * @param Context $context * @param FileFactory $fileFactory */ public function __construct( Context $context, FileFactory $fileFactory ) { $this->fileFactory = $fileFactory; parent::__construct($context); } /** * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface * @throws NotFoundException */ public function execute() { $filePath = $this->getFilePath(); $fileName = basename((string)$filePath); try { return $this->fileFactory->create( $fileName, [ 'type' => 'filename', 'value' => $filePath ] ); } catch (\Exception $e) { throw new NotFoundException($e->getMessage()); } } /** * @return string */ private function getFilePath() { return \Amazon\Core\Logger\Handler\Ipn::FILENAME; } } amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/Download/.htaccess000077700000000177151323541140024553 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Controller/Adminhtml/.htaccess000077700000000177151323541140023004 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Controller/Simplepath/Listener.php000077700000014423151323541140023674 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Controller\Simplepath; use Amazon\Core\Logger\ExceptionLogger; use Magento\Framework\App\CsrfAwareActionInterface; use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\ObjectManager; /** * Class Listener * Retrieves entered keys from Amazon Pay popup * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Listener extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface { // @var \Magento\Framework\Controller\Result\JsonFactory private $jsonResultFactory; // @var \Amazon\Core\Model\Config\SimplePath private $simplepath; // @var \Amazon\Core\Logger\ExceptionLogger private $exceptionLogger; /** * Listener constructor. * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory * @param \Amazon\Core\Model\Config\SimplePath $simplepath * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Amazon\Core\Logger\ExceptionLogger $exceptionLogger */ public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\Controller\Result\JsonFactory $jsonResultFactory, \Amazon\Core\Model\Config\SimplePath $simplepath, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, ExceptionLogger $exceptionLogger = null ) { $this->simplepath = $simplepath; $this->jsonResultFactory = $jsonResultFactory; $this->scopeConfig = $scopeConfig; $this->exceptionLogger = $exceptionLogger ?: ObjectManager::getInstance()->get(ExceptionLogger::class); parent::__construct($context); } /** * Parse POST request from Amazon and import keys */ public function execute() { try { $host = parse_url($this->getRequest()->getHeader('Origin'))['host']; if (in_array($host, $this->simplepath->getListenerOrigins())) { $this->getResponse()->setHeader('Access-Control-Allow-Origin', 'https://' . $host); } $this->getResponse()->setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); $this->getResponse()->setHeader('Access-Control-Allow-Headers', 'Content-Type, X-CSRF-Token'); $this->getResponse()->setHeader('Vary', 'Origin'); $payload = $this->_request->getParam('payload'); $result = $this->jsonResultFactory->create(); $return = ['result' => 'error', 'message' => 'Empty payload']; try { if (strpos($payload, 'encryptedKey') === false) { $return = ['result' => 'error', 'message' => 'Invalid payload: ' . $payload]; } elseif ($payload) { $json = $this->simplepath->decryptPayload($payload, false); if ($json) { $return = ['result' => 'success']; } } else { $return = ['result' => 'error', 'message' => 'payload parameter not found.']; } } catch (\Exception $e) { $return = ['result' => 'error', 'message' => $e->getMessage()]; } if ($this->_request->isPost() && (empty($return['result']) || $return['result'] == 'error')) { $result->setHttpResponseCode(\Magento\Framework\Webapi\Exception::HTTP_BAD_REQUEST); } $result->setData($return); return $result; } catch (\Exception $e) { $this->exceptionLogger->logException($e); throw $e; } } /** * Overridden to allow POST without form key * * @return bool */ public function _processUrlKeys() { $_isValidFormKey = true; $_isValidSecretKey = true; $_keyErrorMsg = ''; if ($this->_auth->isLoggedIn()) { if ($this->_backendUrl->useSecretKey()) { $_isValidSecretKey = $this->_validateSecretKey(); $_keyErrorMsg = __('You entered an invalid Secret Key. Please refresh the page.'); } } if (!$_isValidFormKey || !$_isValidSecretKey) { $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); $this->_actionFlag->set('', self::FLAG_NO_POST_DISPATCH, true); if ($this->getRequest()->getQuery('isAjax', false) || $this->getRequest()->getQuery('ajax', false)) { $this->getResponse()->representJson( $this->_objectManager->get( \Magento\Framework\Json\Helper\Data::class )->jsonEncode( ['error' => true, 'message' => $_keyErrorMsg] ) ); } else { $this->_redirect($this->_backendUrl->getStartupPageUrl()); } return false; } return true; } /** * @inheritDoc */ public function createCsrfValidationException( RequestInterface $request ): ?InvalidRequestException { return null; } /** * Disable Magento's CSRF validation. * * @inheritDoc */ public function validateForCsrf(RequestInterface $request): ?bool { return true; } } amazon-pay-and-login-with-amazon-core-module/Controller/Simplepath/.htaccess000077700000000177151323541140023175 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Controller/.htaccess000077700000000177151323541140021067 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Api/Data/AmazonCustomerInterface.php000077700000002047151323541140024027 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Api\Data; /** * @api */ interface AmazonCustomerInterface { /** * Get first name * * @return string */ public function getFirstName(); /** * Get last name * * @return string */ public function getLastName(); /** * Get email * * @return string */ public function getEmail(); /** * Get id * * @return string */ public function getId(); } amazon-pay-and-login-with-amazon-core-module/Api/Data/AmazonNameInterface.php000077700000001665151323541140023113 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Api\Data; /** * @api */ interface AmazonNameInterface { const FIRST_NAME = 'first_name'; const LAST_NAME = 'last_name'; /** * Get first name * * @return string */ public function getFirstName(); /** * Get last name * * @return string */ public function getLastName(); } amazon-pay-and-login-with-amazon-core-module/Api/Data/.htaccess000077700000000177151323541140020326 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Api/Data/AmazonAddressInterface.php000077700000004436151323541140023617 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Api\Data; /** * @api */ interface AmazonAddressInterface { const FIRST_NAME = 'first_name'; const LAST_NAME = 'last_name'; const CITY = 'city'; const POSTAL_CODE = 'postal_code'; const COUNTRY_CODE = 'country_code'; const TELEPHONE = 'telephone'; const STATE_OR_REGION = 'state'; const LINES = 'lines'; const COMPANY = 'company'; /** * Get first name * * @return string */ public function getFirstName(); /** * Get last name * * @return string */ public function getLastName(); /** * Get address lines * * @return array */ public function getLines(); /** * Get an address line * * @param int $lineNumber * @return null|string */ public function getLine($lineNumber); /** * Shifts address lines * * @param int $times * @return null|string */ public function shiftLines($times); /** * Get city * * @return string */ public function getCity(); /** * Get state * * @return string */ public function getState(); /** * Get postal code * * @return string */ public function getPostCode(); /** * Get country code * * @return string */ public function getCountryCode(); /** * Get telephone * * @return string */ public function getTelephone(); /** * Get company name * * @return string */ public function getCompany(); /** * Set company name * * @param string $company * @return string */ public function setCompany($company); } amazon-pay-and-login-with-amazon-core-module/Api/.htaccess000077700000000177151323541140017455 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/registration.php000077700000001517151323541140020370 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ use Magento\Framework\Component\ComponentRegistrar; $registrar = new ComponentRegistrar(); if ($registrar->getPath(ComponentRegistrar::MODULE, 'Amazon_Core') === null) { ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Amazon_Core', __DIR__); } amazon-pay-and-login-with-amazon-core-module/README.md000077700000001276151323541140016426 0ustar00# Amazon_Core Module The Amazon_Core module is required for the Amazon_Login and Amazon_Payment modules. ## About Amazon Pay and Login Amazon_Core provides base functionality and client integration for Amazon Login and Payment modules. ## Dependencies You can find a list of modules in the require section of the `composer.json` file located in the same directory as this `README.md` file. Amazon_Core does not have any standalone functionality but is required by Amazon_Login and Amazon_Payment. ## Extension Points Amazon_Core does not provide any specific extension points. ## Additional Information [View the Complete User Guide](https://amzn.github.io/amazon-payments-magento-2-plugin/)amazon-pay-and-login-with-amazon-core-module/Model/Validation/JsonConfigDataValidator.php000077700000005251151323541140025506 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Validation; use Amazon\Core\Helper\Data; use Magento\Framework\Validator\AbstractValidator; use Magento\Framework\Json\DecoderInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class JsonConfigDataValidator extends AbstractValidator { /** * @var DecoderInterface */ private $jsonDecoder; /** * @var Data */ private $amazonCoreHelper; /** * @param DecoderInterface $jsonDecoder * @param Data $amazonCoreHelper */ public function __construct( Data $amazonCoreHelper, DecoderInterface $jsonDecoder ) { $this->amazonCoreHelper = $amazonCoreHelper; $this->jsonDecoder = $jsonDecoder; } /** * @param string $credentialsJson * @return bool */ public function isValid($credentialsJson) { try { $decodedCredentials = $this->jsonDecoder->decode($credentialsJson); } catch (\Zend_Json_Exception $e) { $this->_addMessages(['Invalid Credentials JSON supplied! ' . $e->getMessage()]); return false; } if (!$this->mandatoryFieldsExist($decodedCredentials)) { $this->_addMessages(['Required fields are missing in supplied JSON!']); return false; } return true; } protected function mandatoryFieldsExist($decodedCredentials) { // SimplePath if (isset($decodedCredentials['encryptedKey'])) { return true; } foreach ($this->amazonCoreHelper->getAmazonCredentialsFields() as $mandatoryField) { if (!isset($decodedCredentials[$mandatoryField])) { return false; } } return true; } } amazon-pay-and-login-with-amazon-core-module/Model/Validation/AddressBlacklistTermsValidator.php000077700000004172151323541140027107 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Validation; use Amazon\Core\Helper\Data; use Magento\Framework\Validator\AbstractValidator; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AddressBlacklistTermsValidator extends AbstractValidator { /** * @var Data */ private $amazonCoreHelper; /** * @param Data $amazonCoreHelper */ public function __construct(Data $amazonCoreHelper) { $this->amazonCoreHelper = $amazonCoreHelper; } /** * {@inheritdoc} */ public function isValid($entity) { if (!$this->amazonCoreHelper->isBlacklistedTermValidationEnabled()) { return true; } /** @var $entity \Magento\Customer\Api\Data\AddressInterface */ $addressLines = (array) $entity->getStreet(); foreach ($this->amazonCoreHelper->getBlackListedTerms() as $term) { foreach ($addressLines as $addressLine) { if (stripos($addressLine, $term) !== false) { $this->_addMessages(['Unfortunately, we don’t deliver to lockers/packing stations.']); return false; } } } return true; } } amazon-pay-and-login-with-amazon-core-module/Model/Validation/ApiCredentialsValidator.php000077700000010243151323541140025541 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Validation; use Amazon\Core\Client\ClientFactoryInterface; use Amazon\Core\Helper\Data; use Magento\Framework\DataObject; use Magento\Framework\Validator\AbstractValidator; use AmazonPay\ResponseInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ApiCredentialsValidator extends AbstractValidator { const TEST_ORDER_REF = 'S00-0000000-0000000'; /** * @var ClientFactoryInterface */ private $amazonHttpClientFactory; /** * @var Data */ private $amazonCoreHelper; /** * @param ClientFactoryInterface $amazonHttpClientFactory * @param Data $amazonCoreHelper */ public function __construct( ClientFactoryInterface $amazonHttpClientFactory, Data $amazonCoreHelper ) { $this->amazonHttpClientFactory = $amazonHttpClientFactory; $this->amazonCoreHelper = $amazonCoreHelper; } /** * {@inheritdoc} */ public function isValid($scopeId = null, $scope = 'default') { if (empty($scopeId)) { $scopeId = null; } try { // convert to DataObject for an easier array key querying $response = new DataObject($this->sendTestRequest($scopeId, $scope)->toArray()); } catch (\Exception $e) { $this->_addMessages(['An error occurred while connecting to Amazon: ' . $e->getMessage()]); return false; } if ($this->isValidResponse($response)) { $this->_addMessages(['Your Amazon configuration is valid.']); return true; } else { $this->_addMessages([$this->getErrorMessage($response)]); return false; } } /** * @param null|string $scopeId * @param null|string $scope * * @return ResponseInterface */ protected function sendTestRequest($scopeId = null, $scope = 'default') { $client = $this->amazonHttpClientFactory->create($scopeId, $scope); return $client->getOrderReferenceDetails(['amazon_order_reference_id' => self::TEST_ORDER_REF]); } /** * @param DataObject $response * * @return bool */ protected function isValidResponse(DataObject $response) { $isError = $response->getData('ResponseStatus') == '404'; $isInvalidOrderRef = $response->getData('Error/Code') === 'InvalidOrderReferenceId'; return $isError && $isInvalidOrderRef; } /** * @param DataObject $response * * @return string */ protected function getErrorMessage(DataObject $response) { // special case for 200 if ($response->getData('ResponseStatus') == '200') { return 'Amazon responded with 200 on the OrderReference check. ' . 'Although the configuration is correct, you are probably using a valid order reference' . ' to do the checking, and must revert to using S00-0000000-0000000 instead.' ; } $message = $response->getData('Error/Message') ?: 'There was an unknown error in the Amazon service.'; return sprintf($message . ' (Error code: %s)', $response->getData('Error/Code') ?: 'Unknown error code'); } } amazon-pay-and-login-with-amazon-core-module/Model/Validation/.htaccess000077700000000177151323541140022076 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Model/Config/Credentials/.htaccess000077700000000177151323541140023446 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Model/Config/Credentials/Json.php000077700000012213151323541140023264 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Credentials; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Validation\JsonConfigDataValidatorFactory; use Amazon\Core\Model\Config\SimplePath; use Magento\Config\Model\ResourceModel\Config as ConfigWriter; use Magento\Framework\Encryption\EncryptorInterface; use Magento\Framework\Json\DecoderInterface; use Magento\Framework\Message\ManagerInterface as MessageManager; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Json { const AMAZON_CONFIG_PREFIX = 'payment/amazon_payment/'; const AMAZON_CREDENTIALS_JSON = 'credentials_json'; /** * @var Data */ private $amazonCoreHelper; /** * @var JsonConfigDataValidatorFactory */ private $jsonConfigDataValidatorFactory; /** * @var ConfigWriter */ private $configWriter; /** * @var MessageManager */ private $messageManager; /** * @var DecoderInterface */ private $jsonDecoder; /** * @var EncryptorInterface $encryptor */ private $encryptor; /** * @var SimplePath */ private $simplePath; /** * @param Data $amazonCoreHelper * @param JsonConfigDataValidatorFactory $jsonConfigDataValidator * @param ConfigWriter $configWriter * @param MessageManager $messageManager * @param DecoderInterface $jsonDecoder * @param EncryptorInterface $encryptor */ public function __construct( Data $amazonCoreHelper, JsonConfigDataValidatorFactory $jsonConfigDataValidator, ConfigWriter $configWriter, MessageManager $messageManager, DecoderInterface $jsonDecoder, EncryptorInterface $encryptor, SimplePath $simplePath ) { $this->amazonCoreHelper = $amazonCoreHelper; $this->jsonConfigDataValidatorFactory = $jsonConfigDataValidator; $this->configWriter = $configWriter; $this->messageManager = $messageManager; $this->jsonDecoder = $jsonDecoder; $this->encryptor = $encryptor; $this->simplePath = $simplePath; } /** * @param string $jsonCredentials * @param array $scopeData */ public function processCredentialsJson($jsonCredentials, $scopeData) { $validator = $this->jsonConfigDataValidatorFactory->create(); if ($validator->isValid($jsonCredentials)) { $this->applyCredentialsFromJson($jsonCredentials, $scopeData); } foreach ($validator->getMessages() as $message) { $this->messageManager->addErrorMessage($message); } } protected function applyCredentialsFromJson($jsonCredentials, $scopeData) { $arrayCredentials = $this->jsonDecoder->decode($jsonCredentials); $this->wipeJsonCredentialsConfig($scopeData); // Decrypt SimplePath JSON if (isset($arrayCredentials['encryptedKey'])) { $arrayCredentials = $this->jsonDecoder->decode( $this->simplePath->decryptPayload( json_encode($arrayCredentials), false, false ) ); } foreach ($this->amazonCoreHelper->getAmazonCredentialsFields() as $mandatoryField) { $valueToSave = $arrayCredentials[$mandatoryField]; $encryptedFields = array_flip($this->amazonCoreHelper->getAmazonCredentialsEncryptedFields()); if (isset($encryptedFields[$mandatoryField])) { $valueToSave = $this->encryptor->encrypt($valueToSave); } $this->configWriter->saveConfig( self::AMAZON_CONFIG_PREFIX . $mandatoryField, $valueToSave, $scopeData['scope'], $scopeData['scope_id'] ); } } protected function wipeJsonCredentialsConfig($scopeData) { $this->configWriter->deleteConfig( self::AMAZON_CONFIG_PREFIX . self::AMAZON_CREDENTIALS_JSON, $scopeData['scope'], $scopeData['scope_id'] ); } } amazon-pay-and-login-with-amazon-core-module/Model/Config/SimplePath.php000077700000050372151323541140022174 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config; use Amazon\Core\Helper\Data as CoreHelper; use Amazon\Core\Model\AmazonConfig; use Magento\Framework\App\State; use Magento\Framework\App\Cache\Type\Config as CacheTypeConfig; use Magento\Backend\Model\UrlInterface; use Magento\Payment\Helper\Formatter; use \phpseclib\Crypt\RSA; use \phpseclib\Crypt\AES; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SimplePath { const CONFIG_XML_PATH_PRIVATE_KEY = 'payment/amazon_payments/simplepath/privatekey'; const CONFIG_XML_PATH_PUBLIC_KEY = 'payment/amazon_payments/simplepath/publickey'; private $_spIds = [ 'USD' => 'AUGT0HMCLQVX1', 'GBP' => 'A1BJXVS5F6XP', 'EUR' => 'A2ZAYEJU54T1BM', 'JPY' => 'A1MCJZEB1HY93J', ]; private $_mapCurrencyRegion = [ 'EUR' => 'de', 'USD' => 'us', 'GBP' => 'uk', 'JPY' => 'ja', ]; /** * @var */ private $_storeId; /** * @var */ private $_websiteId; /** * @var string */ private $_scope; /** * @var int */ private $_scopeId; /** * @var CoreHelper */ private $coreHelper; /** * @var AmazonConfig */ private $amazonConfig; /** * SimplePath constructor. * @param CoreHelper $coreHelper * @param AmazonConfig $amazonConfig * @param \Magento\Framework\App\Config\ConfigResource\ConfigInterface $config * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\App\ProductMetadataInterface $productMeta * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor * @param \Magento\Framework\Message\ManagerInterface $messageManager * @param \Magento\Framework\App\ResourceConnection $connection * @param \Magento\Framework\App\Cache\Manager $cacheManager * @param \Magento\Framework\App\Request\Http $request * @param State $state * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param UrlInterface $backendUrl * @param \Magento\Paypal\Model\Config $paypal * @param \Psr\Log\LoggerInterface $logger * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( CoreHelper $coreHelper, AmazonConfig $amazonConfig, \Magento\Framework\App\Config\ConfigResource\ConfigInterface $config, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\App\ProductMetadataInterface $productMeta, \Magento\Framework\Encryption\EncryptorInterface $encryptor, \Magento\Framework\Message\ManagerInterface $messageManager, \Magento\Framework\App\ResourceConnection $connection, \Magento\Framework\App\Cache\Manager $cacheManager, \Magento\Framework\App\Request\Http $request, \Magento\Framework\App\State $state, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Backend\Model\UrlInterface $backendUrl, \Magento\Paypal\Model\Config $paypal, \Psr\Log\LoggerInterface $logger ) { $this->coreHelper = $coreHelper; $this->amazonConfig = $amazonConfig; $this->config = $config; $this->scopeConfig = $scopeConfig; $this->productMeta = $productMeta; $this->encryptor = $encryptor; $this->backendUrl = $backendUrl; $this->cacheManager = $cacheManager; $this->connection = $connection; $this->state = $state; $this->request = $request; $this->storeManager = $storeManager; $this->paypal = $paypal; $this->logger = $logger; $this->messageManager = $messageManager; // Find store ID and scope $this->_websiteId = $request->getParam('website', 0); $this->_storeId = $request->getParam('store', 0); $this->_scope = $request->getParam('scope'); // Website scope if ($this->_websiteId) { $this->_scope = !$this->_scope ? 'websites' : $this->_scope; } else { $this->_websiteId = $storeManager->getWebsite()->getId(); } // Store scope if ($this->_storeId) { $this->_websiteId = $this->storeManager->getStore($this->_storeId)->getWebsite()->getId(); $this->_scope = !$this->_scope ? 'stores' : $this->_scope; } else { $this->_storeId = $storeManager->getWebsite($this->_websiteId)->getDefaultStore()->getId(); } // Set scope ID switch ($this->_scope) { case 'websites': $this->_scopeId = $this->_websiteId; break; case 'stores': $this->_scopeId = $this->_storeId; break; default: $this->_scope = 'default'; $this->_scopeId = 0; break; } } /** * Return domain */ private function getEndpointDomain() { return in_array($this->getConfig('currency/options/default'), ['EUR', 'GBP']) ? 'https://payments-eu.amazon.com/' : 'https://payments.amazon.com/'; } /** * Return register popup endpoint URL */ public function getEndpointRegister() { return $this->getEndpointDomain() . 'register'; } /** * Return pubkey endpoint URL */ public function getEndpointPubkey() { return $this->getEndpointDomain() . 'register/getpublickey'; } /** * Return listener origins */ public function getListenerOrigins() { return [ 'payments.amazon.com', 'payments-eu.amazon.com', 'sellercentral.amazon.com', 'sellercentral-europe.amazon.com' ]; } /** * Generate and save RSA keys */ public function generateKeys() { $rsa = new RSA(); $keys = $rsa->createKey(2048); $encrypt = $this->encryptor->encrypt($keys['privatekey']); $this->config ->saveConfig(self::CONFIG_XML_PATH_PUBLIC_KEY, $keys['publickey'], 'default', 0) ->saveConfig(self::CONFIG_XML_PATH_PRIVATE_KEY, $encrypt, 'default', 0); $this->cacheManager->clean([CacheTypeConfig::TYPE_IDENTIFIER]); return $keys; } /** * Delete key-pair from config */ public function destroyKeys() { $this->config ->deleteConfig(self::CONFIG_XML_PATH_PUBLIC_KEY, 'default', 0) ->deleteConfig(self::CONFIG_XML_PATH_PRIVATE_KEY, 'default', 0); $this->cacheManager->clean([CacheTypeConfig::TYPE_IDENTIFIER]); } /** * Return RSA public key * * @param bool $pemformat * @param bool $reset * @return mixed|string|string[]|null */ public function getPublicKey($pemformat = false, $reset = false) { $publickey = $this->scopeConfig->getValue(self::CONFIG_XML_PATH_PUBLIC_KEY, 'default', 0); // Generate key pair if (!$publickey || $reset || strlen($publickey) < 300) { $keys = $this->generateKeys(); $publickey = $keys['publickey']; } if (!$pemformat) { $pubtrim = ['-----BEGIN PUBLIC KEY-----', '-----END PUBLIC KEY-----', "\n"]; $publickey = str_replace($pubtrim, ['','',''], $publickey); // Remove binary characters $publickey = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $publickey); } return $publickey; } /** * Return RSA private key */ public function getPrivateKey() { return $this->encryptor->decrypt($this->scopeConfig->getValue(self::CONFIG_XML_PATH_PRIVATE_KEY, 'default', 0)); } /** * Convert key to PEM format for openssl functions */ public function key2pem($key) { return "-----BEGIN PUBLIC KEY-----\n" . chunk_split($key, 64, "\n") . "-----END PUBLIC KEY-----\n"; } /** * Verify and decrypt JSON payload * * @param string $payloadJson * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ public function decryptPayload($payloadJson, $autoEnable = true, $autoSave = true) { try { $payload = (object) json_decode($payloadJson); $payloadVerify = clone $payload; // Unencrypted via admin if ($this->state->getAreaCode() == 'adminhtml' && isset($payload->merchant_id, $payload->access_key, $payload->secret_key) ) { return $this->saveToConfig($payloadJson, $autoEnable); } // Validate JSON if (!isset($payload->encryptedKey, $payload->encryptedPayload, $payload->iv, $payload->sigKeyID)) { throw new \Magento\Framework\Validator\Exception( __( 'Unable to import Amazon keys. ' . 'Please verify your JSON format and values.' ) ); } foreach ($payload as $key => $value) { $payload->$key = rawurldecode($value); } // Retrieve Amazon public key to verify signature try { $client = new \Zend_Http_Client( $this->getEndpointPubkey(), [ 'maxredirects' => 2, 'timeout' => 30, ] ); $client->setParameterGet(['sigkey_id' => $payload->sigKeyID]); $response = $client->request(); $amazonPublickey = urldecode($response->getBody()); } catch (\Exception $e) { throw new \Magento\Framework\Validator\Exception(__($e->getMessage())); } // Use raw JSON (without signature or URL decode) as the data to verify signature unset($payloadVerify->signature); $payloadVerifyJson = json_encode($payloadVerify); // Verify signature using Amazon publickey and JSON paylaod if ($amazonPublickey && openssl_verify( $payloadVerifyJson, base64_decode($payload->signature), $this->key2pem($amazonPublickey), 'SHA256' ) ) { // Decrypt Amazon key using own private key $decryptedKey = null; openssl_private_decrypt( base64_decode($payload->encryptedKey), $decryptedKey, $this->getPrivateKey(), OPENSSL_PKCS1_OAEP_PADDING ); // Decrypt final payload (AES 256-bit CBC) $aes = new AES(); $aes->setKey($decryptedKey); $aes->setIV(base64_decode($payload->iv, true)); $aes->setKeyLength(256); $finalPayload = $aes->decrypt(base64_decode($payload->encryptedPayload)); // Remove binary characters $finalPayload = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $finalPayload); if (json_decode($finalPayload)) { if ($autoSave) { $this->saveToConfig($finalPayload, $autoEnable); $this->destroyKeys(); } return $finalPayload; } } else { throw new \Magento\Framework\Validator\Exception("Unable to verify signature for JSON payload."); } } catch (\Exception $e) { $this->logger->critical($e); $this->messageManager->addError(__($e->getMessage())); $link = 'https://payments.amazon.com/help/202024240'; $this->messageManager->addError( __( "If you're experiencing consistent errors with transferring keys, " . "click <a href=\"%1\" target=\"_blank\">Manual Transfer Instructions</a> to learn more.", $link ) ); } return false; } /** * Save values to Mage config * * @param $json * @param bool $autoEnable * @return bool */ public function saveToConfig($json, $autoEnable = true) { if ($values = (object) json_decode($json)) { foreach ($values as $key => $value) { $values->{strtolower($key)} = $value; } $this->config->saveConfig( 'payment/amazon_payment/merchant_id', $values->merchant_id, $this->_scope, $this->_scopeId ); $this->config->saveConfig( 'payment/amazon_payment/client_id', $values->client_id, $this->_scope, $this->_scopeId ); $this->config->saveConfig( 'payment/amazon_payment/client_secret', $this->encryptor->encrypt($values->client_secret), $this->_scope, $this->_scopeId ); $this->config->saveConfig( 'payment/amazon_payment/access_key', $values->access_key, $this->_scope, $this->_scopeId ); $this->config->saveConfig( 'payment/amazon_payment/secret_key', $this->encryptor->encrypt($values->secret_key), $this->_scope, $this->_scopeId ); $currency = $this->getConfig('currency/options/default'); if (isset($this->_mapCurrencyRegion[$currency])) { $this->config->saveConfig( 'payment/amazon_payment/payment_region', $this->_mapCurrencyRegion[$currency], $this->_scope, $this->_scopeId ); } if ($autoEnable) { $this->autoEnable(); } $this->cacheManager->clean([CacheTypeConfig::TYPE_IDENTIFIER]); return true; } } /** * Auto-enable payment method */ public function autoEnable() { if (!$this->getConfig('payment/amazon_payment/active')) { $this->config->saveConfig('payment/amazon_payment/active', true, $this->_scope, $this->_scopeId); $this->messageManager->addSuccessMessage(__("Login and Pay with Amazon is now enabled.")); } } /** * Return listener URL */ public function getReturnUrl() { $baseUrl = $this->storeManager->getStore($this->_storeId)->getBaseUrl(UrlInterface::URL_TYPE_WEB, true); $baseUrl = str_replace('http:', 'https:', $baseUrl); $params = 'website=' . $this->_websiteId . '&store=' . $this->_storeId . '&scope=' . $this->_scope; return $baseUrl . 'amazon_core/simplepath/listener?' . urlencode($params); } /** * Return array of form POST params for SimplePath sign up */ public function getFormParams() { // Get redirect URLs and store URL-s $urlArray = []; $baseUrls = []; $stores = $this->storeManager->getStores(); foreach ($stores as $store) { // Get secure base URL if ($baseUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_WEB, true)) { $value = $baseUrl . 'amazon/login/processAuthHash/'; $urlArray[] = $value; $url = parse_url($baseUrl); if (isset($url['host'])) { $baseUrls[] = 'https://' . $url['host']; } } // Get unsecure base URL if ($baseUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_WEB, false)) { $url = parse_url($baseUrl); if (isset($url['host'])) { $baseUrls[] = 'https://' . $url['host']; } } } $urlArray = array_unique($urlArray); $baseUrls = array_unique($baseUrls); $coreVersion = $this->coreHelper->getVersion(); if (!$coreVersion) { $coreVersion = '--'; } $currency = $this->getConfig('currency/options/default'); return [ 'keyShareURL' => $this->getReturnUrl(), 'publicKey' => $this->getPublicKey(), 'locale' => $this->getConfig('general/locale/code'), 'source' => 'SPPL', 'spId' => isset($this->_spIds[$currency]) ? $this->_spIds[$currency] : '', 'spSoftwareVersion' => $this->productMeta->getVersion(), 'spAmazonPluginVersion' => $coreVersion, 'merchantStoreDescription' => $this->getConfig('general/store_information/name'), 'merchantLoginDomains[]' => $baseUrls, 'merchantLoginRedirectURLs[]' => $urlArray, ]; } /** * Return config value based on scope and scope ID */ public function getConfig($path) { return $this->scopeConfig->getValue($path, $this->_scope, $this->_scopeId); } /** * Return payment region based on currency */ public function getRegion() { $currency = $this->getCurrency(); $region = null; if ($currency) { $region = isset($this->_mapCurrencyRegion[$currency]) ? strtoupper($this->_mapCurrencyRegion[$currency]) : 'DE'; } if ($region == 'DE') { $region = 'Euro Region'; } return $region ? $region : 'US'; } /** * Return a valid store currency, otherwise return null */ public function getCurrency() { $currency = $this->getConfig('currency/options/default'); $isCurrencyValid = isset($this->_mapCurrencyRegion[$currency]); if (!$isCurrencyValid) { if ($this->getConfig(CoreHelper::AMAZON_ACTIVE, $this->_scope, $this->_scopeId)) { $isCurrencyValid = $this->amazonConfig->canUseCurrency($currency, $this->_scope, $this->_scopeId); } else { $isCurrencyValid = in_array($currency, $this->amazonConfig->getValidCurrencies($this->_scope, $this->_scopeId)); } } return $isCurrencyValid ? $currency : null; } /** * Return merchant country */ public function getCountry() { $co = $this->getConfig('paypal/general/merchant_country'); return $co ? $co : 'US'; } /** * Return array of config for JSON AmazonSp variable. */ public function getJsonAmazonSpConfig() { return [ 'co' => $this->getCountry(), 'region' => $this->getRegion(), 'currency' => $this->getCurrency(), 'amazonUrl' => $this->getEndpointRegister(), 'pollUrl' => $this->backendUrl->getUrl('amazonsp/simplepath/poll/'), 'isSecure' => (int) ($this->request->isSecure()), 'hasOpenssl' => (int) (extension_loaded('openssl')), 'formParams' => $this->getFormParams(), 'isMultiCurrencyRegion' => (int) $this->amazonConfig->isMulticurrencyRegion($this->_scope, $this->_scopeId), ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/UpdateMechanism.php000077700000002727151323541140024436 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class UpdateMechanism implements ArrayInterface { const IPN = 'instant'; const CRON = 'polling'; /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => static::CRON, 'label' => __('Data Polling via Cron Job')], ['value' => static::IPN, 'label' => __('Instant Payment Notifications')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/Button/Type.php000077700000002707151323541140023561 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source\Button; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Type implements ArrayInterface { /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => 'full', 'label' => __('Login with Amazon / Amazon Pay')], ['value' => 'short', 'label' => __('Login / Pay')], ['value' => 'logo', 'label' => __('Amazon Pay Logo')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/Button/Size.php000077700000002744151323541140023553 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source\Button; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Size implements ArrayInterface { /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => 'small', 'label' => __('Small')], ['value' => 'medium', 'label' => __('Medium')], ['value' => 'large', 'label' => __('Large')], ['value' => 'x-large', 'label' => __('Extra Large')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/Button/Color.php000077700000002657151323541140023722 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source\Button; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Color implements ArrayInterface { /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => 'Gold', 'label' => __('Gold')], ['value' => 'LightGray', 'label' => __('Light Gray')], ['value' => 'DarkGray', 'label' => __('Dark Gray')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/Button/.htaccess000077700000000177151323541140023724 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/PaymentRegion.php000077700000003052151323541140024140 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PaymentRegion implements ArrayInterface { /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => '', 'label' => __('-- Please Select --')], ['value' => 'de', 'label' => __('Euro Region')], ['value' => 'uk', 'label' => __('United Kingdom')], ['value' => 'us', 'label' => __('United States')], ['value' => 'jp', 'label' => __('Japan')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/AuthorizationMode.php000077700000002777151323541140025041 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AuthorizationMode implements ArrayInterface { const ASYNC = 'asynchronous'; const SYNC = 'synchronous'; const SYNC_THEN_ASYNC = 'synchronous_possible'; /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => static::SYNC, 'label' => __('Immediate')], ['value' => static::SYNC_THEN_ASYNC, 'label' => __('Automatic')] ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/PaymentAction.php000077700000002772151323541140024142 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model\Config\Source; use Magento\Framework\Option\ArrayInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PaymentAction implements ArrayInterface { const AUTHORIZE = 'authorize'; const AUTHORIZE_AND_CAPTURE = 'authorize_capture'; /** * {@inheritdoc} */ public function toOptionArray() { return [ ['value' => static::AUTHORIZE, 'label' => __('Charge on Shipment')], ['value' => static::AUTHORIZE_AND_CAPTURE, 'label' => __('Charge on Order')], ]; } } amazon-pay-and-login-with-amazon-core-module/Model/Config/Source/.htaccess000077700000000177151323541140022451 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Model/Config/.htaccess000077700000000177151323541140021211 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Model/AmazonConfig.php000077700000012744151323541140021275 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Model; use Magento\Store\Model\ScopeInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\StoreManagerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonConfig { /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** * @var StoreManagerInterface */ private $storeManager; /** * Config constructor. * * @param StoreManagerInterface $storeManager * @param ScopeConfigInterface $scopeConfig */ public function __construct( StoreManagerInterface $storeManager, ScopeConfigInterface $scopeConfig ) { $this->storeManager = $storeManager; $this->scopeConfig = $scopeConfig; } /** * Gets customer's current currency * * @param null $store * @return mixed * @throws \Magento\Framework\Exception\NoSuchEntityException */ protected function getCurrentCurrencyCode($store = null) { return $this->storeManager->getStore()->getCurrentCurrency()->getCode(); } /** * @param string $scope * @param null $scopeCode * * @return mixed */ public function getPaymentRegion($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/payment_region', $scope, $scopeCode ); } /** * Checks to see if store's selected region is a multicurrency region. * @param string $scope * @param null $scopeCode * @return bool */ public function isMulticurrencyRegion($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $mcRegions = $this->scopeConfig->getValue( 'multicurrency/regions', $scope, $scopeCode ); if ($mcRegions) { $allowedRegions = explode(',', $mcRegions); if (in_array($this->getPaymentRegion($scope, $scopeCode), $allowedRegions)) { return true; } } return false; } /** * Check to see if multicurrency is enabled and if it's available for given endpoint/region * * @param string $scope * @param null $scopeCode * * @return bool */ public function multiCurrencyEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $enabled = $this->scopeConfig->getValue( 'payment/amazon_payment/multicurrency', $scope, $scopeCode ); if ($enabled) { return $this->isMulticurrencyRegion($scope, $scopeCode); } return false; } /** * @param string $scope * @param string $scopeCode * @return array */ public function getValidCurrencies($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return explode(',', $this->scopeConfig->getValue('multicurrency/currencies', $scope, $scopeCode)); } /** * @param string $currencyCode * @param string $scope * @param string $scopeCode * @return boolean */ public function canUseCurrency($currencyCode, $scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $result = false; if ($this->multiCurrencyEnabled($scope, $scopeCode)) { $result = in_array($currencyCode, $this->getValidCurrencies($scope, $scopeCode)); } return $result; } /** * Only certain currency codes are allowed to be used with multi-currency * * @param null $store * @return bool */ public function useMultiCurrency($store = null) { return $this->canUseCurrency($this->getCurrentCurrencyCode(), ScopeInterface::SCOPE_STORE, $store); } /* * @return string */ public function getPresentmentCurrency() { return $this->getCurrentCurrencyCode(); } /** * Retrieves the base currency of the store. * * @param null $store * @return mixed */ public function getBaseCurrencyCode($store = null) { return $this->scopeConfig->getValue( 'currency/options/base', ScopeInterface::SCOPE_STORE, $store ); } /** * Is AmazonWebapiException code a soft decline error? * * @param $errorCode * @return bool */ public function isSoftDecline($errorCode) { return $errorCode == $this->scopeConfig->getValue('payment/amazon_payment/soft_decline_code'); } } amazon-pay-and-login-with-amazon-core-module/Model/.htaccess000077700000000177151323541140020004 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/templates/system/config/logs.phtml000077700000001264151323541140026674 0ustar00<?php /* * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. * */ ?> <div id="amazon-payment-log-list"><?php echo /* @noEscape */ $block->getLinks(); ?></div>view/adminhtml/templates/system/config/simplepath_admin.phtml000077700000006701151323541140031170 0ustar00amazon-pay-and-login-with-amazon-core-module<!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <br/> <div data-mage-init='{ "Amazon_Core/js/simplepath": <?php echo $block->escapeHtml($block->getJsonConfig()) ?> }' id="amazon_simplepath"> <?php if (!$block->getCurrency()) : // SimplePath not supported ?> <div id="simplepath_unsported"> <?= $block->escapeHtml(__('An unsupported currency is currently selected. ' . 'Please review our configuration guide.')); ?> <span class="note"> <a href="https://amzn.github.io/amazon-payments-magento-2-plugin/configuration.html" target="_blank"> (<?= $block->escapeHtml(__('More Information')); ?>) </a> </span> </div> <?php else : ?> <div id="simplepath_hint"> <?= $block->escapeHtml( __( 'You will be registering for a %1 account based on the base currency of your shop (%2).', $block->getRegion(), $block->getCurrency() ) ); ?> <span class="note"> <a href="https://amzn.github.io/amazon-payments-magento-2-plugin/overview.html" target="_blank"> (<?= $block->escapeHtml(__('More Information')); ?>) </a> </span> </div> <span class="apsp-getstarted"> <button> <span><?= $block->escapeHtml(__('Get started with account registration')); ?></span> </button> </span> <span class="apsp-or"> <?= $block->escapeHtml(__('or')); ?> <a href="#" id="simplepath-skip"> <?= $block->escapeHtml(__("I've already setup Amazon Pay, I want to edit my settings")); ?> </a> </span> <p id="amazon_https_required"> <?= $block->escapeHtml(__("In order to enable automatic account configuration using Amazon's secure key " . 'exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.')); ?> </p> <p id="amazon_reload"> <?= $block->escapeHtml(__('Updating your config with new keys, please wait...')); ?> </p> <div id="json-import-wrapper"> <textarea rows="2" cols="15" placeholder="<?= $block->escapeHtml(__('Paste JSON credentials here')); ?>" id="json-import"> </textarea> <br/> <button id="save-json" class="action-default scalable save primary ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"> <?= $block->escapeHtml(__('Save Credentials')); ?> </button> </div> <?php endif; ?> </div> <div id="amazon_simplepath_back"> <a href="#">« <?= $block->escapeHtml(__('Back to register or connect an account')); ?></a> </div> amazon-pay-and-login-with-amazon-core-module/view/adminhtml/templates/system/config/.htaccess000077700000000177151323541140026462 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/templates/system/.htaccess000077700000000177151323541140025215 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/templates/.htaccess000077700000000177151323541140023671 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/layout/.htaccess000077700000000177151323541140023210 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/layout/adminhtml_system_config_edit.xml000077700000000374151323541140030046 0ustar00<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <head> <css src="Amazon_Core::styles.css"/> </head> </page> amazon-pay-and-login-with-amazon-core-module/view/adminhtml/web/js/simplepath.js000077700000040474151323541140023776 0ustar00/** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /*browser:true*/ /*global define*/ define( [ 'jquery', 'uiComponent', 'mage/translate', 'jquery/ui', 'jquery/validate' ], function ($, Class, $t) { 'use strict'; var pollTimer, windowOpen = false; return Class.extend({ defaults: { $amazonFields: null, $amazonCredentialJson: null, $amazonSpBack: null, $amazonMerchantId: null, selector: 'amazon_payment', $container: null, pollInterval: 1500, $form: null, apSimplePathSelector: '#amazon_simplepath', apSimplePathBackSelector: '#amazon_simplepath_back', }, /** * Set list of observable attributes * @returns {exports.initObservable} */ initObservable: function () { var self = this; self.$amazonSimplepath = $(self.apSimplePathSelector); self.$amazonFields = $('#payment_' + self.getCountry() + '_' + self.selector + ' .form-list'); self.$amazonCredentialsHeader = $('#payment_' + self.getCountry() + '_' + self.selector + '_credentials-head'); self.$amazonCredentialJson = $('#payment_' + self.getCountry() + '_' + self.selector + '_credentials_credentials_json'); self.$amazonMerchantId = $('#payment_' + self.getCountry() + '_' + self.selector + '_credentials_merchant_id').val(); self.$amazonSpBack = $(self.apSimplePathBackSelector); self.$container = $(self.apSimplePathSelector); if (this.isMultiCurrencyRegion) { $('#row_payment_' + self.getCountry() + '_amazon_payment_advanced_sales_options_multicurrency').show(); $('#row_payment_other_amazon_payment_advanced_sales_options_multicurrency').show(); } else { $('#row_payment_' + self.getCountry() + '_amazon_payment_advanced_sales_options_multicurrency').hide(); $('#row_payment_other_amazon_payment_advanced_sales_options_multicurrency').hide(); } if (self.$amazonMerchantId) { self.hideAmazonConfig(); } else { self.showAmazonConfig(); } if (!self.$form) { self.generateSimplePathForm(); } self._super(); self.initEventHandlers(); return self; }, /** * Init event handlers */ initEventHandlers: function () { var self = this; self.$amazonSpBack.click(function () { self.showAmazonConfig(); return false; }); $('#simplepath-skip').click(function () { self.hideAmazonConfig(); return false; }); $('#simplepath_form').on('submit', function () { // Remove the numeric indices added by Magento's form validation logic $('#simplepath_form :input').each(function() { if($(this).attr('orig-name')) { $(this).attr('name', $(this).attr('orig-name')); $(this).removeAttr('orig-name'); } }); self.setupWindowLaunch(); }); self.$amazonCredentialJson.on('input', function () { self.updateCredentials(self); }); }, /** * Detects when a properly formatted JSON block is pasted into the Credentials JSON field * and auto populates specified fields. * * @param self */ updateCredentials: function (self) { var elJson = self.$amazonCredentialJson.val(), obj = null, success = true, item = null; try { obj = $.parseJSON($.trim(elJson)); } catch (err) { obj = null; self.$amazonCredentialJson.val('').attr( 'placeholder', $t('Invalid JSON credentials entered, please try again.') ).focus(); } if (obj && typeof obj === 'object') { for (var prop in obj) { if (obj.hasOwnProperty(prop)) { item = $('#payment_' + self.getCountry() + '_amazon_payment_credentials_' + $.trim(prop)); if (item && item.length) { $('#payment_' + self.getCountry() + '_amazon_payment_credentials_' + $.trim(prop)).val($.trim(obj[prop])); } else { success = false; } } } if (success) { self.$amazonCredentialJson.val('').attr( 'placeholder', $t('Credential fields successfully updated and being saved.') ).focus(); $('#save').click(); } else { self.$amazonCredentialJson.val('').attr( 'placeholder', $t('One or more of your credential fields did not parse correctly. ' + 'Please review your entry and try again.') ).focus(); } } }, /** * Sets up Amazon merchant key popup and polls for data update upon user completion. */ setupWindowLaunch: function () { var self = this, heights = [660, 720, 810, 900], popupWidth = this.getCountry() !== 'us' ? 768 : 1050, popupHeight = heights[0], region = self.region, elCheckDefault = $('#payment_' + self.getCountry() + '_amazon_payment_credentials_payment_region_inherit:checked'), elRegion = $('payment_' + self.getCountry() + '_amazon_payment_credentials_payment_region'), elJson = self.$amazonCredentialJson.val(); for (var i in heights) { if (heights.hasOwnProperty(i)) { popupHeight = window.innerHeight >= heights[i] ? heights[i] : popupHeight; } } self.launchPopup(self.amazonUrl, popupWidth, popupHeight); // flags that popup is open and poll timer can proceed windowOpen = true; // begin polling for feedback pollTimer = setTimeout(self.pollForKeys(self), self.pollInterval); // Save JSON $('#save-json').click(function (e) { e.stop(); var json = $('#json-import').value; if (!json || !json.isJSON()) { return; } elJson.value = json; $('#save').click(); }); // Autoset payment region (for EU/UK) if (self.region.indexOf('eu') !== -1) { region = 'de'; } if (elCheckDefault && elCheckDefault.length) { elCheckDefault[0].click(); } if (elRegion) { elRegion.value = region; } }, /** * Perform Ajax request looking for new keys. */ pollForKeys: function (self) { clearTimeout(pollTimer); if (windowOpen) { $.ajax({ url: self.pollUrl, data: {}, type: 'GET', cache: true, dataType: 'json', context: this, /** * Response handler * @param {Object} response */ success: function (response) { // poll controller returns a 0 if invalid and a 1 if valid if (response) { $('#amazon_reload').show(); document.location.replace(document.location + '#payment_amazon_payments-head'); location.reload(); } else { pollTimer = setTimeout(self.pollForKeys(self), self.pollInterval); } } }); } }, /** * Sets up dynamic form for capturing popup/form input for simple path setup. */ generateSimplePathForm: function () { this.$form = new Element('form', { method: 'post', action: this.amazonUrl, id: 'simplepath_form', target: 'simplepath', novalidate: 'novalidate', }); this.$container.wrap(this.$form); // Convert formParams JSON to hidden inputs for (var key in this.formParams) { if ( $.isPlainObject(this.formParams[key]) || $.isArray(this.formParams[key])) { for (var i in this.formParams[key]) { if (typeof this.formParams[key][i] !== 'function') { $(new Element('input', { type: 'hidden', name: key, value: this.formParams[key][i], novalidate: 'novalidate' })).appendTo($("#simplepath_form")); } } } else { $(new Element('input', { type: 'hidden', name: key, novalidate: 'novalidate', value: this.formParams[key] })).appendTo($("#simplepath_form")); } } // unable to use this.form, had to resort to direct call $('#simplepath_form').validate({}); }, /** * display amazon simple path config section */ showAmazonConfig: function () { this.$amazonSimplepath.show(); this.$amazonSpBack.hide(); if (this.$amazonCredentialsHeader.hasClass('open')) { this.$amazonCredentialsHeader.click(); } }, /** * hide amazon simple path config. */ hideAmazonConfig: function () { this.$amazonSimplepath.hide(); this.$amazonSpBack.show(); if (!this.$amazonCredentialsHeader.hasClass('open')) { this.$amazonCredentialsHeader.click(); } }, /** * Get payment code * @returns {String} */ getCountry: function () { return this.co.toLowerCase(); }, /** * Generate popup window for simple path process * @param url * @param requestedWidth * @param requestedHeight */ launchPopup: function (url, requestedWidth, requestedHeight) { var leftOffset = this.getLeftOffset(requestedWidth), topOffset = this.getTopOffset(requestedHeight), newWindow = window.open(url, 'simplepath', 'scrollbars=yes, width=' + requestedWidth + ', height=' + requestedHeight + ', top=' + topOffset + ', left=' + leftOffset); if (window.focus) { newWindow.focus(); } // Set interval to check when this popup window is closed so timeout can be suspended. var winTimer = window.setInterval(function () { if (newWindow.closed !== false) { window.clearInterval(winTimer); windowOpen = false; } }); }, /** * Determine left offset for popup window * @param requestedWidth * @returns {number} */ getLeftOffset: function (requestedWidth) { var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left; return (this.windowWidth() / 2) - (requestedWidth / 2) + dualScreenLeft; }, /** * Determine top offset for popup window * @param requestedHeight * @returns {number} */ getTopOffset: function (requestedHeight) { var dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top; return (this.windowHeight() / 2) - (requestedHeight / 2) + dualScreenTop; }, /** * Determine width of popup window * @returns {number} */ windowWidth: function () { return window.innerWidth || document.documentElement.clientWidth || screen.width; }, /** * Determine window height of popup * @returns {number} */ windowHeight: function () { return window.innerHeight || document.documentElement.clientHeight || screen.height; } } ); } ); amazon-pay-and-login-with-amazon-core-module/view/adminhtml/web/js/.htaccess000077700000000177151323541140023064 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/web/.htaccess000077700000000177151323541140022450 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/adminhtml/web/styles.css000077700000071163151323541140022712 0ustar00.apsp-getstarted { display:inline-block; padding:1em 0em; } .apsp-or { display:inline-block; } #amazon_https_required, #amazon_reload { color:red; display:none; } #json-import-wrapper { display:none; } #amazon_simplepath_back { display:none; margin-bottom:1em; margin-top:-0.5em; } #amazon_simplepath td.creds { width:10%; } .complex.amazon-payment-section .amazon-payment-logo { display:inline-block; vertical-align: middle; margin: 0 20px 0 0px; width: 180px; height:60px; background-repeat: no-repeat, no-repeat, no-repeat; background-image: url('data:image/jpeg;base64,/9j/4QxwRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAkAAAAcgEyAAIAAAAUAAAAlodpAAQAAAABAAAArAAAANgACvyAAAAnEAAK/IAAACcQQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykAMjAxODowODoyMyAyMzozNTozMQAAAAADoAEAAwAAAAH//wAAoAIABAAAAAEAAAC0oAMABAAAAAEAAAA8AAAAAAAAAAYBAwADAAAAAQAGAAABGgAFAAAAAQAAASYBGwAFAAAAAQAAAS4BKAADAAAAAQACAAACAQAEAAAAAQAAATYCAgAEAAAAAQAACzIAAAAAAAAASAAAAAEAAABIAAAAAf/Y/+0ADEFkb2JlX0NNAAL/7gAOQWRvYmUAZIAAAAAB/9sAhAAMCAgICQgMCQkMEQsKCxEVDwwMDxUYExMVExMYEQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQ0LCw0ODRAODhAUDg4OFBQODg4OFBEMDAwMDBERDAwMDAwMEQwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAA1AJ8DASIAAhEBAxEB/90ABAAK/8QBPwAAAQUBAQEBAQEAAAAAAAAAAwABAgQFBgcICQoLAQABBQEBAQEBAQAAAAAAAAABAAIDBAUGBwgJCgsQAAEEAQMCBAIFBwYIBQMMMwEAAhEDBCESMQVBUWETInGBMgYUkaGxQiMkFVLBYjM0coLRQwclklPw4fFjczUWorKDJkSTVGRFwqN0NhfSVeJl8rOEw9N14/NGJ5SkhbSVxNTk9KW1xdXl9VZmdoaWprbG1ub2N0dXZ3eHl6e3x9fn9xEAAgIBAgQEAwQFBgcHBgU1AQACEQMhMRIEQVFhcSITBTKBkRShsUIjwVLR8DMkYuFygpJDUxVjczTxJQYWorKDByY1wtJEk1SjF2RFVTZ0ZeLys4TD03Xj80aUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm9ic3R1dnd4eXp7fH/9oADAMBAAIRAxEAPwD1VJJJJSkkkklKSSSSUpJJJJSkkkklKSSSSUpJJJJSkkkklKSSSSUpJJJJT//Q0OtfV3L6l1vIv+t/VKcDpMuOFWMhrWls7amMqyWtqY5tfvybvT9Wy3/g1V/xf5l+D9ar+i42Wcvpbm3Csh26p3pFrqcrHEurr31ucy30P0V3/bazug5HRMj6zZ+d9b3Nc8byPXBcwXMeW2U2N1/o9TPSxaHfo/8AryJ9VupYTPr6zKZWcfFzbLq8SoMja24TiH0m/QqtbX+Z7K/U/wBH70/pS3qkrxOodS+vfVem4mZZh/a7MivIvaS5zaAarLWVNLva+xzKav8Ag2Kt0rpvV8L6x5X1S6fnHFbkvNGTfWC0GtjPtnr11Nf+iyH0foNzH/4T+c/wjNb6ukf+Oj1ATrvy/wD0Slgkf+O3eJ/w1n/to1L+Cv4tb6uYmX9W/r+zolF5fTa5zLw0bW2sdQ/LrfZT9D16dn87/wAZ/pti2PrT0Pq3VOuF3WuoVdP+rTYFf6cM+i0E76rgyl+RdYX/AKSz1fQp+gqWSR/47dYkfTZp/wCgr1m5N3T8z/GFlH60O3YlF1lLW2z6bGNb+pscP8Hjvn1/3LbX/pkPHwV/Fn9Xrm9D+utPTui5/wBs6VfYKyWva6qxtjN/+C/V/Xx7f8PT7/8AB/6RdF9dPqr06y7J+sXUOp5OJSytjXU0hpJLfZXXRv8A8Le921jP9IuSs6t0Zv13x+p4Nfo9JZkUir069gLWj7PZfTSxu5zHXfuM9RXf8YnV83qXX3dHqDzj9P27aapc59r2h773sYHe6up/pUf6P9LZ/hEdbCuiX/Ft0nLyOpnrlr314WC2xg3OLvUse3a+v+VXj1/zzv8AT+ls/m7UPpWFd/jC61mX9UybWYGON9NFZEMa8uZisqZY2ylrvTq9S+70vUts/wCDWz9VPrhh234/1WPS39MrfW+rGAcXRDXWRa21lVu97fUe+79Jvt+n++sb6k9Txvqp1rqPTetOOKQxtZc5rne6oudTpU1/syKLvVqs+glrqrs6P1B6rnYHX8v6r5mQ7IoqNrccvJJa+h2xzat5Oyi2n9J6P+Cf/NfTWD9U+ldQ6/b1DpLM1+Lh2xbmv1sc/Y+1uPR73j9G59j7L/8ASemtX6j0P6v9c87r1THNw6rL7GvcNN95210H/hfQd6tjP8H7P9Ipf4qCD1PqcH/Bt/8APliXdXZl/iwuy8XrXUOjOsnGqrc41AnY22q0UOfS0/zfqb/ftXQ/4yLbafqpkPqsfU71aQXVuLHQbGbm72Frlzv1AIP136vB/MyP/bhi6D/GYJ+qWQP+Fo/8+sQO6hs1aPqPjde6djdQ631DMzMzJprtDhZsrq3sYQ3Hxmt9Fmz+V/O/zlqb6i9Q6ljdV6n9V+o3uyz0478a+wku9OduxznFz9rmvpurY7+Z9T0d/psrVvoX10+rFfRMau/Prx7sOiuu+i6WWhzGNDtlLv0l/wDI9D1d6yfqi/M6n1j6wfWrEqIqvY6nBa8fzj2huzv+7RR6nu/nLPTS72ns3s36jfV624v611TLyMm1zng5GVs0LidtVXtaytk7G7FU+qlF+P13r31Rsyrr+m01D0C959SsWNbuFNo/mv0eR/g/8LV6rNiyPqhV9SMzAyc760X493VbLXG92faA8tAG3022OZv/ALHv/wAF/o2K/wDUI9M/559W/ZDPS6ccZjsSstcyKyapcK7f0rWWXerYzel3R2dL/F3m5lX7S+r3UrXXZnSrzD7HOc51b9NzTZud6e9nqV/8HdWouuyet/4xvs9V1jen9BpD7mMe9rH3vHsY9rC1r/c9v0v+4tlah9ZXN+rf1wwfrMQ4YWbU/E6gGCSXNYX47o9rd7/Tp/sY6b6r4+b036kdU6/ZA6p1KrJ6i558dllmN/Y/wrP+NS8U+D//0fQcv6r/AFezcz7dldPouyZBNjmAlxHewfRs/wCuKxZ03Gbf9uxqKW57KfQquczisHe2iWQ5tW791XEkjqCLKhobcTG/YdHUX5F2HVgdTs3F9r2NBfuje5uUBte1+xX2dJ6SM49Trxaftr5Jygxu8y0Vz6n0v5tuxHyMXHyq/TyKxY3wPb+qfzVlP+r9lJLunZT6P+DJMf5zP+/MsVWU+ax/oDmI94n283+FH+bn/gcDYjHBP9I4ZdiPcx/4Mvni3j0jpZzx1I4tRzhxk7B6mjfS/nPpfzfsQOo/VvoPVL25HUMGnIuaIFrm+4gcNc9sOe1v8tVPR+tFPtbYLR4yw/8Anxtbk4H1pfoS1nmfT/77vTPv52PLcxfhjsf43Eu+6D/P4a/v/s4XSHSemC3GtGLU1+CHNxCGNHpB42vbTA/R7o/NVTJd6WY5lGVRiWZL2jayr1LXugMa++HD93Zvez6CG3o3U7/6bnO292VE6/2v0bf/AAJX8TpmJhMcMVgZY4QbT7nE/wAop3FnzCvaOGF3cp8OSXhwYZf+pUCOHFrxjLLaowuH+Nl/9VtbphuybLjm+ne/DuLKLtgBDtu2xzP3PY9E6l0Ho3Vi13UcOrJewQ172guA/d3/AE9nu+grOHisxMdtDCXRJc88uc47nvd/XcjqbBCUMUYzJlIDUk8R11ri/qsWaUZZJGIAj0ocO36XD/WQ4mHi4VDcbEpZj0M+jXW0NaP7LUHC6R0vp77LMHEqxn2/zjqmBpdBLvdt/lOVxJSsbTxekdLw8mzLxcSqjIun1ba2Brnbj6j9zm/vP9ywf8ZjXu+qOSGtLiLKSQ0FxgWMkw1dUklanD6f0HpGd0np1ufg03XtxaAX21gvkVs9r3OG/wBv8tbNVVVNbaqWNrrYA1jGANa0DhrWt9rVNJJTm2/VzoF2Ucy7p2NZkOJLrHVNJJOrnP097v5TlcbiYleRZlsorbk2NDbL2sAsc1v0WPsA3va1GSSU+ddc65V9ebMHoHRqbvRfc2/PyLK9npVM0dG78/3u/wCu+lXX/hF6B9lx/s32T02/ZtnpelHt2Rs9Pb+5s9qKkjan/9L1VJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn/9n/7RR8UGhvdG9zaG9wIDMuMAA4QklNBCUAAAAAABAAAAAAAAAAAAAAAAAAAAAAOEJJTQQ6AAAAAADlAAAAEAAAAAEAAAAAAAtwcmludE91dHB1dAAAAAUAAAAAUHN0U2Jvb2wBAAAAAEludGVlbnVtAAAAAEludGUAAAAAQ2xybQAAAA9wcmludFNpeHRlZW5CaXRib29sAAAAAAtwcmludGVyTmFtZVRFWFQAAAABAAAAAAAPcHJpbnRQcm9vZlNldHVwT2JqYwAAAAwAUAByAG8AbwBmACAAUwBlAHQAdQBwAAAAAAAKcHJvb2ZTZXR1cAAAAAEAAAAAQmx0bmVudW0AAAAMYnVpbHRpblByb29mAAAACXByb29mQ01ZSwA4QklNBDsAAAAAAi0AAAAQAAAAAQAAAAAAEnByaW50T3V0cHV0T3B0aW9ucwAAABcAAAAAQ3B0bmJvb2wAAAAAAENsYnJib29sAAAAAABSZ3NNYm9vbAAAAAAAQ3JuQ2Jvb2wAAAAAAENudENib29sAAAAAABMYmxzYm9vbAAAAAAATmd0dmJvb2wAAAAAAEVtbERib29sAAAAAABJbnRyYm9vbAAAAAAAQmNrZ09iamMAAAABAAAAAAAAUkdCQwAAAAMAAAAAUmQgIGRvdWJAb+AAAAAAAAAAAABHcm4gZG91YkBv4AAAAAAAAAAAAEJsICBkb3ViQG/gAAAAAAAAAAAAQnJkVFVudEYjUmx0AAAAAAAAAAAAAAAAQmxkIFVudEYjUmx0AAAAAAAAAAAAAAAAUnNsdFVudEYjUHhsQFIAAAAAAAAAAAAKdmVjdG9yRGF0YWJvb2wBAAAAAFBnUHNlbnVtAAAAAFBnUHMAAAAAUGdQQwAAAABMZWZ0VW50RiNSbHQAAAAAAAAAAAAAAABUb3AgVW50RiNSbHQAAAAAAAAAAAAAAABTY2wgVW50RiNQcmNAWQAAAAAAAAAAABBjcm9wV2hlblByaW50aW5nYm9vbAAAAAAOY3JvcFJlY3RCb3R0b21sb25nAAAAAAAAAAxjcm9wUmVjdExlZnRsb25nAAAAAAAAAA1jcm9wUmVjdFJpZ2h0bG9uZwAAAAAAAAALY3JvcFJlY3RUb3Bsb25nAAAAAAA4QklNA+0AAAAAABAASAAAAAEAAQBIAAAAAQABOEJJTQQmAAAAAAAOAAAAAAAAAAAAAD+AAAA4QklNBA0AAAAAAAQAAABaOEJJTQQZAAAAAAAEAAAAHjhCSU0D8wAAAAAACQAAAAAAAAAAAQA4QklNJxAAAAAAAAoAAQAAAAAAAAABOEJJTQP1AAAAAABIAC9mZgABAGxmZgAGAAAAAAABAC9mZgABAKGZmgAGAAAAAAABADIAAAABAFoAAAAGAAAAAAABADUAAAABAC0AAAAGAAAAAAABOEJJTQP4AAAAAABwAAD/////////////////////////////A+gAAAAA/////////////////////////////wPoAAAAAP////////////////////////////8D6AAAAAD/////////////////////////////A+gAADhCSU0EAAAAAAAAAgABOEJJTQQCAAAAAAAEAAAAADhCSU0EMAAAAAAAAgEBOEJJTQQtAAAAAAAGAAEAAAACOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EHgAAAAAABAAAAAA4QklNBBoAAAAAA0kAAAAGAAAAAAAAAAAAAAA8AAAAtAAAAAoAVQBuAHQAaQB0AGwAZQBkAC0AMwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAtAAAADwAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAG51bGwAAAACAAAABmJvdW5kc09iamMAAAABAAAAAAAAUmN0MQAAAAQAAAAAVG9wIGxvbmcAAAAAAAAAAExlZnRsb25nAAAAAAAAAABCdG9tbG9uZwAAADwAAAAAUmdodGxvbmcAAAC0AAAABnNsaWNlc1ZsTHMAAAABT2JqYwAAAAEAAAAAAAVzbGljZQAAABIAAAAHc2xpY2VJRGxvbmcAAAAAAAAAB2dyb3VwSURsb25nAAAAAAAAAAZvcmlnaW5lbnVtAAAADEVTbGljZU9yaWdpbgAAAA1hdXRvR2VuZXJhdGVkAAAAAFR5cGVlbnVtAAAACkVTbGljZVR5cGUAAAAASW1nIAAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAAAAAAAABMZWZ0bG9uZwAAAAAAAAAAQnRvbWxvbmcAAAA8AAAAAFJnaHRsb25nAAAAtAAAAAN1cmxURVhUAAAAAQAAAAAAAG51bGxURVhUAAAAAQAAAAAAAE1zZ2VURVhUAAAAAQAAAAAABmFsdFRhZ1RFWFQAAAABAAAAAAAOY2VsbFRleHRJc0hUTUxib29sAQAAAAhjZWxsVGV4dFRFWFQAAAABAAAAAAAJaG9yekFsaWduZW51bQAAAA9FU2xpY2VIb3J6QWxpZ24AAAAHZGVmYXVsdAAAAAl2ZXJ0QWxpZ25lbnVtAAAAD0VTbGljZVZlcnRBbGlnbgAAAAdkZWZhdWx0AAAAC2JnQ29sb3JUeXBlZW51bQAAABFFU2xpY2VCR0NvbG9yVHlwZQAAAABOb25lAAAACXRvcE91dHNldGxvbmcAAAAAAAAACmxlZnRPdXRzZXRsb25nAAAAAAAAAAxib3R0b21PdXRzZXRsb25nAAAAAAAAAAtyaWdodE91dHNldGxvbmcAAAAAADhCSU0EKAAAAAAADAAAAAI/8AAAAAAAADhCSU0EEQAAAAAAAQEAOEJJTQQUAAAAAAAEAAAAAjhCSU0EDAAAAAALTgAAAAEAAACfAAAANQAAAeAAAGNgAAALMgAYAAH/2P/tAAxBZG9iZV9DTQAC/+4ADkFkb2JlAGSAAAAAAf/bAIQADAgICAkIDAkJDBELCgsRFQ8MDA8VGBMTFRMTGBEMDAwMDAwRDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAENCwsNDg0QDg4QFA4ODhQUDg4ODhQRDAwMDAwREQwMDAwMDBEMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8AAEQgANQCfAwEiAAIRAQMRAf/dAAQACv/EAT8AAAEFAQEBAQEBAAAAAAAAAAMAAQIEBQYHCAkKCwEAAQUBAQEBAQEAAAAAAAAAAQACAwQFBgcICQoLEAABBAEDAgQCBQcGCAUDDDMBAAIRAwQhEjEFQVFhEyJxgTIGFJGhsUIjJBVSwWIzNHKC0UMHJZJT8OHxY3M1FqKygyZEk1RkRcKjdDYX0lXiZfKzhMPTdePzRieUpIW0lcTU5PSltcXV5fVWZnaGlqa2xtbm9jdHV2d3h5ent8fX5/cRAAICAQIEBAMEBQYHBwYFNQEAAhEDITESBEFRYXEiEwUygZEUobFCI8FS0fAzJGLhcoKSQ1MVY3M08SUGFqKygwcmNcLSRJNUoxdkRVU2dGXi8rOEw9N14/NGlKSFtJXE1OT0pbXF1eX1VmZ2hpamtsbW5vYnN0dXZ3eHl6e3x//aAAwDAQACEQMRAD8A9VSSSSUpJJJJSkkkklKSSSSUpJJJJSkkkklKSSSSUpJJJJSkkkklKSSSSU//0NDrX1dy+pdbyL/rf1SnA6TLjhVjIa1pbO2pjKslramObX78m70/Vst/4NVf8X+Zfg/Wq/ouNlnL6W5twrIduqd6Ra6nKxxLq699bnMt9D9Fd/22s7oOR0TI+s2fnfW9zXPG8j1wXMFzHltlNjdf6PUz0sWh36P/AK8ifVbqWEz6+symVnHxc2y6vEqDI2tuE4h9Jv0KrW1/meyv1P8AR+9P6Ut6pK8TqHUvr31XpuJmWYf2uzIryL2kuc2gGqy1lTS72vscymr/AINirdK6b1fC+seV9Uun5xxW5LzRk31gtBrYz7Z69dTX/osh9H6Dcx/+E/nP8IzW+rpH/jo9QE678v8A9EpYJH/jt3if8NZ/7aNS/gr+LW+rmJl/Vv6/s6JReX02ucy8NG1trHUPy632U/Q9enZ/O/8AGf6bYtj609D6t1Trhd1rqFXT/q02BX+nDPotBO+q4MpfkXWF/wCks9X0KfoKlkkf+O3WJH02af8AoK9ZuTd0/M/xhZR+tDt2JRdZS1ts+mxjW/qbHD/B4759f9y21/6ZDx8FfxZ/V65vQ/rrT07ouf8AbOlX2Cslr2uqsbYzf/gv1f18e3/D0+//AAf+kXRfXT6q9OsuyfrF1DqeTiUsrY11NIaSS32V10b/APC3vdtYz/SLkrOrdGb9d8fqeDX6PSWZFIq9OvYC1o+z2X00sbucx137jPUV3/GJ1fN6l193R6g84/T9u2mqXOfa9oe+97GB3urqf6VH+j/S2f4RHWwrol/xbdJy8jqZ65a99eFgtsYNzi71LHt2vr/lV49f887/AE/pbP5u1D6VhXf4wutZl/VMm1mBjjfTRWRDGvLmYrKmWNspa706vUvu9L1LbP8Ag1s/VT64Ydt+P9Vj0t/TK31vqxgHF0Q11kWttZVbve31Hvu/Sb7fp/vrG+pPU8b6qda6j03rTjikMbWXOa53uqLnU6VNf7Mii71arPoJa6q7Oj9Qeq52B1/L+q+ZkOyKKja3HLySWvodsc2reTsotp/Sej/gn/zX01g/VPpXUOv29Q6SzNfi4dsW5r9bHP2Ptbj0e94/RufY+y//AEnprV+o9D+r/XPO69UxzcOqy+xr3DTfedtdB/4X0HerYz/B+z/SKX+Kgg9T6nB/wbf/AD5Yl3V2Zf4sLsvF611DozrJxqq3ONQJ2NtqtFDn0tP836m/37V0P+Mi22n6qZD6rH1O9WkF1bix0Gxm5u9ha5c79QCD9d+rwfzMj/24Yug/xmCfqlkD/haP/PrEDuobNWj6j43XunY3UOt9QzMzMyaa7Q4WbK6t7GENx8ZrfRZs/lfzv85am+ovUOpY3Vep/VfqN7ss9OO/GvsJLvTnbsc5xc/a5r6bq2O/mfU9Hf6bK1b6F9dPqxX0TGrvz68e7DorrvoullocxjQ7ZS79Jf8AyPQ9Xesn6ovzOp9Y+sH1qxKiKr2OpwWvH849obs7/u0Uep7v5yz00u9p7N7N+o31etuL+tdUy8jJtc54ORlbNC4nbVV7WsrZOxuxVPqpRfj9d699UbMq6/ptNQ9AvefUrFjW7hTaP5r9Hkf4P/C1eqzYsj6oVfUjMwMnO+tF+Pd1Wy1xvdn2gPLQBt9Ntjmb/wCx7/8ABf6Niv8A1CPTP+efVv2Qz0unHGY7ErLXMismqXCu39K1ll3q2M3pd0dnS/xd5uZV+0vq91K112Z0q8w+xznOdW/Tc02bnenvZ6lf/B3VqLrsnrf+Mb7PVdY3p/QaQ+5jHvax97x7GPawta/3Pb9L/uLZWofWVzfq39cMH6zEOGFm1PxOoBgklzWF+O6Pa3e/06f7GOm+q+Pm9N+pHVOv2QOqdSqyeouefHZZZjf2P8Kz/jUvFPg//9H0HL+q/wBXs3M+3ZXT6LsmQTY5gJcR3sH0bP8ArisWdNxm3/bsailueyn0KrnM4rB3tolkObVu/dVxJI6giyoaG3Exv2HR1F+Rdh1YHU7Nxfa9jQX7o3ublAbXtfsV9nSekjOPU68Wn7a+ScoMbvMtFc+p9L+bbsR8jFx8qv08isWN8D2/qn81ZT/q/ZSS7p2U+j/gyTH+cz/vzLFVlPmsf6A5iPeJ9vN/hR/m5/4HA2IxwT/SOGXYj3Mf+DL54t49I6Wc8dSOLUc4cZOwepo30v5z6X837EDqP1b6D1S9uR1DBpyLmiBa5vuIHDXPbDntb/LVT0frRT7W2C0eMsP/AJ8bW5OB9aX6EtZ5n0/++70z7+djy3MX4Y7H+NxLvug/z+Gv7/7OF0h0npgtxrRi1NfghzcQhjR6QeNr20wP0e6PzVUyXelmOZRlUYlmS9o2sq9S17oDGvvhw/d2b3s+ght6N1O/+m5ztvdlROv9r9G3/wACV/E6ZiYTHDFYGWOEG0+5xP8AKKdxZ8wr2jhhd3KfDkl4cGGX/qVAjhxa8Yyy2qMLh/jZf/VbW6Ybsmy45vp3vw7iyi7YAQ7btscz9z2PROpdB6N1Ytd1HDqyXsENe9oLgP3d/wBPZ7voKzh4rMTHbQwl0SXPPLnOO573f13I6mwQlDFGMyZSA1JPEdda4v6rFmlGWSRiAI9KHDt+lw/1kOJh4uFQ3GxKWY9DPo11tDWj+y1BwukdL6e+yzBxKsZ9v846pgaXQS73bf5TlcSUrG08XpHS8PJsy8XEqoyLp9W2tga524+o/c5v7z/csH/GY17vqjkhrS4iykkNBcYFjJMNXVJJWpw+n9B6RndJ6dbn4NN17cWgF9tYL5FbPa9zhv8Ab/LWzVVVTW2qlja62ANYxgDWtA4a1rfa1TSSU5tv1c6BdlHMu6djWZDiS6x1TSSTq5z9Pe7+U5XG4mJXkWZbKK25NjQ2y9rALHNb9Fj7AN72tRkklPnXXOuVfXmzB6B0am70X3Nvz8iyvZ6VTNHRu/P97v8ArvpV1/4RegfZcf7N9k9Nv2bZ6XpR7dkbPT2/ubPaipI2p//S9VSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp//ZOEJJTQQhAAAAAABhAAAAAQEAAAAPAEEAZABvAGIAZQAgAFAAaABvAHQAbwBzAGgAbwBwAAAAGQBBAGQAbwBiAGUAIABQAGgAbwB0AG8AcwBoAG8AcAAgAEMAQwAgADIAMAAxADUALgA1AAAAAQA4QklNBAYAAAAAAAcACAAAAAEBAP/hDeFodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIiB4bWxuczpwaG90b3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUuNSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE4LTA4LTIzVDIzOjM1OjMxLTA3OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDE4LTA4LTIzVDIzOjM1OjMxLTA3OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAxOC0wOC0yM1QyMzozNTozMS0wNzowMCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpkY2ZmMGFlYy0zZTI1LTQ1NDctYmMyNi1mMDljNGQxMmVhNmMiIHhtcE1NOkRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDplNWRkYzRkMC1hNzY3LTExZTgtODAyYS1iMTUzYWVhOTFiMWEiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5N2YwNmQ2Zi1lYjgxLTBmNDMtOTIyMS1kMjlmYzc1YjU1NWMiIGRjOmZvcm1hdD0iaW1hZ2UvanBlZyIgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249ImNyZWF0ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6OTdmMDZkNmYtZWI4MS0wZjQzLTkyMjEtZDI5ZmM3NWI1NTVjIiBzdEV2dDp3aGVuPSIyMDE4LTA4LTIzVDIzOjM1OjMxLTA3OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNS41IChXaW5kb3dzKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6ZGNmZjBhZWMtM2UyNS00NTQ3LWJjMjYtZjA5YzRkMTJlYTZjIiBzdEV2dDp3aGVuPSIyMDE4LTA4LTIzVDIzOjM1OjMxLTA3OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNS41IChXaW5kb3dzKSIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD94cGFja2V0IGVuZD0idyI/Pv/uAA5BZG9iZQBkQAAAAAH/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQECAgICAgICAgICAgMDAwMDAwMDAwMBAQEBAQEBAQEBAQICAQICAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDA//AABEIADwAtAMBEQACEQEDEQH/3QAEABf/xAGiAAAABgIDAQAAAAAAAAAAAAAHCAYFBAkDCgIBAAsBAAAGAwEBAQAAAAAAAAAAAAYFBAMHAggBCQAKCxAAAgEDBAEDAwIDAwMCBgl1AQIDBBEFEgYhBxMiAAgxFEEyIxUJUUIWYSQzF1JxgRhikSVDobHwJjRyChnB0TUn4VM2gvGSokRUc0VGN0djKFVWVxqywtLi8mSDdJOEZaOzw9PjKThm83UqOTpISUpYWVpnaGlqdnd4eXqFhoeIiYqUlZaXmJmapKWmp6ipqrS1tre4ubrExcbHyMnK1NXW19jZ2uTl5ufo6er09fb3+Pn6EQACAQMCBAQDBQQEBAYGBW0BAgMRBCESBTEGACITQVEHMmEUcQhCgSORFVKhYhYzCbEkwdFDcvAX4YI0JZJTGGNE8aKyJjUZVDZFZCcKc4OTRnTC0uLyVWV1VjeEhaOzw9Pj8ykalKS0xNTk9JWltcXV5fUoR1dmOHaGlqa2xtbm9md3h5ent8fX5/dIWGh4iJiouMjY6Pg5SVlpeYmZqbnJ2en5KjpKWmp6ipqqusra6vr/2gAMAwEAAhEDEQA/AN/j37r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvdf/Q3+Pfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691/9Gyb5P/AM4L58fJL5rbx+EX8rLZO3qet6/zu6Nt1+/svhdsZnc+46/YFW+L37umWo7KdOutk9e4XNBqOmNVS1VZXukMsc4esiolOYbG3igFxeMaEcPT9mTX/UOiiW8uJZ2gtFFR5/Zx44A6Db46fzj/AOY58YfnNtT4cfzKMHt3d0e6t8bK2FuDIw7Z2Lt3d+zJexqjF0ezd77dz3VyYvYO6dms+agqK6NqOaoamEgjmhqIJKd7y2NrLbtPamlATxNDTiDXNfTqkd7cxTiG6AOQPmK8DjBHRuP57P8AM9+V/wADO3fj7s7487m2jt3Ab72DuXc26v7wbGxG7qurr8fuiixlM0UmWe9PT01CjgRwmEu0rFnJ0FGNvs4bmOVpAag0Gfl09f3U1u6CMgAj0r1WZ8sP50384XYu59i/IvEddy/HX4udpyx5Lo3aO+On9t7h2j2Htylp46+gk3ZvTMYht7tk914oiv8AHjsngzNj5PLQq0SfdMrgsLJg0ZbVKONDkf5P5fLpLNfXqlZQumI8ARg/aeP+D5dLf5Pfzs/5o3c2wH+TPw56e3X0J8Qtg0e2sHvLtCr6t2r2M2X3/UUtBHvKTNbh3pgtzYDF7LxO6K4YmiONpQ0eiOWtrlqK6Oho6w2FpG3hTyBpzwFaY8sChr5/4PXq0t9dOviwIVhHE0rnz4+XV4f8qz+aDVfL/wCDfZHyJ7+x+H2nuv441m8sb3Jlts0ctNgM3gdl7Mot/DfmKw81ZVyYyWu2zVOlXRiYxfxCjmeERQSxQxl95aeBcLHHlXpT8zSnS+0ujNA0klAVrWnyFa9UwbI/mhfzsf5mm/OzMn/Lv2Btbq3qjruq1CjmwvT1TlqCgyjVdVtbBb33n3ZUZzbmY7FylBTFqimwcVNQ01vUfEFqZV7WlhaKguXJc/b/ACA8vt6QrdX10zm2UBB9n+E+f2dG9/k2/wA4/wCRnyV+RO5Phb8yNvYKo7Rx+J3jU7Z37hNv0m0M6u6OvaqX++Wx9/7bxkkW22rYqCCplparG01D4Wx0kU0MxlWaJi+sYooluICdBpj5HgR09ZXskspgmHdnP2cQeha+fHZP8+bA/K/fmD+EPWOE3D8bEx+wo9hZmuxPRcwqMhV7Sw8u75azJb73Ri83B4N4T1kTtVLFBDDCrLaP9x6Wy7cYVNw362a8fy4dXuG3ATMIErFinD8+PVT/AMIv5yn81n5G/Nnon461G5dhbzx2e7gweI7MxO3es9iSUkfW238ys/amX/vVgYXp6XFYbaFDXVEeQpKrTLJHEKd5WlijlW3FjZxQSSaSCFNKk8fLj8/LpJBe3ck8cdQanOBw8/5dWQ/zZ/5x3e3TXyP2v8CvgRtbD7k+Q2aqdsYfeO88rhaHddRhd3b/AP4dJsbrrrzb9bXrganeE9HXw1mVrc1BNjqCnq6eJYZJHqJaNJZWMUkRublqR+Q4YHEn/Y6U3d7Ikot7dayevzPAD/Z6KXt/+bp/M8/l0/JvYXUH81jb23d7dcdg0WLzuQ3Hgtv9c0m69vbRylTXYY7r2PmuoIsLsvcK7azkB/jGIr6R65qeBjBLEZadqh82VpdRM9maMPt4/Oufs6ZF5dW0qpdgFT9nD1FMH5jo5v8APa/mcfJz4N5b4uQfF7duysXhe3ts9k7gzuTzG0cPvNMrHg6nYibdqcZU5IVFPBQfabhmlvChM2tSWIAHtjb7SG4E3jKaqR509en9wupbcxeEwowPlX06rG+W385/+bZQnaHym6q2Rmug/hZvPK47b/Ulfu3pvZuaxXaElBjlqqjK7q3DuvC5XcNO2+JqGuq8aMXNiKSXGIVpJKl6easdXDYWXdC7argDOTj/AIrpLNfXeJUXTATjHH/i+tq7+Xh8tl+cXw/6d+SNRg6LbGf3risrj957dxslVJi8RvXaOeye1Nzx4g1rzVaYWvymHesoY5ZZ5oqOpiSSWWRWdie6h+nneKtQOH2HPRtbTePCktKE8ftGOiE/zmv5lHdv8u7NfDqq6m2ztPdmC7a35vmDsvA5zC5DKbgzu3NkzdbBdu7OqqPLY+LDZjNU28atEqJIaorVJTkIUEqSKLC1juhPrJBUCn51/wA3Se9untjBoAIYmv5U4ft6CXsqu/4UadsQ5TtHqvE/Fn40bbUZDJbU+OuQy+197dq1WISaaow2H3Xu/cm092bEqt3VtEY4ppYctgKITfripfUFug2tKI5dz/FkD/Iafkfz6ox3J6ugRR6cT/mr+Y6HL+UN/NN3b85z270X8h9iYnq35ZfHmrNPvrbuHhrcZit14SlzVXtbLZui25lqzIZXbmf2humjGOz9Caiop4amqpZoZFWq+2pm72zW38OSJtULcPl/xY4dOWd2Z9ccq0mXj/g/kcHps+Q9b/Pj7L7l7O2/8ZcR8Uvj10ZtjdVVh+s98djV9PubfPYm3aenpPHurIUtPS9o0WMhrqppTFTTYXF1ECjRIkthLJuIbckaGUu0hGQOA+Xl/hPWpP3g7sItCxg4rxP+H/B0S7b38xH+aB8CvmZ8ffjf/MqXprtvrL5KZ7D7c252l1hjKHFVODqM1ncftRcviazCYLZMNTSbX3BnKI5mgyWBSoajmWalqOLSPm1tLmCWW01K6Dgf9R/Kh6ZFzdW88cV1pZW8x/qHDzx0bHvX+Y78jvi9/N26Z+J/btF1sfiJ8kaPbkHWe7afbuSoN5YrM7rx1TtLGUOT3I24psXV1tJ3JjEpamNqONUxOWppjpazFmO1imspJkr46VqPLGa/s/n07JcyxXiQvTwW4eucf4f5dXL919r7Z6J6f7P7p3nKYtq9VbC3Vv8Az2lxHNPjtq4WszM9HSkq+qtrhSeGBQrF5pFUAkgFAiGR0ReJNP29LncRo7twAr1qj/8ADvP81j/hvz/hw7+7nx1/0ff7Mj/o0/uj/o13V5/7hfafw/8AvN/Ev7/6/wCD/wCkH/fv+b/gR91+5+j2c/RWf1P02ptWmta+f/FfLoo+su/p/qaLp1U4eXrx9cdf/9I9WT/mj/NX5+fPXc/xx/lhbf6W6PxNG27aJu/N4bF2tmt+5rZW06qlpN0dh7vzmawu8KLHbUyecWA4fF0GKrMhL9zSyVMgkkeKiO/o4La3Et2WY/w1NK+g4Z/lx6Jvqpri4Mdqqr86CtPU8cdVQfNrrz5D9XfzZ+oNo/KXvTHfIjuGl3v8YavN9jYvbtDtWjlxtfntuVOIwkeFx1BjKSnXD0j6A6wRmYMJGAZj7WwNG9k7Qx6Uo1B0knWRbxFlk1PVc9H9/wCFVPPyB+KY/r05vX/3tYPabZ/7Kb/TD/B0o3b+0j/0v+U9HW/4UQUlLD/Km+JEcVLTxpR9xdGwUYSJB9pCPj/2hGIaY2vDGY0VSFtdRb2n2yv1k2fwn/jw6e3L/cSH01D/AAHqd1nS0tN/wl1yqQU0ESTfH7tiqmVI0VZamo793fLPUSAAa5pJTqLHm/vzf8lcf6Yf8dHW0/5JR/0p/wAJ6CH/AITu90bG+Ov8uT50929kpO+yeq+0czv/AHM1DSR12cyGKxfUO02G2cZTzTU9JVSV9RQeKhglaNDW5CTySrG9477nG0t1bxp8TCn8+qba6x208jfCDX+XSU+Gvyt/m1fzUt79u5L4j7r+O3wP6Q2fmcNJu6r251vtrcNfJlM1DUfwDDrl87sjP5rsLeC4fGE11eIdv0IghS0dOZYqdrTw2VmqCZWkkPDP+zgft6rBLeXbOYWWNBxx/sZ/l0RX+TLitz4D+eXV4Tem6It771w+6PlrhN4b0ghWni3huLH4bflPuLcsVMqotPDn83RtWBAq6PIF4HHtRfEHb6qKLRaD04dMWQIv6MatVvz49XCf8KHv5nx6J66n+EvSG5pKTuTtvAfc9x7jwVbC1d1p1JlEVG2pIY45ZaHdXbOPlkiFnjqaPBCWYKrVlHMEO2WniN48i/pjhXzOc/kfyr9nSzcrrw18CNv1CM/If7P+DoW/+E/XwO60+MPSGR7fz24uvt3fKPt/D0Mu8qPam7tt7uqunOtqh6XKbb6ykfB11eMZmsg4gyO4CGVZK77elvIlBHLJTcrlppAgBEK8KilT6/5v9nq+3W6xR6yQZW40zQen+f8A2OqOOspKum/4Uu5Nt8kio/2drtmOjNf/AMqtZjN5RdeiPy34bG1GMFNb8FLWNrGD/wDJKGn/AH2P8lekKV/efdx1n/LTo2H/AAq7XGf30+E5UQtlZNq98rXKuk1DYyPK9UnHCUCz+E1MtWI78Fi9vz7Z2eumf0qP8vTu701QetD/AJOijfzvjuaT4qfyZ23p5jumT4aKc41TcVbVjbL6LLmsPpYVxQjzX9QlLX59vbfp8a+0/Dr/AMp6Zvq+FZauOj/IOreP5yuNoMd/In+PuPoaOnpaHF4z4h0+OpYIY4oaKGn2BFSwx00aKqQrHTkoAoFlJH0PtFYkncZanPd/h6WXwAsIv9r/AIOjZ/8ACdkn/hrfqQX4Xf3c4Uf0DdkZ1yP9i7k/7H2zuf8AuZJ9g/wDp7bf9xE+0/4eiCf8Kdf+Pj/lvf8AiTe4P/c7of2p2jhdfYP8vSfdONr9p/ydbYHsm6N+tR/4cxRT/wDCmD5kTbMVHwdLtHtBt0NQhTTpKcP1RTbh+6MJ0CT/AEhuiy6ufufr6vZ1P/ySoNXGo/y0/l0Tw/8AJUm08KH/ACf5eh4wH8yX+Y3/ADGfkb3T1d/LJ210P1j0Z0BnRgNxd698QZbMz7prZclm8Ziq+Ckx1Pmvscfu5cBV1WMx1LhqqrhpKdZq6tpmqEpkbNra2sUb3ZYyMOA/1eXnn7PXpwXNzcyOlqFEanif9R4+WPt6rW/mi0H8wXD/ACz/AJZuH+eeb+N2666i7gd+sN2/Hqm3jQvmKSbtPpo7rTflDurHYWnpa+jePGfYfYUUMRiebyM8guqq0+mMN2bcMBpyGp6GlOk119QJrUXBU92KfaK16uU/4UR/FzIdv/DTHfIbYkNVTdsfD/ddP2bhszilCZul2Dk6nG0O/PsKlAk9O+AqqLFbgMokXwx4WQqCxFkO2TaJ/Cb4HFPz8v8AN0s3KLXAJF+NDX8vP/P+XRQv5onzyzXyo/lV/CnZPUsRre3v5k25djbJm25iquGKR8lsLPYnGdpbfozH4nkpk7uTF4cnRHE9PO4k0htBetLcQ3k7P8EQJr9vA/sz0zd3BmtIFT45SB+zj/PHV4f+yEdcf8N1/wDDfGuH+5v+gL/RH/HPt2v/AHp/hP3P+kL7a9/4j/pC/wBz2j6fc8Wtx7QfUt9V9T56q/l6fsx0v+nX6b6f8Omn+z+3PX//0zDY/wDlE/zYv5fPzQznb/8AL/wm0uxdqVVburG7O3bUbt6zoaJuud2Vwq/7ldmbP7J3Dtqt+8x0VLTeabHCoieekinp50c+JD83tlcwBLkkNiooeI8wR0R/R3dtMXtgCPy4ehr09/IP+QH/ADF+7uxOp/kDvj5AbL378he5991WT+TG6YK8bexPQcePFJJsbceyK2nTCVu88dt7b2HjoDQYigoJMdkko4KKOWgE2Qg1HuVrGjxiOkSjHz9a+n58eJz16TbrmRkkaQGVj3fL0+38vy6OZ/On/lY/Mn5v7m+LGc6Vn2h2tP1d0rWbJ7B3tuPcm3Ovanc27WyOLqp9yQYF5Xx9LHuaSOar8NJJJBTMxjB0hCyTatysvAaaOVWgkIZSp1KVPAhhUEehqa9KtxsbppFjKESIKMG7SCONQeB+XRxP5wHwN+QfzF+CHRfQfR+L2xmOxuvOyertybhos3uej27jTidsdXb32bmJ6DK5GNKapeny24KdljOh5IdTKCRpNLK4iguJJZCdJB/wg9XvbeSaCNIx3gj/AAEdZtn/AAV+QWG/kc1fwXrsPtxfkLP0vvfaqYKPc+Pk2+NwZ/szcG88fjW3QP8AcUHOLyMcby6jTrUXXyFB5PfmuIjuH1AJ8LUP8FOtrbyCx+nIHiaSP2nouv8ALe/lId3db/y8/mh8O/lBJgtg5n5JZ7KDbeY2lncdvcYKFtj4DHYLc1VFQyU9LUpjN14uOZ6Izwy1EMDJrh1rIHbq9je5gniqQn5efD9nTVtZyLbTwy4LHy+zqtf4g/y7/wCfx8IM72n1H8d8d1fsfZ/bpx+P3T2lWdgdYbn69x9bjEq8fj9/7STMrP2fichQ0WQnRW/uutTLCyNLQtLDB4lU9zttwEeUklfKhr9h8v5/n0lhttwgLJHQKeJqKfb6/wAvy6Hv4sfyCPl58Yv5ifUPcm3fkPhz1b11Dh+y9yd4R0iVW8d47iylJVYbs7pqTYGVy1ZXVEm9Ia/IU8uarZ5aOLD161gaTKRfZK3LuUEts6GLvONPl8jX5enr8unItvmiuUcSdgzX1PmKfPP/ABfT38sv5F2L74+ZHyL+Q3yS+aHXnSm1u0uxKvdGwtoYbHnePYGT2l/DcZjcfLmZdz5vaMOBmx/2X28dPR02agjghjUSoLIkc83+93tX7YxWtrzzz1tW2XjR6liubqGKZ1rTWkJYzOtRQssZUHFehdsPtjzxzrLcXHLXLN9e24eheGCSRFaldLyAeGhpkBmrTy6RHV38gMbD7f6u7p+Efz72/vDcXVvY2xtz53b+YxdbsTcVLtah3JQTbjaj3ZsXcG4q7Vk8JHU06UVThoKKv1NBLULG723yP74+1vumt/DyJzjt26ywIDKlvOkkkatgO8R0yKhOA5XSTgGo69zL7X878jvaS8z8v3likjURpoXRHIyVSTKMwGSoNQMkUPRtP5tv8mzuzvH5DbX+dvwN3LgtqfInB1O2M1vHaeUza7Zqtx7z6/OOXYfZWw9x5SKt25i954yhxVLRVdBX/ZYutipIahplnFQtWP7K+jjiNtcgmI1/YeIPnToL3lk8kguLcgSin5086/sxjoo20f5QP8zP+Yb8m9kdz/zXd2YXavXmxKXF4fI7ZxO4OvKzd25drYaeqykWztl4LqIZDYe08fuLNSu2ZylVULkDBO4gid/C9K+17aWsRjsxVj9tPzrk/Z0wtndXEqvdmij5iv2CmB8+jo/z2v5Y3ya+c2W+L9R8YNq7KyOG6h2x2XgM7jMtuzDbMXFx5yfYsu3KXE0uRWCjmovttvTRKsTAQlFBCqQfafbruG3E3ik1Yjyr69P39rLOYfCAooPy9OjO/wAyf4Od+fJX+WB1p8V+qcZtrK9ubRg+P8OVx+S3JSYXCyHr7b0GF3K9Fm8gkVLKlPUXkj1hDNEpKjXpQtWtxHFdvM5Og1/n07dQSS2qRIO8U/l0OH8oD4tdt/Df4M9fdFd34/DYvsPA7q7HzGUoMDm6XcOPgo9ybzyuXxWnKUQ+1mlloKhHZULaC2knUCA3ezJPcvJGe0gfyAHTlnE8ECxyfFU/4eqa/wDhUVQvk67+XhjYq6rxcmQ373ZQx5KgJWuxz1c3RdOldRMJYCKukaTyRnWnrUeofX2v2jAuj8h/l6Rbrk2wr5n/ACdGe3tsj/hRp1bS5HqTq7tL4xfIDamqfEbQ+Rm5cNt3anbNBgFIpcTld27azRotrpuako9LT/7j9z+SRS8lTVSMWZlW2t6O6Orea8R/xX7OnWXckBRHRh6+f+r9vRpf5TP8req+A2D7K7N7i35SdvfLDvyvGS7U37RPkazEYahevnzlRtfb2XzkVPntwzZfctbNksxl6qCikylV9uDSxilV5Wb28FzoSNdMC8B/q+XAdO2dp9OGZ21TNxP+r+fVbnXP8vj+a9/LJ+RPfma/l4YzoHvPoHv3PxZeLb3b+cfG1+1aOiyOYyG2o9wY6fdGwK6PcWz13LXUArcZkq+my9FpqKimiqClPTKmubO7ijFyWWRR5efr5ef2Cn8ymW3u7WWQ24Vo2Pn/AKhw/n07/IT+Vb/NJ+WPanxP+RPyM756H3lvnq/tzFZ3MdQbOpMhszrHpfrek3PtDctXT7FzR25WZ/f+687Lg3OSfIgPE9PTww1dVAqvF6K8s4UmiijYKV4nJJoePoOtyWl3M8Mksilga04ADHD162ed17XwO+Nrbl2VurGwZnbG78Bmdr7jxFUC1LlcDuDHVOJzGNqQpVjBXY+rkicAg6WPsoUlSGU5B6NCAwKkYI60ov5J3xLye+/5kXYdDkN61naPxw/lqbt7hxvT2QqKivrdqSb23tvjcW3dn1+34ZaanoIZspRYfI7iqigUfxGipZow6Mrg+v5tNqp00llAr60ABNf8HRHYwlrlgTWOImn21x/n63fPZB0e9f/U3+Pfuvde9+690UHeXTnaXW9VWbs+L+4KLHQVFTU5LM9Jbo01HX2YqqmWSrqp9pmaenOzK+tqpHaWCnnpKSZ3B8kCppfDfnX2Y91/bS6vObvuscxw28DyvNccs3x17TcO7NI7WGt0/dsskjEvFDLbQSFhSWBE0PkRy37jcic5wW+we+W0SzSoixw71bdt/CqgIq3elW+sjRQAryJLKgWmiUtqUNMJ8+sLt/KNtTvfrPeXVm6aQBKwx0UmVxbWuorFpp1oczFR1LKTE0MNbGy2IlZTq9xfsf8AeD7Ly7urcpe/ntfvPKvNcOJdMZnh9PE0OIbhY3oTGY0ulYZWVwQxGu5/dN3Ld7Eb97Vc7bbvuxSZSriKX/SFlLwl1wGDvCwNQY1OOjJ7a+Tvx/3YkLYftnZivOoMVNmcrHtusYn+x9luJcVVeQf6nRf3k3yx96b7vHN6wnZvd3ZQ8g7UuZxZSH5eHeCB9Xy016hbevY/3b5faQbj7f7kVQ5aGI3Kfbrt/FWnzrToUqfeW0KtFkpN1bbqkYAq9PnMZMjA/Qq0dUwIPuVrbnbky8QSWnN22SxnzS6gYftWQjoCzcucw27FbjYb1GHk0Eqn+ajqHkOwtg4mN5srvjZ+MhjBLy5DcuFoo0A+pd6mtjVQLfk+0e4+4/t5s8bTbtz5strCOLTXttGB9peVR0os+UObNwdY7DlfcZ5DwEdtM5P2BUJ6A/dvzK+OW0Y3M/Y+NztSuoJRbSp6zckkxX6hKvGwS4pP8DJUIp/B9wTzf99X7tXJ8Tmf3KttwuRWke3pJeMxHkJIVNuPkXmQHyPUocv/AHb/AHl5hdRFyZNawni92yWwH2pIwlP2LGxHmOgA2juSD5B7zG4+tPitsaLa2VzcFfuzt/u7buPrajL0AkigyMG3aGnhq6qsyzUVMUgMNbU0kUoVZ1iXk49cncywfeI52HMnth90/YU5Vu75Zdw5g5ms4pXuItSrMlpEiu8lwY0KxeFcz28cmlZ1iTuMtcw7NL7RctHZudffndG32C1aO02nZbiRFhkoWja4diipEHYM4eGOV1qYjIcBV/FfY2C/0y/I3tDaWFoMDseo3MvXmzaTEUcdBiKn+7rQ/wB7a7FU0McNOmNlzNJCYmhXwmRpVW2gj2Lvuncg7EvvT95H3T5S2SDb+RJdz/dO2xwRiK3kFow+ult0UKghaeOMxmNfCLNIqEaCoIffjmndf9bf2b5G5g3KW75oSxO4XjyuZJl+or9IkrEljIIXfUHOsKI2NdVej6e+gHWKPXvfuvde9+691737r3XvfuvdUsfze/5anbv8wvK/E2v6r3z1xs2PoXe+8s9uxOwKjc9O+UxO66rrmZG27/dzbu4FqcjQpsua8NSaWKQzJ+8tmIX2V2lqJg6k6gKU+Vf8/SG8tXuTCUYDSTx+dP8AN1dP7QdLuve/de697917r3v3Xuqgf5hPWP8AN77C30MP8Ee6+h+uelN2ddUe19xjfED43sXa28KnI56LcO5sJuCPr/d1TTUNZt+soo6aeklatpJ4ZHhhilCTsttnslWtxGxkBrjhT9o6RXKXjNS3kUIR58a/sPQ1fyxP5fu1/wCXT8aMd0/RZyHevYm5sxNvzuTsGKkekh3Tv7JUNFQ1FPhYqnXkafaO26ChiosZFUSPMY43qJAs1RKopd3JupS9KKMAeg6ctbcW0QQGrHJPz/zdWKe0vSnr/9Xf49+691737r3XvfuvdJHeWwdk9h4z+D742tg9044azFT5rHU9aaWSRdDz0M8qGox9SUFvLA8cgH0b2Dudfb3kb3G2v9zc98p2G67cK6VuYUkMZYULRORrhemPEiZHHk3Qh5b5s5m5Qvv3jyvvt1YXmKtDIyagDUK6g6ZFr+Fwy/Lome7/AOXT0ZnpZqjblbu/ZEshJjpcblYcxiYr3uPts/S1+SYX+gFYoHvCjnH+7a9ht/lmueWr7edimY9scM63Nuv+0uklnP8A2UjrJHl7743ultSRw7zbbdukY4tJEYZT/toGjj/6onoIJ/5X9Azk03dFXFHc2WfYMFQ4H+Mke8KVSbfnSPcOT/3V9gzk23vdMkfo20q5/aNxQfy6kSL78l2FAn9tY2f1W/ZR+w2jf4enrDfyxtnQTI24O1Ny5SAEaosPt/FYKUji4SetrNxKhI+noNvZ3sv91vybBOrcxe7O53VtXK21pBasfseWW8A/3g9Fu5fff5jljYbRyHZQSngZriWcfmqJbk/70OjNbA+Gfx76+lgq6TY8G5spAQUym9qhtyyalsUkGMqlTb8U0bDUskdGkityDwLZRe3v3KPu6e3csF5acipum6x8J9zc3pr5HwHAtFYHKutsrg0IaoFIR5t+8j7vc3pLb3HNDWNi/GKyUWwp5jxFJuCCMFWmKkcRx6ND4YxD9uqCOER+FUivCEj06AkZiKGIKvC6bafxb3lT4MQh+nVNMOnSAvbRaUoummmgwKUp5U6gzxHMnis1ZNVanNTWtTWtanjWtfPpq29t3B7TwmM23trF0WEwWGpY6LGYvHwrBSUdNHchIo1+rMzFnZiXkdizEsSSVcu8ubFyjsm28t8s7TBY7DZx6IYIUCRxrUkgKPNmJZmNWd2Z2JZiSv3jeN05g3O93rer+W53W5kLyyyHU7sfMk+goABQKoCqAAB08+zrot697917r3v3Xuve/de697917r3v3Xuve/de697917r3v3Xuve/de697917r3v3Xuve/de6//9bf49+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3Xvfuvde9+691737r3X/2Q=='); } .section-config.with-button.amazon-payment-section .config-heading strong { font-weight: normal; } .complex.amazon-payment-section .button-container { float:right; } .complex.amazon-payment-section .amazon-payment-byline { display: inline-block; vertical-align: middle; width: 50%; } .simplepath-wrapper-set.active .admin__collapsible-block { display:none; } .amazon-payment-section.section-config.active > .admin__collapsible-block + input + fieldset { margin-left: 40px; } amazon-pay-and-login-with-amazon-core-module/view/adminhtml/.htaccess000077700000000177151323541140021673 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/frontend/templates/config.phtml000077700000001466151323541140024252 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ ?> <?php if ($block->isExtensionEnabled()) : ?> <script> require (['uiRegistry'], function(registry) { registry.set('amazonPayment', <?= /* @noEscape */ \Zend_Json::encode($block->getConfig()); ?>); }); </script> <?php endif ?> amazon-pay-and-login-with-amazon-core-module/view/frontend/templates/amazon_payments_mark.phtml000077700000001616151323541140027221 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /** * Show Amazon badges widget if badge enabled */ ?> <?php if ($block->isBadgeEnabled()) : ?> <div class="amazon-payments-mark-container"> <div class="amazon-payments-mark _grad"> <span class="text"><?= $block->escapeHtml(__('Amazon Pay')); ?></span> </div> </div> <?php endif; ?> amazon-pay-and-login-with-amazon-core-module/view/frontend/templates/.htaccess000077700000000177151323541140023533 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/frontend/layout/default.xml000077700000001727151323541140023424 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="content"> <block class="Amazon\Core\Block\Config" name="amazon_config" template="Amazon_Core::config.phtml" /> </referenceContainer> </body> </page>amazon-pay-and-login-with-amazon-core-module/view/frontend/layout/.htaccess000077700000000177151323541140023052 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/frontend/.htaccess000077700000000177151323541140021535 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/view/.htaccess000077700000000177151323541140017716 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Client/ClientFactoryInterface.php000077700000001721151323541140023460 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Client; use Magento\Store\Model\ScopeInterface; use AmazonPay\ClientInterface; interface ClientFactoryInterface { /** * Create amazon client instance * * @param null|int|string $scopeId * @param null|int|string $scope * @return ClientInterface */ public function create($scopeId = null, $scope = ScopeInterface::SCOPE_STORE); } amazon-pay-and-login-with-amazon-core-module/Client/Client.php000077700000002567151323541140020320 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Client; use AmazonPay\Client as AmazonClient; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Client extends AmazonClient { /** * Client constructor * * Changes variable name from config to fix an issue with M2 DI compiler * * @param array $amazonConfig */ public function __construct(array $amazonConfig) { parent::__construct($amazonConfig); } } amazon-pay-and-login-with-amazon-core-module/Client/ClientFactory.php000077700000006411151323541140021640 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Client; use Amazon\Core\Helper\Data; use Magento\Framework\ObjectManagerInterface; use Magento\Store\Model\ScopeInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ClientFactory implements ClientFactoryInterface { /** * @var ObjectManagerInterface */ private $objectManager; /** * @var Data */ private $coreHelper; /** * @var string */ private $instanceName; /** * @var LoggerInterface */ private $logger; /** * ClientFactory constructor. * * @param ObjectManagerInterface $objectManager * @param Data $coreHelper * @param LoggerInterface $logger * @param string $instanceName */ public function __construct( ObjectManagerInterface $objectManager, Data $coreHelper, LoggerInterface $logger, $instanceName = '\\AmazonPay\\ClientInterface' ) { $this->objectManager = $objectManager; $this->coreHelper = $coreHelper; $this->instanceName = $instanceName; $this->logger = $logger; } /** * {@inheritDoc} */ public function create($scopeId = null, $scope = ScopeInterface::SCOPE_STORE) { $config = [ $this->coreHelper->getClientPath('secretkey') => $this->coreHelper->getSecretKey($scope, $scopeId), $this->coreHelper->getClientPath('accesskey') => $this->coreHelper->getAccessKey($scope, $scopeId), $this->coreHelper->getClientPath('merchantid') => $this->coreHelper->getMerchantId($scope, $scopeId), $this->coreHelper->getClientPath('amazonregion') => $this->coreHelper->getRegion($scope, $scopeId), $this->coreHelper->getClientPath('amazonsandbox') => $this->coreHelper->isSandboxEnabled($scope, $scopeId), $this->coreHelper->getClientPath('clientid') => $this->coreHelper->getClientId($scope, $scopeId) ]; $client = $this->objectManager->create($this->instanceName, ['amazonConfig' => $config]); if ($client instanceof LoggerAwareInterface && $this->coreHelper->isLoggingEnabled($scope, $scopeId)) { $client->setLogger($this->logger); } return $client; } } amazon-pay-and-login-with-amazon-core-module/Client/.htaccess000077700000000177151323541140020162 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/i18n/es_AR.csv000077700000012777151323541140017444 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/es_CL.csv000077700000013000151323541140017414 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/es_PA.csv000077700000012777151323541140017442 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/it_IT.csv000077700000013034151323541140017446 0ustar00"click here to display the categories","clicca qui per visualizzare le categorie" "No Simulation","Nessuna simulazione" "Authorization soft decline","Autorizzazione non riuscita" "Authorization hard decline","Autorizzazione negata" "Authorization timed out","Autorizzazione scaduta" "Capture declined","Acquisizione negata" "Capture pending","Acquisizione in sospeso" "Refund declined","Rimborso negato" "Synchronous","Sincrono" "Asynchronous","Asincrono" "Synchronous if Possible","Sincrono, se possibile" "Gold","Oro" "Light Gray","Grigio chiaro" "Dark Gray","Grigio scuro" "Small","Piccolo" "Medium","Medio" "Large","Grande" "Extra Large","Extra large" "Login with Amazon / Amazon Pay","Accedi con Amazon / Amazon Pay" "Login / Pay","Accedi e paga" "Amazon Pay Logo","Logo Amazon Pay" "Charge on Shipment","Addebito al momento della spedizione" "Charge on Order","Addebito al momento dell'ordine" "Euro Region","Area euro" "United Kingdom","Regno Unito" "United States","Stati Uniti" "Japan","Giappone" "Data Polling via Cron Job","Polling dei dati tramite Cron job" "Instant Payment Notifications","Notifiche istantanee di pagamento" "Amazon Pay","Amazon Pay" "General","Generale" "Credentials","Credenziali" "Merchant Id","Numero venditore" "Access Key Id","Numero chiave d'accesso" "Secret Access Key","Chiave d'accesso segreta" "Client Id","ID cliente" "Client Secret","Chiave segreta cliente" "Credentials JSON","Credenziali JSON" "Payment Region","Area pagamento" "Sandbox","Sandbox" "Allowed Javascript Origins","Origini JavaScript consentite" "Allowed Return URLs","URL restituiti consentiti" "Options","Opzioni" "Enable Amazon Pay","Abilita Amazon Pay" "Enable Login with Amazon","Abilita Accedi con Amazon" "Payment Action","Azione pagamento" "Authorization Mode","Modalità autorizzazione" "Update Mechanism","Meccanismo di aggiornamento" "Amazon Pay button is visible on Product Page","Il pulsante Amazon Pay è visibile sulla pagina prodotto" "Advanced","Avanzate" "Frontend","Front-end" "Button Display Language","Lingua di visualizzazione del pulsante" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Imposta la lingua dei widget e dei pulsanti. Viene utilizzata la lingua del sito dell'utente come impostazione predefinita. Per trovare le opzioni disponibili, clicca <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">qui</a>." "Button Color","Colore pulsante" "Button Size","Dimensione pulsante" "Sales Options","Opzioni di vendita" "New Order Status","Nuovo stato ordine" "Sales Exclusions","Esclusioni dalla vendita" "Is Packing Stations Terms Validation Enabled","Convalida dei termini per le stazioni di imballaggio abilitata" "Packing Stations Terms","Termini stazioni di imballaggio" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Elenco di termini senza distinzione tra maiuscole e minuscole e separati da virgole che saranno utilizzati per verificare se l'indirizzo del cliente corrisponde a un locker o a una stazione di imballaggio." "Excluded Categories","Categorie escluse" "The ""Amazon Pay"" button will not be available for products of the selected categories.","Il pulsante Amazon Pay non sarà disponibile per i prodotti delle categorie selezionate." "Developer Options","Opzioni sviluppatori" "Logging","Accesso" "Allowed IPs","IP consentiti" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separato da virgola. I pulsanti Accedi con Amazon e Amazon Pay saranno resi disponibili <em>solo</em> per i clienti che dispongono degli IP sopra indicati. Se il campo è vuoto, i pulsanti saranno visibili a tutti i clienti." "Module version","Versione del Modulo" "--","--" "Amazon Pay button in minicart","Pulsante Amazon Pay nel mini-carrello" "An unsupported currency is currently selected. Please review our configuration guide.","È attualmente selezionata una valuta non supportata. Consulta la nostra guida alla configurazione." "You will be registering for a %1 account based on the base currency of your shop (%2).","Effettuerai la registrazione per un account %1 in base alla valuta principale del tuo negozio (%2)." "Get started with account registration","Inizia la registrazione dell'account" "My account is ready, I need to connect it to Magento","Il mio account è pronto, devo associarlo a Magento" "or","o" "I've already setup Pay with Amazon, I want to edit my settings","Ho già configurato Amazon Pay, voglio modificare le mie impostazioni" "Back to register or connect an account","Indietro" "Updating your config with new keys, please wait...","Aggiornamento della configurazione con nuove chiavi in corso. Attendi..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Per attivare la configurazione automatica dell'account mediante lo scambio di chiavi sicuro Amazon, attiva le pagine di amministrazione sicura in Generale > Web > Utilizza URL sicuri in Amministrazione." "Paste JSON credentials here","Incolla credenziali JSON qui" "Save Credentials","Salva credenziali" "Valid JSON credentials are required.","Sono necessarie credenziali JSON valide." amazon-pay-and-login-with-amazon-core-module/i18n/es_MX.csv000077700000013000151323541140017442 0ustar006 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/de_CH.csv000077700000012776151323541140017414 0ustar00"click here to display the categories","Klicken Sie hier, um die Kategorien anzuzeigen" "No Simulation","Keine Simulation" "Authorization soft decline","Weiche Ablehnung für Autorisierung" "Authorization hard decline","Harte Ablehnung für Autorisierung" "Authorization timed out","Zeitüberschreitung bei Autorisierung" "Capture declined","Capture abgelehnt" "Capture pending","Capture ausstehend" "Refund declined","Erstattung abgelehnt" "Synchronous","Synchron" "Asynchronous","Asynchron" "Synchronous if Possible","Synchron, wenn möglich" "Gold","Gold" "Light Gray","Hellgrau" "Dark Gray","Dunkelgrau" "Small","Klein" "Medium","Mittelgroß" "Large","Groß" "Extra Large","Extragroß" "Login with Amazon / Amazon Pay","Login mit Amazon / Amazon Pay" "Login / Pay","Login/Bezahlen" "Amazon Pay Logo","Amazon Pay Logo" "Charge on Shipment","Abbuchung bei Versand" "Charge on Order","Abbuchung bei Bestellung" "Euro Region","Eurozone" "United Kingdom","Vereinigtes Königreich" "United States","Vereinigte Staaten" "Japan","Japan" "Data Polling via Cron Job","Datenabruf über Cron-Job" "Instant Payment Notifications","Sofortige Zahlungsbenachrichtigungen" "Amazon Pay","Amazon Pay" "General","Allgemeines" "Credentials","Anmeldedaten" "Merchant Id","Händlernummer" "Access Key Id","Access Key ID" "Secret Access Key","Secret Access Key" "Client Id","Client-ID" "Client Secret","Client Secret" "Credentials JSON","JSON-Anmeldedaten" "Payment Region","Zahlungsregion" "Sandbox","Sandbox" "Allowed Javascript Origins","Zulässige JavaScript-Ursprünge" "Allowed Return URLs","Zulässige Rückleitungs-URLs" "Options","Optionen" "Enable Amazon Pay","Amazon Pay aktivieren" "Enable Login with Amazon","Login mit Amazon aktivieren" "Payment Action","Zahlungsaktion" "Authorization Mode","Autorisierungsmodus" "Update Mechanism","Aktualisierungsmechanismus" "Amazon Pay button is visible on Product Page","""Amazon Pay"" ist auf der Produktseite sichtbar" "Advanced","Erweitert" "Frontend","Front-End" "Button Display Language","Anzeigesprache für Schaltflächen" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Steuert die Sprache für Schaltflächen und Widgets. Die Standardeinstellung ist das Gebietsschema Ihrer Website. Verfügbare Optionen finden Sie <a href=""https://payments.amazon.de/developer/documentation/lpwa/201953980#SPRACHPARAMETER_EINGEBEN"">hier</a>." "Button Color","Farbe der Schaltfläche" "Button Size","Größe der Schaltfläche" "Sales Options","Verkaufsoptionen" "New Order Status","Neuer Bestellstatus" "Sales Exclusions","Verkaufsausschlüsse" "Is Packing Stations Terms Validation Enabled","Überprüfung der Begriffe für Packstationen ist aktiviert" "Packing Stations Terms","Begriffe für Packstationen" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Eine kommagetrennte Liste mit Begriffen (ohne Unterscheidung zwischen Groß- und Kleinschreibung), anhand derer überprüft wird, ob es sich bei einer Kundenadresse um ein Schließfach oder eine Packstation handelt." "Excluded Categories","Ausgeschlossene Kategorien" "The ""Amazon Pay"" button will not be available for products of the selected categories.","""Amazon Pay"" ist für Produkte der ausgewählten Kategorien nicht verfügbar." "Developer Options","Entwickleroptionen" "Logging","Protokollierung" "Allowed IPs","Zulässige IPs" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Kommagetrennt. ""Login mit Amazon"" und ""Amazon Pay"" sind <em>nur<em/> für Kunden mit den oben aufgeführten IPs verfügbar. Wenn das Feld leer ist, sind die Schaltflächen für alle Clients sichtbar." "Module version","Modulversion" "--","--" "Amazon Pay button in minicart","Amazon Pay Button in Minicart anzeigen" "An unsupported currency is currently selected. Please review our configuration guide.","Die aktuell gewählte Währung wird nicht unterstützt. Bitte besuchen Sie unsere Konfigurationsanleitung." "You will be registering for a %1 account based on the base currency of your shop (%2).","Sie werden sich für ein %1 Konto registrieren, basierend auf der Basiswährung Ihres Shops (%2)." "Get started with account registration","Registrierung des Kontos beginnen" "My account is ready, I need to connect it to Magento","Ich habe bereits ein Amazon Pay Konto, I möchte es mit Magento verbinden." "or","oder" "I've already setup Pay with Amazon, I want to edit my settings","Ich habe Amazon Pay bereits konfiguriert, zu den Einstellungen." "Back to register or connect an account","Zurück" "Updating your config with new keys, please wait...","Ihre Zugangsdaten werden übernommen, bitte warten..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Um die automatische Kontokonfiguration mittels sicherer Übertragung der Zugangsdaten zu nutzen, aktivieren Sie bitte sichere Administrationseiten unter: General > Web > Use secure URLs in Admin." "Paste JSON credentials here","JSON Zugangsdaten hier einfügen" "Save Credentials","Zugansdaten übernehmen" "Valid JSON credentials are required.","Gültige JSON Zugangsdaten werden benötigt." amazon-pay-and-login-with-amazon-core-module/i18n/fr_CA.csv000077700000013345151323541140017415 0ustar00"click here to display the categories","cliquez ici pour afficher les catégories" "No Simulation","Aucune simulation" "Authorization soft decline","Refus court de l'autorisation" "Authorization hard decline","Refus long de l'autorisation" "Authorization timed out","Autorisation expirée" "Capture declined","Saisie rejetée" "Capture pending","Saisie en attente" "Refund declined","Remboursement refusé" "Synchronous","Synchrone" "Asynchronous","Asynchrone" "Synchronous if Possible","Synchrone si possible" "Gold","Doré" "Light Gray","Gris clair" "Dark Gray","Gris foncé" "Small","Petit" "Medium","Moyen" "Large","Grand" "Extra Large","Très grand" "Login with Amazon / Amazon Pay","Connectez-vous avec Amazon / Amazon Pay" "Login / Pay","Connectez-vous / Payez" "Amazon Pay Logo","Logo Amazon Pay" "Charge on Shipment","Débit lors de l'expédition" "Charge on Order","Débit lors de la commande" "Euro Region","Eurorégion" "United Kingdom","Royaume-Uni" "United States","États-Unis" "Japan","Japon" "Data Polling via Cron Job","Analyse des données via les tâches Cron" "Instant Payment Notifications","Notifications de paiement instantané" "Amazon Pay","Amazon Pay" "General","Général" "Credentials","Informations d'identification" "Merchant Id","Identifiant du marchand" "Access Key Id","ID de clé d'accès" "Secret Access Key","Clé d'accès secrète" "Client Id","Identifiant client" "Client Secret","Secret du client" "Credentials JSON","Informations d'identification JSON" "Payment Region","Région de paiement" "Sandbox","Environnement test" "Allowed Javascript Origins","OOrigines JavaScript autorisées" "Allowed Return URLs","URL de renvoi autorisées" "Options","Options" "Enable Amazon Pay","Activer Amazon Pay" "Enable Login with Amazon","Activer Connectez-vous avec Amazon" "Payment Action","Action de paiement" "Authorization Mode","Mode d'autorisation" "Update Mechanism","Mettre à jour le mécanisme" "Amazon Pay button is visible on Product Page","Le bouton Amazon Pay est visible sur la page du produit" "Advanced","Avancé" "Frontend","Avant" "Button Display Language","Langue d'affichage du bouton" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Contrôle la langue du bouton et du widget. Il s'agit par défaut de la langue du pays de votre site. Les options disponibles se trouvent <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">ici</a>." "Button Color","Couleur du bouton" "Button Size","Taille du bouton" "Sales Options","Options de vente" "New Order Status","Nouvel état de la commande" "Sales Exclusions","Exclusions de vente" "Is Packing Stations Terms Validation Enabled","La validation des termes pour les lieux de conditionnement est-elle activée" "Packing Stations Terms","Termes pour les lieux de conditionnement" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Liste séparée par des virgules de termes ne tenant pas compte des majuscules et des minuscules, qui sera utilisée pour vérifier si l'adresse d'un client est un casier ou un lieu de conditionnement." "Excluded Categories","Catégories exclues" "The ""Amazon Pay"" button will not be available for products of the selected categories.","Le bouton Amazon Pay ne sera pas disponible pour les produits des catégories sélectionnées." "Developer Options","Options pour le développeur" "Logging","Journalisation" "Allowed IPs","IP autorisées" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Séparée par des virgules. Les boutons Connectez-vous avec Amazon et Amazon Pay seront intégrés <em>uniquement</em> pour les clients aux IP ci-dessus. Si le champ est vide, les boutons seront visibles par tous les clients." "Module version","Version du Module" "--","--" "Amazon Pay button in minicart","Bouton Amazon Pay dans le mini-panier" "An unsupported currency is currently selected. Please review our configuration guide.","Une devise non prise en charge est actuellement sélectionnée. Consultez notre guide de configuration." "You will be registering for a %1 account based on the base currency of your shop (%2).","Vous procéderez à l'enregistrement d'un compte %1 selon la devise de base de votre boutique (%2)." "Get started with account registration","Commencer l'enregistrement" "My account is ready, I need to connect it to Magento","Mon compte est prêt, j'ai besoin de le connecter à Magento" "or","ou" "I've already setup Pay with Amazon, I want to edit my settings","J'ai déjà configuré le service Amazon Pay, je souhaite modifier mes paramètres" "Back to register or connect an account","Retour" "Updating your config with new keys, please wait...","Mise à jour de votre configuration avec les nouvelles clés, veuillez patienter..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Pour activer la configuration automatique du compte à l'aide de l'échange de clé sécurisé d'Amazon, activez les pages d'administration sécurisées dans Général > Web > Utiliser des URL sécurisées dans Administration." "Paste JSON credentials here","Collez les informations d'identification JSON ici" "Save Credentials","Enregistrer les informations d'identification" "Valid JSON credentials are required.","Des informations d'identification JSON valides sont requises." amazon-pay-and-login-with-amazon-core-module/i18n/es_PE.csv000077700000012777151323541140017446 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/es_CR.csv000077700000012777151323541140017446 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/en_US.csv000077700000021342151323541140017450 0ustar00"--","--" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station." "A shop account for this email address already exists. Please enter your shop accounts password to log in without leaving the shop.","A store account for this email address already exists. Please enter your store account password to log in without leaving the store." "Access Key Id","Access Key Id" "Action is not available","Action is not available" "Advanced","Advanced" "Allowed IPs","Allowed IPs" "Allowed Javascript Origins","Allowed Javascript Origins" "Allowed Return URLs","Allowed Return URLs" "Amazon authorize invalid state : %1 with reason %2","Unexpected state for the Amazon Pay authoriziation. State: %1, Reason code: %2" "Amazon capture declined : %1","Amazon Pay declined the capture. Reason code: %1" "Amazon capture invalid state : %1 with reason %2","Unexpected state for the Amazon Pay capture. State: %1, Reason code: %2" "Amazon could not process your request.","Amazon Pay could not process your request. Please try again." "Amazon refund invalid state : %1 with reason %2","Unexpected state for the Amazon Pay refund. State: %1, Reason code: %2" "Amazon Pay","Amazon Pay" "Amazon Pay button in minicart","Amazon Pay button in minicart" "Amazon Pay button is visible on Product Page","Amazon Pay button is visible on Product Page" "Amazon Pay Logo","Amazon Pay Logo" "Amazon Pay refund successful.","Amazon Pay refund successful." "An unsupported currency is currently selected. Please review our configuration guide.","An unsupported currency is currently selected. Please review our configuration guide." "Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account.","Are you an Amazon customer? Pay now with address and payment details stored in your Amazon account." "Asynchronous","Asynchronous" "Authorization Mode","Authorization Mode" "Authorization soft decline","Authorization soft decline" "Authorization hard decline","Authorization hard decline" "Authorization timed out","Authorization timed out" "Button Color","Button Color" "Button Display Language","Button Display Language" "Button Size","Button Size" "Capture declined","Capture declined" "Capture pending","Capture pending" "Captured amount of %1 online","Captured amount of %1 online." "Capture declined for Order <a href=""%2"">#%1</a>","Capture declined for Order <a href=""%2"">#%1</a>" "Capture pending approval from the payment gateway","Capture pending approval from the payment gateway. Please check back later." "Charge on Order","Charge on Order" "Charge on Shipment","Charge on Shipment" "click here to display the categories","click here to display the categories" "Client Id","Client Id" "Client Secret","Client Secret" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients." "Continue as Guest","Continue as Guest" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>." "Could not find the ""multiline_count"" config of the ""street"" Customer address attribute.","Could not find the ""multiline_count"" config of the ""street"" Customer address attribute." "Credentials,Credentials" "Credentials JSON","Credentials JSON" "Dark Gray","Dark Gray" "Data Polling via Cron Job","Data Polling via Cron Job" "Declined amount of %1 online","Online Capture of amount %1 was declined." "Developer Options","Developer Options" "Enable Amazon Pay","Enable Amazon Pay" "Enable Login with Amazon","Enable Login with Amazon" "Euro Region","Euro Region" "Error processing Amazon Login","Error processing Amazon Login" "Excluded Categories","Excluded Categories" "Extra Large","Extra Large" "Forgot Your Password?","Forgot Your Password?" "Frontend","Frontend" "General","General" "Get started with account registration","Get started with account registration" "Gold","Gold" "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin." "Instant Payment Notifications","Instant Payment Notifications" "Is Packing Stations Terms Validation Enabled","Is Packing Stations Terms Validation Enabled" "I've already setup Pay with Amazon, I want to edit my settings","I've already setup Amazon Pay, I want to edit my settings" "Japan","Japan" "Large","Large" "Light Gray","Light Gray" "Logging","Logging" "Login / Pay","Login / Pay" "Login with Amazon","Login with Amazon" "Login with Amazon / Amazon Pay","Login with Amazon / Amazon Pay" "Login with Amazon available in authentication popup","Login with Amazon available in authentication popup" "Medium","Medium" "Merchant Id","Merchant Id" "Module version","Module version" "My account is ready, I need to connect it to Magento","My account is ready, I need to connect it to Magento" "New Order Status","New Order Status" "No Simulation","No Simulation" "Ok","Ok" "Options","Options" "or","or" "Packing Stations Terms","Packing Stations Terms" "Password","Password" "Paste JSON credentials here","Paste JSON credentials here" "Payment Action","Payment Action" "Payment Region","Payment Region" "Please select a payment method.","Please select a payment method." "Refund declined","Refund declined" "* Required Fields","* Required Fields" "Return to standard checkout","Return to standard checkout" "Sales Exclusions","Sales Exclusions" "Sales Options","Sales Options" "Sandbox","Sandbox" "Save Credentials","Save Credentials" "Secret Access Key","Secret Access Key" "Securely login into our website using your existing Amazon details.","Securely login to our website using your existing Amazon details." "Simulate Payment Scenarios","Simulate Payment Scenarios" "Small","Small" "Successfully cancelled Amazon Pay","Successfully cancelled Amazon Pay" "Synchronous","Synchronous" "Synchronous if Possible","Synchronous if Possible" "The ""Amazon Pay"" button will not be available for products of the selected categories.","The ""Amazon Pay"" button will not be available for products of the selected categories." "the country for your address is not allowed for this store","The country associated with your address is not allowed for this store." "The currency selected is not supported by Amazon Pay","The currency selected is not supported by Amazon Pay on this store." "the email address for your Amazon account is invalid","The email address for your Amazon account is invalid." "There has been a problem with the selected payment method on your Amazon account. Please choose another one.","There has been a problem with the selected payment method on your Amazon account. Please choose another one." "Unfortunately it is not possible to use Amazon Pay for this order, please choose another payment method.","Unfortunately it is not possible to Pay with Amazon Pay for this order. Please choose another payment method." "United Kingdom","United Kingdom" "United States","United States" "Update Mechanism","Update Mechanism" "Updating your config with new keys, please wait...","Updating your config with new keys, please wait..." "Valid JSON credentials are required.","Valid JSON credentials are required." "Welcome back!","Welcome back!" "With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop.","With Amazon Pay and Login with Amazon, you can easily sign-in and use the shipping and payment information stored in your Amazon account to place an order on this shop." "You will be registering for a %1 account based on the base currency of your shop (%2).","You will be registering for a %1 account based on the base currency of your shop (%2)." "Your session has expired, please reload the page and try again.","Your session has expired, please reload the page and try again."amazon-pay-and-login-with-amazon-core-module/i18n/de_AT.csv000077700000012776151323541140017426 0ustar00"click here to display the categories","Klicken Sie hier, um die Kategorien anzuzeigen" "No Simulation","Keine Simulation" "Authorization soft decline","Weiche Ablehnung für Autorisierung" "Authorization hard decline","Harte Ablehnung für Autorisierung" "Authorization timed out","Zeitüberschreitung bei Autorisierung" "Capture declined","Capture abgelehnt" "Capture pending","Capture ausstehend" "Refund declined","Erstattung abgelehnt" "Synchronous","Synchron" "Asynchronous","Asynchron" "Synchronous if Possible","Synchron, wenn möglich" "Gold","Gold" "Light Gray","Hellgrau" "Dark Gray","Dunkelgrau" "Small","Klein" "Medium","Mittelgroß" "Large","Groß" "Extra Large","Extragroß" "Login with Amazon / Amazon Pay","Login mit Amazon / Amazon Pay" "Login / Pay","Login/Bezahlen" "Amazon Pay Logo","Amazon Pay Logo" "Charge on Shipment","Abbuchung bei Versand" "Charge on Order","Abbuchung bei Bestellung" "Euro Region","Eurozone" "United Kingdom","Vereinigtes Königreich" "United States","Vereinigte Staaten" "Japan","Japan" "Data Polling via Cron Job","Datenabruf über Cron-Job" "Instant Payment Notifications","Sofortige Zahlungsbenachrichtigungen" "Amazon Pay","Amazon Pay" "General","Allgemeines" "Credentials","Anmeldedaten" "Merchant Id","Händlernummer" "Access Key Id","Access Key ID" "Secret Access Key","Secret Access Key" "Client Id","Client-ID" "Client Secret","Client Secret" "Credentials JSON","JSON-Anmeldedaten" "Payment Region","Zahlungsregion" "Sandbox","Sandbox" "Allowed Javascript Origins","Zulässige JavaScript-Ursprünge" "Allowed Return URLs","Zulässige Rückleitungs-URLs" "Options","Optionen" "Enable Amazon Pay","Amazon Pay aktivieren" "Enable Login with Amazon","Login mit Amazon aktivieren" "Payment Action","Zahlungsaktion" "Authorization Mode","Autorisierungsmodus" "Update Mechanism","Aktualisierungsmechanismus" "Amazon Pay button is visible on Product Page","""Amazon Pay"" ist auf der Produktseite sichtbar" "Advanced","Erweitert" "Frontend","Front-End" "Button Display Language","Anzeigesprache für Schaltflächen" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Steuert die Sprache für Schaltflächen und Widgets. Die Standardeinstellung ist das Gebietsschema Ihrer Website. Verfügbare Optionen finden Sie <a href=""https://payments.amazon.de/developer/documentation/lpwa/201953980#SPRACHPARAMETER_EINGEBEN"">hier</a>." "Button Color","Farbe der Schaltfläche" "Button Size","Größe der Schaltfläche" "Sales Options","Verkaufsoptionen" "New Order Status","Neuer Bestellstatus" "Sales Exclusions","Verkaufsausschlüsse" "Is Packing Stations Terms Validation Enabled","Überprüfung der Begriffe für Packstationen ist aktiviert" "Packing Stations Terms","Begriffe für Packstationen" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Eine kommagetrennte Liste mit Begriffen (ohne Unterscheidung zwischen Groß- und Kleinschreibung), anhand derer überprüft wird, ob es sich bei einer Kundenadresse um ein Schließfach oder eine Packstation handelt." "Excluded Categories","Ausgeschlossene Kategorien" "The ""Amazon Pay"" button will not be available for products of the selected categories.","""Amazon Pay"" ist für Produkte der ausgewählten Kategorien nicht verfügbar." "Developer Options","Entwickleroptionen" "Logging","Protokollierung" "Allowed IPs","Zulässige IPs" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Kommagetrennt. ""Login mit Amazon"" und ""Amazon Pay"" sind <em>nur<em/> für Kunden mit den oben aufgeführten IPs verfügbar. Wenn das Feld leer ist, sind die Schaltflächen für alle Clients sichtbar." "Module version","Modulversion" "--","--" "Amazon Pay button in minicart","Amazon Pay Button in Minicart anzeigen" "An unsupported currency is currently selected. Please review our configuration guide.","Die aktuell gewählte Währung wird nicht unterstützt. Bitte besuchen Sie unsere Konfigurationsanleitung." "You will be registering for a %1 account based on the base currency of your shop (%2).","Sie werden sich für ein %1 Konto registrieren, basierend auf der Basiswährung Ihres Shops (%2)." "Get started with account registration","Registrierung des Kontos beginnen" "My account is ready, I need to connect it to Magento","Ich habe bereits ein Amazon Pay Konto, I möchte es mit Magento verbinden." "or","oder" "I've already setup Pay with Amazon, I want to edit my settings","Ich habe Amazon Pay bereits konfiguriert, zu den Einstellungen." "Back to register or connect an account","Zurück" "Updating your config with new keys, please wait...","Ihre Zugangsdaten werden übernommen, bitte warten..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Um die automatische Kontokonfiguration mittels sicherer Übertragung der Zugangsdaten zu nutzen, aktivieren Sie bitte sichere Administrationseiten unter: General > Web > Use secure URLs in Admin." "Paste JSON credentials here","JSON Zugangsdaten hier einfügen" "Save Credentials","Zugansdaten übernehmen" "Valid JSON credentials are required.","Gültige JSON Zugangsdaten werden benötigt." amazon-pay-and-login-with-amazon-core-module/i18n/es_CO.csv000077700000013000151323541140017417 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/fr_FR.csv000077700000013345151323541140017441 0ustar00"click here to display the categories","cliquez ici pour afficher les catégories" "No Simulation","Aucune simulation" "Authorization soft decline","Refus court de l'autorisation" "Authorization hard decline","Refus long de l'autorisation" "Authorization timed out","Autorisation expirée" "Capture declined","Saisie rejetée" "Capture pending","Saisie en attente" "Refund declined","Remboursement refusé" "Synchronous","Synchrone" "Asynchronous","Asynchrone" "Synchronous if Possible","Synchrone si possible" "Gold","Doré" "Light Gray","Gris clair" "Dark Gray","Gris foncé" "Small","Petit" "Medium","Moyen" "Large","Grand" "Extra Large","Très grand" "Login with Amazon / Amazon Pay","Connectez-vous avec Amazon / Amazon Pay" "Login / Pay","Connectez-vous / Payez" "Amazon Pay Logo","Logo Amazon Pay" "Charge on Shipment","Débit lors de l'expédition" "Charge on Order","Débit lors de la commande" "Euro Region","Eurorégion" "United Kingdom","Royaume-Uni" "United States","États-Unis" "Japan","Japon" "Data Polling via Cron Job","Analyse des données via les tâches Cron" "Instant Payment Notifications","Notifications de paiement instantané" "Amazon Pay","Amazon Pay" "General","Général" "Credentials","Informations d'identification" "Merchant Id","Identifiant du marchand" "Access Key Id","ID de clé d'accès" "Secret Access Key","Clé d'accès secrète" "Client Id","Identifiant client" "Client Secret","Secret du client" "Credentials JSON","Informations d'identification JSON" "Payment Region","Région de paiement" "Sandbox","Environnement test" "Allowed Javascript Origins","OOrigines JavaScript autorisées" "Allowed Return URLs","URL de renvoi autorisées" "Options","Options" "Enable Amazon Pay","Activer Amazon Pay" "Enable Login with Amazon","Activer Connectez-vous avec Amazon" "Payment Action","Action de paiement" "Authorization Mode","Mode d'autorisation" "Update Mechanism","Mettre à jour le mécanisme" "Amazon Pay button is visible on Product Page","Le bouton Amazon Pay est visible sur la page du produit" "Advanced","Avancé" "Frontend","Avant" "Button Display Language","Langue d'affichage du bouton" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Contrôle la langue du bouton et du widget. Il s'agit par défaut de la langue du pays de votre site. Les options disponibles se trouvent <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">ici</a>." "Button Color","Couleur du bouton" "Button Size","Taille du bouton" "Sales Options","Options de vente" "New Order Status","Nouvel état de la commande" "Sales Exclusions","Exclusions de vente" "Is Packing Stations Terms Validation Enabled","La validation des termes pour les lieux de conditionnement est-elle activée" "Packing Stations Terms","Termes pour les lieux de conditionnement" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Liste séparée par des virgules de termes ne tenant pas compte des majuscules et des minuscules, qui sera utilisée pour vérifier si l'adresse d'un client est un casier ou un lieu de conditionnement." "Excluded Categories","Catégories exclues" "The ""Amazon Pay"" button will not be available for products of the selected categories.","Le bouton Amazon Pay ne sera pas disponible pour les produits des catégories sélectionnées." "Developer Options","Options pour le développeur" "Logging","Journalisation" "Allowed IPs","IP autorisées" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Séparée par des virgules. Les boutons Connectez-vous avec Amazon et Amazon Pay seront intégrés <em>uniquement</em> pour les clients aux IP ci-dessus. Si le champ est vide, les boutons seront visibles par tous les clients." "Module version","Version du Module" "--","--" "Amazon Pay button in minicart","Bouton Amazon Pay dans le mini-panier" "An unsupported currency is currently selected. Please review our configuration guide.","Une devise non prise en charge est actuellement sélectionnée. Consultez notre guide de configuration." "You will be registering for a %1 account based on the base currency of your shop (%2).","Vous procéderez à l'enregistrement d'un compte %1 selon la devise de base de votre boutique (%2)." "Get started with account registration","Commencer l'enregistrement" "My account is ready, I need to connect it to Magento","Mon compte est prêt, j'ai besoin de le connecter à Magento" "or","ou" "I've already setup Pay with Amazon, I want to edit my settings","J'ai déjà configuré le service Amazon Pay, je souhaite modifier mes paramètres" "Back to register or connect an account","Retour" "Updating your config with new keys, please wait...","Mise à jour de votre configuration avec les nouvelles clés, veuillez patienter..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Pour activer la configuration automatique du compte à l'aide de l'échange de clé sécurisé d'Amazon, activez les pages d'administration sécurisées dans Général > Web > Utiliser des URL sécurisées dans Administration." "Paste JSON credentials here","Collez les informations d'identification JSON ici" "Save Credentials","Enregistrer les informations d'identification" "Valid JSON credentials are required.","Des informations d'identification JSON valides sont requises." amazon-pay-and-login-with-amazon-core-module/i18n/en_GB.csv000077700000012105151323541140017406 0ustar00"click here to display the categories","click here to display the categories" "No Simulation","No Simulation" "Authorization soft decline","Authorization soft decline" "Authorization hard decline","Authorization hard decline" "Authorization timed out","Authorization timed out" "Capture declined","Capture declined" "Capture pending","Capture pending" "Refund declined","Refund declined" "Synchronous","Synchronous" "Asynchronous","Asynchronous" "Synchronous if Possible","Synchronous if Possible" "Gold","Gold" "Light Gray","Light Gray" "Dark Gray","Dark Gray" "Small","Small" "Medium","Medium" "Large","Large" "Extra Large","Extra Large" "Login with Amazon / Amazon Pay","Login with Amazon / Amazon Pay" "Login / Pay","Login / Pay" "Amazon Pay Logo","Amazon Pay Logo" "Charge on Shipment","Charge on Shipment" "Charge on Order","Charge on Order" "Euro Region","Euro Region" "United Kingdom","United Kingdom" "United States","United States" "Japan","Japan" "Data Polling via Cron Job","Data Polling via Cron Job" "Instant Payment Notifications","Instant Payment Notifications" "Amazon Pay","Amazon Pay" General,General Credentials,Credentials "Merchant Id","Merchant Id" "Access Key Id","Access Key Id" "Secret Access Key","Secret Access Key" "Client Id","Client Id" "Client Secret","Client Secret" "Credentials JSON","Credentials JSON" "Payment Region","Payment Region" Sandbox,Sandbox "Allowed Javascript Origins","Allowed Javascript Origins" "Allowed Return URLs","Allowed Return URLs" Options,Options "Enable Amazon Pay","Enable Amazon Pay" "Enable Login with Amazon","Enable Login with Amazon" "Payment Action","Payment Action" "Authorization Mode","Authorization Mode" "Update Mechanism","Update Mechanism" "Amazon Pay button is visible on Product Page","Amazon Pay button is visible on Product Page" Advanced,Advanced Frontend,Frontend "Button Display Language","Button Display Language" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>." "Button Color","Button Color" "Button Size","Button Size" "Sales Options","Sales Options" "New Order Status","New Order Status" "Sales Exclusions","Sales Exclusions" "Is Packing Stations Terms Validation Enabled","Is Packing Stations Terms Validation Enabled" "Packing Stations Terms","Packing Stations Terms" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station." "Excluded Categories","Excluded Categories" "The ""Amazon Pay"" button will not be available for products of the selected categories.","The ""Amazon Pay"" button will not be available for products of the selected categories." "Developer Options","Developer Options" Logging,Logging "Allowed IPs","Allowed IPs" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients." "Module version","Module version" "--","--" "Amazon Pay button in minicart","Amazon Pay button in minicart" "An unsupported currency is currently selected. Please review our configuration guide.","An unsupported currency is currently selected. Please review our configuration guide." "You will be registering for a %1 account based on the base currency of your shop (%2).","You will be registering for a %1 account based on the base currency of your shop (%2)." "Get started with account registration","Register or Connect an Amazon Pay Account" "My account is ready, I need to connect it to Magento","My account is ready, I need to connect it to Magento" "or","or" "I've already setup Pay with Amazon, I want to edit my settings","I've already setup Amazon Pay, I want to edit my settings" "Back to register or connect an account","Back to register or connect an account" "Updating your config with new keys, please wait...","Updating your config with new keys, please wait..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin." "Paste JSON credentials here","Paste JSON credentials here" "Save Credentials","Save Credentials" "Valid JSON credentials are required.","Valid JSON credentials are required." amazon-pay-and-login-with-amazon-core-module/i18n/.htaccess000077700000000177151323541140017523 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/i18n/es_VE.csv000077700000012777151323541140017454 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/de_DE.csv000077700000012776151323541140017412 0ustar00"click here to display the categories","Klicken Sie hier, um die Kategorien anzuzeigen" "No Simulation","Keine Simulation" "Authorization soft decline","Weiche Ablehnung für Autorisierung" "Authorization hard decline","Harte Ablehnung für Autorisierung" "Authorization timed out","Zeitüberschreitung bei Autorisierung" "Capture declined","Capture abgelehnt" "Capture pending","Capture ausstehend" "Refund declined","Erstattung abgelehnt" "Synchronous","Synchron" "Asynchronous","Asynchron" "Synchronous if Possible","Synchron, wenn möglich" "Gold","Gold" "Light Gray","Hellgrau" "Dark Gray","Dunkelgrau" "Small","Klein" "Medium","Mittelgroß" "Large","Groß" "Extra Large","Extragroß" "Login with Amazon / Amazon Pay","Login mit Amazon / Amazon Pay" "Login / Pay","Login/Bezahlen" "Amazon Pay Logo","Amazon Pay Logo" "Charge on Shipment","Abbuchung bei Versand" "Charge on Order","Abbuchung bei Bestellung" "Euro Region","Eurozone" "United Kingdom","Vereinigtes Königreich" "United States","Vereinigte Staaten" "Japan","Japan" "Data Polling via Cron Job","Datenabruf über Cron-Job" "Instant Payment Notifications","Sofortige Zahlungsbenachrichtigungen" "Amazon Pay","Amazon Pay" "General","Allgemeines" "Credentials","Anmeldedaten" "Merchant Id","Händlernummer" "Access Key Id","Access Key ID" "Secret Access Key","Secret Access Key" "Client Id","Client-ID" "Client Secret","Client Secret" "Credentials JSON","JSON-Anmeldedaten" "Payment Region","Zahlungsregion" "Sandbox","Sandbox" "Allowed Javascript Origins","Zulässige JavaScript-Ursprünge" "Allowed Return URLs","Zulässige Rückleitungs-URLs" "Options","Optionen" "Enable Amazon Pay","Amazon Pay aktivieren" "Enable Login with Amazon","Login mit Amazon aktivieren" "Payment Action","Zahlungsaktion" "Authorization Mode","Autorisierungsmodus" "Update Mechanism","Aktualisierungsmechanismus" "Amazon Pay button is visible on Product Page","""Amazon Pay"" ist auf der Produktseite sichtbar" "Advanced","Erweitert" "Frontend","Front-End" "Button Display Language","Anzeigesprache für Schaltflächen" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Steuert die Sprache für Schaltflächen und Widgets. Die Standardeinstellung ist das Gebietsschema Ihrer Website. Verfügbare Optionen finden Sie <a href=""https://payments.amazon.de/developer/documentation/lpwa/201953980#SPRACHPARAMETER_EINGEBEN"">hier</a>." "Button Color","Farbe der Schaltfläche" "Button Size","Größe der Schaltfläche" "Sales Options","Verkaufsoptionen" "New Order Status","Neuer Bestellstatus" "Sales Exclusions","Verkaufsausschlüsse" "Is Packing Stations Terms Validation Enabled","Überprüfung der Begriffe für Packstationen ist aktiviert" "Packing Stations Terms","Begriffe für Packstationen" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Eine kommagetrennte Liste mit Begriffen (ohne Unterscheidung zwischen Groß- und Kleinschreibung), anhand derer überprüft wird, ob es sich bei einer Kundenadresse um ein Schließfach oder eine Packstation handelt." "Excluded Categories","Ausgeschlossene Kategorien" "The ""Amazon Pay"" button will not be available for products of the selected categories.","""Amazon Pay"" ist für Produkte der ausgewählten Kategorien nicht verfügbar." "Developer Options","Entwickleroptionen" "Logging","Protokollierung" "Allowed IPs","Zulässige IPs" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Kommagetrennt. ""Login mit Amazon"" und ""Amazon Pay"" sind <em>nur<em/> für Kunden mit den oben aufgeführten IPs verfügbar. Wenn das Feld leer ist, sind die Schaltflächen für alle Clients sichtbar." "Module version","Modulversion" "--","--" "Amazon Pay button in minicart","Amazon Pay Button in Minicart anzeigen" "An unsupported currency is currently selected. Please review our configuration guide.","Die aktuell gewählte Währung wird nicht unterstützt. Bitte besuchen Sie unsere Konfigurationsanleitung." "You will be registering for a %1 account based on the base currency of your shop (%2).","Sie werden sich für ein %1 Konto registrieren, basierend auf der Basiswährung Ihres Shops (%2)." "Get started with account registration","Registrierung des Kontos beginnen" "My account is ready, I need to connect it to Magento","Ich habe bereits ein Amazon Pay Konto, I möchte es mit Magento verbinden." "or","oder" "I've already setup Pay with Amazon, I want to edit my settings","Ich habe Amazon Pay bereits konfiguriert, zu den Einstellungen." "Back to register or connect an account","Zurück" "Updating your config with new keys, please wait...","Ihre Zugangsdaten werden übernommen, bitte warten..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Um die automatische Kontokonfiguration mittels sicherer Übertragung der Zugangsdaten zu nutzen, aktivieren Sie bitte sichere Administrationseiten unter: General > Web > Use secure URLs in Admin." "Paste JSON credentials here","JSON Zugangsdaten hier einfügen" "Save Credentials","Zugansdaten übernehmen" "Valid JSON credentials are required.","Gültige JSON Zugangsdaten werden benötigt." amazon-pay-and-login-with-amazon-core-module/i18n/es_ES.csv000077700000012777151323541140017451 0ustar00 "click here to display the categories","haz clic aquí para mostrar las categorías" "No Simulation","Sin simulación" "Authorization soft decline","Rechazo parcial de la autorización" "Authorization hard decline","Rechazo total de la autorización" "Authorization timed out","Tiempo de espera de la autorización superado" "Capture declined","Captura rechazada" "Capture pending","Captura pendiente" "Refund declined","Reembolso rechazado" "Synchronous","Sincrónico" "Asynchronous","Asincrónico" "Synchronous if Possible","Sincrónico si es posible" "Gold","Dorado" "Light Gray","Gris claro" "Dark Gray","Gris oscuro" "Small","Pequeño" "Medium","Mediano" "Large","Grande" "Extra Large","Extragrande" "Login with Amazon / Amazon Pay","Login con Amazon / Amazon Pay" "Login / Pay","Login / Pagar" "Amazon Pay Logo","Logotipo de Amazon Pay" "Charge on Shipment","Cargo del envío" "Charge on Order","Cargo del pedido" "Euro Region","Región de Europa" "United Kingdom","Reino Unido" "United States","Estados Unidos" "Japan","Japón" "Data Polling via Cron Job","Sondeo de datos mediante trabajo de Cron" "Instant Payment Notifications","Notificaciones de pago inmediato" "Amazon Pay","Amazon Pay" "General","General" "Credentials","Credenciales" "Merchant Id","Identificador de vendedor" "Access Key Id","ID de clave de acceso" "Secret Access Key","Clave de acceso secreta" "Client Id","Identificador del cliente" "Client Secret","Secreto del cliente" "Credentials JSON","JSON de credenciales" "Payment Region","Región de pago" "Sandbox","Sandbox" "Allowed Javascript Origins","Orígenes JavaScript permitidos" "Allowed Return URLs","URL retorno permitidas" "Options","Opciones" "Enable Amazon Pay","Activar Amazon Pay" "Enable Login with Amazon","Activar Login con Amazon" "Payment Action","Acción de pago" "Authorization Mode","Modo de autorización" "Update Mechanism","Actualizar mecanismo" "Amazon Pay button is visible on Product Page","El botón Amazon Pay es visible en la página del producto" "Advanced","Avanzado" "Frontend","Página principal" "Button Display Language","Idioma del botón" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Idioma del botón de controles y el widget. El valor predeterminado es el idioma de tu sitio web. Encontrarás las opciones disponibles <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">aquí</a>." "Button Color","Color del botón" "Button Size","Tamaño del botón" "Sales Options","Opciones de ventas" "New Order Status","Estado de nuevo pedido" "Sales Exclusions","Exclusiones de ventas" "Is Packing Stations Terms Validation Enabled","¿Está activada la validación de los términos de las estaciones de embalaje?" "Packing Stations Terms","Términos de las estaciones de embalaje" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Una lista separada por comas de términos con distinción de mayúsculas que se usará para comprobar si la dirección de un cliente es una taquilla o estación de embalaje." "Excluded Categories","Categorías excluidas" "The ""Amazon Pay"" button will not be available for products of the selected categories.","El botón Amazon Pay no estará disponible para los productos de ciertas categorías." "Developer Options","Opciones para desarrolladores" "Logging","Inicio de sesión" "Allowed IPs","IP permitidas" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separado por comas. Los botones Login con Amazon y Amazon Pay se mostrarán <em>sólo</em> a los clientes que utilicen las IP anteriores. Si el campo está vacío, los botones serán visibles para todos los clientes." "Module version","Versión del módulo" "--","--" "Amazon Pay button in minicart","Botón de Amazon Pay en la minicesta" "An unsupported currency is currently selected. Please review our configuration guide.","Has seleccionado una moneda no admitida. Consulta nuestra guía de configuración." "You will be registering for a %1 account based on the base currency of your shop (%2).","Te estás registrando para una cuenta de %1 basada en la moneda base de tu tienda (%2)." "Get started with account registration","Inicia el registro de tu cuenta" "My account is ready, I need to connect it to Magento","Mi cuenta está lista, sólo tengo que vincularla a Magento." "or","o bien" "I've already setup Pay with Amazon, I want to edit my settings","Ya he configurado Amazon Pay, pero quiero modificar mi configuración." "Back to register or connect an account","Volver" "Updating your config with new keys, please wait...","Actualizando tu configuración con claves nuevas... Espera, por favor." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Para activar la configuración automática utilizando el intercambio seguro de claves de Amazon, accede a la página de administración de seguridad en General > Web > Utilizar URL seguras en Admin." "Pega las credenciales de JSON aquí" "Save Credentials","Guardar credenciales" "Valid JSON credentials are required.","Son necesarias credenciales de JSON válidas." amazon-pay-and-login-with-amazon-core-module/i18n/it_CH.csv000077700000013034151323541140017424 0ustar00"click here to display the categories","clicca qui per visualizzare le categorie" "No Simulation","Nessuna simulazione" "Authorization soft decline","Autorizzazione non riuscita" "Authorization hard decline","Autorizzazione negata" "Authorization timed out","Autorizzazione scaduta" "Capture declined","Acquisizione negata" "Capture pending","Acquisizione in sospeso" "Refund declined","Rimborso negato" "Synchronous","Sincrono" "Asynchronous","Asincrono" "Synchronous if Possible","Sincrono, se possibile" "Gold","Oro" "Light Gray","Grigio chiaro" "Dark Gray","Grigio scuro" "Small","Piccolo" "Medium","Medio" "Large","Grande" "Extra Large","Extra large" "Login with Amazon / Amazon Pay","Accedi con Amazon / Amazon Pay" "Login / Pay","Accedi e paga" "Amazon Pay Logo","Logo Amazon Pay" "Charge on Shipment","Addebito al momento della spedizione" "Charge on Order","Addebito al momento dell'ordine" "Euro Region","Area euro" "United Kingdom","Regno Unito" "United States","Stati Uniti" "Japan","Giappone" "Data Polling via Cron Job","Polling dei dati tramite Cron job" "Instant Payment Notifications","Notifiche istantanee di pagamento" "Amazon Pay","Amazon Pay" "General","Generale" "Credentials","Credenziali" "Merchant Id","Numero venditore" "Access Key Id","Numero chiave d'accesso" "Secret Access Key","Chiave d'accesso segreta" "Client Id","ID cliente" "Client Secret","Chiave segreta cliente" "Credentials JSON","Credenziali JSON" "Payment Region","Area pagamento" "Sandbox","Sandbox" "Allowed Javascript Origins","Origini JavaScript consentite" "Allowed Return URLs","URL restituiti consentiti" "Options","Opzioni" "Enable Amazon Pay","Abilita Amazon Pay" "Enable Login with Amazon","Abilita Accedi con Amazon" "Payment Action","Azione pagamento" "Authorization Mode","Modalità autorizzazione" "Update Mechanism","Meccanismo di aggiornamento" "Amazon Pay button is visible on Product Page","Il pulsante Amazon Pay è visibile sulla pagina prodotto" "Advanced","Avanzate" "Frontend","Front-end" "Button Display Language","Lingua di visualizzazione del pulsante" "Controls button and widget language. The default is your shop's locale. Available options can be found <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">here</a>.","Imposta la lingua dei widget e dei pulsanti. Viene utilizzata la lingua del sito dell'utente come impostazione predefinita. Per trovare le opzioni disponibili, clicca <a href=""https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER"">qui</a>." "Button Color","Colore pulsante" "Button Size","Dimensione pulsante" "Sales Options","Opzioni di vendita" "New Order Status","Nuovo stato ordine" "Sales Exclusions","Esclusioni dalla vendita" "Is Packing Stations Terms Validation Enabled","Convalida dei termini per le stazioni di imballaggio abilitata" "Packing Stations Terms","Termini stazioni di imballaggio" "A comma-separated list of case-insensitive terms which will be used to check whether a Customer Address is a locker or packing station.","Elenco di termini senza distinzione tra maiuscole e minuscole e separati da virgole che saranno utilizzati per verificare se l'indirizzo del cliente corrisponde a un locker o a una stazione di imballaggio." "Excluded Categories","Categorie escluse" "The ""Amazon Pay"" button will not be available for products of the selected categories.","Il pulsante Amazon Pay non sarà disponibile per i prodotti delle categorie selezionate." "Developer Options","Opzioni sviluppatori" "Logging","Accesso" "Allowed IPs","IP consentiti" "Comma separated. The ""Login with Amazon"" and ""Amazon Pay"" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.","Separato da virgola. I pulsanti Accedi con Amazon e Amazon Pay saranno resi disponibili <em>solo</em> per i clienti che dispongono degli IP sopra indicati. Se il campo è vuoto, i pulsanti saranno visibili a tutti i clienti." "Module version","Versione del Modulo" "--","--" "Amazon Pay button in minicart","Pulsante Amazon Pay nel mini-carrello" "An unsupported currency is currently selected. Please review our configuration guide.","È attualmente selezionata una valuta non supportata. Consulta la nostra guida alla configurazione." "You will be registering for a %1 account based on the base currency of your shop (%2).","Effettuerai la registrazione per un account %1 in base alla valuta principale del tuo negozio (%2)." "Get started with account registration","Inizia la registrazione dell'account" "My account is ready, I need to connect it to Magento","Il mio account è pronto, devo associarlo a Magento" "or","o" "I've already setup Pay with Amazon, I want to edit my settings","Ho già configurato Amazon Pay, voglio modificare le mie impostazioni" "Back to register or connect an account","Indietro" "Updating your config with new keys, please wait...","Aggiornamento della configurazione con nuove chiavi in corso. Attendi..." "In order to enable automatic account configuration using Amazon's secure key exchange, please turn on secure admin pages in General > Web > Use secure URLs in Admin.","Per attivare la configurazione automatica dell'account mediante lo scambio di chiavi sicuro Amazon, attiva le pagine di amministrazione sicura in Generale > Web > Utilizza URL sicuri in Amministrazione." "Paste JSON credentials here","Incolla credenziali JSON qui" "Save Credentials","Salva credenziali" "Valid JSON credentials are required.","Sono necessarie credenziali JSON valide." amazon-pay-and-login-with-amazon-core-module/etc/adminhtml/routes.xml000077700000001774151323541140021745 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="admin"> <route id="amazonlogs" frontName="amazonlogs"> <module name="Amazon_Core" /> </route> <route id="amazonsp" frontName="amazonsp"> <module name="Amazon_Core" /> </route> </router> </config> amazon-pay-and-login-with-amazon-core-module/etc/adminhtml/system.xml000077700000036365151323541140021754 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> <system> <section id="payment"> <group id="amazon_payment" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="1"> <label><![CDATA[<div class="amazon-payment-logo"></div><div class="amazon-payment-byline">The convenient, trusted way to pay.<br/>Let your customers check out in just a few clicks or taps using the shipping and payment info already stored in their Amazon account.</div>]]></label> <fieldset_css>complex amazon-payment-section</fieldset_css> <frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model> <field id="simplepath" type="text" translate="label comment" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <frontend_model>Amazon\Core\Block\Adminhtml\System\Config\Form\SimplepathConfig</frontend_model> </field> <group id="credentials" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Credentials</label> <field id="merchant_id" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Merchant Id</label> <config_path>payment/amazon_payment/merchant_id</config_path> </field> <field id="access_key" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Access Key Id</label> <config_path>payment/amazon_payment/access_key</config_path> </field> <field id="secret_key" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Secret Access Key</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <config_path>payment/amazon_payment/secret_key</config_path> </field> <field id="client_id" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Client Id</label> <config_path>payment/amazon_payment/client_id</config_path> </field> <field id="client_secret" translate="label comment" type="obscure" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Client Secret</label> <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model> <config_path>payment/amazon_payment/client_secret</config_path> <comment><![CDATA[<input type="checkbox" name="amazon_test_creds" id="amazon_test_creds" value="1"><label for="amazon_test_creds">]]><![CDATA[Test Credentials]]><![CDATA[</label>]]></comment> </field> <field id="credentials_json" translate="label" type="textarea" sortOrder="55" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Credentials JSON</label> <config_path>payment/amazon_payment/credentials_json</config_path> <comment><![CDATA[Warning! Individual credential fields will be populated/overwritten, if credentials JSON is supplied!]]></comment> </field> <field id="payment_region" translate="label" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Payment Region</label> <source_model>Amazon\Core\Model\Config\Source\PaymentRegion</source_model> <config_path>payment/amazon_payment/payment_region</config_path> </field> <field id="sandbox" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Sandbox</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/sandbox</config_path> </field> <field id="js_origin" translate="label" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Allowed Javascript Origins</label> <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\JsOrigin</frontend_model> </field> <field id="redirect_url" translate="label" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Allowed Return URLs</label> <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\RedirectUrl</frontend_model> </field> <field id="ipn_url" translate="label" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1"> <label>IPN URL</label> <frontend_model>Amazon\Core\Block\Adminhtml\Form\Field\IpnUrl</frontend_model> </field> </group> <group id="options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Options</label> <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Enable Amazon Pay</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/active</config_path> </field> <field id="lwa_enabled" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Enable Login with Amazon</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/lwa_enabled</config_path> <comment><![CDATA[Note that if Login with Amazon is disabled and Guest Checkout is disabled, the customer will not be able to use Amazon Pay.]]></comment> </field> <field id="payment_action" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Payment Action</label> <source_model>Amazon\Core\Model\Config\Source\PaymentAction</source_model> <config_path>payment/amazon_payment/payment_action</config_path> </field> <field id="authorization_mode" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Authorization Mode</label> <source_model>Amazon\Core\Model\Config\Source\AuthorizationMode</source_model> <config_path>payment/amazon_payment/authorization_mode</config_path> </field> <field id="update_mechanism" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Update Mechanism</label> <source_model>Amazon\Core\Model\Config\Source\UpdateMechanism</source_model> <config_path>payment/amazon_payment/update_mechanism</config_path> </field> </group> <group id="advanced" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Advanced</label> <field id="version" type="text" translate="label comment" sortOrder="0" showInDefault="1" showInWebsite="1" showInStore="1"> <frontend_model>Amazon\Core\Block\Adminhtml\System\Config\Form\Version</frontend_model> </field> <group id="frontend" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Frontend</label> <field id="display_language" translate="label comment" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Button Display Language</label> <config_path>payment/amazon_payment/button_display_language</config_path> <comment><![CDATA[Controls button and widget language. The default is your shop's locale. Available options can be found <a href="https://payments.amazon.co.uk/developer/documentation/lpwa/201953980#ENTER_LANGUAGE_PARAMETER">here</a>. Applies only to UK and DE Amazon Merchant Accounts.]]></comment> </field> <field id="button_color" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Button Color</label> <source_model>Amazon\Core\Model\Config\Source\Button\Color</source_model> <config_path>payment/amazon_payment/button_color</config_path> </field> <field id="button_size" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Button Size</label> <source_model>Amazon\Core\Model\Config\Source\Button\Size</source_model> <config_path>payment/amazon_payment/button_size</config_path> </field> <field id="pwa_pp_button_is_visible" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Amazon Pay button on product page</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/pwa_pp_button_is_visible</config_path> </field> <field id="minicart_button_is_visible" translate="label comment" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Amazon Pay button in minicart</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/minicart_button_is_visible</config_path> </field> <field id="amazonloggin" translate="label comment" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Show Amazon Pay in payment methods</label> <comment><![CDATA[If enabled, Amazon Pay is presented as an option in the list of available payment methods during the final step of checkout.]]></comment> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazonlogin/active</config_path> </field> </group> <group id="sales_options" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Sales Options</label> <field id="storename" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="1"> <label>Store Name</label> <config_path>payment/amazon_payment/storename</config_path> </field> <field id="multicurrency" translate="label" type="select" sortOrder="10" showInDefault="0" showInWebsite="0" showInStore="1"> <label>Use Multi-currency</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/multicurrency</config_path> <comment><![CDATA[Amazon Pay currently supports multi-currency only for UK and EU endpoints. Currencies supported include: AUD, GBP, DKK, EUR, HKD, JPY, NZD, NOK, ZAR, SEK, CHF USD.]]></comment> </field> </group> <group id="extra_options" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Developer Options</label> <field id="logging" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Logging</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> <config_path>payment/amazon_payment/logging</config_path> </field> <field id="allowed_ips" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="0"> <label>Allowed IPs</label> <comment><![CDATA[Comma separated. The "Login with Amazon" and "Amazon Pay" buttons will <em>only</em> be rendered for clients having the above IPs. If the field is empty, the buttons will be visible to all clients.]]></comment> <config_path>payment/amazon_payment/allowed_ips</config_path> <backend_model>Magento\Developer\Model\Config\Backend\AllowedIps</backend_model> </field> <field id="loglist" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Developer Logs</label> <depends> <field id="logging">1</field> </depends> <frontend_model>Amazon\Core\Block\Adminhtml\System\Config\Form\DeveloperLogs</frontend_model> </field> </group> </group> </group> </section> </system> </config> amazon-pay-and-login-with-amazon-core-module/etc/adminhtml/.htaccess000077700000000177151323541140021474 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/etc/events.xml000077700000002201151323541140017735 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="admin_system_config_changed_section_payment"> <observer name="amazon_core_save_payment_config_after" instance="Amazon\Core\Observer\PaymentConfigSaveAfter" /> </event> <event name="sales_quote_product_add_after"> <observer name="amazon_core_blacklist_category_addition" instance="Amazon\Core\Observer\ExcludedCategoryQuoteItemAddition" /> </event> </config> amazon-pay-and-login-with-amazon-core-module/etc/frontend/routes.xml000077700000001623151323541140021600 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd"> <router id="standard"> <route id="amazon_core" frontName="amazon_core"> <module name="Amazon_Core" /> </route> </router> </config> amazon-pay-and-login-with-amazon-core-module/etc/frontend/.htaccess000077700000000177151323541140021336 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/etc/module.xml000077700000002160151323541140017722 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Amazon_Core" setup_version="4.2.0"> <sequence> <module name="Magento_Store"/> <module name="Magento_Customer"/> <module name="Magento_Payment"/> <module name="Magento_Checkout"/> <module name="Magento_Catalog"/> <module name="Magento_Quote"/> </sequence> </module> </config> amazon-pay-and-login-with-amazon-core-module/etc/di.xml000077700000012653151323541140017041 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Amazon\Core\Client\ClientFactoryInterface" type="Amazon\Core\Client\ClientFactory" /> <preference for="Amazon\Core\Api\Data\AmazonNameInterface" type="Amazon\Core\Domain\AmazonName" /> <preference for="Amazon\Core\Api\Data\AmazonCustomerInterface" type="Amazon\Core\Domain\AmazonCustomer" /> <preference for="Amazon\Core\Api\Data\AmazonAddressInterface" type="Amazon\Core\Domain\AmazonAddress" /> <preference for="AmazonPay\ClientInterface" type="Amazon\Core\Client\Client" /> <type name="Amazon\Core\Client\Client"> <arguments> <argument name="config" xsi:type="array" /> </arguments> </type> <type name="Amazon\Core\Helper\Data"> <arguments> <argument name="storeManager" xsi:type="object">Magento\Store\Model\StoreManagerInterface\Proxy</argument> <argument name="clientIpHelper" xsi:type="object">Amazon\Core\Helper\ClientIp\Proxy</argument> </arguments> </type> <type name="Amazon\Core\Domain\AmazonNameFactory"> <arguments> <argument name="nameDecoratorPool" xsi:type="array"> <item name="JP" xsi:type="string">Amazon\Core\Domain\AmazonNameDecoratorJp</item> </argument> </arguments> </type> <type name="Amazon\Core\Domain\AmazonAddressFactory"> <arguments> <argument name="addressDecoratorPool" xsi:type="array"> <item name="DE" xsi:type="string">Amazon\Core\Domain\AmazonAddressDecoratorDe</item> <item name="AT" xsi:type="string">Amazon\Core\Domain\AmazonAddressDecoratorDe</item> <item name="JP" xsi:type="string">Amazon\Core\Domain\AmazonAddressDecoratorJp</item> </argument> </arguments> </type> <virtualType name="Amazon_Core_RemoteAddressWithAdditionalIpHeaders" type="Magento\Framework\HTTP\PhpEnvironment\RemoteAddress"> <arguments> <argument name="alternativeHeaders" xsi:type="array"> <item name="x-forwarded-for" xsi:type="string">HTTP_X_FORWARDED_FOR</item> <item name="x-real-ip" xsi:type="string">HTTP_X_REAL_IP</item> </argument> </arguments> </virtualType> <type name="Amazon\Core\Helper\ClientIp"> <arguments> <argument name="remoteAddress" xsi:type="object">Amazon_Core_RemoteAddressWithAdditionalIpHeaders</argument> </arguments> </type> <type name="Amazon\Core\Logger\Logger"> <arguments> <argument name="name" xsi:type="string">amazonClientLogger</argument> <argument name="handlers" xsi:type="array"> <item name="debug" xsi:type="object">Amazon\Core\Logger\Handler\Client</item> </argument> </arguments> </type> <type name="Amazon\Core\Client\ClientFactory"> <arguments> <argument name="logger" xsi:type="object">Amazon\Core\Logger\Logger</argument> </arguments> </type> <type name="Amazon\Core\Helper\CategoryExclusion"> <arguments> <argument name="checkoutSession" xsi:type="object">Magento\Checkout\Model\Session\Proxy</argument> </arguments> </type> <type name="Magento\Checkout\CustomerData\Cart"> <plugin name="amazon_core_cart_section" type="Amazon\Core\Plugin\CartSection" /> </type> <type name="Magento\Config\Model\Config\TypePool"> <arguments> <argument name="sensitive" xsi:type="array"> <item name="payment/amazon_payments/simplepath/privatekey" xsi:type="string">1</item> <item name="payment/amazon_payment/client_secret" xsi:type="string">1</item> <item name="payment/amazon_payment/secret_key" xsi:type="string">1</item> <item name="payment/amazon_payment/credentials_json" xsi:type="string">1</item> </argument> <argument name="environment" xsi:type="array"> <item name="payment/amazon_payments/simplepath/publickey" xsi:type="string">1</item> <item name="payment/amazon_payments/simplepath/privatekey" xsi:type="string">1</item> <item name="payment/amazon_payment/merchant_id" xsi:type="string">1</item> <item name="payment/amazon_payment/client_id" xsi:type="string">1</item> <item name="payment/amazon_payment/client_secret" xsi:type="string">1</item> <item name="payment/amazon_payment/access_key" xsi:type="string">1</item> <item name="payment/amazon_payment/secret_key" xsi:type="string">1</item> <item name="payment/amazon_payment/sandbox" xsi:type="string">1</item> </argument> </arguments> </type> </config> amazon-pay-and-login-with-amazon-core-module/etc/.htaccess000077700000000177151323541140017517 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/etc/validation.xml000077700000002541151323541140020572 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <validation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Validator/etc/validation.xsd"> <entity name="amazon_address"> <rules> <rule name="amazon_check_blacklisted_terms"> <entity_constraints> <constraint alias="amazon_core_address_data_blacklist_terms_validator" class="Amazon\Core\Model\Validation\AddressBlacklistTermsValidator" /> </entity_constraints> </rule> </rules> <groups> <group name="on_select"> <uses> <use rule="amazon_check_blacklisted_terms"/> </uses> </group> </groups> </entity> </validation> amazon-pay-and-login-with-amazon-core-module/etc/db_schema_whitelist.json000077700000001401151323541140022604 0ustar00{ "amazon_quote": { "column": { "entity_id": true, "quote_id": true, "amazon_order_reference_id": true, "sandbox_simulation_reference": true, "confirmed": true }, "constraint": { "PRIMARY": true, "AMAZON_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID": true, "AMAZON_QUOTE_QUOTE_ID": true } }, "amazon_sales_order": { "column": { "entity_id": true, "order_id": true, "amazon_order_reference_id": true }, "constraint": { "PRIMARY": true, "AMAZON_SALES_ORDER_ORDER_ID_SALES_ORDER_ENTITY_ID": true, "AMAZON_SALES_ORDER_ORDER_ID": true } } }amazon-pay-and-login-with-amazon-core-module/etc/db_schema.xml000077700000005764151323541140020357 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd"> <table name="amazon_quote" resource="checkout" engine="innodb" comment="amazon_quote"> <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID"/> <column xsi:type="int" name="quote_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Quote ID"/> <column xsi:type="varchar" name="amazon_order_reference_id" nullable="false" length="255" comment="Amazon Order Reference ID"/> <column xsi:type="varchar" name="sandbox_simulation_reference" nullable="true" length="255" comment="Sandbox simulation reference"/> <column xsi:type="smallint" name="confirmed" padding="5" unsigned="true" nullable="false" identity="false" default="0" comment="Quote confirmed with Amazon"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="entity_id"/> </constraint> <constraint xsi:type="foreign" referenceId="AMAZON_QUOTE_QUOTE_ID_QUOTE_ENTITY_ID" table="amazon_quote" column="quote_id" referenceTable="quote" referenceColumn="entity_id" onDelete="CASCADE"/> <constraint xsi:type="unique" referenceId="AMAZON_QUOTE_QUOTE_ID"> <column name="quote_id"/> </constraint> </table> <table name="amazon_sales_order" resource="sales" engine="innodb" comment="amazon_sales_order"> <column xsi:type="int" name="entity_id" padding="10" unsigned="true" nullable="false" identity="true" comment="Entity ID"/> <column xsi:type="int" name="order_id" padding="10" unsigned="true" nullable="false" identity="false" comment="Order ID"/> <column xsi:type="varchar" name="amazon_order_reference_id" nullable="false" length="255" comment="Amazon Order Reference ID"/> <constraint xsi:type="primary" referenceId="PRIMARY"> <column name="entity_id"/> </constraint> <constraint xsi:type="foreign" referenceId="AMAZON_SALES_ORDER_ORDER_ID_SALES_ORDER_ENTITY_ID" table="amazon_sales_order" column="order_id" referenceTable="sales_order" referenceColumn="entity_id" onDelete="CASCADE"/> <constraint xsi:type="unique" referenceId="AMAZON_SALES_ORDER_ORDER_ID"> <column name="order_id"/> </constraint> </table> </schema> amazon-pay-and-login-with-amazon-core-module/etc/config.xml000077700000005510151323541140017704 0ustar00<?xml version="1.0"?> <!-- /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ --> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> <default> <region> <country> <us>https://payments.amazon.com/overview</us> <uk>https://payments.amazon.co.uk/overview</uk> <de>https://payments.amazon.de/overview</de> <jp>https://payments.amazon.co.jp/overview</jp> </country> </region> <multicurrency> <regions>uk,de</regions> <currencies>AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF,USD</currencies> </multicurrency> <client> <paths> <secretkey>secret_key</secretkey> <accesskey>access_key</accesskey> <merchantid>merchant_id</merchantid> <clientid>client_id</clientid> <clientsecret>client_secret</clientsecret> <amazonregion>region</amazonregion> <amazonsandbox>sandbox</amazonsandbox> </paths> </client> <widget> <production> <de>https://static-eu.payments-amazon.com/OffAmazonPayments/de/lpa/js/Widgets.js?nomin</de> <uk>https://static-eu.payments-amazon.com/OffAmazonPayments/uk/lpa/js/Widgets.js?nomin</uk> <us>https://static-na.payments-amazon.com/OffAmazonPayments/us/js/Widgets.js?nomin</us> <jp>https://static-fe.payments-amazon.com/OffAmazonPayments/jp/lpa/js/Widgets.js?nomin</jp> </production> <sandbox> <de>https://static-eu.payments-amazon.com/OffAmazonPayments/de/sandbox/lpa/js/Widgets.js?nomin</de> <uk>https://static-eu.payments-amazon.com/OffAmazonPayments/uk/sandbox/lpa/js/Widgets.js?nomin</uk> <us>https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js?nomin</us> <jp>https://static-fe.payments-amazon.com/OffAmazonPayments/jp/sandbox/lpa/js/Widgets.js?nomin</jp> </sandbox> </widget> <customer> <address> <street_lines>3</street_lines> </address> </customer> </default> </config> amazon-pay-and-login-with-amazon-core-module/LICENSE000077700000026136151323541140016156 0ustar00 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright {yyyy} {name of copyright owner} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. amazon-pay-and-login-with-amazon-core-module/Plugin/CartSection.php000077700000004055151323541140021332 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Plugin; use Amazon\Core\Helper\Data; use Amazon\Core\Helper\CategoryExclusion; use Magento\Checkout\CustomerData\Cart; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CartSection { /** * @var CategoryExclusion */ private $categoryExclusionHelper; /** * @var Data */ private $coreHelper; /** * @param CategoryExclusion $categoryExclusionHelper * @param Data $coreHelper */ public function __construct( CategoryExclusion $categoryExclusionHelper, Data $coreHelper ) { $this->categoryExclusionHelper = $categoryExclusionHelper; $this->coreHelper = $coreHelper; } /** * @param Cart $subject * @param array $result * * @return mixed * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function afterGetSectionData(Cart $subject, $result) { if ($this->coreHelper->isPwaEnabled()) { $result['amazon_quote_has_excluded_item'] = $this->categoryExclusionHelper->isQuoteDirty(); } return $result; } } amazon-pay-and-login-with-amazon-core-module/Plugin/.htaccess000077700000000177151323541140020202 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Config.php000077700000013252151323541140020114 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block; use Amazon\Core\Helper\CategoryExclusion; use Amazon\Core\Helper\Data; use Amazon\Core\Model\AmazonConfig; use Magento\Customer\Model\Url; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; /** * Config * * @api * * Provides a block that displays links to available custom error logs in Amazon Pay admin/config section. * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Config extends Template { /** * @var Data */ private $coreHelper; /** * @var Url */ private $url; /** * @var CategoryExclusion */ private $categoryExclusionHelper; /** * @var AmazonConfig */ private $config; /** * Config constructor. * @param Context $context * @param Data $coreHelper * @param AmazonConfig $config * @param Url $url * @param CategoryExclusion $categoryExclusionHelper */ public function __construct( Context $context, Data $coreHelper, AmazonConfig $config, Url $url, CategoryExclusion $categoryExclusionHelper ) { parent::__construct($context); $this->coreHelper = $coreHelper; $this->config = $config; $this->url = $url; $this->categoryExclusionHelper = $categoryExclusionHelper; } /** * @return string */ public function getConfig() { $config = [ 'widgetUrl' => $this->coreHelper->getWidgetUrl(), 'merchantId' => $this->coreHelper->getMerchantId(), 'clientId' => $this->coreHelper->getClientId(), 'isPwaEnabled' => $this->coreHelper->isPaymentButtonEnabled(), 'isLwaEnabled' => $this->coreHelper->isLoginButtonEnabled(), 'isSandboxEnabled' => $this->coreHelper->isSandboxEnabled(), 'chargeOnOrder' => $this->sanitizePaymentAction(), 'authorizationMode' => $this->coreHelper->getAuthorizationMode(), 'displayLanguage' => $this->coreHelper->getButtonDisplayLanguage(), 'buttonTypePwa' => $this->coreHelper->getButtonTypePwa(), 'buttonTypeLwa' => $this->coreHelper->getButtonTypeLwa(), 'buttonColor' => $this->coreHelper->getButtonColor(), 'buttonSize' => $this->coreHelper->getButtonSize(), 'redirectUrl' => $this->coreHelper->getRedirectUrl(), 'loginPostUrl' => $this->url->getLoginPostUrl(), 'customerLoginPageUrl' => $this->url->getLoginUrl(), 'sandboxSimulationOptions' => [], 'loginScope' => $this->coreHelper->getLoginScope(), 'allowAmLoginLoading' => $this->coreHelper->allowAmLoginLoading(), 'isEuPaymentRegion' => $this->coreHelper->isEuPaymentRegion(), 'presentmentCurrency' => $this->config->getPresentmentCurrency(), 'oAuthHashRedirectUrl' => $this->coreHelper->getOAuthRedirectUrl(), 'isQuoteDirty' => $this->categoryExclusionHelper->isQuoteDirty(), 'region' => $this->coreHelper->getRegion(), 'useMultiCurrency' => $this->config->useMultiCurrency(), 'scaRegions' => $this->coreHelper->getScaRegions() ]; if ($this->coreHelper->isSandboxEnabled()) { $config['sandboxSimulationOptions'] = $this->transformSandboxSimulationOptions(); } if ($orderReferenceId = $this->getRequest()->getParam('orderReferenceId')) { $config['orderReferenceId'] = preg_replace('/[^A-Z0-9-]/', '', $orderReferenceId); } return $config; } /** * @return bool */ public function isBadgeEnabled() { return ($this->coreHelper->isPwaEnabled()); } /** * @return bool */ public function isExtensionEnabled() { return ($this->coreHelper->isPwaEnabled() || $this->coreHelper->isLwaEnabled()); } /** * @return bool */ public function sanitizePaymentAction() { return ($this->coreHelper->getPaymentAction() === 'authorize_capture'); } /** * @return array */ public function transformSandboxSimulationOptions() { $sandboxSimulationOptions = $this->coreHelper->getSandboxSimulationOptions(); $output = []; foreach ($sandboxSimulationOptions as $key => $value) { $output[] = [ 'labelText' => $value, 'simulationValue' => $key, ]; } return $output; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/Form/SimplepathConfig.php000077700000003473151323541140027460 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\System\Config\Form; use Magento\Backend\Block\Template\Context; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SimplepathConfig extends \Magento\Config\Block\System\Config\Form\Field { /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) { $html = $this->_layout ->createBlock(\Amazon\Core\Block\Adminhtml\System\Config\SimplePathAdmin::class) ->setTemplate('Amazon_Core::system/config/simplepath_admin.phtml') ->setCacheable(false) ->toHtml(); return '<div id="row_' . $element->getHtmlId() . '">' . $html . '</div>'; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/Form/DeveloperLogs.php000077700000010650151323541140026771 0ustar00<?php /** * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. * */ namespace Amazon\Core\Block\Adminhtml\System\Config\Form; use Magento\Backend\Block\Template\Context; use Magento\Backend\Model\UrlInterface; use Magento\Framework\App\Filesystem\DirectoryList; /** * Displays links to available custom logs * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class DeveloperLogs extends \Magento\Config\Block\System\Config\Form\Field { const DOWNLOAD_PATH = 'amazonlogs/download'; const LOGS = [ 'ipnLog' => ['name' => 'IPN Log', 'path' => '/var/log/amazonipn.log'], 'clientLog' => ['name' => 'Client Log', 'path' => '/var/log/paywithamazon.log'] ]; /** * @var DirectoryList */ private $directoryList; /** * @var UrlInterface */ private $urlBuilder; /** * DeveloperLogs constructor. * @param Context $context * @param DirectoryList $directoryList * @param UrlInterface $urlBuilder * @param array $data */ public function __construct( Context $context, DirectoryList $directoryList, UrlInterface $urlBuilder, $data = [] ) { $this->directoryList = $directoryList; $this->urlBuilder = $urlBuilder; parent::__construct($context, $data); } /** * @inheritdoc */ protected function _prepareLayout() { parent::_prepareLayout(); if (!$this->getTemplate()) { $this->setTemplate('system/config/logs.phtml'); } return $this; } /** * Render log list * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @throws \Magento\Framework\Exception\LocalizedException */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) { // Remove scope label $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); return parent::render($element); } /** * Renders string as an html element * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * * @return string */ protected function _getElementHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element) { return $this->_toHtml(); } /** * Returns markup for developer log field. * * @return \Magento\Framework\Phrase|string */ public function getLinks() { $links = $this->getLogFiles(); if ($links) { $output = ''; foreach ($links as $link) { $output .= '<a href="' . $link['link'] . '">' . $link['name'] . '</a><br />'; } return $output; } return __('No logs are currently available.'); } /** * Get list of available log files. * * @return array */ private function getLogFiles() { $links = []; $path = $this->directoryList->getPath(DirectoryList::ROOT); foreach (self::LOGS as $name => $data) { $filePath = $data['path']; $exists = file_exists($path . $filePath); if ($exists) { $links[] = ['link' => $this->urlBuilder->getUrl(self::DOWNLOAD_PATH . '/' . $name), 'name' => $data['name']]; } } return $links; } /** * Return ajax url for synchronize button * * @return string */ public function getAjaxSyncUrl() { return $this->getUrl('amazon_core/system_config/amazonlogs'); } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/Form/Version.php000077700000004451151323541140025646 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\System\Config\Form; use Magento\Backend\Block\Template\Context; use Amazon\Core\Helper\Data as CoreHelper; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Version extends \Magento\Config\Block\System\Config\Form\Field { /** * @var CoreHelper */ private $coreHelper; /** * Version constructor. * @param CoreHelper $coreHelper * @param Context $context * @param array $data */ public function __construct( Context $context, CoreHelper $coreHelper, array $data = [] ) { $this->coreHelper = $coreHelper; parent::__construct($context, $data); } /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) { $version = $this->coreHelper->getVersion(); if (!$version) { $version = __('--'); } $output = '<div style="background-color:#eee;padding:1em;border:1px solid #ddd;">'; $output .= __('Module version') . ': ' . $version; $output .= "</div>"; return '<div id="row_' . $element->getHtmlId() . '">' . $output . '</div>'; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/Form/.htaccess000077700000000177151323541140025307 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/.htaccess000077700000000177151323541140024404 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/Config/SimplePathAdmin.php000077700000004234151323541140026334 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\System\Config; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class SimplePathAdmin extends \Magento\Framework\View\Element\Template { /** * @var SimplePath */ private $simplePath; /** * SimplePathAdmin constructor. * * @param \Magento\Framework\View\Element\Template\Context $context * @param \Amazon\Core\Model\Config\SimplePath $simplePath * @param array $data */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Amazon\Core\Model\Config\SimplePath $simplePath, array $data = [] ) { parent::__construct($context, $data); $this->simplePath = $simplePath; } /** * Return SimplePath settings */ public function getJsonConfig() { return json_encode($this->simplePath->getJsonAmazonSpConfig()); } /** * Return region */ public function getRegion() { return $this->simplePath->getRegion(); } /** * Return currency */ public function getCurrency() { return $this->simplePath->getCurrency(); } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/System/.htaccess000077700000000177151323541140023177 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/Field/CategoryMultiselect.php000077700000003314151323541140026540 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\Form\Field; use Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Category; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CategoryMultiselect extends Category { /** * {@inheritdoc} */ public function getAfterElementHtml() { $htmlId = $this->getHtmlId(); $suggestPlaceholder = __('click here to display the categories'); $selectorOptions = $this->_jsonEncoder->encode($this->_getSelectorOptions()); return <<<HTML <input id="{$htmlId}-suggest" placeholder="$suggestPlaceholder" /> <script> require(["jquery", "mage/mage"], function($){ $('#{$htmlId}-suggest').mage('treeSuggest', {$selectorOptions}); }); </script> HTML; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/Field/RedirectUrl.php000077700000005163151323541140025000 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\Form\Field; use Magento\Config\Block\System\Config\Form\Field as BaseField; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\UrlInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class RedirectUrl extends BaseField { /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderValue(AbstractElement $element) { $stores = $this->_storeManager->getStores(); $valueReturn = ''; $urlArray = []; foreach ($stores as $store) { $baseUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_WEB, true); if ($baseUrl) { $value = $baseUrl . 'amazon/login/processAuthHash/'; $urlArray[] = "<div>".$this->escapeHtml($value)."</div>"; } } $urlArray = array_unique($urlArray); foreach ($urlArray as $uniqueUrl) { $valueReturn .= "<div>".$uniqueUrl."</div>"; } return '<td class="value">' . $valueReturn . '</td>'; } /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderInheritCheckbox(AbstractElement $element) { return '<td class="use-default"></td>'; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/Field/JsOrigin.php000077700000005274151323541140024303 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\Form\Field; use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field as BaseField; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\UrlInterface; use Zend\Uri\UriFactory; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class JsOrigin extends BaseField { /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderValue(AbstractElement $element) { $stores = $this->_storeManager->getStores(); $valueReturn = ''; $urlArray = []; foreach ($stores as $store) { $baseUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_WEB, true); if ($baseUrl) { $uri = UriFactory::factory($baseUrl); $urlArray[] = $this->escapeHtml($uri->getScheme() . '://' . $uri->getHost()); } } $urlArray = array_unique($urlArray); foreach ($urlArray as $uniqueUrl) { $valueReturn .= "<div>".$uniqueUrl."</div>"; } return '<td class="value">' . $valueReturn . '</td>'; } /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderInheritCheckbox(AbstractElement $element) { return '<td class="use-default"></td>'; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/Field/.htaccess000077700000000177151323541140023641 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/Field/IpnUrl.php000077700000004576151323541140023774 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Block\Adminhtml\Form\Field; use Magento\Config\Block\System\Config\Form\Field as BaseField; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\UrlInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IpnUrl extends BaseField { /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderValue(AbstractElement $element) { $store = $this->_storeManager->getDefaultStoreView(); $valueReturn = ''; $baseUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_WEB, true); if ($baseUrl) { $value = $baseUrl . 'amazonpayments/payment/ipn/'; $valueReturn = "<div>".$this->escapeHtml($value)."</div>"; } return '<td class="value">' . $valueReturn . '</td>'; } /** * Render element value * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ protected function _renderInheritCheckbox(AbstractElement $element) { return '<td class="use-default"></td>'; } } amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/Form/.htaccess000077700000000177151323541140022616 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/Adminhtml/.htaccess000077700000000177151323541140021713 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Block/.htaccess000077700000000177151323541140017776 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Observer/PaymentConfigSaveAfter.php000077700000011151151323541140024004 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Observer; use Amazon\Core\Helper\Data; use Amazon\Core\Model\Validation\ApiCredentialsValidatorFactory; use Amazon\Core\Model\Config\Credentials\Json; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; use Magento\Framework\Message\ManagerInterface; use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Framework\App\RequestInterface; use Magento\Store\Model\ScopeInterface; use Magento\Framework\App\Config\Storage\WriterInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class PaymentConfigSaveAfter implements ObserverInterface { /** * @var ApiCredentialsValidatorFactory */ private $apiCredentialsValidatorFactory; /** * @var ManagerInterface */ private $messageManager; /** * @var Json */ private $jsonCredentials; /** * @var Data */ private $amazonCoreHelper; /** * Application config * * @var ReinitableConfigInterface */ private $appConfig; /** * @var RequestInterface */ private $request; /** * PaymentConfigSaveAfter constructor. * * @param ApiCredentialsValidatorFactory $apiCredentialsValidatorFactory * @param ManagerInterface $messageManager * @param Json $jsonCredentials * @param Data $amazonCoreHelper * @param ReinitableConfigInterface $config * @param RequestInterface $request */ public function __construct( ApiCredentialsValidatorFactory $apiCredentialsValidatorFactory, ManagerInterface $messageManager, Json $jsonCredentials, Data $amazonCoreHelper, ReinitableConfigInterface $config, RequestInterface $request ) { $this->apiCredentialsValidatorFactory = $apiCredentialsValidatorFactory; $this->messageManager = $messageManager; $this->amazonCoreHelper = $amazonCoreHelper; $this->jsonCredentials = $jsonCredentials; $this->appConfig = $config; $this->request = $request; } /** * {@inheritdoc} */ public function execute(Observer $observer) { if (!$this->request->getParam('amazon_test_creds')) { return; } $scopeData = $this->getScopeData($observer); $jsonCredentials = $this->amazonCoreHelper->getCredentialsJson($scopeData['scope'], $scopeData['scope_id']); if (!empty($jsonCredentials)) { $this->appConfig->reinit(); $this->jsonCredentials->processCredentialsJson($jsonCredentials, $scopeData); } /** @see \Magento\Config\Model\Config::save() */ $validator = $this->apiCredentialsValidatorFactory->create(); $messageManagerMethod = 'addErrorMessage'; if ($validator->isValid($scopeData['scope_id'], $scopeData['scope'])) { $messageManagerMethod = 'addSuccessMessage'; } foreach ($validator->getMessages() as $message) { $this->messageManager->$messageManagerMethod($message); } } protected function getScopeData($observer) { $scopeData = []; $scopeData['scope'] = 'default'; $scopeData['scope_id'] = null; $website = $observer->getWebsite(); $store = $observer->getStore(); if ($website) { $scopeData['scope'] = ScopeInterface::SCOPE_WEBSITES; $scopeData['scope_id'] = $website; } if ($store) { $scopeData['scope'] = ScopeInterface::SCOPE_STORES; $scopeData['scope_id'] = $store; } return $scopeData; } } amazon-pay-and-login-with-amazon-core-module/Observer/ExcludedCategoryQuoteItemAddition.php000077700000004733151323541140026214 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Observer; use Amazon\Core\Helper\Data; use Amazon\Core\Helper\CategoryExclusion; use Magento\Checkout\Model\Session; use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ExcludedCategoryQuoteItemAddition implements ObserverInterface { /** * @var CategoryExclusion */ private $categoryExclusionHelper; /** * @var Data */ private $coreHelper; /** * @param CategoryExclusion $categoryExclusionHelper * @param Data $coreHelper */ public function __construct( CategoryExclusion $categoryExclusionHelper, Data $coreHelper ) { $this->categoryExclusionHelper = $categoryExclusionHelper; $this->coreHelper = $coreHelper; } /** * {@inheritdoc} */ public function execute(Observer $observer) { /** @see \Magento\Quote\Model\Quote::addProduct() */ if ($this->coreHelper->isPwaEnabled()) { /** @var \Magento\Quote\Model\Quote\Item\AbstractItem $quoteItem */ foreach ($observer->getItems() as $quoteItem) { $isExcludedProduct = $this->categoryExclusionHelper->productHasExcludedCategory( $quoteItem->getProduct() ); $quoteItem->setDataUsingMethod( CategoryExclusion::ATTR_QUOTE_ITEM_IS_EXCLUDED_PRODUCT, $isExcludedProduct ); } } } } amazon-pay-and-login-with-amazon-core-module/Observer/.htaccess000077700000000177151323541140020533 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Setup/UpgradeData.php000077700000005020151323541140021130 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Setup; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Framework\Setup\UpgradeDataInterface; /** * Class UpgradeData * Ensures default authorization mode is set if upgrading from earlier versions * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class UpgradeData implements UpgradeDataInterface { /** * @param ModuleDataSetupInterface $setup * @param ModuleContextInterface $context */ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { // Used update query because all scopes needed to have this value updated and this is a fast, simple approach if (version_compare($context->getVersion(), '2.1.1', '<')) { $select = $setup->getConnection()->select()->from( $setup->getTable('core_config_data'), ['config_id', 'value'] )->where( 'path = ?', 'payment/amazon_payment/authorization_mode' ); foreach ($setup->getConnection()->fetchAll($select) as $configRow) { if ($configRow['value'] === 'asynchronous') { $row = [ 'value' => 'synchronous_possible' ]; $setup->getConnection()->update( $setup->getTable('core_config_data'), $row, ['config_id = ?' => $configRow['config_id']] ); } } } } } amazon-pay-and-login-with-amazon-core-module/Setup/.htaccess000077700000000177151323541140020044 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Helper/Data.php000077700000054371151323541140017754 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Framework\Encryption\EncryptorInterface; use Magento\Store\Model\ScopeInterface; use Magento\Store\Model\StoreManagerInterface; use Magento\Framework\Module\ModuleListInterface; use Magento\Framework\Module\StatusFactory; use Amazon\Core\Model\AmazonConfig; /** * @SuppressWarnings(PHPMD.ExcessivePublicCount) */ /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Data extends AbstractHelper { const AMAZON_ACTIVE = 'payment/amazon_payment/active'; /** * @var EncryptorInterface */ private $encryptor; /** * @var StoreManagerInterface */ private $storeManager; /** * @var \Amazon\Core\Helper\ClientIp */ private $clientIpHelper; /** * @var ModuleListInterface */ private $moduleList; /** * @var StatusFactory */ private $moduleStatusFactory; /** * @var AmazonConfig */ private $config; /** * Data constructor. * * @param ModuleListInterface $moduleList * @param Context $context * @param EncryptorInterface $encryptor * @param StoreManagerInterface $storeManager * @param ClientIp $clientIpHelper * @param StatusFactory $moduleStatusFactory * @param AmazonConfig $config */ public function __construct( ModuleListInterface $moduleList, Context $context, EncryptorInterface $encryptor, StoreManagerInterface $storeManager, ClientIp $clientIpHelper, StatusFactory $moduleStatusFactory, AmazonConfig $config ) { parent::__construct($context); $this->moduleList = $moduleList; $this->encryptor = $encryptor; $this->storeManager = $storeManager; $this->clientIpHelper = $clientIpHelper; $this->moduleStatusFactory = $moduleStatusFactory; $this->config = $config; } /* * @return string */ public function getMerchantId($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/merchant_id', $scope, $scopeCode ); } /* * @return string */ public function getAccessKey($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/access_key', $scope, $scopeCode ); } /* * @return string */ public function getSecretKey($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $secretKey = $this->scopeConfig->getValue( 'payment/amazon_payment/secret_key', $scope, $scopeCode ); $secretKey = $this->encryptor->decrypt($secretKey); return $secretKey; } /* * @return string */ public function getClientId($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/client_id', $scope, $scopeCode ); } /* * @return string */ public function getClientSecret($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $clientSecret = $this->scopeConfig->getValue( 'payment/amazon_payment/client_secret', $scope, $scopeCode ); $clientSecret = $this->encryptor->decrypt($clientSecret); return $clientSecret; } /* * @return string * * @deprecated - use \Amazon\Core\Model\AmazonConfig::getPaymentRegion() instead */ public function getPaymentRegion($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/payment_region', $scope, $scopeCode ); } /* * @return string */ public function getRegion($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->getPaymentRegion($scope, $scopeCode); } /* * @return string */ public function getCurrencyCode($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $paymentRegion = $this->getPaymentRegion($scope, $scopeCode); $currencyCodeMap = [ 'de' => 'EUR', 'uk' => 'GBP', 'us' => 'USD', 'jp' => 'JPY' ]; return array_key_exists($paymentRegion, $currencyCodeMap) ? $currencyCodeMap[$paymentRegion] : ''; } /** * @return array */ public function getScaRegions($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $regionList = $this->scopeConfig->getValue( 'payment/amazon_payment/sca_regions', $scope, $scopeCode ); $regions = explode(',', $regionList); return is_array($regions) ? $regions : []; } /* * @return string */ public function getWidgetUrl($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $paymentRegion = $this->getPaymentRegion($scope, $scopeCode); $sandboxEnabled = $this->isSandboxEnabled($scope, $scopeCode); $widgetUrlMap = [ 'de' => $this->getWidgetPath('production/de'), 'uk' => $this->getWidgetPath('production/uk'), 'us' => $this->getWidgetPath('production/us'), 'jp' => $this->getWidgetPath('production/jp') ]; if ($sandboxEnabled) { $widgetUrlMap = [ 'de' => $this->getWidgetPath('sandbox/de'), 'uk' => $this->getWidgetPath('sandbox/uk'), 'us' => $this->getWidgetPath('sandbox/us'), 'jp' => $this->getWidgetPath('sandbox/jp') ]; } return array_key_exists($paymentRegion, $widgetUrlMap) ? $widgetUrlMap[$paymentRegion] : ''; } /** * Retrieves region path from config.xml settings * * @param $key * @param null $store * @return mixed */ public function getWidgetPath($key, $store = null) { return $this->scopeConfig->getValue( 'widget/' . $key, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); } /** * @param string $scope * @param null|string $scopeCode * * @return string */ public function getLoginScope($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $paymentRegion = $this->getPaymentRegion($scope, $scopeCode); $scope = [ 'profile', 'payments:widget', 'payments:shipping_address', 'payments:billing_address' ]; return implode(' ', $scope); } /** * @param string $scope * * @return boolean */ public function isEuPaymentRegion($scope = ScopeInterface::SCOPE_STORE) { $paymentRegion = $this->getPaymentRegion($scope); return (in_array($paymentRegion, ['uk', 'de'])); } /* * @return bool */ public function isSandboxEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return (bool)$this->scopeConfig->getValue( 'payment/amazon_payment/sandbox', $scope, $scopeCode ); } /* * @return bool */ public function isPwaEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { if (!$this->moduleList->has('Amazon_Payment') || !$this->moduleList->has('Amazon_Login')) { $this->updateModuleStatus(); return false; } if (!$this->clientIpHelper->clientHasAllowedIp()) { return false; } return $this->scopeConfig->isSetFlag( self::AMAZON_ACTIVE, $scope, $scopeCode ); } /* * @return bool */ public function isLwaEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { if (!$this->moduleList->has('Amazon_Payment') || !$this->moduleList->has('Amazon_Login')) { $this->updateModuleStatus(); return false; } if (!$this->clientIpHelper->clientHasAllowedIp()) { return false; } return $this->scopeConfig->isSetFlag( 'payment/amazon_payment/lwa_enabled', $scope, $scopeCode ); } /* * @return bool */ public function isEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { if (!$this->moduleList->has('Amazon_Payment') || !$this->moduleList->has('Amazon_Login')) { $this->updateModuleStatus(); return false; } return $this->isLwaEnabled($scope, $scopeCode) || $this->isPwaEnabled($scope, $scopeCode); } /* * @return string */ public function getPaymentAction($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/payment_action', $scope, $scopeCode ); } /* * @return string */ public function getAuthorizationMode($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/authorization_mode', $scope, $scopeCode ); } /* * @return string */ public function getUpdateMechanism($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/update_mechanism', $scope, $scopeCode ); } /* * @return string */ public function getButtonDisplayLanguage($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $buttonConfigLang = $this->scopeConfig ->getValue('payment/amazon_payment/button_display_language', $scope, $scopeCode); if (empty($buttonConfigLang)) { $buttonConfigLang = $this->scopeConfig->getValue('general/locale/code', $scope, $scopeCode); } return str_replace('_', '-', $buttonConfigLang); } /* * @return string */ public function getButtonType($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/button_type', $scope, $scopeCode ); } /* * @return string */ public function getButtonTypePwa($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $buttonType = $this->getButtonType($scope, $scopeCode); $buttonTypeMap = [ 'full' => 'PwA', 'short' => 'Pay', 'logo' => 'A', ]; return array_key_exists($buttonType, $buttonTypeMap) ? $buttonTypeMap[$buttonType] : ''; } /* * @return string */ public function getButtonTypeLwa($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $buttonType = $this->getButtonType($scope, $scopeCode); $buttonTypeMap = [ 'full' => 'LwA', 'short' => 'Login', 'logo' => 'A', ]; return array_key_exists($buttonType, $buttonTypeMap) ? $buttonTypeMap[$buttonType] : ''; } /* * @return string */ public function getButtonColor($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/button_color', $scope, $scopeCode ); } /* * @return string */ public function getButtonSize($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/button_size', $scope, $scopeCode ); } /* * @return string */ public function getEmailStoreName($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/email_store_name', $scope, $scopeCode ); } /* * @return string */ public function getAdditionalAccessScope($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/additional_access_scope', $scope, $scopeCode ); } /* * @return bool */ public function isLoggingEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return (bool)$this->scopeConfig->getValue( 'payment/amazon_payment/logging', $scope, $scopeCode ); } /* * @return string */ public function getStoreName($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->getValue( 'payment/amazon_payment/storename', $scope, $scopeCode ); } /* * @return string */ public function getStoreFrontName($storeId) { return $this->storeManager->getStore($storeId)->getName(); } /* * @return string */ public function getRedirectUrl() { $urlPath = $this->isLwaEnabled() ? 'amazon/login/authorize' : 'amazon/login/guest'; return $this->_getUrl($urlPath, ['_secure' => true]); } /** * @param string|null $context * * @return array */ public function getSandboxSimulationStrings($context = null) { $simulationStrings = [ 'default' => null ]; if (in_array($context, ['authorization', 'authorization_capture'])) { $simulationStrings['Authorization:Declined:InvalidPaymentMethod'] = '{"SandboxSimulation": {"State":"Declined", "ReasonCode":"InvalidPaymentMethod", ' . '"PaymentMethodUpdateTimeInMins":5}}'; $simulationStrings['Authorization:Declined:AmazonRejected'] = '{"SandboxSimulation": {"State":"Declined", "ReasonCode":"AmazonRejected"}}'; $simulationStrings['Authorization:Declined:TransactionTimedOut'] = '{"SandboxSimulation": {"State":"Declined", "ReasonCode":"TransactionTimedOut"}}'; } if (in_array($context, ['capture', 'authorization_capture'])) { $simulationStrings['Capture:Declined:AmazonRejected'] = '{"SandboxSimulation": {"State":"Declined", "ReasonCode":"AmazonRejected"}}'; $simulationStrings['Capture:Pending'] = '{"SandboxSimulation": {"State":"Pending"}}'; } if (in_array($context, ['refund'])) { $simulationStrings['Refund:Declined'] = '{"SandboxSimulation": {"State":"Declined", "ReasonCode":"AmazonRejected"}}'; } return $simulationStrings; } /** * @return array */ public function getSandboxSimulationOptions() { $simulationlabels = [ 'default' => __('No Simulation'), 'Authorization:Declined:InvalidPaymentMethod' => __('Authorization soft decline'), 'Authorization:Declined:AmazonRejected' => __('Authorization hard decline'), 'Authorization:Declined:TransactionTimedOut' => __('Authorization timed out') ]; return $simulationlabels; } /** * @param string $scope * @param null $scopeCode * @return bool */ public function isPaymentButtonEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return ($this->isPwaEnabled($scope, $scopeCode) && $this->isCurrentCurrencySupportedByAmazon()); } /** * @return bool */ public function isLoginButtonEnabled() { return ($this->isLwaEnabled() && $this->isPwaEnabled() && $this->isCurrentCurrencySupportedByAmazon()); } /** * @return bool */ public function isCurrentCurrencySupportedByAmazon() { $regionCurrency = $this->getCurrencyCode(); $currentCurrency = $this->config->getPresentmentCurrency(); return $currentCurrency === $regionCurrency || $this->config->canUseCurrency($currentCurrency); } /** * @param string $paymentRegion E.g. "uk", "us", "de", "jp". * * @return mixed */ public function getAmazonAccountUrlByPaymentRegion($paymentRegion) { $url = $this->getPaymentRegionUrl($paymentRegion); if (!$url || empty($url)) { throw new \InvalidArgumentException("$paymentRegion is not a valid payment region"); } return $url; } /** * Retrieves region path from config.xml settings * * @param $key * @param null $store * @return mixed */ public function getPaymentRegionUrl($key, $store = null) { return $this->scopeConfig->getValue( 'region/country/' . $key, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); } /** * Retrieves client path from config.xml settings * * @param $key * @param null $store * @return mixed */ public function getClientPath($key, $store = null) { return $this->scopeConfig->getValue( 'client/paths/' . $key, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store ); } /** * @param string $scope * @param null|string $scopeCode * * @return array */ public function getBlackListedTerms($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $terms = $this->scopeConfig->getValue('payment/amazon_payment/packstation_terms', $scope, $scopeCode); return explode(',', $terms); } /** * @param string $scope * @param null|string $scopeCode * * @return bool */ public function isBlacklistedTermValidationEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig ->isSetFlag('payment/amazon_payment/packstation_terms_validation_enabled', $scope, $scopeCode); } /** * @return string */ public function getOAuthRedirectUrl() { return $this->_getUrl('amazon/login/processAuthHash', ['_secure' => true]); } /** * @param string $scope * @param null|string $scopeCode * * @return bool */ public function isPwaButtonVisibleOnProductPage($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->isPaymentButtonEnabled($scope, $scopeCode) && $this->scopeConfig->isSetFlag('payment/amazon_payment/pwa_pp_button_is_visible', $scope, $scopeCode); } /** * @param string $scope * @param null $scopeCode * @return bool */ public function isPayButtonAvailableInMinicart($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->isSetFlag('payment/amazon_payment/minicart_button_is_visible', $scope, $scopeCode); } /** * @param string $scope * @param null $scopeCode * @return bool */ public function allowAmLoginLoading($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig->isSetFlag( 'payment/amazon_payment/amazon_login_in_popup', $scope, $scopeCode ); } /** * @param string $scope * @param null|string $scopeCode * * @return string */ public function getCredentialsJson($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { return $this->scopeConfig ->getValue('payment/amazon_payment/credentials_json', $scope, $scopeCode); } /** * @return array */ public function getAmazonCredentialsFields() { return [ $this->getClientPath('secretkey'), $this->getClientPath('accesskey'), $this->getClientPath('merchantid'), $this->getClientPath('clientid'), $this->getClientPath('clientsecret') ]; } /** * @return array */ public function getAmazonCredentialsEncryptedFields() { return [ $this->getClientPath('secretkey'), $this->getClientPath('clientsecret') ]; } /** * @return null */ public function getVersion() { $version = $this->moduleList->getOne('Amazon_Core'); if ($version && isset($version['setup_version'])) { return $version['setup_version']; } else { return null; } } /** * Ensures all modules are disabled if one of them is disabled. Amazon Payment or Amazon Login modules will cause * the frontend to break if they are in different enabled states. */ private function updateModuleStatus() { $isDisabled = $this->moduleList->has('Amazon_Payment') ? 0 : 1; $isDisabled += $this->moduleList->has('Amazon_Login') ? 0 : 1; $isDisabled += $this->moduleList->has('Amazon_Core') ? 0 : 1; // Make sure all of them are disabled if any one of them is disabled. if ($isDisabled > 0 && $isDisabled != 3) { $this->moduleStatusFactory->create()->setIsEnabled(false, ['Amazon_Payment', 'Amazon_Login', 'Amazon_Core']); } } } amazon-pay-and-login-with-amazon-core-module/Helper/ClientIp.php000077700000004716151323541140020610 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Store\Model\ScopeInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ClientIp extends AbstractHelper { /** * @var string */ private $clientIp; /** * @var bool */ private $clientHasAllowedIp; /** * @param Context $context */ public function __construct(Context $context) { parent::__construct($context); // e.g. X-Forwarded-For can have a comma-separated list of IPs $this->clientIp = explode(',', $context->getRemoteAddress()->getRemoteAddress())[0]; $allowedIps = $this->getAllowedIps(); $this->clientHasAllowedIp = empty($allowedIps) ? true : in_array($this->clientIp, $allowedIps); } /** * @return string */ public function getRemoteClientIp() { return $this->clientIp; } /** * @param string $scope * @param string|null $scopeCode * * @return string[] */ public function getAllowedIps($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $allowedIpsString = $this->scopeConfig->getValue('payment/amazon_payment/allowed_ips', $scope, $scopeCode); return empty($allowedIpsString) ? [] : explode(',', $allowedIpsString); } /** * @return bool */ public function clientHasAllowedIp() { return $this->clientHasAllowedIp; } } amazon-pay-and-login-with-amazon-core-module/Helper/CategoryExclusion.php000077700000006572151323541140022552 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Helper; use Magento\Catalog\Model\Product; use Magento\Checkout\Model\Session; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Framework\App\Helper\Context; use Magento\Quote\Model\Quote; use Magento\Store\Model\ScopeInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class CategoryExclusion extends AbstractHelper { const ATTR_QUOTE_ITEM_IS_EXCLUDED_PRODUCT = 'is_excluded_product'; /** * @var Session */ protected $checkoutSession; /** * @param Context $context * @param Session $checkoutSession */ public function __construct(Context $context, Session $checkoutSession) { parent::__construct($context); $this->checkoutSession = $checkoutSession; } /** * @param string $scope * @param null|string $scopeCode * * @return array */ public function getExcludedCategories($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null) { $excludedCategoryIds = $this->scopeConfig ->getValue('payment/amazon_payment/excluded_categories', $scope, $scopeCode); return explode(',', $excludedCategoryIds); } /** * @param Product $product * * @return bool */ public function productHasExcludedCategory(Product $product) { /** * \Magento\Catalog\Model\Product::getCategoryIds() doesn't take into consideration the *current* * category, but returns *all* of the associated categories IDs of the product. * * This means that, even if the *current* category is not blacklisted, the button might still not * appear. This is expected behaviour. */ return count(array_intersect($product->getCategoryIds(), $this->getExcludedCategories())) > 0; } /** * @return bool */ public function isQuoteDirty() { if (!empty($this->getExcludedCategories())) { /** @var \Magento\Quote\Model\Quote\Item\AbstractItem $quoteItem */ foreach ($this->checkoutSession->getQuote()->getAllItems() as $quoteItem) { $isDirtyQuoteItem = $quoteItem->getDataUsingMethod( CategoryExclusion::ATTR_QUOTE_ITEM_IS_EXCLUDED_PRODUCT ); if (!$quoteItem->isDeleted() && $isDirtyQuoteItem) { return true; } } } return false; } } amazon-pay-and-login-with-amazon-core-module/Helper/.htaccess000077700000000177151323541140020163 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Logger/IpnLogger.php000077700000002163151323541140020761 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Logger; /** * Enables implementation of custom log file. * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class IpnLogger extends \Monolog\Logger { } amazon-pay-and-login-with-amazon-core-module/Logger/Logger.php000077700000002160151323541140020307 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Logger; /** * Enables implementation of custom log file. * * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Logger extends \Monolog\Logger { } amazon-pay-and-login-with-amazon-core-module/Logger/Handler/Client.php000077700000002476151323541140021675 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Logger\Handler; use Magento\Framework\Logger\Handler\Base; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Client extends Base { const FILENAME = '/var/log/paywithamazon.log'; /** * @var string */ protected $fileName = self::FILENAME; /** * @var int */ protected $loggerType = \Monolog\Logger::DEBUG; } amazon-pay-and-login-with-amazon-core-module/Logger/Handler/Ipn.php000077700000002467151323541140021205 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Logger\Handler; use Magento\Framework\Logger\Handler\Base; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class Ipn extends Base { const FILENAME = '/var/log/amazonipn.log'; /** * @var string */ protected $fileName = self::FILENAME; /** * @var int */ protected $loggerType = \Monolog\Logger::DEBUG; } amazon-pay-and-login-with-amazon-core-module/Logger/Handler/.htaccess000077700000000177151323541140021540 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Logger/ExceptionLogger.php000077700000002521151323541140022167 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Logger; use Psr\Log\LoggerInterface; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class ExceptionLogger { private $logger; public function __construct(LoggerInterface $logger) { $this->logger = $logger; } public function logException(\Exception $e) { $message = (string) $e; $this->logger->addError($message); } } amazon-pay-and-login-with-amazon-core-module/Logger/.htaccess000077700000000177151323541140020163 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/composer.json000077700000001641151323541140017665 0ustar00{ "name": "amzn/amazon-pay-and-login-with-amazon-core-module", "description": "Shared functionality for Amazon Pay and Login with Amazon modules", "type": "magento2-module", "version": "4.2.0", "abandoned": "amzn/amazon-pay-v2-magento-2-module", "license": [ "Apache-2.0" ], "require": { "php": "~7.3.0||~7.4.0", "magento/framework": "*", "magento/module-sales": "*", "magento/module-config": "*", "magento/module-store": "*", "magento/module-developer": "*", "magento/module-quote": "*", "magento/module-catalog": "*", "magento/module-customer": "*", "magento/module-checkout": "*", "magento/module-backend": "*", "magento/module-payment": "*", "magento/module-paypal": "*", "magento/module-eav": "*", "amzn/amazon-pay-sdk-php": "^3.2.0" }, "autoload": { "files": ["registration.php"], "psr-4": { "Amazon\\Core\\": "" } } } amazon-pay-and-login-with-amazon-core-module/Exception/.htaccess000077700000000177151323541140020702 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>amazon-pay-and-login-with-amazon-core-module/Exception/AmazonWebapiException.php000077700000002733151323541140024051 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Exception; use Magento\Framework\Phrase; use Magento\Framework\Webapi\Exception; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonWebapiException extends Exception { public function __construct( Phrase $phrase, $code = 0, $httpCode = self::HTTP_BAD_REQUEST, array $details = [], $name = '', $errors = null, $stackTrace = null ) { parent::__construct($phrase, $code, $httpCode, $details, $name, $errors, $stackTrace); } } amazon-pay-and-login-with-amazon-core-module/Exception/AmazonServiceUnavailableException.php000077700000004400151323541140026377 0ustar00<?php /** * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ namespace Amazon\Core\Exception; use Magento\Framework\Exception\LocalizedException; /** * @deprecated As of February 2021, this Legacy Amazon Pay plugin has been * deprecated, in favor of a newer Amazon Pay version available through GitHub * and Magento Marketplace. Please download the new plugin for automatic * updates and to continue providing your customers with a seamless checkout * experience. Please see https://pay.amazon.com/help/E32AAQBC2FY42HS for details * and installation instructions. */ class AmazonServiceUnavailableException extends LocalizedException { const ERROR_MESSAGE = 'Amazon could not process your request.'; /** * @var string */ private $apiErrorType; /** * @var string */ private $apiErrorCode; /** * @var string */ private $apiErrorMessage; /** * AmazonServiceUnavailableException constructor. * @param string $apiErrorType * @param string $apiErrorCode * @param string $apiErrorMessage */ public function __construct($apiErrorType = '', $apiErrorCode = '', $apiErrorMessage = '') { $this->apiErrorType = $apiErrorType; $this->apiErrorCode = $apiErrorCode; $this->apiErrorMessage = $apiErrorMessage; parent::__construct(__('Amazon could not process your request.')); } /** * @return string */ public function getApiErrorType() { return $this->apiErrorType; } /** * @return string */ public function getApiErrorCode() { return $this->apiErrorCode; } /** * @return string */ public function getApiErrorMessage() { return $this->apiErrorMessage; } } amazon-pay-and-login-with-amazon-core-module/.htaccess000077700000000177151323541140016744 0ustar00<FilesMatch '.(py|exe|php|PHP|Php|PHp|pHp|pHP|pHP7|PHP7|phP|PhP|php5|suspected)$'> Order allow,deny Deny from all </FilesMatch>
/var/www/html/dhandapani/a8fc6/../ebd7e/../9da53/amzn.tar