author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
21,244 | 28.05.2020 22:52:22 | 0 | 09dcecf3ae7cf8c0d872d83a237e83fd3dfca302 | Fixed Displaying Billing Address On Payment Page | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"new_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"diff": "@@ -23,29 +23,21 @@ class CheckoutProcessor\nprivate $amazonConfig;\n/**\n- * @var \\Amazon\\PayV2\\Helper\\Data\n+ * @var \\Magento\\Checkout\\Helper\\Data\n*/\n- private $amazonHelper;\n-\n- /**\n- * @var \\Magento\\Checkout\\Model\\Session\n- */\n- private $checkoutSession;\n+ private $checkoutDataHelper;\n/**\n* CheckoutProcessor constructor.\n* @param \\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig\n- * @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n- * @param \\Magento\\Checkout\\Model\\Session $checkoutSession\n+ * @param \\Magento\\Checkout\\Helper\\Data $checkoutDataHelper\n*/\npublic function __construct(\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n- \\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n- \\Magento\\Checkout\\Model\\Session $checkoutSession\n+ \\Magento\\Checkout\\Helper\\Data $checkoutDataHelper\n) {\n$this->amazonConfig = $amazonConfig;\n- $this->amazonHelper = $amazonHelper;\n- $this->checkoutSession = $checkoutSession;\n+ $this->checkoutDataHelper = $checkoutDataHelper;\n}\n/**\n@@ -71,8 +63,14 @@ class CheckoutProcessor\n['component'] = 'Amazon_PayV2/js/view/shipping-address/address-renderer/default';\n$paymentConfig['children']['payments-list']['component'] = 'Amazon_PayV2/js/view/payment/list';\n- $paymentConfig['children']['payments-list']['children'][\\Amazon\\PayV2\\Gateway\\Config\\Config::CODE . '-form']['component'] = 'Amazon_PayV2/js/view/billing-address';\n- $paymentConfig['children']['payments-list']['children'][\\Amazon\\PayV2\\Gateway\\Config\\Config::CODE . '-form']['isAddressEditable'] = $this->amazonConfig->isBillingAddressEditable();\n+\n+ if ($this->checkoutDataHelper->isDisplayBillingOnPaymentMethodAvailable()) {\n+ $billingConfig = &$paymentConfig['children']['payments-list']['children'][\\Amazon\\PayV2\\Gateway\\Config\\Config::CODE . '-form'];\n+ } else {\n+ $billingConfig = &$paymentConfig['children']['afterMethods']['children']['billing-address-form'];\n+ }\n+ $billingConfig['component'] = 'Amazon_PayV2/js/view/billing-address';\n+ $billingConfig['isAddressEditable'] = $this->amazonConfig->isBillingAddressEditable();\nunset($paymentConfig['children']['renders']['children']['amazonlogin']); // legacy\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/billing-address/form-address-state.js",
"new_path": "src/PayV2/view/frontend/web/js/model/billing-address/form-address-state.js",
"diff": "@@ -4,6 +4,7 @@ define([\n'use strict';\nreturn {\n+ isLoaded: ko.observable(false),\nisValid: ko.observable(false)\n};\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/billing-address.js",
"new_path": "src/PayV2/view/frontend/web/js/view/billing-address.js",
"diff": "@@ -7,8 +7,13 @@ define([\n], function ($, Component, toggleFormFields, amazonStorage, billingFormAddressState) {\n'use strict';\n+ if (!amazonStorage.isAmazonCheckout()) {\n+ // DO NOT EXTEND SHARED BILLING ADDRESS FORM IF AMAZON CHECKOUT IS NOT INITIATED\n+ return Component;\n+ }\n+\nvar self;\n- var formSelector = '#amazon-payment form';\n+ var formSelector = '#amazon-billing-address form';\nreturn Component.extend({\ndefaults: {\n@@ -27,6 +32,7 @@ define([\n}\n}\n},\n+ isAddressLoaded: billingFormAddressState.isLoaded,\nisAddressEditable: true,\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"new_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"diff": "@@ -39,7 +39,7 @@ define(\ndefaults: {\nisAmazonButtonVisible: ko.observable(!amazonStorage.isAmazonCheckout()),\nisBillingAddressVisible: ko.observable(false),\n- isPlaceOrderActionAllowed: ko.observable(false),\n+ isPlaceOrderActionAllowed: billingFormAddressState.isValid,\ntemplate: 'Amazon_PayV2/payment/amazon-payment-method'\n},\n@@ -54,11 +54,6 @@ define(\n},\ninitBillingAddress: function () {\n- billingFormAddressState.isValid.subscribe(function (isValid) {\n- this.isPlaceOrderActionAllowed(isValid);\n- }, this);\n-\n- var billingAddressCode = 'billingAddress' + this.getCode();\nvar checkoutProvider = registry.get('checkoutProvider');\ncheckoutSessionAddressLoad('billing', function (amazonAddress) {\nself.setEmail(amazonAddress.email);\n@@ -87,10 +82,11 @@ define(\nvar formAddress = addressConverter.quoteAddressToFormAddressData(quoteAddress);\ncheckoutData.setBillingAddressFromData(formAddress);\ncheckoutData.setNewCustomerBillingAddress(formAddress);\n- checkoutProvider.set(billingAddressCode, formAddress);\n+ checkoutProvider.set('billingAddress' + (window.checkoutConfig.displayBillingOnPaymentMethod ? self.getCode() : 'shared'), formAddress);\ncheckoutDataResolver.resolveBillingAddress();\nself.isBillingAddressVisible(true);\n+ billingFormAddressState.isLoaded(true);\n});\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/template/billing-address.html",
"new_path": "src/PayV2/view/frontend/web/template/billing-address.html",
"diff": "-<div class=\"checkout-billing-address\">\n+<div if=\"isAddressLoaded\" id=\"amazon-billing-address\" class=\"checkout-billing-address\">\n<render args=\"detailsTemplate\"/>\n<fieldset class=\"fieldset\" data-bind=\"visible: isAddressFormVisible()\">\n<render args=\"formTemplate\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-370: Fixed Displaying Billing Address On Payment Page |
21,244 | 01.06.2020 18:39:42 | 0 | 5deca7c1c50cdc3a25510c1df6ec8c8d5e5b814e | Implemented closing charges if order creation fails | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -295,6 +295,25 @@ class AmazonPayV2Adapter\nreturn $this->processResponse($response, __FUNCTION__);\n}\n+ /**\n+ * @param int $storeId\n+ * @param string $chargePermissionId\n+ * @param string $reason\n+ * @param boolean $cancelPendingCharges\n+ * @return array\n+ */\n+ public function closeChargePermission($storeId, $chargePermissionId, $reason, $cancelPendingCharges = false)\n+ {\n+ $payload = [\n+ 'closureReason' => $reason,\n+ 'cancelPendingCharges' => $cancelPendingCharges,\n+ ];\n+\n+ $response = $this->clientFactory->create($storeId)->closeChargePermission($chargePermissionId, $payload);\n+\n+ return $this->processResponse($response, __FUNCTION__);\n+ }\n+\n/**\n* AuthorizeClient and SaleClient Gateway Command\n*\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -61,6 +61,11 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\nprivate $amazonAdapter;\n+ /**\n+ * @var array\n+ */\n+ private $carts = [];\n+\n/**\n* CheckoutSessionManagement constructor.\n* @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n@@ -101,11 +106,17 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n{\nif ($cartId instanceof CartInterface) {\n$result = $cartId;\n- } elseif (is_numeric($cartId)) {\n- $result = $this->cartRepository->getActive($cartId);\n+ } else {\n+ if (!isset($this->carts[$cartId])) {\n+ if (is_numeric($cartId)) {\n+ $cart = $this->cartRepository->getActive($cartId);\n} else {\n$quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');\n- $result = $this->cartRepository->getActive($quoteIdMask->getQuoteId());\n+ $cart = $this->cartRepository->getActive($quoteIdMask->getQuoteId());\n+ }\n+ $this->carts[$cartId] = $cart;\n+ }\n+ $result = $this->carts[$cartId];\n}\nreturn $result;\n}\n@@ -215,12 +226,21 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$checkoutSession = $this->getCheckoutSessionForCart($cart);\n}\nif ($checkoutSession && $this->canComplete($cart, $checkoutSession)) {\n+ try {\nif (!$cart->getCustomer()->getId()) {\n$cart->setCheckoutMethod(\\Magento\\Quote\\Api\\CartManagementInterface::METHOD_GUEST);\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n$checkoutSession->complete();\n$this->checkoutSessionRepository->save($checkoutSession);\n+ } catch (\\Exception $e) {\n+ $session = $this->amazonAdapter->getCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId());\n+ if (isset($session['chargePermissionId'])) {\n+ $response = $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'ERROR: ' . $e->getMessage(), true);\n+ }\n+ $this->cancelCheckoutSession($cartId);\n+ throw $e;\n+ }\n}\nreturn $result;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionRepository.php",
"new_path": "src/PayV2/Model/CheckoutSessionRepository.php",
"diff": "@@ -33,6 +33,11 @@ class CheckoutSessionRepository implements CheckoutSessionRepositoryInterface\n*/\nprivate $checkoutSessionCollectionFactory;\n+ /**\n+ * @var array\n+ */\n+ private $checkoutSessions = [];\n+\npublic function __construct(\nResourceModel\\CheckoutSession $checkoutSessionResourceModel,\nResourceModel\\CheckoutSession\\CollectionFactory $checkoutSessionCollectionFactory\n@@ -47,6 +52,7 @@ class CheckoutSessionRepository implements CheckoutSessionRepositoryInterface\n*/\npublic function getActiveForCart(CartInterface $cart)\n{\n+ if (!array_key_exists($cart->getId(), $this->checkoutSessions)) {\n$result = null;\n$checkoutSessionCollection = $this->checkoutSessionCollectionFactory->create();\n/* @var $checkoutSessionCollection ResourceModel\\CheckoutSession\\Collection */\n@@ -57,7 +63,9 @@ class CheckoutSessionRepository implements CheckoutSessionRepositoryInterface\nif ($checkoutSessionCollection->count()) {\n$result = $checkoutSessionCollection->getFirstItem();\n}\n- return $result;\n+ $this->checkoutSessions[$cart->getId()] = $result;\n+ }\n+ return $this->checkoutSessions[$cart->getId()];\n}\n/**\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-391: Implemented closing charges if order creation fails |
21,244 | 03.06.2020 23:36:46 | 0 | 46017627ea718151b0fdcd8857ae863167a57a88 | Fixed payment methods rendering | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"new_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"diff": "@@ -62,8 +62,6 @@ class CheckoutProcessor\n$shippingConfig['children']['address-list']['rendererTemplates']['new-customer-address']\n['component'] = 'Amazon_PayV2/js/view/shipping-address/address-renderer/default';\n- $paymentConfig['children']['payments-list']['component'] = 'Amazon_PayV2/js/view/payment/list';\n-\nif ($this->checkoutDataHelper->isDisplayBillingOnPaymentMethodAvailable()) {\n$billingConfig = &$paymentConfig['children']['payments-list']['children'][\\Amazon\\PayV2\\Gateway\\Config\\Config::CODE . '-form'];\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"new_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"diff": "</item>\n</item>\n</item>\n+ <item name=\"customer-email\" xsi:type=\"array\">\n+ <item name=\"children\" xsi:type=\"array\">\n+ <item name=\"before-login-form\" xsi:type=\"array\">\n+ <item name=\"children\" xsi:type=\"array\">\n+ <item name=\"amazon-checkout-revert\" xsi:type=\"array\">\n+ <item name=\"component\" xsi:type=\"string\">Amazon_PayV2/js/view/checkout-revert</item>\n+ </item>\n+ </item>\n+ </item>\n+ </item>\n+ </item>\n</item>\n</item>\n</item>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/requirejs-config.js",
"new_path": "src/PayV2/view/frontend/requirejs-config.js",
"diff": "* permissions and limitations under the License.\n*/\nvar config = {\n+ config: {\n+ mixins: {\n+ 'Magento_Checkout/js/view/payment/list': {\n+ 'Amazon_PayV2/js/view/payment/list-mixin': true\n+ }\n+ }\n+ },\nmap: {\n'*': {\namazonPayV2ProductAdd: 'Amazon_PayV2/js/amazon-product-add',\n"
},
{
"change_type": "DELETE",
"old_path": "src/PayV2/view/frontend/web/js/view/payment/list.js",
"new_path": null,
"diff": "-define([\n- 'jquery',\n- 'underscore',\n- 'ko',\n- 'Magento_Checkout/js/view/payment/list',\n- 'Magento_Checkout/js/model/payment/method-list',\n- 'Magento_Checkout/js/model/checkout-data-resolver',\n- 'Magento_Checkout/js/model/address-converter',\n- 'Magento_Checkout/js/model/quote',\n- 'Magento_Checkout/js/action/select-payment-method',\n- 'Amazon_PayV2/js/model/amazon-payv2-config',\n- 'Amazon_PayV2/js/model/storage'\n-\n-], function (\n- $,\n- _,\n- ko,\n- Component,\n- paymentMethods,\n- checkoutDataResolver,\n- addressConverter,\n- quote,\n- selectPaymentMethodAction,\n- amazonConfig,\n- amazonStorage\n-) {\n- 'use strict';\n-\n- var self;\n-\n- return Component.extend({\n- /**\n- * Initialize view.\n- *\n- * @returns {Component} Chainable.\n- */\n- initialize: function () {\n- self = this;\n- this._hidePaymentMethodsOnLoad(); //hide methods on load\n-\n- //subscribe to payment methods to remove other payment methods from render list\n- paymentMethods.subscribe(function (changes) {\n- checkoutDataResolver.resolvePaymentMethod();\n- //remove renderer for \"deleted\" payment methods\n- _.each(changes, function (change) {\n- if (this._shouldRemovePaymentMethod(change.value.method)) {\n- this.removeRenderer(change.value.method);\n- change.status = 'deleted';\n- }\n- }, this);\n- }, this, 'arrayChange');\n-\n- this._super();\n-\n- return this;\n- },\n-\n- /**\n- * Check if a payment method is applicable with Amazon Pay\n- * @param {String} method\n- * @returns {Boolean}\n- * @private\n- */\n- _shouldRemovePaymentMethod: function (method) {\n- return amazonStorage.isAmazonCheckout() && method !== amazonConfig.getCode() && method !== 'free';\n- },\n-\n- /**\n- * When payment methods exist on load hook into widget render to remove when widget has rendered\n- * @private\n- */\n- _hidePaymentMethodsOnLoad: function () {\n- if (paymentMethods().length > 0) {\n- //if the payment methods are already set\n- $(document).on('rendered', '#amazon-payment', function () {\n- _.each(paymentMethods(), function (payment) {\n- if (this._shouldRemovePaymentMethod(payment.method)) {\n- this.removeRenderer(payment.method);\n- }\n- }, self);\n- });\n- }\n- }\n- });\n-});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-395: Fixed payment methods rendering |
21,244 | 05.06.2020 20:41:54 | 0 | c7d6f55400f6e5a9139ce67017e88b267608248b | Refactored button rendering, implemented REST API GET config method | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"new_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"diff": "@@ -20,6 +20,12 @@ namespace Amazon\\PayV2\\Api;\n*/\ninterface CheckoutSessionManagementInterface\n{\n+ /**\n+ * @param mixed $cartId\n+ * @return mixed\n+ */\n+ public function getConfig($cartId);\n+\n/**\n* @param mixed $cartId\n* @return string\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -24,89 +24,22 @@ namespace Amazon\\PayV2\\Block;\n*/\nclass Config extends \\Magento\\Framework\\View\\Element\\Template\n{\n- const LANG_DE = 'de_DE';\n- const LANG_FR = 'fr_FR';\n- const LANG_ES = 'es_ES';\n- const LANG_IT = 'it_IT';\n- const LANG_JA = 'ja_JP';\n- const LANG_UK = 'en_GB';\n- const LANG_US = 'en_US';\n-\n- /**\n- * @var \\Magento\\Framework\\Locale\\Resolver\n- */\n- private $localeResolver;\n-\n/**\n* @var \\Amazon\\PayV2\\Model\\AmazonConfig\n*/\nprivate $amazonConfig;\n- /**\n- * @var \\Amazon\\Core\\Helper\\CategoryExclusion\n- */\n- private $categoryExclusionHelper;\n-\n/**\n* Config constructor.\n* @param \\Magento\\Framework\\View\\Element\\Template\\Context $context\n- * @param \\Magento\\Framework\\Locale\\Resolver $localeResolver\n* @param \\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig\n- * @param \\Amazon\\Core\\Helper\\CategoryExclusion $categoryExclusionHelper\n*/\npublic function __construct(\n\\Magento\\Framework\\View\\Element\\Template\\Context $context,\n- \\Magento\\Framework\\Locale\\Resolver $localeResolver,\n- \\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n- \\Amazon\\Core\\Helper\\CategoryExclusion $categoryExclusionHelper\n+ \\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig\n) {\nparent::__construct($context);\n- $this->localeResolver = $localeResolver;\n$this->amazonConfig = $amazonConfig;\n- $this->categoryExclusionHelper = $categoryExclusionHelper;\n- }\n-\n- /**\n- * @return string\n- */\n- protected function getLanguage()\n- {\n- $paymentRegion = $this->amazonConfig->getRegion();\n- @list($lang, $region) = explode('_', $this->localeResolver->getLocale());\n- switch ($lang) {\n- case 'de':\n- $result = self::LANG_DE;\n- break;\n- case 'fr':\n- $result = self::LANG_FR;\n- break;\n- case 'es':\n- $result = self::LANG_ES;\n- break;\n- case 'it':\n- $result = self::LANG_IT;\n- break;\n- case 'ja':\n- $result = self::LANG_JA;\n- break;\n- case 'en':\n- $result = $paymentRegion == 'us' ? self::LANG_US : self::LANG_UK;\n- break;\n- }\n- if (!isset($result)) {\n- switch ($paymentRegion) {\n- case 'jp':\n- $result = self::LANG_JA;\n- break;\n- case 'us':\n- $result = self::LANG_US;\n- break;\n- default:\n- $result = self::LANG_UK;\n- break;\n- }\n- }\n- return $result;\n}\n/**\n@@ -115,12 +48,7 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\npublic function getConfig()\n{\n$config = [\n- 'merchantId' => $this->amazonConfig->getMerchantId(),\n'region' => $this->amazonConfig->getRegion(),\n- 'currency' => $this->amazonConfig->getCurrencyCode(),\n- 'sandbox' => $this->amazonConfig->isSandboxEnabled(),\n- 'language' => $this->getLanguage(),\n- 'placement' => 'Cart',\n'code' => \\Amazon\\PayV2\\Gateway\\Config\\Config::CODE,\n'is_method_available' => $this->amazonConfig->isPayButtonAvailableAsPaymentMethod(),\n];\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/CustomerData/CheckoutSession.php",
"new_path": "src/PayV2/CustomerData/CheckoutSession.php",
"diff": "@@ -27,11 +27,6 @@ class CheckoutSession implements SectionSourceInterface\n*/\nprivate $session;\n- /**\n- * @var \\Amazon\\PayV2\\Helper\\Data\n- */\n- private $amazonHelper;\n-\n/**\n* @var \\Amazon\\PayV2\\Model\\CheckoutSessionManagement\n*/\n@@ -40,16 +35,13 @@ class CheckoutSession implements SectionSourceInterface\n/**\n* CheckoutSession constructor.\n* @param \\Magento\\Checkout\\Model\\Session $session\n- * @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n* @param \\Amazon\\PayV2\\Model\\CheckoutSessionManagement $checkoutSessionManagement\n*/\npublic function __construct(\n\\Magento\\Checkout\\Model\\Session $session,\n- \\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Amazon\\PayV2\\Model\\CheckoutSessionManagement $checkoutSessionManagement\n) {\n$this->session = $session;\n- $this->amazonHelper = $amazonHelper;\n$this->checkoutSessionManagement = $checkoutSessionManagement;\n}\n@@ -59,12 +51,19 @@ class CheckoutSession implements SectionSourceInterface\npublic function getSectionData()\n{\n$data = [\n- 'isPayOnly' => $this->amazonHelper->isPayOnly(),\n'checkoutSessionId' => $this->getCheckoutSessionId(),\n];\nreturn $data;\n}\n+ /**\n+ * @return array\n+ */\n+ public function getConfig()\n+ {\n+ return $this->checkoutSessionManagement->getConfig($this->session->getQuote());\n+ }\n+\n/**\n* Clear Amazon Checkout Session Id\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Helper/Data.php",
"new_path": "src/PayV2/Helper/Data.php",
"diff": "@@ -28,11 +28,14 @@ class Data extends AbstractHelper\n}\n/**\n+ * @param \\Magento\\Quote\\Model\\Quote $quote\n* @return bool\n*/\n- public function isPayOnly()\n+ public function isPayOnly($quote = null)\n{\n+ if ($quote === null) {\n$quote = $this->helperCheckout->getQuote();\n+ }\nreturn $quote->hasItems() ? $quote->isVirtual() : true;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -20,6 +20,14 @@ use Magento\\Store\\Model\\ScopeInterface;\nclass AmazonConfig\n{\n+ const LANG_DE = 'de_DE';\n+ const LANG_FR = 'fr_FR';\n+ const LANG_ES = 'es_ES';\n+ const LANG_IT = 'it_IT';\n+ const LANG_JA = 'ja_JP';\n+ const LANG_UK = 'en_GB';\n+ const LANG_US = 'en_US';\n+\n/**\n* @var \\Magento\\Framework\\App\\Config\\ScopeConfigInterface\n*/\n@@ -35,6 +43,11 @@ class AmazonConfig\n*/\nprivate $clientIpHelper;\n+ /**\n+ * @var \\Magento\\Framework\\Locale\\Resolver\n+ */\n+ private $localeResolver;\n+\n/**\n* @var \\Magento\\Framework\\App\\State\n*/\n@@ -45,18 +58,20 @@ class AmazonConfig\n* @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n* @param \\Magento\\Framework\\App\\Config\\ScopeConfigInterface $scopeConfig\n* @param \\Amazon\\PayV2\\Helper\\ClientIp $clientIpHelper\n+ * @param \\Magento\\Framework\\Locale\\Resolver $localeResolver\n+ * @param \\Magento\\Framework\\App\\State $appState\n*/\npublic function __construct(\n\\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\n\\Magento\\Framework\\App\\Config\\ScopeConfigInterface $scopeConfig,\n\\Amazon\\PayV2\\Helper\\ClientIp $clientIpHelper,\n- \\Magento\\Framework\\UrlInterface $urlBuilder,\n+ \\Magento\\Framework\\Locale\\Resolver $localeResolver,\n\\Magento\\Framework\\App\\State $appState\n) {\n$this->storeManager = $storeManager;\n$this->scopeConfig = $scopeConfig;\n$this->clientIpHelper = $clientIpHelper;\n- $this->urlBuilder = $urlBuilder;\n+ $this->localeResolver = $localeResolver;\n$this->appState = $appState;\n}\n@@ -111,6 +126,51 @@ class AmazonConfig\nreturn $this->getPaymentRegion($scope, $scopeCode);\n}\n+ /**\n+ * @param string $scope\n+ * @param null $scopeCode\n+ * @return string\n+ */\n+ public function getLanguage($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ $paymentRegion = $this->getRegion($scope, $scopeCode);\n+ @list($lang, $region) = explode('_', $this->localeResolver->getLocale());\n+ switch ($lang) {\n+ case 'de':\n+ $result = self::LANG_DE;\n+ break;\n+ case 'fr':\n+ $result = self::LANG_FR;\n+ break;\n+ case 'es':\n+ $result = self::LANG_ES;\n+ break;\n+ case 'it':\n+ $result = self::LANG_IT;\n+ break;\n+ case 'ja':\n+ $result = self::LANG_JA;\n+ break;\n+ case 'en':\n+ $result = $paymentRegion == 'us' ? self::LANG_US : self::LANG_UK;\n+ break;\n+ }\n+ if (!isset($result)) {\n+ switch ($paymentRegion) {\n+ case 'jp':\n+ $result = self::LANG_JA;\n+ break;\n+ case 'us':\n+ $result = self::LANG_US;\n+ break;\n+ default:\n+ $result = self::LANG_UK;\n+ break;\n+ }\n+ }\n+ return $result;\n+ }\n+\n/**\n* @param string $scope\n* @param string $scopeCode\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -51,6 +51,11 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\nprivate $checkoutSessionRepository;\n+ /**\n+ * @var \\Amazon\\PayV2\\Helper\\Data\n+ */\n+ private $amazonHelper;\n+\n/**\n* @var AmazonConfig\n*/\n@@ -74,6 +79,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n* @param \\Magento\\Quote\\Api\\CartRepositoryInterface $cartRepository\n* @param \\Amazon\\PayV2\\Api\\Data\\CheckoutSessionInterfaceFactory $checkoutSessionFactory\n* @param \\Amazon\\PayV2\\Api\\CheckoutSessionRepositoryInterface $checkoutSessionRepository\n+ * @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n* @param AmazonConfig $amazonConfig\n* @param Adapter\\AmazonPayV2Adapter $amazonAdapter\n*/\n@@ -84,6 +90,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n\\Magento\\Quote\\Api\\CartRepositoryInterface $cartRepository,\n\\Amazon\\PayV2\\Api\\Data\\CheckoutSessionInterfaceFactory $checkoutSessionFactory,\n\\Amazon\\PayV2\\Api\\CheckoutSessionRepositoryInterface $checkoutSessionRepository,\n+ \\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n\\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter\n)\n@@ -94,6 +101,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->cartRepository = $cartRepository;\n$this->checkoutSessionFactory = $checkoutSessionFactory;\n$this->checkoutSessionRepository = $checkoutSessionRepository;\n+ $this->amazonHelper = $amazonHelper;\n$this->amazonConfig = $amazonConfig;\n$this->amazonAdapter = $amazonAdapter;\n}\n@@ -140,6 +148,24 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nreturn $this->getCart($cartId)->getIsActive() && $checkoutSession->getUpdatedAt();\n}\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function getConfig($cartId)\n+ {\n+ $result = [];\n+ if ($this->amazonConfig->isEnabled()) {\n+ $result = [\n+ 'merchant_id' => $this->amazonConfig->getMerchantId(),\n+ 'currency' => $this->amazonConfig->getCurrencyCode(),\n+ 'language' => $this->amazonConfig->getLanguage(),\n+ 'pay_only' => $this->amazonHelper->isPayOnly($this->getCart($cartId)),\n+ 'sandbox' => $this->amazonConfig->isSandboxEnabled(),\n+ ];\n+ }\n+ return $result;\n+ }\n+\n/**\n* {@inheritdoc}\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"new_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"diff": "@@ -22,6 +22,11 @@ class CheckoutProcessor\n*/\nprivate $amazonConfig;\n+ /**\n+ * @var \\Amazon\\PayV2\\Helper\\Data\n+ */\n+ private $amazonHelper;\n+\n/**\n* @var \\Magento\\Checkout\\Helper\\Data\n*/\n@@ -30,13 +35,16 @@ class CheckoutProcessor\n/**\n* CheckoutProcessor constructor.\n* @param \\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig\n+ * @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n* @param \\Magento\\Checkout\\Helper\\Data $checkoutDataHelper\n*/\npublic function __construct(\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n+ \\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Magento\\Checkout\\Helper\\Data $checkoutDataHelper\n) {\n$this->amazonConfig = $amazonConfig;\n+ $this->amazonHelper = $amazonHelper;\n$this->checkoutDataHelper = $checkoutDataHelper;\n}\n@@ -69,6 +77,7 @@ class CheckoutProcessor\n}\n$billingConfig['component'] = 'Amazon_PayV2/js/view/billing-address';\n$billingConfig['isAddressEditable'] = $this->amazonConfig->isBillingAddressEditable();\n+ $billingConfig['isPayOnly'] = $this->amazonHelper->isPayOnly();\nunset($paymentConfig['children']['renders']['children']['amazonlogin']); // legacy\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/webapi.xml",
"new_path": "src/PayV2/etc/webapi.xml",
"diff": "*/\n-->\n<routes xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Webapi:etc/webapi.xsd\">\n+ <route url=\"/V1/amazon-v2-checkout-session/:cartId/config\" method=\"GET\">\n+ <service class=\"Amazon\\PayV2\\Api\\CheckoutSessionManagementInterface\" method=\"getConfig\"/>\n+ <resources>\n+ <resource ref=\"anonymous\" />\n+ </resources>\n+ </route>\n<route url=\"/V1/amazon-v2-checkout-session/:cartId/billing-address\" method=\"GET\">\n<service class=\"Amazon\\PayV2\\Api\\AddressManagementInterface\" method=\"getBillingAddress\"/>\n<resources>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"new_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"diff": "<item name=\"component\" xsi:type=\"string\">Amazon_PayV2/js/view/checkout-address</item>\n<item name=\"sortOrder\" xsi:type=\"string\">0</item>\n<item name=\"displayArea\" xsi:type=\"string\">amazon-payv2-address</item>\n+ <item name=\"config\" xsi:type=\"array\">\n+ <item name=\"isPayOnly\" xsi:type=\"helper\" helper=\"Amazon\\PayV2\\Helper\\Data::isPayOnly\"/>\n+ </item>\n</item>\n</item>\n</item>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "*/\ndefine([\n'jquery',\n- 'Magento_Customer/js/customer-data',\n- 'Amazon_PayV2/js/model/amazon-payv2-config',\n+ 'Amazon_PayV2/js/action/checkout-session-config-load',\n'Amazon_PayV2/js/model/storage',\n'mage/url',\n'Amazon_PayV2/js/amazon-checkout',\n-], function ($, customerData, amazonPayV2Config, amazonStorage, url, amazonCheckout) {\n+], function ($, checkoutSessionConfigLoad, amazonStorage, url, amazonCheckout) {\n'use strict';\nif (amazonStorage.isEnabled) {\n$.widget('amazon.AmazonButton', {\noptions: {\npayOnly: null,\n- forcePayOnly: false,\n- placement: amazonPayV2Config.getValue('placement'),\n+ placement: 'Cart',\n+ },\n+\n+ _loadButtonConfig: function (callback) {\n+ checkoutSessionConfigLoad(function (checkoutSessionConfig) {\n+ callback({\n+ merchantId: checkoutSessionConfig['merchant_id'],\n+ createCheckoutSession: {\n+ url: url.build('amazon_payv2/checkout/createSession'),\n+ method: 'PUT'\n+ },\n+ ledgerCurrency: checkoutSessionConfig['currency'],\n+ checkoutLanguage: checkoutSessionConfig['language'],\n+ productType: this._isPayOnly(checkoutSessionConfig['pay_only']) ? 'PayOnly' : 'PayAndShip',\n+ placement: this.options.placement,\n+ sandbox: checkoutSessionConfig['sandbox'],\n+ });\n+ }.bind(this));\n},\n/**\n+ * @param {boolean} isCheckoutSessionPayOnly\n* @returns {boolean}\n* @private\n*/\n- _isPayOnly: function () {\n- var result = this.options.forcePayOnly || amazonStorage.isPayOnly(true);\n+ _isPayOnly: function (isCheckoutSessionPayOnly) {\n+ var result = isCheckoutSessionPayOnly;\nif (result && this.options.payOnly !== null) {\nresult = this.options.payOnly;\n}\n@@ -48,30 +64,13 @@ define([\n_create: function () {\nvar $buttonContainer = this.element;\namazonCheckout.withAmazonCheckout(function (amazon, args) {\n- var buttonPreferences = {\n- merchantId: amazonPayV2Config.getValue('merchantId'),\n- createCheckoutSession: {\n- url: url.build('amazon_payv2/checkout/createSession'),\n- method: 'PUT'\n- },\n- ledgerCurrency: amazonPayV2Config.getValue('currency'),\n- checkoutLanguage: amazonPayV2Config.getValue('language'),\n- productType: this._isPayOnly() ? 'PayOnly' : 'PayAndShip',\n- placement: this.options.placement,\n- sandbox: amazonPayV2Config.getValue('sandbox'),\n- },\n- buttonPreferencesJson = JSON.stringify(buttonPreferences);\n- if ($buttonContainer.data('button-preferences') !== buttonPreferencesJson) {\n- $buttonContainer.empty();\n- $buttonContainer.data('button-preferences', buttonPreferencesJson);\n-\nvar $buttonRoot = $('<div></div>');\n- $buttonRoot.uniqueId();\n- $buttonContainer.append($buttonRoot);\n-\n- amazon.Pay.renderButton('#' + $buttonRoot.attr('id'), buttonPreferences);\n+ $buttonRoot.html('<img src=\"' + require.toUrl('images/loader-1.gif') + '\" alt=\"\" width=\"24\" />');\n+ $buttonContainer.empty().append($buttonRoot);\n+ this._loadButtonConfig(function (buttonConfig) {\n+ amazon.Pay.renderButton('#' + $buttonRoot.empty().uniqueId().attr('id'), buttonConfig);\n$('.amazon-button-container-v2 .field-tooltip').fadeIn();\n- }\n+ });\n}, this);\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "@@ -76,16 +76,6 @@ define([\nreturn amazonPayV2Config.getValue('region');\n},\n- /**\n- * @param defaultResult\n- * @returns {boolean}\n- */\n- isPayOnly: function (defaultResult) {\n- var sessionValue = customerData.get(sectionKey)()['isPayOnly'];\n- var result = typeof sessionValue === 'boolean' ? sessionValue : defaultResult;\n- return result;\n- },\n-\n/**\n* @param value\n* @returns {exports}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/billing-address.js",
"new_path": "src/PayV2/view/frontend/web/js/view/billing-address.js",
"diff": "@@ -34,6 +34,7 @@ define([\n},\nisAddressLoaded: billingFormAddressState.isLoaded,\nisAddressEditable: true,\n+ isPayOnly: false,\n},\n/**\n@@ -82,7 +83,7 @@ define([\namazonCheckoutSessionId: amazonStorage.getCheckoutSessionId(),\nchangeAction: 'changePayment'\n});\n- if (!amazonStorage.isPayOnly(true)) {\n+ if (!this.isPayOnly) {\n$elem.click(function () {\namazonStorage.setIsEditPaymentFlag(true);\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"new_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"diff": "@@ -65,6 +65,7 @@ define(\n},\nisCustomerLoggedIn: customer.isLoggedIn,\nisAmazonCheckout: amazonStorage.isAmazonCheckout(),\n+ isPayOnly: false,\nrates: shippingService.getShippingRates(),\n/**\n@@ -73,7 +74,7 @@ define(\ninitialize: function () {\nself = this;\nthis._super();\n- if (!amazonStorage.isPayOnly(true) && this.isAmazonCheckout) {\n+ if (!this.isPayOnly && this.isAmazonCheckout) {\nthis.getShippingAddressFromAmazon();\nif (amazonStorage.getIsEditPaymentFlag()) {\namazonStorage.setIsEditPaymentFlag(false);\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-334: Refactored button rendering, implemented REST API GET config method |
21,244 | 05.06.2020 22:56:28 | 0 | fa865ac1fd4c5cdd26c7762648ccb847f1379b51 | Fixed Terms & Conditions validation | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"new_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"diff": "@@ -8,6 +8,7 @@ define(\n'Magento_Checkout/js/checkout-data',\n'Magento_Checkout/js/model/address-converter',\n'Magento_Checkout/js/model/checkout-data-resolver',\n+ 'Magento_Checkout/js/model/payment/additional-validators',\n'Magento_Checkout/js/model/quote',\n'uiRegistry',\n'Amazon_PayV2/js/model/billing-address/form-address-state',\n@@ -24,6 +25,7 @@ define(\ncheckoutData,\naddressConverter,\ncheckoutDataResolver,\n+ additionalValidators,\nquote,\nregistry,\nbillingFormAddressState,\n@@ -100,7 +102,7 @@ define(\nevent.preventDefault();\n}\n- if (this.validate()) {\n+ if (this.validate() && additionalValidators.validate()) {\n//this.isPlaceOrderActionAllowed(false);\nplaceOrder = placeOrderAction(this.getData());\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-372: Fixed Terms & Conditions validation |
21,262 | 09.06.2020 09:57:03 | 25,200 | 8f119ce33c2063ad1136b0d175fb1e2e6e05f19e | Fixed createCheckoutSession return type | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"new_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"diff": "@@ -28,7 +28,7 @@ interface CheckoutSessionManagementInterface\n/**\n* @param mixed $cartId\n- * @return string\n+ * @return mixed\n*/\npublic function createCheckoutSession($cartId);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Controller/Checkout/CreateSession.php",
"new_path": "src/PayV2/Controller/Checkout/CreateSession.php",
"diff": "@@ -47,10 +47,7 @@ class CreateSession extends \\Magento\\Framework\\App\\Action\\Action\n*/\npublic function execute()\n{\n- $checkoutSessionId = $this->amazonCheckoutSession->createCheckoutSessionId();\n- $data = [\n- 'checkoutSessionId' => $checkoutSessionId,\n- ];\n+ $data = $this->amazonCheckoutSession->createCheckoutSession();\nreturn $this->resultJsonFactory->create()->setData($data);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/CustomerData/CheckoutSession.php",
"new_path": "src/PayV2/CustomerData/CheckoutSession.php",
"diff": "@@ -89,9 +89,9 @@ class CheckoutSession implements SectionSourceInterface\n}\n/**\n- * Create and save Amazon Checkout Session Id\n+ * Create Amazon Checkout Session\n*/\n- public function createCheckoutSessionId()\n+ public function createCheckoutSession()\n{\nreturn $this->checkoutSessionManagement->createCheckoutSession($this->session->getQuote());\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -171,19 +171,18 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\npublic function createCheckoutSession($cartId)\n{\n- $result = null;\n+ $result = [];\n$this->cancelCheckoutSession($cartId);\nif ($this->amazonConfig->isEnabled()) {\n- $response = $this->amazonAdapter->createCheckoutSession($this->storeManager->getStore()->getId());\n- if (isset($response['checkoutSessionId'])) {\n+ $result = $this->amazonAdapter->createCheckoutSession($this->storeManager->getStore()->getId());\n+ if (isset($result['checkoutSessionId'])) {\n$checkoutSession = $this->checkoutSessionFactory->create([\n'data' => [\nCheckoutSessionInterface::KEY_QUOTE_ID => $this->getCart($cartId)->getId(),\n- CheckoutSessionInterface::KEY_SESSION_ID => $response['checkoutSessionId'],\n+ CheckoutSessionInterface::KEY_SESSION_ID => $result['checkoutSessionId'],\n]\n]);\n$this->checkoutSessionRepository->save($checkoutSession);\n- $result = $checkoutSession->getSessionId();\n}\n}\nreturn $result;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-287: Fixed createCheckoutSession return type (#723) |
21,244 | 10.06.2020 20:26:34 | 0 | 5629fa9e0c72df1f8c88b3cb214315dc72090c14 | Clearing checkout data | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/place-order.js",
"new_path": "src/PayV2/view/frontend/web/js/action/place-order.js",
"diff": "@@ -67,6 +67,16 @@ define(\nif (response === true) {\ncheckoutSessionUpdateAction(function (redirectUrl) {\ncustomerData.invalidate(['cart']);\n+ customerData.set('checkout-data', {\n+ 'selectedShippingAddress': null,\n+ 'shippingAddressFromData': null,\n+ 'newCustomerShippingAddress': null,\n+ 'selectedShippingRate': null,\n+ 'selectedPaymentMethod': null,\n+ 'selectedBillingAddress': null,\n+ 'billingAddressFromData': null,\n+ 'newCustomerBillingAddress': null\n+ });\namazonStorage.clearAmazonCheckout();\nwindow.location.replace(redirectUrl);\n});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-366: Clearing checkout data |
21,244 | 11.06.2020 21:59:54 | 0 | 71b1c7455d24f877b412ab354f592d235697c2d5 | Triggering email availability check | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"new_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"diff": "@@ -149,7 +149,7 @@ define(\n* @param email\n*/\nsetEmail: function(email) {\n- $('#customer-email').val(email);\n+ $('#customer-email').val(email).trigger('change');\ncheckoutData.setInputFieldEmailValue(email);\ncheckoutData.setValidatedEmailValue(email);\nquote.guestEmail = email;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-366: Triggering email availability check |
21,258 | 15.06.2020 11:06:13 | 25,200 | 642b92c75ec16781f7bcc4066cc961d326c24c1e | version increase 2.0.3 | [
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.0.2\",\n+ \"version\": \"2.0.3\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.0.2\",\n+ \"version\": \"2.0.3\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.0.2\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.0.3\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase 2.0.3 (#753)
Co-authored-by: Shah <tarishah@f45c898ce31f.ant.amazon.com> |
21,244 | 18.06.2020 16:40:20 | 0 | d15f80308342644c631368f131f797714568e6c0 | Charge on Shipment after 7 Days (Pending Charge) | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Command/Async/ProcessCommand.php",
"diff": "+<?php\n+\n+namespace Amazon\\PayV2\\Command\\Async;\n+\n+use Amazon\\PayV2\\Api\\Data\\AsyncInterface;\n+use Magento\\Framework\\Data\\Collection;\n+use Symfony\\Component\\Console\\Command\\Command;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+\n+class ProcessCommand extends Command\n+{\n+ /**\n+ * @var \\Amazon\\PayV2\\Model\\ResourceModel\\Async\\CollectionFactory\n+ */\n+ private $asyncCollectionFactory;\n+\n+ /**\n+ * @var \\Amazon\\PayV2\\Model\\AsyncUpdater\n+ */\n+ private $asyncUpdater;\n+\n+ public function __construct(\n+ \\Amazon\\PayV2\\Model\\ResourceModel\\Async\\CollectionFactory $asyncCollectionFactory,\n+ \\Amazon\\PayV2\\Model\\AsyncUpdater $asyncUpdater,\n+ string $name = null\n+ )\n+ {\n+ $this->asyncCollectionFactory = $asyncCollectionFactory;\n+ $this->asyncUpdater = $asyncUpdater;\n+ parent::__construct($name);\n+ }\n+\n+ protected function configure()\n+ {\n+ $this->setName('amazon:payment:async:process');\n+ parent::configure();\n+ }\n+\n+ protected function execute(InputInterface $input, OutputInterface $output)\n+ {\n+ $collection = $this->asyncCollectionFactory->create();\n+ $collection->addFieldToFilter(AsyncInterface::IS_PENDING, ['eq' => 1]);\n+ $collection->addOrder(AsyncInterface::ID, Collection::SORT_ORDER_ASC);\n+ foreach ($collection as $item) {\n+ /** @var \\Amazon\\PayV2\\Model\\Async $item */\n+ $this->asyncUpdater->processPending($item);\n+ }\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Http/Client/SettlementClient.php",
"new_path": "src/PayV2/Gateway/Http/Client/SettlementClient.php",
"diff": "@@ -30,7 +30,8 @@ class SettlementClient extends AbstractClient\n$data['store_id'],\n$data['charge_id'],\n$data['amount'],\n- $data['currency_code']\n+ $data['currency_code'],\n+ $data['headers'] ?? []\n);\nreturn $response;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"new_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"diff": "namespace Amazon\\PayV2\\Gateway\\Request;\nuse Magento\\Payment\\Gateway\\Request\\BuilderInterface;\n+use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Amazon\\PayV2\\Gateway\\Helper\\SubjectReader;\nclass SettlementRequestBuilder implements BuilderInterface\n{\n+ /**\n+ * @var AmazonConfig\n+ */\n+ private $amazonConfig;\n+\n/**\n* @var SubjectReader\n*/\n@@ -28,14 +34,69 @@ class SettlementRequestBuilder implements BuilderInterface\n/**\n* AuthorizationRequestBuilder constructor.\n+ * @param AmazonConfig $amazonConfig\n* @param SubjectReader $subjectReader\n*/\npublic function __construct(\n+ AmazonConfig $amazonConfig,\nSubjectReader $subjectReader\n) {\n+ $this->amazonConfig = $amazonConfig;\n$this->subjectReader = $subjectReader;\n}\n+ /**\n+ * @param \\Magento\\Sales\\Model\\Order\\Payment $payment\n+ * @return \\Magento\\Sales\\Model\\Order\\Invoice\n+ */\n+ protected function getCurrentInvoice($payment)\n+ {\n+ $result = null;\n+ $order = $payment->getOrder();\n+ foreach ($order->getInvoiceCollection() as $invoice) {\n+ if (!$invoice->getId()) {\n+ $result = $invoice;\n+ break;\n+ }\n+ }\n+ return $result;\n+ }\n+\n+ /**\n+ * @param \\Magento\\Sales\\Model\\Order\\Payment $payment\n+ * @return string\n+ */\n+ protected function getComment($payment)\n+ {\n+ $result = '';\n+ $invoice = $this->getCurrentInvoice($payment);\n+ if ($invoice && $invoice->getComments()) {\n+ foreach ($invoice->getComments() as $comment) {\n+ if ($comment->getComment()) {\n+ $result = $comment->getComment();\n+ break;\n+ }\n+ }\n+ }\n+ return $result;\n+ }\n+\n+ /**\n+ * @param \\Magento\\Sales\\Model\\Order\\Payment $payment\n+ * @return array\n+ */\n+ protected function getHeaders($payment)\n+ {\n+ $result = [];\n+ $data = (array) json_decode($this->getComment($payment), true);\n+ foreach ($data as $key => $value) {\n+ if (strpos($key, 'x-amz-pay') === 0) {\n+ $result[$key] = $value;\n+ }\n+ }\n+ return $result;\n+ }\n+\n/**\n* @inheritdoc\n*/\n@@ -56,6 +117,9 @@ class SettlementRequestBuilder implements BuilderInterface\n'amount' => $total,\n'currency_code' => $currencyCode,\n];\n+ if ($this->amazonConfig->isSandboxEnabled(\\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE, $orderDO->getStoreId())) {\n+ $data['headers'] = $this->getHeaders($paymentDO->getPayment());\n+ }\nreturn $data;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"new_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"diff": "@@ -77,7 +77,7 @@ class AuthorizationSaleHandler implements HandlerInterface\ncase 'Captured':\n$payment->setIsTransactionClosed(true);\nbreak;\n- case 'CaptureInitated':\n+ case 'CaptureInitiated':\n$payment->setIsTransactionClosed(false);\nbreak;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/SettlementHandler.php",
"new_path": "src/PayV2/Gateway/Response/SettlementHandler.php",
"diff": "@@ -57,7 +57,17 @@ class SettlementHandler implements HandlerInterface\nif (isset($response['chargeId'])) {\n$payment->setTransactionId($response['chargeId'].'-capture');\n$payment->setParentTransactionId($response['chargeId']);\n+\n+ switch ($response['statusDetail']['state']) {\n+ case 'CaptureInitiated':\n+ $payment->setIsTransactionPending(true);\n+ $payment->setIsTransactionClosed(false);\n+ $this->asyncManagement->queuePendingAuthorization($response['chargeId']);\n+ break;\n+ default:\n$payment->setIsTransactionClosed(true);\n+ break;\n+ }\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -227,11 +227,12 @@ class AmazonPayV2Adapter\n* @param $chargeId\n* @param $amount\n* @param $currency\n+ * @param array $headers\n* @return mixed\n*/\n- public function captureCharge($storeId, $chargeId, $amount, $currency)\n+ public function captureCharge($storeId, $chargeId, $amount, $currency, $headers = [])\n{\n- $headers = $this->getIdempotencyHeader();\n+ $headers = array_merge($headers, $this->getIdempotencyHeader());\n$payload = [\n'captureAmount' => $this->createPrice($amount, $currency),\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AsyncManagement/AbstractOperation.php",
"new_path": "src/PayV2/Model/AsyncManagement/AbstractOperation.php",
"diff": "@@ -29,7 +29,7 @@ abstract class AbstractOperation\n/**\n* @var \\Magento\\Framework\\Api\\SearchCriteriaBuilder\n*/\n- private $searchCriteriaBuilder;\n+ protected $searchCriteriaBuilder;\n/**\n* @var \\Magento\\Sales\\Api\\OrderRepositoryInterface\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"new_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"diff": "namespace Amazon\\PayV2\\Model\\AsyncManagement;\nuse Magento\\Sales\\Api\\Data\\TransactionInterface as Transaction;\n+use Magento\\Sales\\Api\\Data\\InvoiceInterface;\n+use Magento\\Sales\\Api\\Data\\OrderInterface;\nclass Charge extends AbstractOperation\n{\n@@ -30,6 +32,11 @@ class Charge extends AbstractOperation\n*/\nprivate $asyncLogger;\n+ /**\n+ * @var \\Magento\\Sales\\Api\\InvoiceRepositoryInterface\n+ */\n+ private $invoiceRepository;\n+\n/**\n* @var \\Magento\\Sales\\Model\\Service\\InvoiceService\n*/\n@@ -56,6 +63,7 @@ class Charge extends AbstractOperation\n* @param \\Magento\\Sales\\Api\\OrderRepositoryInterface $orderRepository\n* @param \\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository\n* @param \\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter\n+ * @param \\Magento\\Sales\\Api\\InvoiceRepositoryInterface $invoiceRepository\n* @param \\Magento\\Sales\\Model\\Service\\InvoiceService $invoiceService\n* @param \\Magento\\Sales\\Model\\Order\\Payment\\Transaction\\BuilderInterface $transactionBuilder\n* @param \\Magento\\Framework\\Notification\\NotifierInterface $notifier\n@@ -67,6 +75,7 @@ class Charge extends AbstractOperation\n\\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository,\n\\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter,\n\\Amazon\\PayV2\\Logger\\AsyncIpnLogger $asyncLogger,\n+ \\Magento\\Sales\\Api\\InvoiceRepositoryInterface $invoiceRepository,\n\\Magento\\Sales\\Model\\Service\\InvoiceService $invoiceService,\n\\Magento\\Sales\\Model\\Order\\Payment\\Transaction\\BuilderInterface $transactionBuilder,\n\\Magento\\Framework\\Notification\\NotifierInterface $notifier,\n@@ -75,12 +84,29 @@ class Charge extends AbstractOperation\nparent::__construct($orderRepository, $transactionRepository, $searchCriteriaBuilder);\n$this->amazonAdapter = $amazonAdapter;\n$this->asyncLogger = $asyncLogger;\n+ $this->invoiceRepository = $invoiceRepository;\n$this->invoiceService = $invoiceService;\n$this->transactionBuilder = $transactionBuilder;\n$this->notifier = $notifier;\n$this->urlBuilder = $urlBuilder;\n}\n+ /**\n+ * @param string $chargeId\n+ * @param OrderInterface $order\n+ * @return \\Magento\\Sales\\Model\\Order\\Invoice\n+ */\n+ protected function loadInvoice($chargeId, OrderInterface $order)\n+ {\n+ $this->searchCriteriaBuilder->addFilter(InvoiceInterface::TRANSACTION_ID, $chargeId . '-capture');\n+ $this->searchCriteriaBuilder->addFilter(InvoiceInterface::ORDER_ID, $order->getEntityId());\n+ $this->searchCriteriaBuilder->setPageSize(1);\n+ $this->searchCriteriaBuilder->setCurrentPage(1);\n+ $searchCriteria = $this->searchCriteriaBuilder->create();\n+ $invoices = $this->invoiceRepository->getList($searchCriteria)->getItems();\n+ return count($invoices) ? current($invoices) : null;\n+ }\n+\n/**\n* Process charge state change\n*/\n@@ -96,16 +122,16 @@ class Charge extends AbstractOperation\nif (isset($charge['statusDetail'])) {\nswitch ($charge['statusDetail']['state']) {\ncase 'Declined':\n- $this->decline($order, $charge['statusDetail']);\n+ $this->decline($order, $chargeId, $charge['statusDetail']['reasonDescription']);\nbreak;\ncase 'Canceled':\n$this->cancel($order, $charge['statusDetail']);\nbreak;\ncase 'Authorized':\n- $this->authorize($order, $charge['chargeId']);\n+ $this->authorize($order, $chargeId);\nbreak;\ncase 'Captured':\n- $this->capture($order, $charge);\n+ $this->capture($order, $chargeId, $charge['captureAmount']['amount']);\nbreak;\n}\n}\n@@ -116,13 +142,20 @@ class Charge extends AbstractOperation\n* Decline charge\n*\n* @param \\Magento\\Sales\\Model\\Order $order\n+ * @param string $chargeId\n+ * @param string $reason\n*/\n- public function decline($order, $detail)\n+ public function decline($order, $chargeId, $reason)\n{\n+ $invoice = $this->loadInvoice($chargeId, $order);\n+ if ($invoice) {\n+ $invoice->cancel();\n+ $order->addRelatedObject($invoice);\n+ }\nif ($order->canHold() || $order->isPaymentReview()) {\n$this->setOnHold($order);\n$this->closeLastTransaction($order);\n- $order->addStatusHistoryComment($detail['reasonDescription']);\n+ $order->addStatusHistoryComment($reason);\n$order->save();\n$this->notifier->addNotice(\n@@ -182,28 +215,31 @@ class Charge extends AbstractOperation\n* Capture charge\n*\n* @param \\Magento\\Sales\\Model\\Order $order\n- * @param $charge\n+ * @param string $chargeId\n+ * @param float $chargeAmount\n*/\n- public function capture($order, $charge)\n+ public function capture($order, $chargeId, $chargeAmount)\n{\n- if ($order->canInvoice()) {\n- $payment = $order->getPayment();\n- $amount = $charge['captureAmount']['amount'];\n-\n+ $invoice = $this->loadInvoice($chargeId, $order);\n+ if (!$invoice && $order->canInvoice()) {\n$invoice = $this->invoiceService->prepareInvoice($order);\n$invoice->register();\n+ }\n+ if ($invoice) {\n+ $payment = $order->getPayment();\n+\n$invoice->pay();\n$order->addRelatedObject($invoice);\n$transaction = $this->transactionBuilder->setPayment($payment)\n->setOrder($order)\n- ->setTransactionId($charge['chargeId'] . '-capture')\n+ ->setTransactionId($chargeId . '-capture')\n->build(Transaction::TYPE_CAPTURE);\n- $formattedAmount = $order->getBaseCurrency()->formatTxt($amount);\n+ $formattedAmount = $order->getBaseCurrency()->formatTxt($chargeAmount);\n$message = __('Captured amount of %1 online.', $formattedAmount);\n- $payment->setDataUsingMethod('base_amount_paid_online', $amount);\n+ $payment->setDataUsingMethod('base_amount_paid_online', $chargeAmount);\n$payment->addTransactionCommentsToOrder($transaction, $message);\n$this->setProcessing($order);\n$order->save();\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/di.xml",
"new_path": "src/PayV2/etc/di.xml",
"diff": "<preference for=\"Amazon\\PayV2\\Api\\Data\\AsyncInterface\" type=\"Amazon\\PayV2\\Model\\Async\" />\n<preference for=\"Amazon\\PayV2\\Api\\Data\\CheckoutSessionInterface\" type=\"Amazon\\PayV2\\Model\\CheckoutSession\" />\n+ <type name=\"Magento\\Framework\\Console\\CommandList\">\n+ <arguments>\n+ <argument name=\"commands\" xsi:type=\"array\">\n+ <item name=\"AmazonPayV2AsyncProcess\" xsi:type=\"object\">Amazon\\PayV2\\Command\\Async\\ProcessCommand</item>\n+ </argument>\n+ </arguments>\n+ </type>\n+\n<!-- Loggers -->\n<type name=\"Amazon\\PayV2\\Logger\\AlexaLogger\">\n<arguments>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-389: Charge on Shipment after 7 Days (Pending Charge) |
21,244 | 19.06.2020 17:06:00 | 0 | 30125b5245e5af12a378e9147b9398acc6481ebe | Fixed scenarios when guest logging in on the checkout | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Api/Data/CheckoutSessionInterface.php",
"new_path": "src/PayV2/Api/Data/CheckoutSessionInterface.php",
"diff": "@@ -42,6 +42,12 @@ interface CheckoutSessionInterface\n*/\npublic function getQuoteId();\n+ /**\n+ * @param int $value\n+ * @return $this\n+ */\n+ public function setQuoteId($value);\n+\n/**\n* @return bool\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/CustomerData/CheckoutSession.php",
"new_path": "src/PayV2/CustomerData/CheckoutSession.php",
"diff": "*/\nnamespace Amazon\\PayV2\\CustomerData;\n-use Magento\\Customer\\CustomerData\\SectionSourceInterface;\n-\n/**\n* Amazon Checkout Session section\n*/\n-class CheckoutSession implements SectionSourceInterface\n+class CheckoutSession\n{\n/**\n* @var \\Magento\\Checkout\\Model\\Session\n@@ -45,17 +43,6 @@ class CheckoutSession implements SectionSourceInterface\n$this->checkoutSessionManagement = $checkoutSessionManagement;\n}\n- /**\n- * {@inheritdoc}\n- */\n- public function getSectionData()\n- {\n- $data = [\n- 'checkoutSessionId' => $this->getCheckoutSessionId(),\n- ];\n- return $data;\n- }\n-\n/**\n* @return array\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSession.php",
"new_path": "src/PayV2/Model/CheckoutSession.php",
"diff": "@@ -73,6 +73,14 @@ class CheckoutSession extends AbstractModel implements CheckoutSessionInterface\nreturn $this->getData(self::KEY_QUOTE_ID);\n}\n+ /**\n+ * @inheritDoc\n+ */\n+ public function setQuoteId($value)\n+ {\n+ return $this->setData(self::KEY_QUOTE_ID, $value);\n+ }\n+\n/**\n* @inheritDoc\n*/\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Observer/SalesQuoteMergeAfter.php",
"diff": "+<?php\n+\n+namespace Amazon\\PayV2\\Observer;\n+\n+class SalesQuoteMergeAfter implements \\Magento\\Framework\\Event\\ObserverInterface\n+{\n+ /**\n+ * @var \\Amazon\\PayV2\\Api\\CheckoutSessionRepositoryInterface\n+ */\n+ private $checkoutSessionRepository;\n+\n+ public function __construct(\\Amazon\\PayV2\\Api\\CheckoutSessionRepositoryInterface $checkoutSessionRepository)\n+ {\n+ $this->checkoutSessionRepository = $checkoutSessionRepository;\n+ }\n+\n+ /**\n+ * @inheritDoc\n+ */\n+ public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n+ {\n+ $source = $observer->getEvent()->getData('source');\n+ /** @var \\Magento\\Quote\\Api\\Data\\CartInterface $source */\n+ $sourceSession = $this->checkoutSessionRepository->getActiveForCart($source);\n+ if ($sourceSession) {\n+ $quote = $observer->getEvent()->getData('quote');\n+ /** @var \\Magento\\Quote\\Api\\Data\\CartInterface $quote */\n+ $quoteSession = $this->checkoutSessionRepository->getActiveForCart($quote);\n+ if ($quoteSession) {\n+ $quoteSession->cancel();\n+ $this->checkoutSessionRepository->save($quoteSession);\n+ }\n+ $sourceSession->setQuoteId($quote->getId());\n+ $this->checkoutSessionRepository->save($sourceSession);\n+ }\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/events.xml",
"new_path": "src/PayV2/etc/events.xml",
"diff": "<event name=\"sales_order_shipment_track_save_after\">\n<observer name=\"amazon_payv2_sales_order_shipment_track_save_after\" instance=\"Amazon\\PayV2\\Observer\\SalesOrderShipmentTrackAfter\"/>\n</event>\n+ <event name=\"sales_quote_merge_after\">\n+ <observer name=\"amazon_payv2_sales_quote_merge_after\" instance=\"Amazon\\PayV2\\Observer\\SalesQuoteMergeAfter\"/>\n+ </event>\n</config>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/frontend/di.xml",
"new_path": "src/PayV2/etc/frontend/di.xml",
"diff": "</argument>\n</arguments>\n</type>\n- <type name=\"Magento\\Customer\\CustomerData\\SectionPoolInterface\">\n- <arguments>\n- <argument name=\"sectionSourceMap\" xsi:type=\"array\">\n- <item name=\"amazon-checkout-session\" xsi:type=\"string\">Amazon\\PayV2\\CustomerData\\CheckoutSession</item>\n- </argument>\n- </arguments>\n- </type>\n<type name=\"Magento\\Checkout\\Block\\Checkout\\LayoutProcessor\">\n<plugin name=\"amazon_payv2_checkout_processor\" type=\"Amazon\\PayV2\\Plugin\\CheckoutProcessor\" />\n</type>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/frontend/sections.xml",
"new_path": "src/PayV2/etc/frontend/sections.xml",
"diff": "<section name=\"checkout-data\"/>\n<section name=\"last-ordered-items\"/>\n</action>\n- <action name=\"checkout/cart/add\">\n- <section name=\"amazon-checkout-session\"/>\n- </action>\n- <action name=\"checkout/cart/delete\">\n- <section name=\"amazon-checkout-session\"/>\n- </action>\n- <action name=\"checkout/sidebar/removeItem\">\n- <section name=\"amazon-checkout-session\"/>\n- </action>\n</config>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"new_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"diff": "@@ -23,7 +23,7 @@ define([\n'use strict';\nvar callbacks = [];\n- var localStorage = $.initNamespaceStorage('amzn-checkout-session').localStorage;\n+ var localStorage = $.initNamespaceStorage('amzn-checkout-session-config').localStorage;\nreturn function (callback) {\nvar cartId = customerData.get('cart')()['data_id'] || 0;\nif (cartId !== localStorage.get('cart_id')) {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "define([\n'jquery',\n- 'ko',\n- 'Magento_Customer/js/customer-data',\n'Amazon_PayV2/js/model/amazon-payv2-config'\n-], function ($, ko, customerData, amazonPayV2Config) {\n+], function ($, amazonPayV2Config) {\n'use strict';\nvar isEnabled = amazonPayV2Config.isDefined(),\n- sessionId,\n- sectionKey = 'amazon-checkout-session';\n+ storage = $.initNamespaceStorage('amzn-checkout-session').localStorage;\nreturn {\nisEnabled: isEnabled,\n@@ -41,9 +38,7 @@ define([\n* Clear Amazon Checkout Session ID and revert checkout\n*/\nclearAmazonCheckout: function() {\n- var sessionData = customerData.get(sectionKey)();\n- sessionData['checkoutSessionId'] = null;\n- customerData.set(sectionKey, sessionData);\n+ storage.removeAll();\n},\n/**\n@@ -52,23 +47,14 @@ define([\n* @returns {*}\n*/\ngetCheckoutSessionId: function () {\n- if (typeof sessionId === 'undefined') {\n- sessionId = customerData.get(sectionKey)()['checkoutSessionId'];\n- if (!sessionId && window.location.search.indexOf('?amazonCheckoutSessionId=') != -1) {\n+ var sessionId = storage.get('id');\n+ if (typeof sessionId === 'undefined' && window.location.search.indexOf('?amazonCheckoutSessionId=') != -1) {\nsessionId = window.location.search.replace('?amazonCheckoutSessionId=', '');\n- this.reloadCheckoutSessionId();\n- }\n+ storage.set('id', sessionId);\n}\nreturn sessionId;\n},\n- /**\n- * Reinit Amazon Checkout Session ID via Ajax\n- */\n- reloadCheckoutSessionId: function() {\n- customerData.reload([sectionKey]);\n- },\n-\n/**\n* Return the Amazon Pay region\n*/\n@@ -81,9 +67,7 @@ define([\n* @returns {exports}\n*/\nsetIsEditPaymentFlag: function (value) {\n- var sessionData = customerData.get(sectionKey)();\n- sessionData['IsEditBillingClicked'] = value;\n- customerData.set(sectionKey, sessionData);\n+ storage.set('is_edit_billing_clicked', value);\nreturn this;\n},\n@@ -91,7 +75,7 @@ define([\n* @returns {boolean}\n*/\ngetIsEditPaymentFlag: function () {\n- return customerData.get(sectionKey)()['IsEditBillingClicked'];\n+ return storage.get('is_edit_billing_clicked');\n}\n};\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"new_path": "src/PayV2/view/frontend/web/js/view/checkout-address.js",
"diff": "@@ -4,23 +4,14 @@ define(\n[\n'jquery',\n'uiComponent',\n- 'ko',\n'Magento_Customer/js/model/customer',\n'Magento_Checkout/js/model/quote',\n- 'Magento_Checkout/js/action/select-shipping-address',\n- 'Magento_Checkout/js/model/shipping-rate-processor/new-address',\n- 'Magento_Checkout/js/action/set-shipping-information',\n'Amazon_PayV2/js/model/storage',\n'Magento_Checkout/js/model/shipping-service',\n'Magento_Checkout/js/model/address-converter',\n'Magento_Checkout/js/action/create-shipping-address',\n- 'mage/storage',\n- 'Magento_Checkout/js/model/full-screen-loader',\n- 'Magento_Checkout/js/model/error-processor',\n- 'Magento_Checkout/js/model/url-builder',\n'Magento_Checkout/js/checkout-data',\n'Magento_Checkout/js/model/checkout-data-resolver',\n- 'Magento_Customer/js/model/address-list',\n'Magento_Checkout/js/model/step-navigator',\n'uiRegistry',\n'Amazon_PayV2/js/action/checkout-session-address-load',\n@@ -30,23 +21,14 @@ define(\nfunction (\n$,\nComponent,\n- ko,\ncustomer,\nquote,\n- selectShippingAddress,\n- shippingProcessor,\n- setShippingInformationAction,\namazonStorage,\nshippingService,\naddressConverter,\ncreateShippingAddress,\n- storage,\n- fullScreenLoader,\n- errorProcessor,\n- urlBuilder,\ncheckoutData,\ncheckoutDataResolver,\n- addressList,\nstepNavigator,\nregistry,\ncheckoutSessionAddressLoad,\n@@ -60,9 +42,6 @@ define(\nrequire([amazonCheckout.getCheckoutModuleName()]);\nreturn Component.extend({\n- defaults: {\n- template: 'Amazon_PayV2/checkout-address'\n- },\nisCustomerLoggedIn: customer.isLoggedIn,\nisAmazonCheckout: amazonStorage.isAmazonCheckout(),\nisPayOnly: false,\n@@ -83,32 +62,10 @@ define(\n}\n},\n- /**\n- * Call when component template is rendered\n- */\n- initAddress: function () {\n- var addressDataList = $.extend({}, quote.shippingAddress());\n-\n- // Only display one address from Amazon\n- addressList.removeAll();\n-\n- // Remove empty street array values for list view\n- if ($.isArray(addressDataList.street)) {\n- addressDataList.street = addressDataList.street.filter(function (el) {\n- return el != null;\n- });\n- }\n-\n- addressList.push(addressDataList);\n- this.setEmail(addressDataList.email);\n- },\n-\n/**\n* Retrieve shipping address from Amazon API\n*/\ngetShippingAddressFromAmazon: function () {\n- // Only display one address from Amazon\n- addressList.removeAll();\ncheckoutSessionAddressLoad('shipping', function (amazonAddress) {\nvar addressData = createShippingAddress(amazonAddress),\ncheckoutProvider = registry.get('checkoutProvider'),\n@@ -139,8 +96,6 @@ define(\ncheckoutProvider.set('shippingAddress', addressConvert);\ncheckoutDataResolver.resolveEstimationAddress();\n-\n- self.initAddress();\n});\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/shipping-address/list.js",
"new_path": "src/PayV2/view/frontend/web/js/view/shipping-address/list.js",
"diff": "@@ -18,6 +18,17 @@ define([\nthis._super();\nthis.visible = true;\nreturn this;\n+ },\n+\n+ /**\n+ * @param {Object} address\n+ * @param {*} index\n+ */\n+ createRendererComponent: function (address, index) {\n+ if (address.getType() === 'new-customer-address') {\n+ // Only display one address from Amazon\n+ this._super();\n+ }\n}\n});\n});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-409: Fixed scenarios when guest logging in on the checkout |
21,244 | 22.06.2020 21:07:42 | 0 | a98a9f00718a8cc0f05fd2ed75aafc27870ea8be | Implemented Address Restrictions | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -122,6 +122,10 @@ class AmazonPayV2Adapter\n'storeId' => $this->amazonConfig->getClientId(),\n'platformId' => $this->amazonConfig->getPlatformId(),\n];\n+ $deliverySpecifications = $this->amazonConfig->getDeliverySpecifications();\n+ if (!empty($deliverySpecifications)) {\n+ $payload['deliverySpecifications'] = $deliverySpecifications;\n+ }\n$response = $this->clientFactory->create($storeId)->createCheckoutSession($payload, $headers);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -43,6 +43,16 @@ class AmazonConfig\n*/\nprivate $clientIpHelper;\n+ /**\n+ * @var \\Magento\\Directory\\Model\\AllowedCountries\n+ */\n+ private $countriesAllowed;\n+\n+ /**\n+ * @var \\Magento\\Directory\\Model\\Config\\Source\\Country\n+ */\n+ private $countryConfig;\n+\n/**\n* @var \\Magento\\Framework\\Locale\\Resolver\n*/\n@@ -58,6 +68,8 @@ class AmazonConfig\n* @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n* @param \\Magento\\Framework\\App\\Config\\ScopeConfigInterface $scopeConfig\n* @param \\Amazon\\PayV2\\Helper\\ClientIp $clientIpHelper\n+ * @param \\Magento\\Directory\\Model\\AllowedCountries $countriesAllowed\n+ * @param \\Magento\\Directory\\Model\\Config\\Source\\Country $countryConfig\n* @param \\Magento\\Framework\\Locale\\Resolver $localeResolver\n* @param \\Magento\\Framework\\App\\State $appState\n*/\n@@ -65,12 +77,16 @@ class AmazonConfig\n\\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\n\\Magento\\Framework\\App\\Config\\ScopeConfigInterface $scopeConfig,\n\\Amazon\\PayV2\\Helper\\ClientIp $clientIpHelper,\n+ \\Magento\\Directory\\Model\\AllowedCountries $countriesAllowed,\n+ \\Magento\\Directory\\Model\\Config\\Source\\Country $countryConfig,\n\\Magento\\Framework\\Locale\\Resolver $localeResolver,\n\\Magento\\Framework\\App\\State $appState\n) {\n$this->storeManager = $storeManager;\n$this->scopeConfig = $scopeConfig;\n$this->clientIpHelper = $clientIpHelper;\n+ $this->countriesAllowed = $countriesAllowed;\n+ $this->countryConfig = $countryConfig;\n$this->localeResolver = $localeResolver;\n$this->appState = $appState;\n}\n@@ -532,6 +548,40 @@ class AmazonConfig\n);\n}\n+ /**\n+ * @param string $scope\n+ * @param string $scopeCode\n+ * @return array\n+ */\n+ public function getDeliverySpecifications($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ $result = [];\n+ $allCountries = array_column($this->countryConfig->toOptionArray(true), 'value');\n+ $allowedCountries = $this->countriesAllowed->getAllowedCountries($scope, $scopeCode);\n+ $allCountriesCount = count($allCountries);\n+ $allowedCountriesCount = count($allowedCountries);\n+ if ($allowedCountriesCount < $allCountriesCount) {\n+ if ($allowedCountriesCount < $allCountriesCount / 2) {\n+ $type = 'Allowed';\n+ $countries = $allowedCountries;\n+ } else {\n+ $type = 'NotAllowed';\n+ $countries = array_diff($allCountries, $allowedCountries);\n+ }\n+ $restrictions = [];\n+ foreach ($countries as $country) {\n+ $restrictions[$country] = new \\stdClass();\n+ }\n+ $result = [\n+ 'addressRestrictions' => [\n+ 'type' => $type,\n+ 'restrictions' => $restrictions,\n+ ],\n+ ];\n+ }\n+ return $result;\n+ }\n+\n/**\n* @return string\n*/\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-343: Implemented Address Restrictions |
21,244 | 25.06.2020 17:37:39 | 0 | bc5bb0c6e15fc974221ce10352d1eec4a2a14236 | Button Color Switcher | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -142,6 +142,16 @@ class AmazonConfig\nreturn $this->getPaymentRegion($scope, $scopeCode);\n}\n+ /**\n+ * @param string $scope\n+ * @param string $scopeCode\n+ * @return string\n+ */\n+ public function getButtonColor($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ return $this->scopeConfig->getValue('payment/amazon_payment_v2/button_color', $scope, $scopeCode);\n+ }\n+\n/**\n* @param string $scope\n* @param null $scopeCode\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -158,6 +158,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$result = [\n'merchant_id' => $this->amazonConfig->getMerchantId(),\n'currency' => $this->amazonConfig->getCurrencyCode(),\n+ 'button_color' => $this->amazonConfig->getButtonColor(),\n'language' => $this->amazonConfig->getLanguage(),\n'pay_only' => $this->amazonHelper->isPayOnly($this->getCart($cartId)),\n'sandbox' => $this->amazonConfig->isSandboxEnabled(),\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "<field id=\"payment/us/amazon_payment/api_version\">1</field>\n</depends>\n</field>\n+ <field id=\"button_color_v2\" translate=\"label\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <label>Button Color</label>\n+ <config_path>payment/amazon_payment_v2/button_color</config_path>\n+ <source_model>Amazon\\PayV2\\Model\\Config\\Source\\ButtonColor</source_model>\n+ <depends>\n+ <field id=\"payment/us/amazon_payment/api_version\">2</field>\n+ </depends>\n+ </field>\n</group>\n<group id=\"extra_options\" translate=\"label\" type=\"text\" sortOrder=\"40\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n<field id=\"checkout_review_url\" translate=\"label comment\" type=\"text\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/config.xml",
"new_path": "src/PayV2/etc/config.xml",
"diff": "<payment>\n<amazon_payment_v2>\n<active>0</active>\n+ <button_color>Gold</button_color>\n<is_gateway>1</is_gateway>\n<title>Amazon Pay V2</title>\n<sort_order>1</sort_order>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -37,6 +37,7 @@ define([\nmethod: 'PUT'\n},\nledgerCurrency: checkoutSessionConfig['currency'],\n+ buttonColor: checkoutSessionConfig['button_color'],\ncheckoutLanguage: checkoutSessionConfig['language'],\nproductType: this._isPayOnly(checkoutSessionConfig['pay_only']) ? 'PayOnly' : 'PayAndShip',\nplacement: this.options.placement,\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-420: Button Color Switcher |
21,244 | 26.06.2020 22:46:01 | 0 | e6945f4951670bc2eb6e0f7357871fc4a395cad7 | Address Restrictions improvement: PO Boxes and PackStations | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -589,6 +589,16 @@ class AmazonConfig\n],\n];\n}\n+ $specialRestrictions = [];\n+ if ($this->scopeConfig->getValue('payment/amazon_payment_v2/shipping_restrict_po_boxes', $scope, $scopeCode)) {\n+ $specialRestrictions[] = 'RestrictPOBoxes';\n+ }\n+ if ($this->scopeConfig->getValue('payment/amazon_payment_v2/shipping_restrict_packstations', $scope, $scopeCode)) {\n+ $specialRestrictions[] = 'RestrictPackstations';\n+ }\n+ if (!empty($specialRestrictions)) {\n+ $result['specialRestrictions'] = $specialRestrictions;\n+ }\nreturn $result;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "</depends>\n</field>\n</group>\n+ <group id=\"shipping_restrictions\" translate=\"label\" type=\"text\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <label>Shipping Restrictions</label>\n+ <depends>\n+ <field id=\"payment/us/amazon_payment/api_version\">2</field>\n+ </depends>\n+ <field id=\"po_boxes\" translate=\"label comment\" type=\"select\" sortOrder=\"10\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <label>Restrict PO Boxes</label>\n+ <comment><![CDATA[Marks PO box addresses in US, CA, GB, FR, DE, ES, PT, IT, AU as restricted]]></comment>\n+ <source_model>Magento\\Config\\Model\\Config\\Source\\Yesno</source_model>\n+ <config_path>payment/amazon_payment_v2/shipping_restrict_po_boxes</config_path>\n+ </field>\n+ <field id=\"packstations\" translate=\"label comment\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <label>Restrict Packstations</label>\n+ <comment><![CDATA[Marks packstation addresses in DE as restricted]]></comment>\n+ <source_model>Magento\\Config\\Model\\Config\\Source\\Yesno</source_model>\n+ <config_path>payment/amazon_payment_v2/shipping_restrict_packstations</config_path>\n+ </field>\n+ </group>\n<group id=\"extra_options\" translate=\"label\" type=\"text\" sortOrder=\"40\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n<field id=\"checkout_review_url\" translate=\"label comment\" type=\"text\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n<label>Checkout review URL</label>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-415: Address Restrictions improvement: PO Boxes and PackStations |
21,261 | 29.06.2020 18:42:54 | -7,200 | d35c2cec92c2e0cf3d29c4cacb59c92af1e1b6ec | version increase to 2.1.0 | [
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.0.3\",\n+ \"version\": \"2.1.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.0.3\",\n+ \"version\": \"2.1.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.0.3\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.1.0\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase to 2.1.0 |
21,244 | 01.07.2020 16:54:17 | 0 | 99418c1bd16584d85ba8af08cdc0b870118e51b9 | Deleted Store Name fallback | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -177,7 +177,7 @@ class AmazonPayV2Adapter\n],\n'merchantMetadata' => [\n'merchantReferenceId' => $quote->getReservedOrderId(),\n- 'merchantStoreName' => $this->amazonConfig->getStoreName() ?: $store->getName(),\n+ 'merchantStoreName' => $this->amazonConfig->getStoreName(),\n'customInformation' => $this->getMerchantCustomInformation(),\n],\n'platformId' => $this->amazonConfig->getPlatformId(),\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-434: Deleted Store Name fallback |
21,244 | 02.07.2020 22:30:23 | 0 | 45689c7917dc1e134edc433dedcf93562b95fcc1 | Updated billing address visibility | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -59,7 +59,6 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n'region' => $this->amazonConfig->getRegion(),\n'code' => \\Amazon\\PayV2\\Gateway\\Config\\Config::CODE,\n'is_method_available' => $this->amazonConfig->isPayButtonAvailableAsPaymentMethod(),\n- 'is_billing_address_required' => $this->amazonHelper->isBillingAddressRequired(),\n'is_pay_only' => $this->amazonHelper->isPayOnly(),\n];\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Helper/Data.php",
"new_path": "src/PayV2/Helper/Data.php",
"diff": "@@ -47,20 +47,6 @@ class Data extends AbstractHelper\nreturn $quote->hasItems() ? $quote->isVirtual() : true;\n}\n- /**\n- * @param string $scope\n- * @param string $scopeCode\n- * @return boolean\n- */\n- public function isBillingAddressRequired($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n- {\n- $region = $this->amazonConfig->getPaymentRegion($scope, $scopeCode);\n- return in_array($region, [\n- 'de',\n- 'uk',\n- ]);\n- }\n-\n/**\n* @return string\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -318,13 +318,9 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\npublic function getBillingAddress($cartId)\n{\n- $result = $this->fetchAddress($cartId, false, function ($session) {\n+ return $this->fetchAddress($cartId, false, function ($session) {\nreturn $session['paymentPreferences'][0]['billingAddress'] ?? [];\n});\n- if (empty($result) && !$this->amazonHelper->isPayOnly()) {\n- $result = $this->getShippingAddress($cartId);\n- }\n- return $result;\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"new_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"diff": "@@ -70,14 +70,12 @@ class CheckoutProcessor\n$shippingConfig['children']['address-list']['rendererTemplates']['new-customer-address']\n['component'] = 'Amazon_PayV2/js/view/shipping-address/address-renderer/default';\n- if (!$this->checkoutDataHelper->isDisplayBillingOnPaymentMethodAvailable()) {\n- $billingConfig = &$paymentConfig['children']['afterMethods']['children']['billing-address-form'];\n- } else if ($this->amazonHelper->isBillingAddressRequired()) {\n+ if ($this->checkoutDataHelper->isDisplayBillingOnPaymentMethodAvailable()) {\n$billingConfig = &$paymentConfig['children']['payments-list']['children'][\\Amazon\\PayV2\\Gateway\\Config\\Config::CODE . '-form'];\n+ } else {\n+ $billingConfig = &$paymentConfig['children']['afterMethods']['children']['billing-address-form'];\n}\n- if (isset($billingConfig)) {\n$billingConfig['component'] = 'Amazon_PayV2/js/view/billing-address';\n- }\nunset($paymentConfig['children']['renders']['children']['amazonlogin']); // legacy\n} else {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"new_path": "src/PayV2/view/frontend/layout/checkout_index_index.xml",
"diff": "</item>\n<item name=\"methods\" xsi:type=\"array\">\n<item name=\"amazon_payment_v2\" xsi:type=\"array\">\n- <item name=\"isBillingAddressRequired\" xsi:type=\"helper\" helper=\"Amazon\\PayV2\\Helper\\Data::isBillingAddressRequired\"/>\n+ <item name=\"isBillingAddressRequired\" xsi:type=\"boolean\">true</item>\n</item>\n</item>\n</item>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"new_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"diff": ".amazon-payment-action-container{\npadding-left: 10px;\n}\n+ .actions-toolbar {\n+ margin-top: 20px;\n+ }\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/checkout-session-address-load.js",
"new_path": "src/PayV2/view/frontend/web/js/action/checkout-session-address-load.js",
"diff": "@@ -31,9 +31,7 @@ define([\nreturn storage.get(serviceUrl).done(function (data) {\nfullScreenLoader.stopLoader(true);\n- if (data.length) {\n- callback(data.shift());\n- }\n+ callback(data.length ? data.shift() : {});\n}).fail(function (response) {\nerrorProcessor.process(response);\nfullScreenLoader.stopLoader(true);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"new_path": "src/PayV2/view/frontend/web/js/view/payment/method-renderer/amazon-payment-method.js",
"diff": "@@ -57,11 +57,7 @@ define(\nthis.initChildren();\nif (amazonStorage.isAmazonCheckout()) {\nthis.initPaymentDescriptor();\n- if (amazonConfig.getValue('is_billing_address_required')) {\nthis.initBillingAddress();\n- } else {\n- this.isPlaceOrderActionAllowed(true);\n- }\nthis.selectPaymentMethod();\n}\n},\n@@ -92,6 +88,11 @@ define(\ninitBillingAddress: function () {\nvar checkoutProvider = registry.get('checkoutProvider');\ncheckoutSessionAddressLoad('billing', function (amazonAddress) {\n+ if ($.isEmptyObject(amazonAddress)) {\n+ self.isPlaceOrderActionAllowed(true);\n+ return;\n+ }\n+\nself.setEmail(amazonAddress.email);\nvar quoteAddress = createBillingAddress(amazonAddress);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/template/billing-address/details.html",
"new_path": "src/PayV2/view/frontend/web/template/billing-address/details.html",
"diff": "click=\"editAddress\">\n<span translate=\"'Edit Billing Address'\"></span>\n</button>\n- <br/><br/>\n</div>\n</div>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-401: Updated billing address visibility |
21,261 | 08.07.2020 12:39:09 | -7,200 | c56c662298b584b86612716be981b11e4dfb4e22 | version increase to 2.1.1 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -52,5 +52,5 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n-| 2.2.4 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.3.1 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.0 |\n+| 2.2.4 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.4.0 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.1 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.0\",\n+ \"version\": \"2.1.1\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.0\",\n+ \"version\": \"2.1.1\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.1.0\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.1.1\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase to 2.1.1 |
21,263 | 10.07.2020 14:21:50 | 25,200 | f30ce5b88ac6ae2aa758879634642dbda248a9b5 | version increase 2.1.2 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -53,4 +53,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.4 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.4.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.1 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.2 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.1\",\n+ \"version\": \"2.1.2\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.1\",\n+ \"version\": \"2.1.2\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.1.1\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.1.2\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase 2.1.2 |
21,244 | 10.07.2020 19:59:58 | 25,200 | 020bd319117084242b01bfa777d290fec02aecf6 | Fixed local storage initialization | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"new_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"diff": "@@ -23,15 +23,21 @@ define([\n'use strict';\nvar callbacks = [];\n- var localStorage = $.initNamespaceStorage('amzn-checkout-session-config').localStorage;\n+ var localStorage = null;\n+ var getLocalStorage = function () {\n+ if (localStorage === null) {\n+ localStorage = $.initNamespaceStorage('amzn-checkout-session-config').localStorage;\n+ }\n+ return localStorage;\n+ };\nreturn function (callback) {\nvar cartId = customerData.get('cart')()['data_id'] || 0;\n- if (cartId !== localStorage.get('cart_id')) {\n+ if (cartId !== getLocalStorage().get('cart_id')) {\ncallbacks.push(callback);\nif (callbacks.length == 1) {\nremoteStorage.get(url.build('amazon_payv2/checkout/config')).done(function (config) {\n- localStorage.set('cart_id', cartId);\n- localStorage.set('config', config);\n+ getLocalStorage().set('cart_id', cartId);\n+ getLocalStorage().set('config', config);\ndo {\ncallbacks.shift()(config);\n} while (callbacks.length);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "@@ -20,7 +20,13 @@ define([\n'use strict';\nvar isEnabled = amazonPayV2Config.isDefined(),\n+ storage = null,\n+ getStorage = function () {\n+ if (storage === null) {\nstorage = $.initNamespaceStorage('amzn-checkout-session').localStorage;\n+ }\n+ return storage;\n+ };\nreturn {\nisEnabled: isEnabled,\n@@ -38,7 +44,7 @@ define([\n* Clear Amazon Checkout Session ID and revert checkout\n*/\nclearAmazonCheckout: function() {\n- storage.removeAll();\n+ getStorage().removeAll();\n},\n/**\n@@ -47,10 +53,10 @@ define([\n* @returns {*}\n*/\ngetCheckoutSessionId: function () {\n- var sessionId = storage.get('id');\n+ var sessionId = getStorage().get('id');\nif (typeof sessionId === 'undefined' && window.location.search.indexOf('?amazonCheckoutSessionId=') != -1) {\nsessionId = window.location.search.replace('?amazonCheckoutSessionId=', '');\n- storage.set('id', sessionId);\n+ getStorage().set('id', sessionId);\n}\nreturn sessionId;\n},\n@@ -67,7 +73,7 @@ define([\n* @returns {exports}\n*/\nsetIsEditPaymentFlag: function (value) {\n- storage.set('is_edit_billing_clicked', value);\n+ getStorage().set('is_edit_billing_clicked', value);\nreturn this;\n},\n@@ -75,7 +81,7 @@ define([\n* @returns {boolean}\n*/\ngetIsEditPaymentFlag: function () {\n- return storage.get('is_edit_billing_clicked');\n+ return getStorage().get('is_edit_billing_clicked');\n}\n};\n});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-432: Fixed local storage initialization |
21,244 | 13.07.2020 18:16:34 | 0 | a94663cbb8fb3a20d7fa0cddda01f622c80fef7c | Fixed tooltip visibility | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"new_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"diff": ".lib-css(background, @sidebar__background-color);\n}\n}\n- .amazon-button-column-tooltip {\n- display: none;\n+ .amazon-button-column-tooltip .field-tooltip {\n+ display: block;\n}\n}\n.product-info-main {\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-334: Fixed tooltip visibility |
21,261 | 20.07.2020 11:43:23 | -7,200 | 4704aacf6410716f3870d01ce653796becd168fb | version increase to 2.1.3 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -53,4 +53,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.4.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.2 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.3 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.2\",\n+ \"version\": \"2.1.3\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.2\",\n+ \"version\": \"2.1.3\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.1.2\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.1.3\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase to 2.1.3 |
21,244 | 23.07.2020 23:07:15 | 0 | d00f9094057a7d56352e4ee764e9863109f46357 | Implemented hiding Amazon Pay for restricted products | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -70,6 +70,6 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n*/\npublic function isEnabled()\n{\n- return $this->amazonConfig->isEnabled();\n+ return $this->amazonConfig->isEnabled() && !$this->amazonHelper->hasRestrictedProducts();\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/ProductPagePaymentLink.php",
"new_path": "src/PayV2/Block/ProductPagePaymentLink.php",
"diff": "@@ -23,6 +23,11 @@ class ProductPagePaymentLink extends \\Magento\\Framework\\View\\Element\\Template\n*/\nprivate $amazonConfig;\n+ /**\n+ * @var \\Amazon\\PayV2\\Helper\\Data\n+ */\n+ private $amazonHelper;\n+\n/**\n* @var \\Magento\\Framework\\Registry\n*/\n@@ -31,12 +36,14 @@ class ProductPagePaymentLink extends \\Magento\\Framework\\View\\Element\\Template\npublic function __construct(\n\\Magento\\Framework\\View\\Element\\Template\\Context $context,\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n+ \\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Magento\\Framework\\Registry $registry,\narray $data = []\n) {\nparent::__construct($context, $data);\n$this->amazonConfig = $amazonConfig;\n+ $this->amazonHelper = $amazonHelper;\n$this->registry = $registry;\n}\n@@ -45,20 +52,26 @@ class ProductPagePaymentLink extends \\Magento\\Framework\\View\\Element\\Template\n*/\nprotected function _toHtml()\n{\n- if (!$this->amazonConfig->isEnabled() || !$this->amazonConfig->isPayButtonAvailableOnProductPage()) {\n+ if (!$this->amazonConfig->isEnabled() || $this->amazonHelper->isProductRestricted($this->_getProduct()) || !$this->amazonConfig->isPayButtonAvailableOnProductPage()) {\nreturn '';\n}\nreturn parent::_toHtml();\n}\n+ /**\n+ * @return \\Magento\\Catalog\\Model\\Product\n+ */\n+ protected function _getProduct()\n+ {\n+ return $this->registry->registry('product');\n+ }\n+\n/**\n* @return bool\n*/\npublic function isPayOnly()\n{\n- $product = $this->registry->registry('product');\n- /* @var $product \\Magento\\Catalog\\Model\\Product */\n- return $product->isVirtual();\n+ return $this->_getProduct()->isVirtual();\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Helper/Data.php",
"new_path": "src/PayV2/Helper/Data.php",
"diff": "namespace Amazon\\PayV2\\Helper;\nuse Magento\\Framework\\App\\Helper\\AbstractHelper;\n-use Magento\\Store\\Model\\ScopeInterface;\nclass Data extends AbstractHelper\n{\n@@ -22,19 +21,75 @@ class Data extends AbstractHelper\n*/\nprivate $moduleList;\n+ /**\n+ * @var \\Magento\\Catalog\\Model\\ResourceModel\\Category\n+ */\n+ private $categoryResourceModel;\n+\n+ /**\n+ * @var mixed\n+ */\n+ private $restrictedCategoryIds;\n+\npublic function __construct(\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n\\Magento\\Checkout\\Helper\\Data $helperCheckout,\n\\Magento\\Framework\\Module\\ModuleListInterface $moduleList,\n+ \\Magento\\Catalog\\Model\\ResourceModel\\Category $categoryResourceModel,\n\\Magento\\Framework\\App\\Helper\\Context $context\n)\n{\n$this->amazonConfig = $amazonConfig;\n$this->helperCheckout = $helperCheckout;\n$this->moduleList = $moduleList;\n+ $this->categoryResourceModel = $categoryResourceModel;\nparent::__construct($context);\n}\n+ /**\n+ * Inspired by \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection::getChildrenCategories\n+ *\n+ * @param int $restrictedCategoryId\n+ * @return array\n+ */\n+ protected function fetchRestrictedCategoryIds($restrictedCategoryId)\n+ {\n+ $result[] = $restrictedCategoryId;\n+ $categories = $this->categoryResourceModel->getCategoryWithChildren($restrictedCategoryId);\n+ if (!empty($categories)) {\n+ $firstCategory = array_shift($categories);\n+ if ($firstCategory['is_anchor'] == 1) {\n+ $anchorCategories[] = $firstCategory['entity_id'];\n+ foreach ($categories as $category) {\n+ if (in_array($category['parent_id'], $result) && in_array($category['parent_id'], $anchorCategories)) {\n+ $result[] = $category['entity_id'];\n+ if ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategories)) {\n+ $anchorCategories[] = $category['entity_id'];\n+ }\n+ }\n+ }\n+ }\n+ }\n+ return $result;\n+ }\n+\n+ /**\n+ * @return array\n+ */\n+ protected function getRestrictedCategoryIds()\n+ {\n+ if ($this->restrictedCategoryIds === null) {\n+ $restrictedCategoryIds = [];\n+ foreach ($this->amazonConfig->getRestrictedCategoryIds() as $restrictedCategoryId) {\n+ if (!in_array($restrictedCategoryId, $restrictedCategoryIds)) {\n+ $restrictedCategoryIds = array_merge($restrictedCategoryIds, $this->fetchRestrictedCategoryIds($restrictedCategoryId));\n+ }\n+ }\n+ $this->restrictedCategoryIds = $restrictedCategoryIds;\n+ }\n+ return $this->restrictedCategoryIds;\n+ }\n+\n/**\n* @param \\Magento\\Quote\\Model\\Quote $quote\n* @return bool\n@@ -47,6 +102,37 @@ class Data extends AbstractHelper\nreturn $quote->hasItems() ? $quote->isVirtual() : true;\n}\n+ /**\n+ * @param \\Magento\\Quote\\Model\\Quote $quote\n+ * @return bool\n+ */\n+ public function hasRestrictedProducts($quote = null)\n+ {\n+ if ($quote === null) {\n+ $quote = $this->helperCheckout->getQuote();\n+ }\n+ $result = false;\n+ foreach ($quote->getAllItems() as $item) {\n+ /** @var \\Magento\\Quote\\Model\\Quote\\Item $item */\n+ if ($this->isProductRestricted($item->getProduct())) {\n+ $result = true;\n+ break;\n+ }\n+ }\n+ return $result;\n+ }\n+\n+ /**\n+ * @param \\Magento\\Catalog\\Model\\Product $product\n+ * @return bool\n+ */\n+ public function isProductRestricted($product)\n+ {\n+ $productCategoryIds = $product->getCategoryIds();\n+ $restrictedCategoryIds = $this->getRestrictedCategoryIds();\n+ return !empty(array_intersect($productCategoryIds, $restrictedCategoryIds));\n+ }\n+\n/**\n* @return string\n*/\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -537,6 +537,16 @@ class AmazonConfig\nreturn $this->scopeConfig->isSetFlag('payment/amazonlogin/active', $scope, $scopeCode);\n}\n+ /**\n+ * @param string $scope\n+ * @param mixed $scopeCode\n+ * @return array\n+ */\n+ public function getRestrictedCategoryIds($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ return explode(',', $this->scopeConfig->getValue('payment/amazon_payment_v2/restrict_categories', $scope, $scopeCode));\n+ }\n+\n/**\n* @param string $scope\n* @param null $scopeCode\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -200,6 +200,20 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nreturn $this->amazonSessions[$amazonSessionId];\n}\n+ /**\n+ * @param mixed $cartId\n+ * @return bool\n+ */\n+ protected function isAvailable($cartId)\n+ {\n+ $result = false;\n+ if ($this->amazonConfig->isEnabled()) {\n+ $cart = $this->getCart($cartId);\n+ $result = !$this->amazonHelper->hasRestrictedProducts($cart);\n+ }\n+ return $result;\n+ }\n+\n/**\n* @param mixed $cartId\n* @param bool $isShippingAddress\n@@ -209,7 +223,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nprotected function fetchAddress($cartId, $isShippingAddress, $addressDataExtractor)\n{\n$result = false;\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$session = $this->getAmazonSession($cartId);\n$addressData = call_user_func($addressDataExtractor, $session);\n@@ -268,7 +282,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\npublic function getConfig($cartId)\n{\n$result = [];\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$result = [\n'merchant_id' => $this->amazonConfig->getMerchantId(),\n'currency' => $this->amazonConfig->getCurrencyCode(),\n@@ -288,7 +302,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n{\n$result = [];\n$this->cancelCheckoutSession($cartId);\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$result = $this->amazonAdapter->createCheckoutSession($this->storeManager->getStore()->getId());\nif (isset($result['checkoutSessionId'])) {\n$checkoutSession = $this->checkoutSessionFactory->create([\n@@ -337,7 +351,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\npublic function cancelCheckoutSession($cartId)\n{\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$checkoutSession = $this->getCheckoutSessionForCart($cartId);\nif ($checkoutSession) {\n$checkoutSession->cancel();\n@@ -352,7 +366,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\npublic function getCheckoutSession($cartId)\n{\n$result = null;\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$checkoutSession = $this->getCheckoutSessionForCart($cartId);\nif ($checkoutSession) {\n$result = $checkoutSession->getSessionId();\n@@ -369,7 +383,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$result = null;\n$checkoutSession = null;\n$cart = $this->getCart($cartId);\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$checkoutSession = $this->getCheckoutSessionForCart($cart);\n}\nif ($checkoutSession && $cart->getIsActive()) {\n@@ -391,7 +405,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$result = null;\n$checkoutSession = null;\n$cart = $this->getCart($cartId);\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->isAvailable($cartId)) {\n$checkoutSession = $this->getCheckoutSessionForCart($cart);\n}\nif ($checkoutSession && $this->canComplete($cart, $checkoutSession)) {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"new_path": "src/PayV2/Plugin/CheckoutProcessor.php",
"diff": "@@ -63,7 +63,7 @@ class CheckoutProcessor\n$paymentConfig = &$jsLayout['components']['checkout']['children']['steps']['children']['billing-step']\n['children']['payment'];\n- if ($this->amazonConfig->isEnabled()) {\n+ if ($this->amazonConfig->isEnabled() && !$this->amazonHelper->hasRestrictedProducts()) {\n$shippingConfig['component'] = 'Amazon_PayV2/js/view/shipping';\n$shippingConfig['children']['customer-email']['component'] = 'Amazon_PayV2/js/view/form/element/email';\n$shippingConfig['children']['address-list']['component'] = 'Amazon_PayV2/js/view/shipping-address/list';\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "<config_path>payment/amazon_payment_v2/shipping_restrict_packstations</config_path>\n</field>\n</group>\n+ <group id=\"sales_options\">\n+ <field id=\"restrict_categories\" translate=\"label\" type=\"text\" sortOrder=\"40\" showInDefault=\"1\" showInWebsite=\"0\" showInStore=\"0\">\n+ <label>Restrict Product Categories</label>\n+ <config_path>payment/amazon_payment_v2/restrict_categories</config_path>\n+ <frontend_model>Amazon\\PayV2\\Block\\Adminhtml\\System\\Config\\Form\\RestrictCategories</frontend_model>\n+ <depends>\n+ <field id=\"payment/us/amazon_payment/api_version\">2</field>\n+ </depends>\n+ </field>\n+ </group>\n<group id=\"extra_options\" translate=\"label\" type=\"text\" sortOrder=\"40\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n<field id=\"checkout_review_url\" translate=\"label comment\" type=\"text\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n<label>Checkout review URL</label>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/view/adminhtml/web/css/source/_module.less",
"diff": "+#row_payment_us_amazon_payment_advanced_sales_options_restrict_categories {\n+ .action-select-wrap {\n+ .action-select:after {\n+ transform: none;\n+ }\n+ &._active .action-select:after {\n+ transform: rotate(180deg);\n+ }\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"new_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"diff": "<div id=\"PayWithAmazon-Cart\"\nclass=\"amazon-checkout-button\"\ndata-loaded-at=\"<?= time() // added for force re-rendering?>\"\n- data-mage-init='{\"Amazon_PayV2/js/amazon-button\": {}}'>\n+ data-mage-init='{\"Amazon_PayV2/js/amazon-button\": {\"hideIfUnavailable\": \".amazon-button-container-v2\"}}'>\n</div>\n</div>\n<div class=\"amazon-button-column amazon-button-column-tooltip\">\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/payment-link-product-page.phtml",
"new_path": "src/PayV2/view/frontend/templates/payment-link-product-page.phtml",
"diff": "<a href=\"javascript:;\"\nclass=\"amazon-addtoCart\"\nid=\"amazon-addtoCart-<?= /* @noEscape */ $block->getJsId() ?>\"\n- data-mage-init='{\"amazonPayV2ProductAdd\": {}}'>\n+ data-mage-init='{\"amazonPayV2ProductAdd\": {\"hideIfUnavailable\": \".amazon-checkout-now,.amazon-button-container-v2\"}}'>\n</a>\n</div>\n<div class=\"amazon-button-column amazon-button-column-tooltip\">\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"new_path": "src/PayV2/view/frontend/web/js/action/checkout-session-config-load.js",
"diff": "@@ -44,7 +44,7 @@ define([\n});\n}\n} else {\n- callback(localStorage.get('config'));\n+ callback(getLocalStorage().get('config'));\n}\n};\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -26,10 +26,12 @@ define([\noptions: {\npayOnly: null,\nplacement: 'Cart',\n+ hideIfUnavailable: '',\n},\n_loadButtonConfig: function (callback) {\ncheckoutSessionConfigLoad(function (checkoutSessionConfig) {\n+ if (!$.isEmptyObject(checkoutSessionConfig)) {\ncallback({\nmerchantId: checkoutSessionConfig['merchant_id'],\ncreateCheckoutSession: {\n@@ -43,6 +45,9 @@ define([\nplacement: this.options.placement,\nsandbox: checkoutSessionConfig['sandbox'],\n});\n+ } else {\n+ $(this.options.hideIfUnavailable).hide();\n+ }\n}.bind(this));\n},\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/template/checkout-button.html",
"new_path": "src/PayV2/view/frontend/web/template/checkout-button.html",
"diff": "<div class=\"amazon-button-column\">\n<div id=\"PayWithAmazon-Checkout\"\nclass=\"amazon-checkout-button\"\n- data-bind=\"attr: {id: 'PayWithAmazon_' + displayArea}, mageInit: {'Amazon_PayV2/js/amazon-button':{'placement': 'Checkout'}}\"></div>\n+ data-bind=\"attr: {id: 'PayWithAmazon_' + displayArea}, mageInit: {'Amazon_PayV2/js/amazon-button':{'placement': 'Checkout', 'hideIfUnavailable': '.amazon-express-title,.amazon-button-container-v2,.amazon-divider'}}\"></div>\n</div>\n<div class=\"amazon-button-column amazon-button-column-tooltip\">\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-437: Implemented hiding Amazon Pay for restricted products |
21,244 | 24.07.2020 00:26:43 | 0 | e2d4f89e1cb125eba4d7701d86325a48d3d5fca3 | Fixed retrieving restricted category ids | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -544,7 +544,8 @@ class AmazonConfig\n*/\npublic function getRestrictedCategoryIds($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n{\n- return explode(',', $this->scopeConfig->getValue('payment/amazon_payment_v2/restrict_categories', $scope, $scopeCode));\n+ $value = $this->scopeConfig->getValue('payment/amazon_payment_v2/restrict_categories', $scope, $scopeCode);\n+ return !empty($value) ? explode(',', $value) : [];\n}\n/**\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-437: Fixed retrieving restricted category ids |
21,244 | 24.07.2020 00:53:18 | 0 | efd1ce3cb9a236b2e73299ff19e2fe95bb682a9b | Fixed Notice: Undefined index: entity_id | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Helper/Data.php",
"new_path": "src/PayV2/Helper/Data.php",
"diff": "@@ -26,6 +26,11 @@ class Data extends AbstractHelper\n*/\nprivate $categoryResourceModel;\n+ /**\n+ * @var \\Magento\\Framework\\EntityManager\\MetadataPool\n+ */\n+ private $metadataPool;\n+\n/**\n* @var mixed\n*/\n@@ -36,6 +41,7 @@ class Data extends AbstractHelper\n\\Magento\\Checkout\\Helper\\Data $helperCheckout,\n\\Magento\\Framework\\Module\\ModuleListInterface $moduleList,\n\\Magento\\Catalog\\Model\\ResourceModel\\Category $categoryResourceModel,\n+ \\Magento\\Framework\\EntityManager\\MetadataPool $metadataPool,\n\\Magento\\Framework\\App\\Helper\\Context $context\n)\n{\n@@ -43,6 +49,7 @@ class Data extends AbstractHelper\n$this->helperCheckout = $helperCheckout;\n$this->moduleList = $moduleList;\n$this->categoryResourceModel = $categoryResourceModel;\n+ $this->metadataPool = $metadataPool;\nparent::__construct($context);\n}\n@@ -59,12 +66,13 @@ class Data extends AbstractHelper\nif (!empty($categories)) {\n$firstCategory = array_shift($categories);\nif ($firstCategory['is_anchor'] == 1) {\n- $anchorCategories[] = $firstCategory['entity_id'];\n+ $linkfield = $this->metadataPool->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)->getLinkField();\n+ $anchorCategories[] = $firstCategory[$linkfield];\nforeach ($categories as $category) {\nif (in_array($category['parent_id'], $result) && in_array($category['parent_id'], $anchorCategories)) {\n- $result[] = $category['entity_id'];\n+ $result[] = $category[$linkfield];\nif ($category['is_anchor'] == 1 || in_array($category['parent_id'], $anchorCategories)) {\n- $anchorCategories[] = $category['entity_id'];\n+ $anchorCategories[] = $category[$linkfield];\n}\n}\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-437: Fixed Notice: Undefined index: entity_id |
21,267 | 30.07.2020 04:50:11 | 14,400 | 6a050c87d50ca95076d8e0f055e580b2c4529913 | validate cached order references on checkout | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"new_path": "src/PayV2/Api/CheckoutSessionManagementInterface.php",
"diff": "@@ -73,4 +73,10 @@ interface CheckoutSessionManagementInterface\n* @return int\n*/\npublic function completeCheckoutSession($cartId);\n+\n+ /**\n+ * @param mixed $cartId\n+ * @return int\n+ */\n+ public function validateAmazonSession($cartId);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -413,4 +413,9 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\nreturn $result;\n}\n+\n+ public function validateAmazonSession($cartId) {\n+ $session = $this->getAmazonSession($cartId);\n+ return ($session['status'] == 200 && $session['statusDetail']['state'] == 'Open');\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/webapi.xml",
"new_path": "src/PayV2/etc/webapi.xml",
"diff": "*/\n-->\n<routes xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:module:Magento_Webapi:etc/webapi.xsd\">\n+ <route url=\"/V1/amazon-v2-checkout-session/:cartId/validate\" method=\"GET\">\n+ <service class=\"Amazon\\PayV2\\Api\\CheckoutSessionManagementInterface\" method=\"validateAmazonSession\"/>\n+ <resources>\n+ <resource ref=\"anonymous\" />\n+ </resources>\n+ </route>\n<route url=\"/V1/amazon-v2-checkout-session/:cartId/config\" method=\"GET\">\n<service class=\"Amazon\\PayV2\\Api\\CheckoutSessionManagementInterface\" method=\"getConfig\"/>\n<resources>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "define([\n'jquery',\n- 'Amazon_PayV2/js/model/amazon-payv2-config'\n-], function ($, amazonPayV2Config) {\n+ 'Amazon_PayV2/js/model/amazon-payv2-config',\n+ 'mage/storage',\n+ 'Magento_Checkout/js/model/url-builder',\n+ 'Amazon_PayV2/js/action/checkout-session-cancel',\n+ 'Magento_Checkout/js/model/quote'\n+], function ($, amazonPayV2Config, mageStorage, urlBuilder, checkoutSessionCancelAction, quote) {\n'use strict';\nvar isEnabled = amazonPayV2Config.isDefined(),\n@@ -58,8 +62,30 @@ define([\nsessionId = window.location.search.replace('?amazonCheckoutSessionId=', '');\ngetStorage().set('id', sessionId);\n}\n+\n+ // If we got a sessionId here, optimistically return it, but validate it asynchronously.\n+ if (sessionId && !this.sessionValidationTriggered) {\n+ var serviceUrl = urlBuilder.createUrl('/amazon-v2-checkout-session/:cartId/validate', {\n+ cartId: quote.getQuoteId()\n+ });\n+ mageStorage.get(serviceUrl).done(function (data) {\n+ if (!data) {\n+ checkoutSessionCancelAction(function () {\n+ this.clearAmazonCheckout();\n+ window.location.replace(window.checkoutConfig.checkoutUrl);\n+ }.bind(this));\n+ }\n+ }.bind(this)).fail(function (response) {\n+ checkoutSessionCancelAction(function () {\n+ this.clearAmazonCheckout();\n+ window.location.replace(window.checkoutConfig.checkoutUrl);\n+ }.bind(this));\n+ }.bind(this));\n+ this.sessionValidationTriggered = true;\n+ }\nreturn sessionId;\n},\n+ sessionValidationTriggered: false,\n/**\n* Return the Amazon Pay region\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-443: validate cached order references on checkout |
21,267 | 31.07.2020 18:40:46 | 14,400 | 03e741b07b9d86bc297aec4237532f1c9dfa0d55 | invalidate checkout session if shipping details cannot be retrieved | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/action/checkout-session-address-load.js",
"new_path": "src/PayV2/view/frontend/web/js/action/checkout-session-address-load.js",
"diff": "@@ -18,8 +18,9 @@ define([\n'mage/storage',\n'Magento_Checkout/js/model/url-builder',\n'Magento_Checkout/js/model/full-screen-loader',\n- 'Magento_Checkout/js/model/error-processor'\n-], function (quote, storage, urlBuilder, fullScreenLoader, errorProcessor) {\n+ 'Magento_Checkout/js/model/error-processor',\n+ 'Amazon_PayV2/js/model/storage'\n+], function (quote, storage, urlBuilder, fullScreenLoader, errorProcessor, amazonStorage) {\n'use strict';\nreturn function (addressType, callback) {\n@@ -29,10 +30,22 @@ define([\nfullScreenLoader.startLoader();\n- return storage.get(serviceUrl).done(function (data) {\n+ var handleResponse = function(data) {\nfullScreenLoader.stopLoader(true);\ncallback(data.length ? data.shift() : {});\n- }).fail(function (response) {\n+ }\n+\n+ var validateAndHandle = function(data) {\n+ if (!data) {\n+ amazonStorage.clearAmazonCheckout();\n+ window.location.replace(window.checkoutConfig.checkoutUrl);\n+ }\n+ handleResponse(data);\n+ }\n+\n+ var responseCallback = addressType == 'shipping' ? validateAndHandle : handleResponse;\n+\n+ return storage.get(serviceUrl).done(responseCallback).fail(function (response) {\nerrorProcessor.process(response);\nfullScreenLoader.stopLoader(true);\n});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-443: invalidate checkout session if shipping details cannot be retrieved |
21,261 | 03.08.2020 19:29:22 | -7,200 | 0e8e52b183fb164a90b740885d4fa65fda75031b | Added V2checkout installation instructions | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -17,7 +17,8 @@ This module will enable \"Amazon Pay Checkout v2\" on your Magento 2 installation.\nAmazon Pay offers a familiar and convenient buying experience that can help your customers spend more time shopping and less time checking out. Amazon Pay is used by large and small companies. From years of shopping safely with Amazon, customers trust their personal information will remain secure and know many transactions are covered by the Amazon A-to-z Guarantee. Businesses have the reassurance of our advanced fraud protection and payment protection policy.\nRequirements:\n-* Magento version requirement: 2.4.0 (June 2020 release)\n+* Magento minimum version requirement: 2.4.0 and above\n+* Amazon Pay V1 plugin minimum version requirement: 4.0.2 and above\n* PHP 7.3 and 7.4 supported\n## Dependencies\n@@ -26,8 +27,69 @@ You can find a list of modules in the require section of the `composer.json` fil\nsame directory as this `README.md` file.\n## Installation and Configuration\n-This section will be released once Magento 2.4.0 is widely available on July 28th 2020.\n-If you are on M2.2.6 and above, please use the [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) branch. The [README.md](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x#amazon-pay-checkout-v2) contains all the installation and configuration information.\n+If you are on M2.2.6 and above or M2.3.x, please use the [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) branch. The [README.md](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x#amazon-pay-checkout-v2) contains all the installation and configuration information.\n+\n+## Installation Steps\n+\n+**Important:** Before proceeding, please make a backup of your current Magento 2 installation.\n+\n+### 1. Install module\n+\n+The module can be either installed via Composer (recommended), or manually. The steps for each option are described below.\n+\n+#### Composer installation\n+\n+In `magento-root`, execute:\n+\n+```\n+$ composer require amzn/amazon-pay-v2-magento-2-module\n+$ bin/magento module:enable Amazon_PayV2\n+```\n+\n+If Composer installation didn't work, use the manual procedure below. If any of these were successful, please proceed with **2. Post-installation procedure**, otherwise reach out to Amazon Pay Merchant Support for additional assistance.\n+\n+#### Manual installation\n+* Download the [Amazon Pay V2 checkout plugin](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) via `git clone` or \"Download ZIP\"\n+* Copy src/PayV2 to app/code/Amazon/PayV2\n+(If `magento-root/app/code/Amazon/PayV2` path is not present, please create the folders `Amazon` and `PayV2`)\n+\n+In `magento-root`, execute:\n+```\n+$ composer require amzn/amazon-pay-sdk-v2-php\n+$ composer require aws/aws-php-sns-message-validator\n+$ bin/magento module:enable Amazon_PayV2\n+```\n+\n+### 2. Post-installation procedure\n+\n+Execute the following steps to perform the module upgrade, compile dependency injection, deploy static content and clean caches.\n+\n+```\n+$ bin/magento setup:upgrade\n+$ bin/magento setup:di:compile\n+$ bin/magento setup:static-content:deploy\n+$ bin/magento cache:clean\n+```\n+\n+## PWA Support\n+\n+1. The module exposes the REST endpoints that needs to set up. You can find them at [src/PayV2/etc/webapi.xml](https://github.com/amzn/amazon-payments-magento-2-plugin/blob/V2checkout/src/PayV2/etc/webapi.xml)\n+1. The front end needs to be setup by the merchant/developer.\n+\n+## Extension Points\n+\n+Amazon Pay does not provide any specific extension points.\n+\n+## Configuration\n+\n+### Amazon Pay V2 configuration ###\n+\n+Upon successful installation of the module, please follow the steps below for configuring it:\n+\n+1. Go to Stores -> Configuration -> Sales -> Payment Methods -> Amazon Pay -> Configure\n+1. Switch to 'V2' under the Amazon Pay Product Version\n+1. To obtain the required keys, please log in to your Amazon Pay merchant account via Seller Central and follow [these instructions](http://amazonpaycheckoutintegrationguide.s3.amazonaws.com/amazon-pay-checkout/get-set-up-for-integration.html#4-get-your-public-key-id) to receive your Public Key Id. You will also need the associated secret key in order to configure the plugin.\n+1. The rest of the settings are all similar to the V1 module settings. We recommend to use the same settings as used in V1 module, with the only difference that \"clientId\" is referenced as \"storeId\" in V2 module.[View V1 Configuration documentation](https://amzn.github.io/amazon-payments-magento-2-plugin/configuration.html).\n## Alexa Notifications\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | Added V2checkout installation instructions |
21,270 | 03.08.2020 14:52:33 | 25,200 | 92cdc0f1910326b4374b3f470b0efd05b74f39d1 | updates checkout session if new one being used | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "@@ -54,8 +54,13 @@ define([\n*/\ngetCheckoutSessionId: function () {\nvar sessionId = getStorage().get('id');\n- if (typeof sessionId === 'undefined' && window.location.search.indexOf('?amazonCheckoutSessionId=') != -1) {\n- sessionId = window.location.search.replace('?amazonCheckoutSessionId=', '');\n+ var paramId = '?amazonCheckoutSessionId=';\n+ if (typeof sessionId === 'undefined' && window.location.search.indexOf(paramId) != -1) {\n+ sessionId = window.location.search.replace(paramId, '');\n+ getStorage().set('id', sessionId);\n+ }\n+ else if(sessionId != window.location.search.replace(paramId, '')) {\n+ sessionId = window.location.search.replace(paramId, '');\ngetStorage().set('id', sessionId);\n}\nreturn sessionId;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-443 updates checkout session if new one being used |
21,270 | 04.08.2020 12:42:13 | 25,200 | 88910a1847424db97e0677ae11bb0e68e4fa7edd | fixes minicart tooltip | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"new_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"diff": "data-mage-init='{\"Amazon_PayV2/js/amazon-button\": {}}'>\n</div>\n</div>\n+ <div class=\"checkout-methods-items\">\n<div class=\"amazon-button-column amazon-button-column-tooltip\">\n<div class=\"field-tooltip toggle\">\n<span class=\"field-tooltip-action action-help\"\n- data-bind=\"mageInit: {'dropdown':{'activeClass': '_active'}}\"\n+ data-mage-init='{\"dropdown\":{\"activeClass\": \"_active\"}}'\ndata-toggle=\"dropdown\"\naria-haspopup=\"true\"\naria-expanded=\"false\">\n</div>\n</div>\n</div>\n+</div>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-334 fixes minicart tooltip |
21,270 | 04.08.2020 13:46:22 | 25,200 | 428096f0f90471df940cc6ad314a112e9c7259d4 | fixes styling for tooltip on cart page | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"new_path": "src/PayV2/view/frontend/web/css/source/_module.less",
"diff": "margin-bottom: 2em;\n}\n}\n+\n+ .cart-summary {\n+ .amazon-button-container-v2 {\n+ .checkout-methods-items {\n+ margin-top: 0;\n+ }\n+ }\n+ }\n+\n.checkout-methods-items,\n.block-minicart {\n.amazon-button-container-v2 {\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-334 fixes styling for tooltip on cart page |
21,261 | 05.08.2020 11:20:23 | -7,200 | 164e13ff43aa63b09f0eec484db26e8989013502 | version increase to 2.1.4 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -52,5 +52,5 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n-| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.4.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.3 |\n+| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.4.1 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.1.4 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.3\",\n+ \"version\": \"2.1.4\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.1.3\",\n+ \"version\": \"2.1.4\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.1.3\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.1.4\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase to 2.1.4 |
21,261 | 07.08.2020 15:44:14 | -7,200 | aa24138ac616aa18d38e5053da6d8bfce3ddf01f | removing unnecessary installation commands (2.4.0) | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -57,7 +57,7 @@ In `magento-root`, execute:\n```\n$ composer require amzn/amazon-pay-sdk-v2-php\n$ composer require aws/aws-php-sns-message-validator\n-$ bin/magento module:enable Amazon_PayV2\n+$ bin/magento module:enable Amazon_PayV2 --clear-static-content\n```\n### 2. Post-installation procedure\n@@ -67,8 +67,6 @@ Execute the following steps to perform the module upgrade, compile dependency in\n```\n$ bin/magento setup:upgrade\n$ bin/magento setup:di:compile\n-$ bin/magento setup:static-content:deploy\n-$ bin/magento cache:clean\n```\n## PWA Support\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | removing unnecessary installation commands (2.4.0) |
21,270 | 13.08.2020 16:08:21 | 25,200 | 95aae1bc2a594f9d3d3f21bda8f258c6490bd681 | fixes elements still showing on minicart and pdp; Redraws pdp button if needed | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -70,6 +70,6 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n*/\npublic function isEnabled()\n{\n- return $this->amazonConfig->isEnabled() && !$this->amazonHelper->hasRestrictedProducts();\n+ return $this->amazonConfig->isEnabled();\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"new_path": "src/PayV2/view/frontend/templates/minicart-button.phtml",
"diff": "*/\n?>\n-<div id=\"minicart-amazon-pay-button\" class=\"amazon-button-container-v2\">\n+<div id=\"minicart-amazon-pay-button\" class=\"amazon-button-container-v2\" style=\"display: none;\">\n<div class=\"amazon-divider\">\n<span><?= __('or') ?></span>\n</div>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/payment-link-product-page.phtml",
"new_path": "src/PayV2/view/frontend/templates/payment-link-product-page.phtml",
"diff": "*/\n?>\n-<div class=\"amazon-checkout-now\"><?= __('Checkout now') ?></div>\n-<div class=\"amazon-button-container-v2 amazon-button-product-page\">\n+<div class=\"amazon-checkout-now\" style=\"display: none;\"><?= __('Checkout now') ?></div>\n+<div class=\"amazon-button-container-v2 amazon-button-product-page\" style=\"display: none;\">\n<div class=\"amazon-button-column\">\n<div id=\"PayWithAmazon-Product\"\nclass=\"amazon-checkout-button\"\n'Amazon_PayV2/js/amazon-button' => [\n'payOnly' => $block->isPayOnly(),\n'placement' => 'Product',\n+ 'hideIfUnavailable' => '.amazon-checkout-now,.amazon-button-container-v2',\n]\n]) ?>'>\n</div>\n<a href=\"javascript:;\"\nclass=\"amazon-addtoCart\"\nid=\"amazon-addtoCart-<?= /* @noEscape */ $block->getJsId() ?>\"\n- data-mage-init='{\"amazonPayV2ProductAdd\": {\"hideIfUnavailable\": \".amazon-checkout-now,.amazon-button-container-v2\"}}'>\n+ data-mage-init='{\"amazonPayV2ProductAdd\": {}}'>\n</a>\n</div>\n<div class=\"amazon-button-column amazon-button-column-tooltip\">\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -18,7 +18,8 @@ define([\n'Amazon_PayV2/js/model/storage',\n'mage/url',\n'Amazon_PayV2/js/amazon-checkout',\n-], function ($, checkoutSessionConfigLoad, amazonStorage, url, amazonCheckout) {\n+ 'Magento_Customer/js/customer-data'\n+], function ($, checkoutSessionConfigLoad, amazonStorage, url, amazonCheckout, customerData) {\n'use strict';\nif (amazonStorage.isEnabled) {\n@@ -26,7 +27,7 @@ define([\noptions: {\npayOnly: null,\nplacement: 'Cart',\n- hideIfUnavailable: '',\n+ hideIfUnavailable: ''\n},\n_loadButtonConfig: function (callback) {\n@@ -45,6 +46,8 @@ define([\nplacement: this.options.placement,\nsandbox: checkoutSessionConfig['sandbox'],\n});\n+\n+ $(this.options.hideIfUnavailable).show();\n} else {\n$(this.options.hideIfUnavailable).hide();\n}\n@@ -68,6 +71,17 @@ define([\n* Create button\n*/\n_create: function () {\n+ this._draw();\n+\n+ if (this.options.placement == 'Product') {\n+ this._redraw();\n+ }\n+ },\n+\n+ /**\n+ * Draw button\n+ **/\n+ _draw: function () {\nvar $buttonContainer = this.element;\namazonCheckout.withAmazonCheckout(function (amazon, args) {\nvar $buttonRoot = $('<div></div>');\n@@ -80,9 +94,23 @@ define([\n}, this);\n},\n+ /**\n+ * Redraw button if needed\n+ **/\n+ _redraw: function () {\n+ var self = this;\n+ var cartData = customerData.get('cart');\n+ cartData.subscribe(function (updatedCart) {\n+ if (!$(self.options.hideIfUnavailable).first().is(':visible')) {\n+ self._draw();\n+ }\n+ });\n+\n+ }\n+\nclick: function () {\nthis.element.children().first().trigger('click');\n- }\n+ },\n});\nreturn $.amazon.AmazonButton;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-437 fixes elements still showing on minicart and pdp; Redraws pdp button if needed |
21,241 | 14.08.2020 13:44:22 | 18,000 | 9951619a8f3e3c3f5b00fc734321d8372bbac35d | switch to Amazon Pay API v2 | [
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"magento/module-customer\": \"*\",\n\"magento/module-store\": \"*\",\n\"zendframework/zend-crypt\": \"^2.6.0\",\n- \"amzn/amazon-pay-sdk-v2-php\": \"^4.2\",\n+ \"amzn/amazon-pay-api-sdk-php\": \"^2.2\",\n\"aws/aws-php-sns-message-validator\": \"^1.5\"\n},\n\"repositories\": [\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Client/Client.php",
"new_path": "src/PayV2/Client/Client.php",
"diff": "*/\nnamespace Amazon\\PayV2\\Client;\n-use AmazonPayV2\\Client as AmazonClient;\n+use Amazon\\Pay\\API\\Client as AmazonClient;\n/**\n* Class Client\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Client/ClientFactoryInterface.php",
"new_path": "src/PayV2/Client/ClientFactoryInterface.php",
"diff": "namespace Amazon\\PayV2\\Client;\nuse Magento\\Store\\Model\\ScopeInterface;\n-use AmazonPayV2\\ClientInterface;\n+use Amazon\\Pay\\API\\ClientInterface;\ninterface ClientFactoryInterface\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"new_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"diff": "@@ -63,7 +63,7 @@ class AuthorizationSaleHandler implements HandlerInterface\n$payment->setTransactionId($response['chargeId']);\n- $chargeState = $response['charge']['statusDetail']['state'];\n+ $chargeState = $response['statusDetails']['state'];\nswitch ($chargeState) {\ncase 'Authorized':\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/SettlementHandler.php",
"new_path": "src/PayV2/Gateway/Response/SettlementHandler.php",
"diff": "@@ -58,7 +58,7 @@ class SettlementHandler implements HandlerInterface\n$payment->setTransactionId($response['chargeId'].'-capture');\n$payment->setParentTransactionId($response['chargeId']);\n- switch ($response['statusDetail']['state']) {\n+ switch ($response['statusDetails']['state']) {\ncase 'CaptureInitiated':\n$payment->setIsTransactionPending(true);\n$payment->setIsTransactionClosed(false);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Validator/GeneralResponseValidator.php",
"new_path": "src/PayV2/Gateway/Validator/GeneralResponseValidator.php",
"diff": "@@ -40,14 +40,14 @@ class GeneralResponseValidator extends AbstractValidator\n$response = $validationSubject['response'];\n- if (isset($response['statusDetail'])) {\n- if (!empty($response['statusDetail']['reasonCode'])) {\n+ if (isset($response['statusDetails'])) {\n+ if (!empty($response['statusDetails']['reasonCode'])) {\n$isValid = false;\n- $errorCodes[] = $response['statusDetail']['reasonCode'];\n+ $errorCodes[] = $response['statusDetails']['reasonCode'];\n}\n- if (!empty($response['statusDetail']['reasonDescription'])) {\n+ if (!empty($response['statusDetails']['reasonDescription'])) {\n$isValid = false;\n- $errorMessages[] = $response['statusDetail']['reasonDescription'];\n+ $errorMessages[] = $response['statusDetails']['reasonDescription'];\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -116,7 +116,7 @@ class AmazonPayV2Adapter\n$headers = $this->getIdempotencyHeader();\n$payload = [\n- 'webCheckoutDetail' => [\n+ 'webCheckoutDetails' => [\n'checkoutReviewReturnUrl' => $this->amazonConfig->getCheckoutReviewUrl(),\n],\n'storeId' => $this->amazonConfig->getClientId(),\n@@ -167,10 +167,10 @@ class AmazonPayV2Adapter\n}\n$payload = [\n- 'webCheckoutDetail' => [\n+ 'webCheckoutDetails' => [\n'checkoutResultReturnUrl' => $this->amazonConfig->getCheckoutResultUrl()\n],\n- 'paymentDetail' => [\n+ 'paymentDetails' => [\n'paymentIntent' => 'Authorize',\n'canHandlePendingAuthorization' => $this->amazonConfig->canHandlePendingAuthorization(),\n'chargeAmount' => $this->createPrice($quote->getGrandTotal(), $quote->getQuoteCurrencyCode()),\n@@ -332,7 +332,7 @@ class AmazonPayV2Adapter\n// Get charge for async checkout\n$charge = $this->getCharge($quote->getStoreId(), $response['chargeId']);\n- if ($captureNow && $charge['statusDetail']['state'] == 'Authorized') {\n+ if ($captureNow && $charge['statusDetails']['state'] == 'Authorized') {\n$response = $this->captureCharge(\n$quote->getStoreId(),\n$response['chargeId'],\n@@ -346,6 +346,26 @@ class AmazonPayV2Adapter\nreturn $response;\n}\n+\n+ /**\n+ * @param $storeId\n+ * @param $sessionId\n+ * @param $amount\n+ * @param $currencyCode\n+ */\n+ public function completeCheckoutSession($storeId, $sessionId, $amount, $currencyCode)\n+ {\n+ $payload = [\n+ 'chargeAmount' => [\n+ 'amount' => $amount,\n+ 'currencyCode' => $currencyCode,\n+ ]\n+ ];\n+\n+ $response = $this->clientFactory->create($storeId)->completeCheckoutSession($sessionId, json_encode($payload));\n+ return $response;\n+ }\n+\n/**\n* Process SDK client response\n*\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"new_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"diff": "@@ -119,13 +119,13 @@ class Charge extends AbstractOperation\n$charge = $this->amazonAdapter->getCharge($order->getStoreId(), $chargeId);\n// Compare Charge State with Order State\n- if (isset($charge['statusDetail'])) {\n- switch ($charge['statusDetail']['state']) {\n+ if (isset($charge['statusDetails'])) {\n+ switch ($charge['statusDetails']['state']) {\ncase 'Declined':\n- $this->decline($order, $chargeId, $charge['statusDetail']['reasonDescription']);\n+ $this->decline($order, $chargeId, $charge['statusDetails']['reasonDescription']);\nbreak;\ncase 'Canceled':\n- $this->cancel($order, $charge['statusDetail']);\n+ $this->cancel($order, $charge['statusDetails']);\nbreak;\ncase 'Authorized':\n$this->authorize($order, $chargeId);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AsyncManagement/Refund.php",
"new_path": "src/PayV2/Model/AsyncManagement/Refund.php",
"diff": "@@ -92,9 +92,9 @@ class Refund extends AbstractOperation\nif ($order) {\n$refund = $this->amazonAdapter->getRefund($order->getStoreId(), $refundId);\n- if (isset($refund['statusDetail']) && $refund['statusDetail']['state'] == 'Declined') {\n+ if (isset($refund['statusDetails']) && $refund['statusDetails']['state'] == 'Declined') {\n- $order->addStatusHistoryComment($refund['statusDetail']['reasonDescription']);\n+ $order->addStatusHistoryComment($refund['statusDetails']['reasonDescription']);\n$order->save();\n$this->notifier->addNotice(\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -319,7 +319,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\npublic function getBillingAddress($cartId)\n{\nreturn $this->fetchAddress($cartId, false, function ($session) {\n- return $session['paymentPreferences'][0]['billingAddress'] ?? [];\n+ return $session['billingAddress'] ?? [];\n});\n}\n@@ -374,8 +374,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\nif ($checkoutSession && $cart->getIsActive()) {\n$response = $this->amazonAdapter->updateCheckoutSession($cart, $checkoutSession->getSessionId());\n- if (!empty($response['webCheckoutDetail']['amazonPayRedirectUrl'])) {\n- $result = $response['webCheckoutDetail']['amazonPayRedirectUrl'];\n+ if (!empty($response['webCheckoutDetails']['amazonPayRedirectUrl'])) {\n+ $result = $response['webCheckoutDetails']['amazonPayRedirectUrl'];\n$checkoutSession->setUpdated();\n$this->checkoutSessionRepository->save($checkoutSession);\n}\n@@ -400,6 +400,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$cart->setCheckoutMethod(\\Magento\\Quote\\Api\\CartManagementInterface::METHOD_GUEST);\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n+ $amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n$checkoutSession->complete();\n$this->checkoutSessionRepository->save($checkoutSession);\n} catch (\\Exception $e) {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"magento/module-paypal\": \"*\",\n\"magento/module-directory\": \"*\",\n\"zendframework/zend-crypt\": \"^2.6.0\",\n- \"amzn/amazon-pay-sdk-v2-php\": \"^4.2\",\n+ \"amzn/amazon-pay-api-sdk-php\": \"^2.2\",\n\"aws/aws-php-sns-message-validator\": \"^1.5\"\n},\n\"suggest\": {\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-222: switch to Amazon Pay API v2 |
21,241 | 17.08.2020 19:11:02 | 18,000 | d1ddcabeeb67baff66cf265bb9dda91307fc6c1d | temporarily use the checkout session id as a placeholder transaction id since we don't get a chargeId back until after completeCheckout is called. Once checkout is complete, update the transaction id with the chargeId. | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"new_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"diff": "@@ -61,12 +61,13 @@ class AuthorizationSaleHandler implements HandlerInterface\n/** @var Payment $payment */\n$payment = $paymentDO->getPayment();\n- $payment->setTransactionId($response['chargeId']);\n+ $payment->setTransactionId($response['checkoutSessionId']);\n$chargeState = $response['statusDetails']['state'];\nswitch ($chargeState) {\ncase 'Authorized':\n+ case 'Open':\n$payment->setIsTransactionClosed(false);\nbreak;\ncase 'AuthorizationInitiated':\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -362,8 +362,8 @@ class AmazonPayV2Adapter\n]\n];\n- $response = $this->clientFactory->create($storeId)->completeCheckoutSession($sessionId, json_encode($payload));\n- return $response;\n+ $rawResponse = $this->clientFactory->create($storeId)->completeCheckoutSession($sessionId, json_encode($payload));\n+ return $this->processResponse($rawResponse, __FUNCTION__);\n}\n/**\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "namespace Amazon\\PayV2\\Model;\nuse Amazon\\PayV2\\Api\\Data\\CheckoutSessionInterface;\n+use http\\Exception\\UnexpectedValueException;\nuse Magento\\Quote\\Api\\Data\\CartInterface;\nuse Magento\\Framework\\Validator\\Exception as ValidatorException;\nuse Magento\\Framework\\Webapi\\Exception as WebapiException;\n+use Magento\\Sales\\Api\\Data\\TransactionInterface as Transaction;\nclass CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionManagementInterface\n{\n@@ -53,6 +55,16 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\nprivate $countryCollectionFactory;\n+ /**\n+ * @var \\Magento\\Sales\\Api\\TransactionRepositoryInterface\n+ */\n+ private $transactionRepository;\n+\n+ /**\n+ * @var \\Magento\\Framework\\Api\\SearchCriteriaBuilder\n+ */\n+ private $searchCriteriaBuilder;\n+\n/**\n* @var \\Amazon\\PayV2\\Domain\\AmazonAddressFactory\n*/\n@@ -113,6 +125,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n* @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n* @param AmazonConfig $amazonConfig\n* @param Adapter\\AmazonPayV2Adapter $amazonAdapter\n+ * @param \\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository\n+ * @param \\Magento\\Framework\\Api\\SearchCriteriaBuilder $searchCriteriaBuilder\n*/\npublic function __construct(\n\\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\n@@ -127,7 +141,9 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n\\Amazon\\PayV2\\Api\\CheckoutSessionRepositoryInterface $checkoutSessionRepository,\n\\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n- \\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter\n+ \\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter,\n+ \\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository,\n+ \\Magento\\Framework\\Api\\SearchCriteriaBuilder $searchCriteriaBuilder\n)\n{\n$this->storeManager = $storeManager;\n@@ -143,6 +159,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->amazonHelper = $amazonHelper;\n$this->amazonConfig = $amazonConfig;\n$this->amazonAdapter = $amazonAdapter;\n+ $this->transactionRepository = $transactionRepository;\n+ $this->searchCriteriaBuilder = $searchCriteriaBuilder;\n}\n/**\n@@ -383,6 +401,45 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nreturn $result;\n}\n+ /**\n+ * Load transaction.\n+ *\n+ * @param $transactionId\n+ * @param \\Magento\\Sales\\Api\\Data\\TransactionInterface $type\n+ * @return mixed\n+ */\n+ private function getTransaction($transactionId, $type = null)\n+ {\n+ $this->searchCriteriaBuilder->addFilter(Transaction::TXN_ID, $transactionId);\n+\n+ if ($type) {\n+ $this->searchCriteriaBuilder->addFilter(Transaction::TXN_TYPE, $type);\n+ }\n+\n+ $searchCriteria = $this->searchCriteriaBuilder->create();\n+ $transactionCollection = $this->transactionRepository->getList($searchCriteria);\n+\n+ if (count($transactionCollection)) {\n+ return $transactionCollection->getFirstItem();\n+ }\n+ }\n+\n+ /**\n+ * Swaps the checkoutSessionId that was originally stored on the sales_payment_transaction record with the\n+ * real payment charge (transaction) id\n+ *\n+ * @param array $amazonResult must have two keys, 'checkoutSessionId' and 'chargeId'\n+ */\n+ private function updateTransactionId($amazonResult)\n+ {\n+ if (!array_key_exists('checkoutSessionId', $amazonResult) || !array_key_exists('chargeId', $amazonResult)) {\n+ throw new Exception('Required data not set on result');\n+ }\n+\n+ $transaction = $this->getTransaction($amazonResult['checkoutSessionId'], Transaction::TYPE_AUTH);\n+ $transaction->setTxnId($amazonResult['chargeId'])->save();\n+ }\n+\n/**\n* {@inheritdoc}\n*/\n@@ -401,6 +458,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n$amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n+ $this->updateTransactionId($amazonResult);\n$checkoutSession->complete();\n$this->checkoutSessionRepository->save($checkoutSession);\n} catch (\\Exception $e) {\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-222: temporarily use the checkout session id as a placeholder transaction id since we don't get a chargeId back until after completeCheckout is called. Once checkout is complete, update the transaction id with the chargeId. |
21,241 | 19.08.2020 16:47:29 | 18,000 | 9828be02dfdc9489c719fb910c649ff4f7099830 | fixes for async processing and some issues where the chargeId is not available until after calling completeCheckoutSession | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"new_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"diff": "@@ -62,40 +62,7 @@ class AuthorizationSaleHandler implements HandlerInterface\n$payment = $paymentDO->getPayment();\n$payment->setTransactionId($response['checkoutSessionId']);\n-\n- $chargeState = $response['statusDetails']['state'];\n-\n- switch ($chargeState) {\n- case 'Authorized':\n- case 'Open':\n- $payment->setIsTransactionClosed(false);\n- break;\n- case 'AuthorizationInitiated':\n$payment->setIsTransactionClosed(false);\n- $this->setPending($payment);\n- $this->asyncManagement->queuePendingAuthorization($response['chargeId']);\n- break;\n- case 'Captured':\n- $payment->setIsTransactionClosed(true);\n- break;\n- case 'CaptureInitiated':\n- $payment->setIsTransactionClosed(false);\n- break;\n- }\n- }\n}\n-\n- /**\n- * Set order as pending review\n- *\n- * @param Payment $payment\n- */\n- private function setPending($payment)\n- {\n- $order = $payment->getOrder();\n- $payment->setIsTransactionPending(true);\n- $order->setState(\\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)->setStatus(\n- \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n- );\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -21,6 +21,10 @@ namespace Amazon\\PayV2\\Model\\Adapter;\n*/\nclass AmazonPayV2Adapter\n{\n+ const PAYMENT_INTENT_CONFIRM = 'Confirm';\n+ const PAYMENT_INTENT_AUTHORIZE = 'Authorize';\n+ const PAYMENT_INTENT_AUTHORIZE_WITH_CAPTURE = 'AuthorizeWithCapture';\n+\n/**\n* @var \\Amazon\\PayV2\\Client\\ClientFactoryInterface\n*/\n@@ -151,9 +155,10 @@ class AmazonPayV2Adapter\n*\n* @param $quote\n* @param $checkoutSessionId\n+ * @param $paymentIntent\n* @return mixed\n*/\n- public function updateCheckoutSession($quote, $checkoutSessionId)\n+ public function updateCheckoutSession($quote, $checkoutSessionId, $paymentIntent = self::PAYMENT_INTENT_AUTHORIZE)\n{\n$storeId = $quote->getStoreId();\n$store = $quote->getStore();\n@@ -171,7 +176,7 @@ class AmazonPayV2Adapter\n'checkoutResultReturnUrl' => $this->amazonConfig->getCheckoutResultUrl()\n],\n'paymentDetails' => [\n- 'paymentIntent' => 'Authorize',\n+ 'paymentIntent' => $paymentIntent,\n'canHandlePendingAuthorization' => $this->amazonConfig->canHandlePendingAuthorization(),\n'chargeAmount' => $this->createPrice($quote->getGrandTotal(), $quote->getQuoteCurrencyCode()),\n],\n@@ -323,25 +328,13 @@ class AmazonPayV2Adapter\n* AuthorizeClient and SaleClient Gateway Command\n*\n* @param $data\n+ * @return array|mixed\n+ * @throws \\Magento\\Framework\\Exception\\NoSuchEntityException\n*/\n- public function authorize($data, $captureNow = false)\n+ public function authorize($data)\n{\n$quote = $this->quoteRepository->get($data['quote_id']);\n$response = $this->getCheckoutSession($quote->getStoreId(), $data['amazon_checkout_session_id']);\n- if (!empty($response['chargeId'])) {\n- // Get charge for async checkout\n- $charge = $this->getCharge($quote->getStoreId(), $response['chargeId']);\n-\n- if ($captureNow && $charge['statusDetails']['state'] == 'Authorized') {\n- $response = $this->captureCharge(\n- $quote->getStoreId(),\n- $response['chargeId'],\n- $quote->getGrandTotal(),\n- $quote->getStore()->getCurrentCurrency()->getCode()\n- );\n- }\n- $response['charge'] = $charge;\n- }\nreturn $response;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "namespace Amazon\\PayV2\\Model;\nuse Amazon\\PayV2\\Api\\Data\\CheckoutSessionInterface;\n+use Amazon\\PayV2\\Model\\Config\\Source\\PaymentAction;\n+use Amazon\\PayV2\\Model\\AsyncManagement;\nuse http\\Exception\\UnexpectedValueException;\nuse Magento\\Quote\\Api\\Data\\CartInterface;\nuse Magento\\Framework\\Validator\\Exception as ValidatorException;\nuse Magento\\Framework\\Webapi\\Exception as WebapiException;\n+use Magento\\Sales\\Api\\OrderRepositoryInterface;\n+use Magento\\Sales\\Model\\Order\\Payment;\nuse Magento\\Sales\\Api\\Data\\TransactionInterface as Transaction;\nclass CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionManagementInterface\n@@ -45,6 +49,16 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\nprivate $cartRepository;\n+ /**\n+ * @var \\Magento\\Sales\\Api\\OrderRepositoryInterface\n+ */\n+ private $orderRepository;\n+\n+ /**\n+ * @var \\Magento\\Sales\\Api\\OrderPaymentRepositoryInterface\n+ */\n+ private $paymentRepository;\n+\n/**\n* @var \\Magento\\Framework\\Validator\\Factory\n*/\n@@ -100,6 +114,11 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n*/\nprivate $amazonAdapter;\n+ /**\n+ * @var AsyncManagement\n+ */\n+ private $asyncManagement;\n+\n/**\n* @var array\n*/\n@@ -116,6 +135,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n* @param \\Magento\\Quote\\Model\\QuoteIdMaskFactory $quoteIdMaskFactory\n* @param \\Magento\\Quote\\Api\\CartManagementInterface $cartManagement\n* @param \\Magento\\Quote\\Api\\CartRepositoryInterface $cartRepository\n+ * @param \\Magento\\Sales\\Api\\OrderRepositoryInterface $orderRepository\n+ * @param \\Magento\\Sales\\Api\\OrderPaymentRepositoryInterface $paymentRepository\n* @param \\Magento\\Framework\\Validator\\Factory $validatorFactory ,\n* @param \\Magento\\Directory\\Model\\ResourceModel\\Country\\CollectionFactory $countryCollectionFactory ,\n* @param \\Amazon\\PayV2\\Domain\\AmazonAddressFactory $amazonAddressFactory ,\n@@ -125,6 +146,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n* @param \\Amazon\\PayV2\\Helper\\Data $amazonHelper\n* @param AmazonConfig $amazonConfig\n* @param Adapter\\AmazonPayV2Adapter $amazonAdapter\n+ * @param AsyncManagement $asyncManagement\n* @param \\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository\n* @param \\Magento\\Framework\\Api\\SearchCriteriaBuilder $searchCriteriaBuilder\n*/\n@@ -133,6 +155,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n\\Magento\\Quote\\Model\\QuoteIdMaskFactory $quoteIdMaskFactory,\n\\Magento\\Quote\\Api\\CartManagementInterface $cartManagement,\n\\Magento\\Quote\\Api\\CartRepositoryInterface $cartRepository,\n+ \\Magento\\Sales\\Api\\OrderRepositoryInterface $orderRepository,\n+ \\Magento\\Sales\\Api\\OrderPaymentRepositoryInterface $paymentRepository,\n\\Magento\\Framework\\Validator\\Factory $validatorFactory,\n\\Magento\\Directory\\Model\\ResourceModel\\Country\\CollectionFactory $countryCollectionFactory,\n\\Amazon\\PayV2\\Domain\\AmazonAddressFactory $amazonAddressFactory,\n@@ -142,6 +166,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n\\Amazon\\PayV2\\Helper\\Data $amazonHelper,\n\\Amazon\\PayV2\\Model\\AmazonConfig $amazonConfig,\n\\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter,\n+ \\Amazon\\PayV2\\Model\\AsyncManagement $asyncManagement,\n\\Magento\\Sales\\Api\\TransactionRepositoryInterface $transactionRepository,\n\\Magento\\Framework\\Api\\SearchCriteriaBuilder $searchCriteriaBuilder\n)\n@@ -150,6 +175,8 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->quoteIdMaskFactory = $quoteIdMaskFactory;\n$this->cartManagement = $cartManagement;\n$this->cartRepository = $cartRepository;\n+ $this->orderRepository = $orderRepository;\n+ $this->paymentRepository = $paymentRepository;\n$this->validatorFactory = $validatorFactory;\n$this->countryCollectionFactory = $countryCollectionFactory;\n$this->amazonAddressFactory = $amazonAddressFactory;\n@@ -159,6 +186,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->amazonHelper = $amazonHelper;\n$this->amazonConfig = $amazonConfig;\n$this->amazonAdapter = $amazonAdapter;\n+ $this->asyncManagement = $asyncManagement;\n$this->transactionRepository = $transactionRepository;\n$this->searchCriteriaBuilder = $searchCriteriaBuilder;\n}\n@@ -386,12 +414,16 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n{\n$result = null;\n$checkoutSession = null;\n+ $paymentIntent = Adapter\\AmazonPayV2Adapter::PAYMENT_INTENT_AUTHORIZE;\n+ if ($this->amazonConfig->getPaymentAction() == PaymentAction::AUTHORIZE_AND_CAPTURE) {\n+ $paymentIntent = Adapter\\AmazonPayV2Adapter::PAYMENT_INTENT_AUTHORIZE_WITH_CAPTURE;\n+ }\n$cart = $this->getCart($cartId);\nif ($this->amazonConfig->isEnabled()) {\n$checkoutSession = $this->getCheckoutSessionForCart($cart);\n}\nif ($checkoutSession && $cart->getIsActive()) {\n- $response = $this->amazonAdapter->updateCheckoutSession($cart, $checkoutSession->getSessionId());\n+ $response = $this->amazonAdapter->updateCheckoutSession($cart, $checkoutSession->getSessionId(), $paymentIntent);\nif (!empty($response['webCheckoutDetails']['amazonPayRedirectUrl'])) {\n$result = $response['webCheckoutDetails']['amazonPayRedirectUrl'];\n$checkoutSession->setUpdated();\n@@ -426,18 +458,35 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n/**\n* Swaps the checkoutSessionId that was originally stored on the sales_payment_transaction record with the\n- * real payment charge (transaction) id\n+ * real payment charge (transaction) id. Also updates the payment's last transaction id to match.\n*\n- * @param array $amazonResult must have two keys, 'checkoutSessionId' and 'chargeId'\n+ * @param $chargeId\n+ * @param $payment\n+ * @param $transaction\n+ * @return void\n*/\n- private function updateTransactionId($amazonResult)\n+ private function updateTransactionId($chargeId, $payment, $transaction)\n{\n- if (!array_key_exists('checkoutSessionId', $amazonResult) || !array_key_exists('chargeId', $amazonResult)) {\n- throw new Exception('Required data not set on result');\n+ $transaction->setTxnId($chargeId);\n+ $this->transactionRepository->save($transaction);\n+\n+ $payment->setLastTransId($chargeId);\n+ $this->paymentRepository->save($payment);\n}\n- $transaction = $this->getTransaction($amazonResult['checkoutSessionId'], Transaction::TYPE_AUTH);\n- $transaction->setTxnId($amazonResult['chargeId'])->save();\n+ /**\n+ * Set order as pending review\n+ *\n+ * @param Payment $payment\n+ */\n+ private function setPending($payment)\n+ {\n+ $order = $payment->getOrder();\n+ $payment->setIsTransactionPending(true);\n+ $order->setState(\\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)->setStatus(\n+ \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n+ );\n+ $this->orderRepository->save($order);\n}\n/**\n@@ -457,8 +506,28 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$cart->setCheckoutMethod(\\Magento\\Quote\\Api\\CartManagementInterface::METHOD_GUEST);\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n+ $order = $this->orderRepository->get($result);\n$amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n- $this->updateTransactionId($amazonResult);\n+ $chargeId = $amazonResult['chargeId'];\n+ $amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n+ $payment = $order->getPayment();\n+ $transaction = $this->getTransaction($amazonResult['checkoutSessionId']);\n+\n+ $chargeState = $amazonCharge['statusDetails']['state'];\n+ switch ($chargeState) {\n+ case 'AuthorizationInitiated':\n+ $payment->setIsTransactionClosed(false);\n+ $this->setPending($payment);\n+ $transaction->setIsClosed(false);\n+ $this->asyncManagement->queuePendingAuthorization($chargeId);\n+ break;\n+ case 'Captured':\n+ $payment->setIsTransactionClosed(true);\n+ $transaction->setIsClosed(true);\n+ break;\n+ }\n+\n+ $this->updateTransactionId($chargeId, $payment, $transaction);\n$checkoutSession->complete();\n$this->checkoutSessionRepository->save($checkoutSession);\n} catch (\\Exception $e) {\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-222: fixes for async processing and some issues where the chargeId is not available until after calling completeCheckoutSession |
21,241 | 20.08.2020 13:38:44 | 18,000 | 2ab85b870fc0b07bc0d56779754428a8ca1ad03a | clear Amazon checkout session ID if not on a checkout page | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/config.phtml",
"new_path": "src/PayV2/view/frontend/templates/config.phtml",
"diff": "@@ -22,5 +22,11 @@ require (['uiRegistry'], function(registry) {\nregistry.set('amazonPayV2', <?= /* @noEscape */ \\Zend_Json::encode($block->getConfig()); ?>);\n});\n+<?php if ($block->getRequest()->getFrontName() != 'checkout'): ?>\n+require (['jquery', 'Amazon_PayV2/js/model/storage'], function($, amazonStorage) {\n+ amazonStorage.clearAmazonCheckout();\n+});\n+<?php endif; ?>\n+\n</script>\n<?php endif ?>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "define([\n'jquery',\n- 'Amazon_PayV2/js/model/amazon-payv2-config'\n+ 'Amazon_PayV2/js/model/amazon-payv2-config',\n+ 'jquery/jquery-storageapi'\n], function ($, amazonPayV2Config) {\n'use strict';\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-225: clear Amazon checkout session ID if not on a checkout page |
21,241 | 20.08.2020 14:07:50 | 18,000 | b496f82d5d05d177e24f680df3e502c2a8f0a40e | remove jquery require from the clear storage call | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/config.phtml",
"new_path": "src/PayV2/view/frontend/templates/config.phtml",
"diff": "@@ -23,7 +23,7 @@ require (['uiRegistry'], function(registry) {\n});\n<?php if ($block->getRequest()->getFrontName() != 'checkout'): ?>\n-require (['jquery', 'Amazon_PayV2/js/model/storage'], function($, amazonStorage) {\n+require (['Amazon_PayV2/js/model/storage'], function(amazonStorage) {\namazonStorage.clearAmazonCheckout();\n});\n<?php endif; ?>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-225: remove jquery require from the clear storage call |
21,270 | 21.08.2020 13:53:01 | 25,200 | 9efbf4310c0739f8d3a70d1c4eab9efc94ee6040 | removes base currency charge message | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/requirejs-config.js",
"new_path": "src/PayV2/view/frontend/requirejs-config.js",
"diff": "@@ -17,6 +17,9 @@ var config = {\nmixins: {\n'Magento_Checkout/js/view/payment/list': {\n'Amazon_PayV2/js/view/payment/list-mixin': true\n+ },\n+ 'Magento_Tax/js/view/checkout/summary/grand-total': {\n+ 'Amazon_PayV2/js/view/checkout/summary/grand-total-mixin': true\n}\n}\n},\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/view/frontend/web/js/view/checkout/summary/grand-total-mixin.js",
"diff": "+/*global define*/\n+\n+define([\n+ 'Amazon_Payment/js/model/storage'\n+], function (amazonStorage) {\n+ 'use strict';\n+\n+ return function (GrandTotal) {\n+ return GrandTotal.extend({\n+ /**\n+ * @return {Boolean}\n+ */\n+ isBaseGrandTotalDisplayNeeded: function () {\n+ if (!amazonStorage.isAmazonAccountLoggedIn()) {\n+ return this._super();\n+ }\n+\n+ return false;\n+ }\n+ });\n+ }\n+});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-413 removes base currency charge message |
21,270 | 25.08.2020 17:06:47 | 25,200 | 670c8094dc4728497930ccb4c6950f55502ccc97 | updates closeChargePermission reason to not go over char limit | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -310,7 +310,7 @@ class AmazonPayV2Adapter\npublic function closeChargePermission($storeId, $chargePermissionId, $reason, $cancelPendingCharges = false)\n{\n$payload = [\n- 'closureReason' => $reason,\n+ 'closureReason' => substr($reason, 0, 255),\n'cancelPendingCharges' => $cancelPendingCharges,\n];\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -405,7 +405,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n} catch (\\Exception $e) {\n$session = $this->amazonAdapter->getCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId());\nif (isset($session['chargePermissionId'])) {\n- $response = $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'ERROR: ' . $e->getMessage(), true);\n+ $response = $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'Canceled due to technical issue: ' . $e->getMessage(), true);\n}\n$this->cancelCheckoutSession($cartId);\nthrow $e;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-471 updates closeChargePermission reason to not go over char limit |
21,270 | 26.08.2020 17:01:53 | 25,200 | fddfb796869517abcdb861a4e7a343a75f4f98eb | adds store currency to order comments if needed | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"new_path": "src/PayV2/Model/AsyncManagement/Charge.php",
"diff": "@@ -201,6 +201,9 @@ class Charge extends AbstractOperation\n->build(Transaction::TYPE_AUTH);\n$formattedAmount = $order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized());\n+ if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) {\n+ $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getAmountOrdered()) .']';\n+ }\n$message = __('Authorized amount of %1.', $formattedAmount);\n$payment->addTransactionCommentsToOrder($transaction, $message);\n$payment->setIsTransactionClosed(false);\n@@ -237,6 +240,9 @@ class Charge extends AbstractOperation\n->build(Transaction::TYPE_CAPTURE);\n$formattedAmount = $order->getBaseCurrency()->formatTxt($chargeAmount);\n+ if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) {\n+ $formattedAmount = $formattedAmount .' ['. $order->formatPriceTxt($payment->getAmountOrdered()) .']';\n+ }\n$message = __('Captured amount of %1 online.', $formattedAmount);\n$payment->setDataUsingMethod('base_amount_paid_online', $chargeAmount);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/di.xml",
"new_path": "src/PayV2/etc/di.xml",
"diff": "</arguments>\n</virtualType>\n+ <!-- Order comments for currency differences -->\n+ <type name=\"Magento\\Sales\\Model\\Order\\Payment\\State\\AuthorizeCommand\">\n+ <plugin name=\"amazon_payv2_order_payment_state_authorizecommand\" type=\"Amazon\\PayV2\\Plugin\\AuthorizeCommand\" />\n+ </type>\n</config>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-413 adds store currency to order comments if needed |
21,241 | 03.09.2020 15:19:07 | 18,000 | 98f2a3fa184822adb4f5c302e38539ad1dd7c80b | Do not use AuthorizeWithCapture payment intent (for now) | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -429,9 +429,6 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$result = null;\n$checkoutSession = null;\n$paymentIntent = Adapter\\AmazonPayV2Adapter::PAYMENT_INTENT_AUTHORIZE;\n- if ($this->amazonConfig->getPaymentAction() == PaymentAction::AUTHORIZE_AND_CAPTURE) {\n- $paymentIntent = Adapter\\AmazonPayV2Adapter::PAYMENT_INTENT_AUTHORIZE_WITH_CAPTURE;\n- }\n$cart = $this->getCart($cartId);\nif ($this->isAvailable($cartId)) {\n$checkoutSession = $this->getCheckoutSessionForCart($cart);\n@@ -523,6 +520,9 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$order = $this->orderRepository->get($result);\n$amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n$chargeId = $amazonResult['chargeId'];\n+ if ($this->amazonConfig->getPaymentAction() == PaymentAction::AUTHORIZE_AND_CAPTURE) {\n+ $this->amazonAdapter->captureCharge($cart->getStoreId(), $chargeId, $cart->getGrandTotal(), $cart->getQuoteCurrencyCode());\n+ }\n$amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n$payment = $order->getPayment();\n$transaction = $this->getTransaction($amazonResult['checkoutSessionId']);\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-230: Do not use AuthorizeWithCapture payment intent (for now) |
21,241 | 31.08.2020 15:57:12 | 18,000 | c6042f18bd54196145836589141801bf6f314272 | further disconnect CV1 and CV2 login functionality | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -624,11 +624,23 @@ class AmazonConfig\nreturn $this->scopeConfig->getValue('payment/amazon_payment_v2/platform_id');\n}\n- /**\n+ /*\n* @return bool\n*/\n- public function isLwaEnabled()\n+ public function isLwaEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n{\n- return $this->isEnabled() && $this->coreHelper->isLwaEnabled();\n+ if (!$this->isEnabled()) {\n+ return false;\n+ }\n+\n+ if (!$this->clientHasAllowedIp()) {\n+ return false;\n+ }\n+\n+ return $this->scopeConfig->isSetFlag(\n+ 'payment/amazon_payment_v2/lwa_enabled',\n+ $scope,\n+ $scopeCode\n+ );\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CustomerCollection.php",
"new_path": "src/PayV2/Plugin/CustomerCollection.php",
"diff": "namespace Amazon\\PayV2\\Plugin;\nuse Closure;\n-use Amazon\\Core\\Helper\\Data as AmazonHelper;\n+use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Magento\\Customer\\Model\\ResourceModel\\Customer\\Collection;\nuse Magento\\Eav\\Model\\Entity\\Attribute\\AttributeInterface;\nuse Magento\\Framework\\DB\\Select;\n@@ -24,17 +24,17 @@ use Magento\\Framework\\DB\\Select;\nclass CustomerCollection\n{\n/**\n- * @var AmazonHelper\n+ * @var AmazonConfig\n*/\n- private $amazonHelper;\n+ private $amazonConfig;\n/**\n- * @param AmazonHelper $amazonHelper\n+ * @param AmazonConfig $amazonConfig\n*/\npublic function __construct(\n- AmazonHelper $amazonHelper\n+ AmazonConfig $amazonConfig\n) {\n- $this->amazonHelper = $amazonHelper;\n+ $this->amazonConfig = $amazonConfig;\n}\n/**\n@@ -55,7 +55,7 @@ class CustomerCollection\n$condition = null,\n$joinType = 'inner'\n) {\n- if ($this->amazonHelper->isLwaEnabled() && is_array($attribute)) {\n+ if ($this->amazonConfig->isLwaEnabled() && is_array($attribute)) {\n$attribute = $this->addAmazonIdFilter($attribute, $collection);\nif (0 === count($attribute)) {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/CustomerRepository.php",
"new_path": "src/PayV2/Plugin/CustomerRepository.php",
"diff": "*/\nnamespace Amazon\\PayV2\\Plugin;\n-use Amazon\\Core\\Helper\\Data as AmazonHelper;\n+use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Amazon\\PayV2\\Api\\CustomerManagementInterface;\nuse Magento\\Customer\\Api\\CustomerRepositoryInterface;\nuse Magento\\Customer\\Api\\Data\\CustomerInterface;\n@@ -28,22 +28,22 @@ class CustomerRepository\nprivate $customerManagement;\n/**\n- * @var AmazonHelper\n+ * @var AmazonConfig\n*/\n- private $amazonHelper;\n+ private $amazonConfig;\n/**\n* CustomerRepository constructor.\n*\n* @param CustomerManagementInterface $customerManagement\n- * @param AmazonHelper $amazonHelper\n+ * @param AmazonConfig $amazonConfig\n*/\npublic function __construct(\nCustomerManagementInterface $customerManagement,\n- AmazonHelper $amazonHelper\n+ AmazonConfig $amazonConfig\n) {\n$this->customerManagement = $customerManagement;\n- $this->amazonHelper = $amazonHelper;\n+ $this->amazonConfig = $amazonConfig;\n}\n/**\n@@ -57,7 +57,7 @@ class CustomerRepository\n*/\npublic function afterGetById(CustomerRepositoryInterface $customerRepository, CustomerInterface $customer)\n{\n- if ($this->amazonHelper->isEnabled()) {\n+ if ($this->amazonConfig->isEnabled()) {\n$this->customerManagement->setAmazonIdExtensionAttribute($customer);\n}\n@@ -75,7 +75,7 @@ class CustomerRepository\n*/\npublic function afterGet(CustomerRepositoryInterface $customerRepository, CustomerInterface $customer)\n{\n- if ($this->amazonHelper->isEnabled()) {\n+ if ($this->amazonConfig->isEnabled()) {\n$this->customerManagement->setAmazonIdExtensionAttribute($customer);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "</depends>\n</field>\n<field id=\"lwa_enabled\" translate=\"label\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <depends>\n+ <field id=\"payment/us/amazon_payment/api_version\">1</field>\n+ </depends>\n+ </field>\n+ <field id=\"v2_lwa_enabled\" translate=\"label\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n+ <label>Enable Login with Amazon</label>\n+ <source_model>Magento\\Config\\Model\\Config\\Source\\Yesno</source_model>\n+ <config_path>payment/amazon_payment_v2/lwa_enabled</config_path>\n+ <depends>\n+ <field id=\"payment/us/amazon_payment/api_version\">2</field>\n+ </depends>\n<comment><![CDATA[Please note that if Amazon Sign-in is disabled and Magento Guest Checkout is disabled, the customer will be able to use Amazon Pay only if already signed in with a Magento account]]></comment>\n</field>\n<field id=\"update_mechanism\" translate=\"label\" type=\"select\" sortOrder=\"50\" showInDefault=\"1\" showInWebsite=\"0\" showInStore=\"0\">\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-login.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-login.js",
"diff": "@@ -22,7 +22,7 @@ define([\n'use strict';\nif (amazonStorage.isEnabled) {\n- $.widget('amazon.AmazonButton', {\n+ $.widget('amazon.AmazonLoginButton', {\noptions: {\npayOnly: null,\nplacement: 'Cart',\n@@ -82,6 +82,6 @@ define([\n}\n});\n- return $.amazon.AmazonButton;\n+ return $.amazon.AmazonLoginButton;\n}\n});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: further disconnect CV1 and CV2 login functionality |
21,241 | 01.09.2020 20:18:28 | 18,000 | 3b7daad8526b7a26374573bf460a3a898fdaadf1 | adjustments for Login, including logging out of Amazon after logging out of Magento | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -72,4 +72,12 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n{\nreturn $this->amazonConfig->isEnabled();\n}\n+\n+ /**\n+ * @return bool\n+ */\n+ public function isLwaEnabled()\n+ {\n+ return $this->amazonConfig->isLwaEnabled();\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Validate.php",
"new_path": "src/PayV2/Block/Validate.php",
"diff": "@@ -33,4 +33,9 @@ class Validate extends Template\n{\nreturn $this->_urlBuilder->getUrl('checkout');\n}\n+\n+ public function isGuestCheckoutEnabled()\n+ {\n+ return $this->_scopeConfig->getValue('checkout/options/guest_checkout');\n+ }\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/view/frontend/layout/customer_account_logoutsuccess.xml",
"diff": "+<?xml version=\"1.0\"?>\n+<!--\n+/**\n+ * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ * http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+-->\n+<page xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:View/Layout/etc/page_configuration.xsd\">\n+ <body>\n+ <referenceContainer name=\"content\">\n+ <block class=\"Amazon\\PayV2\\Block\\Config\" name=\"amazon_logout\" after=\"customer_logout\" template=\"Amazon_PayV2::logout.phtml\" />\n+ </referenceContainer>\n+ </body>\n+</page>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/requirejs-config.js",
"new_path": "src/PayV2/view/frontend/requirejs-config.js",
"diff": "@@ -25,7 +25,8 @@ var config = {\namazonPayV2ProductAdd: 'Amazon_PayV2/js/amazon-product-add',\namazonPayV2Button: 'Amazon_PayV2/js/amazon-button',\namazonPayV2Config: 'Amazon_PayV2/js/model/amazonPayV2Config',\n- amazonPayV2Login: 'Amazon_PayV2/js/amazon-login'\n+ amazonPayV2LoginButton: 'Amazon_PayV2/js/amazon-login-button',\n+ amazonPayV2Logout: 'Amazon_PayV2/js/amazon-logout'\n}\n},\npaths: {\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/form/validate.phtml",
"new_path": "src/PayV2/view/frontend/templates/form/validate.phtml",
"diff": "<span><?= $block->escapeHtml(__('Ok')) ?></span>\n</button>\n</div>\n+ <?php if ($block->isGuestCheckoutEnabled()): ?>\n<div class=\"secondary continue-as-guest\">\n<a class=\"action secondary\" href=\"<?= $block->escapeUrl($block->getContinueAsGuestUrl())?>\">\n<span><?= $block->escapeHtml(__('Continue as Guest')) ?></span>\n</a>\n</div>\n+ <?php endif; ?>\n<div class=\"secondary forgot-password\">\n<a class=\"action secondary\" href=\"<?= $block->escapeUrl($block->getForgotPasswordUrl()) ?>\">\n<span><?= $block->escapeHtml(__('Forgot Your Password?')) ?></span>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/login.phtml",
"new_path": "src/PayV2/view/frontend/templates/login.phtml",
"diff": "@@ -40,7 +40,7 @@ $amazonPublicKeyId = $block->getAmazonPublicKeyId();\n<div class=\"amazon-button-container__cell\">\n<div id=\"AmazonPayButton\"\nclass=\"login-with-amazon\"\n- data-mage-init='{\"amazonPayV2Login\": {\"payload\": \"<?= addslashes($buttonPayload) ?>\", \"signature\": \"<?= $buttonSignature ?>\", \"public_key_id\": \"<?= $amazonPublicKeyId ?>\" }}'>\n+ data-mage-init='{\"amazonPayV2LoginButton\": {\"payload\": \"<?= addslashes($buttonPayload) ?>\", \"signature\": \"<?= $buttonSignature ?>\", \"public_key_id\": \"<?= $amazonPublicKeyId ?>\" }}'>\n</div>\n</div>\n<div class=\"amazon-button-container__cell\">\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/view/frontend/templates/logout.phtml",
"diff": "+<?php\n+/**\n+ * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ * http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+?>\n+<?php /** @var \\Amazon\\PayV2\\Block\\Config $block */?>\n+<?php if ($block->isLwaEnabled()): ?>\n+<div class=\"amazon-logout-widget\" data-mage-init='{\"amazonPayV2Logout\": {\"onInit\": \"true\"}}'></div>\n+<?php endif; ?>\n"
},
{
"change_type": "RENAME",
"old_path": "src/PayV2/view/frontend/web/js/amazon-login.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-login-button.js",
"diff": ""
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/view/frontend/web/js/amazon-logout.js",
"diff": "+/**\n+ * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ * http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+\n+define([\n+ 'jquery',\n+ 'amazonCore',\n+ 'Amazon_PayV2/js/amazon-checkout',\n+ 'mage/cookies'\n+], function ($, core, amazonCheckout) {\n+ 'use strict';\n+\n+ $.widget('amazon.AmazonLogout', {\n+ options: {\n+ onInit: false\n+ },\n+\n+ /**\n+ * Create Amazon Logout Widget\n+ * @private\n+ */\n+ _create: function () {\n+ if (this.options.onInit) {\n+ amazonCheckout.withAmazonCheckout(function (amazon, args) {\n+ amazon.Pay.signout(); //logout amazon user on init\n+ });\n+ }\n+ },\n+\n+ /**\n+ * Logs out a user if called directly\n+ * @private\n+ */\n+ _logoutAmazonUser: function () {\n+ amazonCheckout.withAmazonCheckout(function (amazon, args) {\n+ amazon.Pay.signout();\n+ });\n+ }\n+ });\n+\n+ return $.amazon.AmazonLogout;\n+});\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: adjustments for Login, including logging out of Amazon after logging out of Magento |
21,241 | 02.09.2020 12:34:38 | 18,000 | 81f77929df94de1cec54d5011c3c8e36d7509f94 | use the cart currency and total for completing checkout, and catch if there is a non-success response | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -526,7 +526,11 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n$order = $this->orderRepository->get($result);\n- $amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n+ $amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getGrandTotal() , $cart->getQuoteCurrencyCode());\n+ if (array_key_exists('status', $amazonResult) && $amazonResult['status'] != 200) {\n+ // Something went wrong, but the order has already been placed\n+ return $result;\n+ }\n$chargeId = $amazonResult['chargeId'];\n$amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n$payment = $order->getPayment();\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-222: use the cart currency and total for completing checkout, and catch if there is a non-success response |
21,241 | 02.09.2020 12:35:23 | 18,000 | 91858727abb56e56882d0ef21f530dc0884f0932 | Change verbiage on the LwA config option | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "</depends>\n</field>\n<field id=\"v2_lwa_enabled\" translate=\"label\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n- <label>Enable Login with Amazon</label>\n+ <label>Enable Amazon Pay Sign-in</label>\n<source_model>Magento\\Config\\Model\\Config\\Source\\Yesno</source_model>\n<config_path>payment/amazon_payment_v2/lwa_enabled</config_path>\n<depends>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: Change verbiage on the LwA config option |
21,241 | 03.09.2020 12:36:58 | 18,000 | 860f2a6b5dec193c637d542f8e954a2606e7ec0d | allow guest checkout when Amazon email matches a Magento account | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Validate.php",
"new_path": "src/PayV2/Block/Validate.php",
"diff": "@@ -31,7 +31,8 @@ class Validate extends Template\npublic function getContinueAsGuestUrl()\n{\n- return $this->_urlBuilder->getUrl('checkout');\n+ $checkoutSessionId = $this->getRequest()->getParam('amazonCheckoutSessionId');\n+ return $this->_urlBuilder->getUrl('checkout', ['_query' => ['amazonCheckoutSessionId' => $checkoutSessionId]]);\n}\npublic function isGuestCheckoutEnabled()\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Controller/Login.php",
"new_path": "src/PayV2/Controller/Login.php",
"diff": "@@ -22,6 +22,7 @@ use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Amazon\\PayV2\\Model\\Validator\\AccessTokenRequestValidator;\nuse Amazon\\PayV2\\Model\\Customer\\Account\\Redirect as AccountRedirect;\nuse Amazon\\PayV2\\Helper\\Session;\n+use Magento\\Customer\\Api\\AccountManagementInterface;\nuse Magento\\Customer\\Model\\Session as CustomerSession;\nuse Magento\\Customer\\Model\\Url;\nuse Magento\\Framework\\App\\Action\\Action;\n@@ -103,12 +104,16 @@ abstract class Login extends Action\n*/\nprotected $url;\n+ /**\n+ * @var AccountManagementInterface\n+ */\n+ protected $accountManagement;\n+\n/**\n* Login constructor.\n* @param Context $context\n* @param AmazonCustomerFactory $amazonCustomerFactory\n- * @param Adapter\\AmazonPayV2Adapter $amazonAdapter\n- * @param LoggerInterface $logger\n+ * @param \\Amazon\\PayV2\\Model\\Adapter\\AmazonPayV2Adapter $amazonAdapter\n* @param AmazonConfig $amazonConfig\n* @param Url $customerUrl\n* @param AccessTokenRequestValidator $accessTokenRequestValidator\n@@ -120,6 +125,7 @@ abstract class Login extends Action\n* @param LoggerInterface $logger\n* @param StoreManager $storeManager\n* @param UrlInterface $url\n+ * @param AccountManagementInterface $accountManagement\n* @SuppressWarnings(PHPMD.ExcessiveParameterList)\n*/\npublic function __construct(\n@@ -136,7 +142,8 @@ abstract class Login extends Action\nSession $session,\nLoggerInterface $logger,\nStoreManager $storeManager,\n- UrlInterface $url\n+ UrlInterface $url,\n+ AccountManagementInterface $accountManagement\n) {\n$this->amazonCustomerFactory = $amazonCustomerFactory;\n$this->amazonAdapter = $amazonAdapter;\n@@ -151,6 +158,7 @@ abstract class Login extends Action\n$this->logger = $logger;\n$this->storeManager = $storeManager;\n$this->url = $url;\n+ $this->accountManagement = $accountManagement;\nparent::__construct($context);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Controller/Login/Checkout.php",
"new_path": "src/PayV2/Controller/Login/Checkout.php",
"diff": "@@ -18,7 +18,6 @@ namespace Amazon\\PayV2\\Controller\\Login;\nuse Amazon\\PayV2\\Api\\Data\\AmazonCustomerInterface;\nuse Amazon\\PayV2\\Domain\\ValidationCredentials;\nuse Magento\\Framework\\Exception\\ValidatorException;\n-use Magento\\Framework\\Exception\\NotFoundException;\nuse Zend_Validate;\nclass Checkout extends \\Amazon\\PayV2\\Controller\\Login\n@@ -29,32 +28,34 @@ class Checkout extends \\Amazon\\PayV2\\Controller\\Login\npublic function execute()\n{\n$checkoutSessionId = $this->getRequest()->getParam('amazonCheckoutSessionId');\n- $checkoutSession = $this->amazonAdapter->getCheckoutSession($this->storeManager->getStore()->getId(), $checkoutSessionId);\n- $amazonCustomer = $this->getAmazonCustomerFromSession($checkoutSession);\ntry {\n- if ($this->amazonConfig->isLwaEnabled()) {\n- if ($amazonCustomer) {\n- $processed = $this->processAmazonCustomer($amazonCustomer);\n+ $checkoutSession = $this->amazonAdapter->getCheckoutSession($this->storeManager->getStore()->getId(), $checkoutSessionId);\n- if ($processed instanceof ValidationCredentials) {\n- $this->session->setValidationCredentials($processed);\n- $this->session->setAmazonCustomer($amazonCustomer);\n- return $this->_redirect($this->_url->getRouteUrl('*/*/validate'));\n- } else {\n- $this->session->login($processed);\n- }\n- }\n- } else {\n+ if (!$this->amazonConfig->isLwaEnabled()) {\n$userInfo = $checkoutSession['buyer'];\nif ($userInfo && isset($userInfo['email'])) {\n+ $userEmail = $userInfo['email'];\n$quote = $this->session->getQuote();\nif ($quote) {\n- $quote->setCustomerEmail($userInfo['email']);\n+ $quote->setCustomerEmail($userEmail);\n$quote->save();\n}\n}\n+ } else {\n+ $amazonCustomer = $this->createAmazonCustomerFromSession($checkoutSession);\n+ if ($amazonCustomer) {\n+ $processed = $this->processAmazonCustomer($amazonCustomer);\n+\n+ if ($processed instanceof ValidationCredentials) {\n+ $this->session->setValidationCredentials($processed);\n+ $this->session->setAmazonCustomer($amazonCustomer);\n+ return $this->_redirect($this->_url->getUrl('*/*/validate', ['_query' => ['amazonCheckoutSessionId' => $checkoutSessionId]]));\n+ } elseif (!$this->customerSession->isLoggedIn()) {\n+ $this->session->login($processed);\n+ }\n+ }\n}\n} catch (ValidatorException $e) {\n$this->logger->error($e);\n@@ -103,7 +104,7 @@ class Checkout extends \\Amazon\\PayV2\\Controller\\Login\n/**\n* @param $checkoutSession\n- * @return \\Amazon\\PayV2\\Domain\\AmazonCustomer|false\n+ * @return array|false\n*/\nprotected function getAmazonCustomerFromSession($checkoutSession)\n{\n@@ -116,9 +117,21 @@ class Checkout extends \\Amazon\\PayV2\\Controller\\Login\n'name' => $userInfo['name'],\n'country' => $this->amazonConfig->getRegion(),\n];\n- return $this->amazonCustomerFactory->create($data);\n+\n+ return $data;\n}\nreturn false;\n}\n+\n+ /**\n+ * @param $checkoutSession\n+ * @return \\Amazon\\PayV2\\Domain\\AmazonCustomer\n+ */\n+ protected function createAmazonCustomerFromSession($checkoutSession)\n+ {\n+ $data = $this->getAmazonCustomerFromSession($checkoutSession);\n+\n+ return $this->amazonCustomerFactory->create($data);\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -643,4 +643,18 @@ class AmazonConfig\n$scopeCode\n);\n}\n+\n+ /**\n+ * @param string $scope\n+ * @param null $scopeCode\n+ * @return bool\n+ */\n+ public function isGuestCheckoutEnabled($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ return $this->scopeConfig->isSetFlag(\n+ 'checkout/options/guest_checkout',\n+ $scope,\n+ $scopeCode\n+ );\n+ }\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: allow guest checkout when Amazon email matches a Magento account |
21,241 | 04.09.2020 14:14:06 | 18,000 | c555950f413fecbd8cc8b2a53b5d3796d98fff98 | update branding to Amazon Sign-in | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/adminhtml/system.xml",
"new_path": "src/PayV2/etc/adminhtml/system.xml",
"diff": "</depends>\n</field>\n<field id=\"v2_lwa_enabled\" translate=\"label\" type=\"select\" sortOrder=\"20\" showInDefault=\"1\" showInWebsite=\"1\" showInStore=\"1\">\n- <label>Enable Amazon Pay Sign-in</label>\n+ <label>Enable Amazon Sign-in</label>\n<source_model>Magento\\Config\\Model\\Config\\Source\\Yesno</source_model>\n<config_path>payment/amazon_payment_v2/lwa_enabled</config_path>\n<depends>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/templates/login.phtml",
"new_path": "src/PayV2/view/frontend/templates/login.phtml",
"diff": "@@ -27,11 +27,11 @@ $amazonPublicKeyId = $block->getAmazonPublicKeyId();\n<div class=\"block block-amazon-login\">\n<div class=\"block-title\">\n<strong id=\"block-amazon-login-heading\" role=\"heading\" aria-level=\"2\">\n- <?= $block->escapeHtml(__('Login with Amazon')) ?>\n+ <?= $block->escapeHtml(__('Amazon Sign-in')) ?>\n</strong>\n</div>\n<div class=\"block-content\" aria-labelledby=\"block-amazon-login-heading\">\n- <p><?= $block->escapeHtml(__('With Amazon Pay and Login with Amazon, you can easily sign-in and use the ' .\n+ <p><?= $block->escapeHtml(__('With Amazon Pay and Amazon Sign-in, you can easily sign-in and use the ' .\n'shipping and payment information stored in your Amazon account to place an order on this shop. ')) ?>\n</p>\n<div class=\"actions-toolbar\">\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: update branding to Amazon Sign-in |
21,270 | 04.09.2020 15:51:11 | 25,200 | 4133749d35055cfbac9c14b4bf41e86906362a3e | fixes repeated company name for DE addresses | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Domain/AmazonAddress.php",
"new_path": "src/PayV2/Domain/AmazonAddress.php",
"diff": "@@ -54,6 +54,24 @@ class AmazonAddress extends \\Magento\\Framework\\DataObject implements AmazonAddre\nreturn null;\n}\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function shiftLines($times = 1)\n+ {\n+ while ($times > 0) {\n+ $lines = $this->getData(AmazonAddressInterface::LINES);\n+ for ($i = 1; $i <= count($lines); $i++) {\n+ $lines[$i] = isset($lines[$i + 1]) ? $lines[$i + 1] : '';\n+ }\n+ $this->setData(AmazonAddressInterface::LINES, $lines);\n+\n+ $times--;\n+ }\n+\n+ return $this->getLines();\n+ }\n+\n/**\n* {@inheritdoc}\n*/\n@@ -101,4 +119,14 @@ class AmazonAddress extends \\Magento\\Framework\\DataObject implements AmazonAddre\n{\nreturn $this->getData(AmazonAddressInterface::COMPANY);\n}\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function setCompany($company)\n+ {\n+ $this->setData(AmazonAddressInterface::COMPANY, $company);\n+\n+ return $this->getCompany();\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Domain/AmazonAddressDecoratorDe.php",
"new_path": "src/PayV2/Domain/AmazonAddressDecoratorDe.php",
"diff": "@@ -79,11 +79,15 @@ class AmazonAddressDecoratorDe implements AmazonAddressInterface\n$firstTwoLines = $line1 . ' ' . $line2;\nif (!$this->isPOBox($line1, $firstTwoLines)) {\n$company = $firstTwoLines;\n+ $this->amazonAddress->setCompany($company);\n+ $this->amazonAddress->shiftLines(2);\n}\nbreak;\ncase !empty($line2):\nif (!$this->isPOBox($line1, $line1)) {\n$company = $line1;\n+ $this->amazonAddress->setCompany($company);\n+ $this->amazonAddress->shiftLines();\n}\nbreak;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Domain/AmazonAddressInterface.php",
"new_path": "src/PayV2/Domain/AmazonAddressInterface.php",
"diff": "@@ -58,6 +58,14 @@ interface AmazonAddressInterface\n*/\npublic function getLine($lineNumber);\n+ /**\n+ * Shifts address lines\n+ *\n+ * @param int $times\n+ * @return null|string\n+ */\n+ public function shiftLines($times);\n+\n/**\n* Get city\n*\n@@ -99,4 +107,12 @@ interface AmazonAddressInterface\n* @return string\n*/\npublic function getCompany();\n+\n+ /**\n+ * Set company name\n+ *\n+ * @param string $company\n+ * @return string\n+ */\n+ public function setCompany($company);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Helper/Address.php",
"new_path": "src/PayV2/Helper/Address.php",
"diff": "@@ -80,6 +80,9 @@ class Address\n$address->setTelephone($amazonAddress->getTelephone());\n$address->setCountryId($this->getCountryId($amazonAddress));\n+ $company = !empty($amazonAddress->getCompany()) ? $amazonAddress->getCompany() : '';\n+ $address->setCompany($company);\n+\n/*\n* The number of lines in a street address is configurable via 'customer/address/street_lines'.\n* To avoid discarding information, we'll concatenate additional lines so that they fit within the configured\n@@ -96,9 +99,6 @@ class Address\n}\n$address->setStreet(array_values($lines));\n- $company = !empty($amazonAddress->getCompany()) ? $amazonAddress->getCompany() : '';\n- $address->setCompany($company);\n-\nif ($amazonAddress->getState()) {\n$address->setRegion($this->getRegionData($amazonAddress, $address->getCountryId()));\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-488 fixes repeated company name for DE addresses |
21,270 | 04.09.2020 17:17:09 | 25,200 | f8cce27d4686ac095767b3a44f7cf7e5a483b865 | adds missing methods | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Domain/AmazonAddressDecoratorDe.php",
"new_path": "src/PayV2/Domain/AmazonAddressDecoratorDe.php",
"diff": "@@ -184,4 +184,20 @@ class AmazonAddressDecoratorDe implements AmazonAddressInterface\n{\nreturn $this->amazonAddress->getLine($lineNumber);\n}\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function shiftLines($times)\n+ {\n+ return $this->amazonAddress->shiftLines($times);\n+ }\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function setCompany($company)\n+ {\n+ return $this->amazonAddress->setCompany($company);\n+ }\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-488 adds missing methods |
21,241 | 08.09.2020 10:08:51 | 18,000 | 96d41a5bd2a737bd768ea747ab30ad53f0200e9f | match BaseRedirect params | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Customer/Account/Redirect.php",
"new_path": "src/PayV2/Model/Customer/Account/Redirect.php",
"diff": "@@ -22,6 +22,7 @@ use Magento\\Customer\\Model\\Url as CustomerUrl;\nuse Magento\\Framework\\App\\Config\\ScopeConfigInterface;\nuse Magento\\Framework\\App\\RequestInterface;\nuse Magento\\Framework\\Controller\\ResultFactory;\n+use Magento\\Framework\\Stdlib\\Cookie\\CookieMetadataFactory;\nuse Magento\\Framework\\Url\\DecoderInterface;\nuse Magento\\Framework\\UrlInterface;\nuse Magento\\Store\\Model\\StoreManagerInterface;\n@@ -47,6 +48,7 @@ class Redirect extends BaseRedirect\nDecoderInterface $urlDecoder,\nCustomerUrl $customerUrl,\nResultFactory $resultFactory,\n+ CookieMetadataFactory $cookieMetadataFactory,\nCheckoutSession $checkoutSession\n) {\nparent::__construct(\n@@ -57,7 +59,8 @@ class Redirect extends BaseRedirect\n$url,\n$urlDecoder,\n$customerUrl,\n- $resultFactory\n+ $resultFactory,\n+ $cookieMetadataFactory\n);\n$this->customerSession = $customerSession;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-220: match BaseRedirect params |
21,270 | 08.09.2020 10:44:40 | 25,200 | b71e6b1f77d3387930c474b5ea72b6f1e0010e77 | adds methods to Jp address decorator | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Domain/AmazonAddressDecoratorJp.php",
"new_path": "src/PayV2/Domain/AmazonAddressDecoratorJp.php",
"diff": "@@ -116,4 +116,20 @@ class AmazonAddressDecoratorJp implements AmazonAddressInterface\n}\nreturn null;\n}\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function shiftLines($times)\n+ {\n+ return $this->amazonAddress->shiftLines($times);\n+ }\n+\n+ /**\n+ * {@inheritdoc}\n+ */\n+ public function setCompany($company)\n+ {\n+ return $this->amazonAddress->setCompany($company);\n+ }\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-488 adds methods to Jp address decorator |
21,270 | 10.09.2020 15:51:12 | 25,200 | ec7e99793fb33782309d85066078c0fd13238d40 | updates remaining requests to show display currency on comments and use it on api | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"new_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"diff": "@@ -107,9 +107,10 @@ class SettlementRequestBuilder implements BuilderInterface\n$paymentDO = $this->subjectReader->readPayment($buildSubject);\n$orderDO = $paymentDO->getOrder();\n$storeId = $orderDO->getStoreId();\n+ $order = $paymentDO->getPayment()->getOrder();\n- $currencyCode = $orderDO->getCurrencyCode();\n- $total = $buildSubject['amount'];\n+ $currencyCode = $order->getOrderCurrencyCode();\n+ $total = $paymentDO->getPayment()->getAmountOrdered();\n$data = [\n'store_id' => $storeId,\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Validator/GeneralResponseValidator.php",
"new_path": "src/PayV2/Gateway/Validator/GeneralResponseValidator.php",
"diff": "@@ -41,6 +41,7 @@ class GeneralResponseValidator extends AbstractValidator\n$response = $validationSubject['response'];\nif (isset($response['statusDetails'])) {\n+ if ($response['statusDetails']['state'] != 'Canceled') {\nif (!empty($response['statusDetails']['reasonCode'])) {\n$isValid = false;\n$errorCodes[] = $response['statusDetails']['reasonCode'];\n@@ -50,6 +51,7 @@ class GeneralResponseValidator extends AbstractValidator\n$errorMessages[] = $response['statusDetails']['reasonDescription'];\n}\n}\n+ }\nif (!empty($response['reasonCode'])) {\n$isValid = false;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -521,7 +521,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\n$result = $this->cartManagement->placeOrder($cart->getId());\n$order = $this->orderRepository->get($result);\n- $amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getBaseGrandTotal() , $cart->getBaseCurrencyCode());\n+ $amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getGrandTotal() , $cart->getQuoteCurrencyCode());\n$chargeId = $amazonResult['chargeId'];\n$amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n$payment = $order->getPayment();\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Plugin/OrderCurrencyComment.php",
"diff": "+<?php\n+/**\n+ * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ * http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+namespace Amazon\\PayV2\\Plugin;\n+\n+use Magento\\Framework\\Phrase;\n+use Magento\\Sales\\Model\\Order\\Payment;\n+use Amazon\\PayV2\\Gateway\\Config\\Config;\n+\n+/**\n+ * Class OrderCurrencyComment\n+ * @package Amazon\\PayV2\\Plugin\n+ */\n+class OrderCurrencyComment\n+{\n+ /**\n+ * @param Payment $subject\n+ * @param $messagePrependTo\n+ * @return array|null\n+ */\n+ public function beforePrependMessage(Payment $subject, $messagePrependTo)\n+ {\n+ if ($subject->getMethod() == Config::CODE) {\n+ $order = $subject->getOrder();\n+ if ($order->getBaseCurrencyCode() != $order->getOrderOrderCurrencyCode()) {\n+ $messagePrependTo = __(\n+ $messagePrependTo->getText(),\n+ $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()) .' ['. $order->formatPriceTxt($subject->getAmountOrdered()) .']'\n+ );\n+\n+ return [$messagePrependTo];\n+ }\n+ }\n+\n+ return null;\n+ }\n+\n+ /**\n+ * @param Payment $subject\n+ * @param $result\n+ * @return string\n+ */\n+ public function afterFormatPrice(Payment $subject, $result)\n+ {\n+ if ($subject->getMethod() == Config::CODE) {\n+ $order = $subject->getOrder();\n+ if (($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()\n+ && $subject->getMessage() instanceof Phrase\n+ && $subject->getMessage()->getText() == 'Canceled order online')\n+ || strpos($subject->getTransactionId(), '-void') !== FALSE\n+ ) {\n+ return $result .' ['. $order->formatPriceTxt($subject->getAmountOrdered()) .']';\n+ }\n+ }\n+\n+ return $result;\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/di.xml",
"new_path": "src/PayV2/etc/di.xml",
"diff": "</virtualType>\n<!-- Order comments for currency differences -->\n- <type name=\"Magento\\Sales\\Model\\Order\\Payment\\State\\AuthorizeCommand\">\n- <plugin name=\"amazon_payv2_order_payment_state_authorizecommand\" type=\"Amazon\\PayV2\\Plugin\\AuthorizeCommand\" />\n+ <type name=\"Magento\\Sales\\Model\\Order\\Payment\">\n+ <plugin name=\"amazon_payv2_order_payment\" type=\"Amazon\\PayV2\\Plugin\\OrderCurrencyComment\" />\n</type>\n</config>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-413 updates remaining requests to show display currency on comments and use it on api |
21,270 | 11.09.2020 13:56:11 | 25,200 | 259d8fff2105b867bb8701a2f11b8268ac8c917c | fixes refunds when charge on order | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/di.xml",
"new_path": "src/PayV2/etc/di.xml",
"diff": "<!-- Refund Command -->\n<virtualType name=\"AmazonPayV2RefundCommand\" type=\"Magento\\Payment\\Gateway\\Command\\GatewayCommand\">\n<arguments>\n- <argument name=\"requestBuilder\" xsi:type=\"object\">Amazon\\PayV2\\Gateway\\Request\\SettlementRequestBuilder</argument>\n+ <argument name=\"requestBuilder\" xsi:type=\"object\">Amazon\\PayV2\\Gateway\\Request\\RefundRequestBuilder</argument>\n<argument name=\"handler\" xsi:type=\"object\">Amazon\\PayV2\\Gateway\\Response\\RefundHandler</argument>\n<argument name=\"transferFactory\" xsi:type=\"object\">Amazon\\PayV2\\Gateway\\Http\\TransferFactory</argument>\n<argument name=\"client\" xsi:type=\"object\">Amazon\\PayV2\\Gateway\\Http\\Client\\RefundClient</argument>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-497 fixes refunds when charge on order |
21,241 | 16.09.2020 19:36:13 | 18,000 | 397e3b6c42ae3ec8550f639c842b2fc1f4fe917f | add support for split invoicing | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Request/AuthorizationSaleRequestBuilder.php",
"new_path": "src/PayV2/Gateway/Request/AuthorizationSaleRequestBuilder.php",
"diff": "namespace Amazon\\PayV2\\Gateway\\Request;\n+use Magento\\Framework\\Exception\\NoSuchEntityException;\nuse Magento\\Payment\\Gateway\\Request\\BuilderInterface;\nuse Amazon\\PayV2\\Gateway\\Helper\\SubjectReader;\n@@ -50,10 +51,17 @@ class AuthorizationSaleRequestBuilder implements BuilderInterface\npublic function build(array $buildSubject)\n{\n$payment = $this->subjectReader->readPayment($buildSubject)->getPayment();\n+ try {\n+ $amazonCheckoutSessionId = $this->sessionManagement->getCheckoutSession($payment->getOrder()->getQuoteId());\n+ } catch (NoSuchEntityException $e) {\n+ $amazonCheckoutSessionId = null;\n+ }\n/* @var $payment \\Magento\\Sales\\Model\\Order\\Payment */\nreturn [\n'quote_id' => $payment->getOrder()->getQuoteId(),\n- 'amazon_checkout_session_id' => $this->sessionManagement->getCheckoutSession($payment->getOrder()->getQuoteId()),\n+ 'amazon_checkout_session_id' => $amazonCheckoutSessionId,\n+ 'charge_permission_id' => $payment->getAdditionalInformation('charge_permission_id'),\n+ 'amount' => $buildSubject['amount'],\n];\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"new_path": "src/PayV2/Gateway/Response/AuthorizationSaleHandler.php",
"diff": "@@ -61,8 +61,9 @@ class AuthorizationSaleHandler implements HandlerInterface\n/** @var Payment $payment */\n$payment = $paymentDO->getPayment();\n- $payment->setTransactionId($response['checkoutSessionId']);\n- $payment->setIsTransactionClosed(false);\n+ $transactionId = $response['chargeId'] ?? $response['checkoutSessionId'];\n+ $payment->setTransactionId($transactionId);\n+ $payment->setIsTransactionClosed($handlingSubject['partial_capture'] ?? false);\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -213,15 +213,17 @@ class AmazonPayV2Adapter\n* @param $chargePermissionId\n* @param $amount\n* @param $currency\n+ * @param bool $captureNow\n* @return mixed\n*/\n- public function createCharge($storeId, $chargePermissionId, $amount, $currency)\n+ public function createCharge($storeId, $chargePermissionId, $amount, $currency, $captureNow = false)\n{\n$headers = $this->getIdempotencyHeader();\n$payload = [\n'chargePermissionId' => $chargePermissionId,\n'chargeAmount' => $this->createPrice($amount, $currency),\n+ 'captureNow' => $captureNow,\n];\n$response = $this->clientFactory->create($storeId)->createCharge($payload, $headers);\n@@ -288,6 +290,18 @@ class AmazonPayV2Adapter\nreturn $this->processResponse($response, __FUNCTION__);\n}\n+ /**\n+ * @param int $storeId\n+ * @param string $chargePermissionId\n+ * @return array\n+ */\n+ public function getChargePermission(int $storeId, string $chargePermissionId)\n+ {\n+ $response = $this->clientFactory->create($storeId)->getChargePermission($chargePermissionId);\n+\n+ return $this->processResponse($response, __FUNCTION__);\n+ }\n+\n/**\n* Cancel charge\n*\n@@ -334,7 +348,14 @@ class AmazonPayV2Adapter\npublic function authorize($data)\n{\n$quote = $this->quoteRepository->get($data['quote_id']);\n+ if (!empty($data['amazon_checkout_session_id'])) {\n$response = $this->getCheckoutSession($quote->getStoreId(), $data['amazon_checkout_session_id']);\n+ } elseif (!empty($data['charge_permission_id'])) {\n+ $getChargePermissionResponse = $this->getChargePermission($quote->getStoreId(), $data['charge_permission_id']);\n+ if ($getChargePermissionResponse['statusDetails']['state'] == \"Chargeable\") {\n+ $response = $this->createCharge($quote->getStoreId(), $data['charge_permission_id'], $data['amount'], $quote->getQuoteCurrencyCode(), true);\n+ }\n+ }\nreturn $response;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -525,6 +525,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$chargeId = $amazonResult['chargeId'];\n$amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n$payment = $order->getPayment();\n+ $payment->setAdditionalInformation('charge_permission_id', $amazonResult['chargePermissionId']);\n$transaction = $this->getTransaction($amazonResult['checkoutSessionId']);\n$chargeState = $amazonCharge['statusDetails']['state'];\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-221 - add support for split invoicing |
21,241 | 16.09.2020 20:24:04 | 18,000 | 1b15dc2f993fe6364c8c40086073c15ae975af7b | block split invoicing for DE and UK | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Config/Config.php",
"new_path": "src/PayV2/Gateway/Config/Config.php",
"diff": "*/\nnamespace Amazon\\PayV2\\Gateway\\Config;\n+use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Magento\\Framework\\App\\Config\\ScopeConfigInterface;\nuse Magento\\Store\\Model\\ScopeInterface;\n@@ -14,6 +15,42 @@ class Config extends \\Magento\\Payment\\Gateway\\Config\\Config\nconst KEY_ACTIVE = 'active';\n+ /**\n+ * @var AmazonConfig\n+ */\n+ protected $amazonConfig;\n+\n+ /**\n+ * @param AmazonConfig $amazonConfig\n+ * @param ScopeConfigInterface $scopeConfig\n+ */\n+ public function __construct(\n+ AmazonConfig $amazonConfig,\n+ ScopeConfigInterface $scopeConfig\n+ ) {\n+ $this->amazonConfig = $amazonConfig;\n+ parent::__construct($scopeConfig, self::CODE);\n+ }\n+\n+ /**\n+ * @param int|null $storeId\n+ * @return boolean\n+ */\n+ protected function canCapturePartial($storeId = null)\n+ {\n+ $region = $this->amazonConfig->getPaymentRegion(ScopeInterface::SCOPE_STORE, $storeId);\n+ switch ($region) {\n+ case 'de':\n+ case 'uk':\n+ $result = false;\n+ break;\n+ default:\n+ $result = parent::getValue('can_capture_partial', $storeId);\n+ break;\n+ }\n+ return $result;\n+ }\n+\n/**\n* Gets Payment configuration status.\n*\n@@ -24,4 +61,22 @@ class Config extends \\Magento\\Payment\\Gateway\\Config\\Config\n{\nreturn (bool) $this->getValue(self::KEY_ACTIVE, $storeId);\n}\n+\n+ /**\n+ * @param string $field\n+ * @param int|null $storeId\n+ * @return mixed\n+ */\n+ public function getValue($field, $storeId = null)\n+ {\n+ switch ($field) {\n+ case 'can_capture_partial':\n+ $result = $this->canCapturePartial($storeId);\n+ break;\n+ default:\n+ $result = parent::getValue($field, $storeId);\n+ break;\n+ }\n+ return $result;\n+ }\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-221 - block split invoicing for DE and UK |
21,241 | 17.09.2020 17:15:22 | 18,000 | d4e38f427d4b92a06e4d9adbe6a4ffd0e3fb30e7 | set the transaction ID on the invoice if one is created (with Charge on Order config) | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -486,6 +486,10 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$payment->setLastTransId($chargeId);\n$this->paymentRepository->save($payment);\n+\n+ if ($invoice = $payment->getCreatedInvoice()) {\n+ $invoice->setTransactionId($chargeId)->save();\n+ }\n}\n/**\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-239 - set the transaction ID on the invoice if one is created (with Charge on Order config) |
21,241 | 18.09.2020 17:34:13 | 18,000 | 503334193cc312cc5566885c5f4f72e7a2a46885 | don't show the Amazon Pay button when customer is not logged in, guest checkout is disabled, and Amazon Sign-in is disabled. | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -51,7 +51,7 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n}\n/**\n- * @return string\n+ * @return array\n*/\npublic function getConfig()\n{\n@@ -60,6 +60,7 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n'code' => \\Amazon\\PayV2\\Gateway\\Config\\Config::CODE,\n'is_method_available' => $this->amazonConfig->isPayButtonAvailableAsPaymentMethod(),\n'is_pay_only' => $this->amazonHelper->isPayOnly(),\n+ 'is_lwa_enabled' => $this->isLwaEnabled(),\n];\nreturn $config;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -22,7 +22,16 @@ define([\n], function ($, checkoutSessionConfigLoad, amazonStorage, url, amazonCheckout, customerData) {\n'use strict';\n- if (amazonStorage.isEnabled) {\n+ var cart = customerData.get('cart'),\n+ customer = customerData.get('customer'),\n+ canCheckoutWithAmazon = false;\n+\n+ // to use Amazon Pay: customer needs to be logged in, or guest checkout allowed, or Amazon Sign-in enabled\n+ if (customer().firstname || cart().isGuestCheckoutAllowed === true || amazonStorage.isLwaEnabled) {\n+ canCheckoutWithAmazon = true;\n+ }\n+\n+ if (amazonStorage.isEnabled && canCheckoutWithAmazon) {\n$.widget('amazon.AmazonButton', {\noptions: {\npayOnly: null,\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "@@ -29,8 +29,11 @@ define([\nreturn storage;\n};\n+ var isLwaEnabled = amazonPayV2Config.getValue('is_lwa_enabled');\n+\nreturn {\nisEnabled: isEnabled,\n+ isLwaEnabled: isLwaEnabled,\n/**\n* Is checkout using Amazon PAYV2?\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-233 - don't show the Amazon Pay button when customer is not logged in, guest checkout is disabled, and Amazon Sign-in is disabled. |
21,241 | 18.09.2020 18:13:17 | 18,000 | 6d330c7aa4eacd7af810009d8932e8c3d41ace31 | clean up reference to CV1 | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "namespace Amazon\\PayV2\\Model;\nuse Magento\\Store\\Model\\ScopeInterface;\n-use Amazon\\Core\\Helper\\Data as AmazonCoreHelper;\nclass AmazonConfig\n{\n@@ -59,13 +58,6 @@ class AmazonConfig\n*/\nprivate $remoteAddress;\n- /**\n- * @var AmazonCoreHelper\n- *\n- * Temporarily route any references to CV1 helper methods through here\n- */\n- private $coreHelper;\n-\n/**\n* AmazonConfig constructor.\n* @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n@@ -81,8 +73,7 @@ class AmazonConfig\n\\Magento\\Directory\\Model\\AllowedCountries $countriesAllowed,\n\\Magento\\Directory\\Model\\Config\\Source\\Country $countryConfig,\n\\Magento\\Framework\\Locale\\Resolver $localeResolver,\n- \\Magento\\Framework\\HTTP\\PhpEnvironment\\RemoteAddress $remoteAddress,\n- AmazonCoreHelper $coreHelper\n+ \\Magento\\Framework\\HTTP\\PhpEnvironment\\RemoteAddress $remoteAddress\n) {\n$this->storeManager = $storeManager;\n$this->scopeConfig = $scopeConfig;\n@@ -90,7 +81,6 @@ class AmazonConfig\n$this->countryConfig = $countryConfig;\n$this->localeResolver = $localeResolver;\n$this->remoteAddress = $remoteAddress;\n- $this->coreHelper = $coreHelper;\n}\n/**\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-252 - clean up reference to CV1 |
21,241 | 21.09.2020 10:43:42 | 18,000 | 1c51fb1f03a8ca4437c27e26e7049ecd46d854a3 | clean up unused carryover from CV1 Login | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/frontend/di.xml",
"new_path": "src/PayV2/etc/frontend/di.xml",
"diff": "<type name=\"Amazon\\Core\\Helper\\Data\">\n<plugin name=\"amazon_payv2_amazon_core_helper\" type=\"Amazon\\PayV2\\Plugin\\AmazonCoreHelperData\" sortOrder=\"1\" />\n</type>\n- <type name=\"Magento\\Checkout\\Model\\CompositeConfigProvider\">\n- <arguments>\n- <argument name=\"configProviders\" xsi:type=\"array\">\n- <item name=\"amazon_login_checkout_config_provider\" xsi:type=\"object\">Amazon\\Login\\Model\\CheckoutConfigProvider\\Proxy</item>\n- </argument>\n- </arguments>\n- </type>\n</config>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-252 - clean up unused carryover from CV1 Login |
21,241 | 22.09.2020 15:27:17 | 18,000 | 23bad5a75f6642c269c0baf33bcf1d80f5f37456 | Improved split invoicing block stolen from | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Config/Config.php",
"new_path": "src/PayV2/Gateway/Config/Config.php",
"diff": "@@ -9,6 +9,10 @@ use Amazon\\PayV2\\Model\\AmazonConfig;\nuse Magento\\Framework\\App\\Config\\ScopeConfigInterface;\nuse Magento\\Store\\Model\\ScopeInterface;\n+/**\n+ * Class Config\n+ * @package Amazon\\PayV2\\Gateway\\Config\n+ */\nclass Config extends \\Magento\\Payment\\Gateway\\Config\\Config\n{\nconst CODE = 'amazon_payment_v2';\n@@ -20,15 +24,31 @@ class Config extends \\Magento\\Payment\\Gateway\\Config\\Config\n*/\nprotected $amazonConfig;\n+ /**\n+ * @var \\Magento\\Framework\\App\\RequestInterface\n+ */\n+ protected $request;\n+\n+ /**\n+ * @var \\Magento\\Sales\\Api\\OrderRepositoryInterface\n+ */\n+ protected $orderRepository;\n+\n/**\n* @param AmazonConfig $amazonConfig\n* @param ScopeConfigInterface $scopeConfig\n+ * @param \\Magento\\Framework\\App\\RequestInterface $request\n+ * @param \\Magento\\Sales\\Api\\OrderRepositoryInterface $orderRepository\n*/\npublic function __construct(\nAmazonConfig $amazonConfig,\n- ScopeConfigInterface $scopeConfig\n+ ScopeConfigInterface $scopeConfig,\n+ \\Magento\\Framework\\App\\RequestInterface $request,\n+ \\Magento\\Sales\\Api\\OrderRepositoryInterface $orderRepository\n) {\n$this->amazonConfig = $amazonConfig;\n+ $this->request = $request;\n+ $this->orderRepository = $orderRepository;\nparent::__construct($scopeConfig, self::CODE);\n}\n@@ -38,6 +58,15 @@ class Config extends \\Magento\\Payment\\Gateway\\Config\\Config\n*/\nprotected function canCapturePartial($storeId = null)\n{\n+ // get the order store id if not provided\n+ if (empty($storeId)) {\n+ $orderId = $this->request->getParam('order_id');\n+ if ($orderId) {\n+ $order = $this->orderRepository->get($orderId);\n+ $storeId = $order->getStoreId();\n+ }\n+ }\n+\n$region = $this->amazonConfig->getPaymentRegion(ScopeInterface::SCOPE_STORE, $storeId);\nswitch ($region) {\ncase 'de':\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-221 - Improved split invoicing block stolen from ASD-321 |
21,241 | 22.09.2020 18:08:48 | 18,000 | ae65ef141884eecb55e2f13421074c6f158da9f5 | V2 implementation of adjustments for display currency use on partial capture/refund, and comments | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Request/AuthorizationSaleRequestBuilder.php",
"new_path": "src/PayV2/Gateway/Request/AuthorizationSaleRequestBuilder.php",
"diff": "@@ -56,12 +56,20 @@ class AuthorizationSaleRequestBuilder implements BuilderInterface\n} catch (NoSuchEntityException $e) {\n$amazonCheckoutSessionId = null;\n}\n+\n+ if ($payment->getAmazonDisplayInvoiceAmount()) {\n+ $total = $payment->getAmazonDisplayInvoiceAmount();\n+ }\n+ else {\n+ $total = $payment->getAmountOrdered();\n+ }\n+\n/* @var $payment \\Magento\\Sales\\Model\\Order\\Payment */\nreturn [\n'quote_id' => $payment->getOrder()->getQuoteId(),\n'amazon_checkout_session_id' => $amazonCheckoutSessionId,\n'charge_permission_id' => $payment->getAdditionalInformation('charge_permission_id'),\n- 'amount' => $buildSubject['amount'],\n+ 'amount' => $total,\n];\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"new_path": "src/PayV2/Gateway/Request/SettlementRequestBuilder.php",
"diff": "@@ -108,9 +108,16 @@ class SettlementRequestBuilder implements BuilderInterface\n$orderDO = $paymentDO->getOrder();\n$storeId = $orderDO->getStoreId();\n$order = $paymentDO->getPayment()->getOrder();\n+ $payment = $paymentDO->getPayment();\n$currencyCode = $order->getOrderCurrencyCode();\n- $total = $paymentDO->getPayment()->getAmountOrdered();\n+ if ($payment->getAmazonDisplayInvoiceAmount()) {\n+ $total = $payment->getAmazonDisplayInvoiceAmount();\n+ } elseif ($creditMemo = $payment->getCreditMemo()) {\n+ $total = $creditMemo->getGrandTotal();\n+ } else {\n+ $total = $payment->getAmountOrdered();\n+ }\n$data = [\n'store_id' => $storeId,\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Observer/OrderPaymentCapture.php",
"diff": "+<?php\n+/**\n+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\").\n+ * You may not use this file except in compliance with the License.\n+ * A copy of the License is located at\n+ *\n+ * http://aws.amazon.com/apache2.0\n+ *\n+ * or in the \"license\" file accompanying this file. This file is distributed\n+ * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n+ * express or implied. See the License for the specific language governing\n+ * permissions and limitations under the License.\n+ */\n+namespace Amazon\\PayV2\\Observer;\n+\n+use Magento\\Framework\\Event\\Observer;\n+use Magento\\Framework\\Event\\ObserverInterface;\n+\n+/**\n+ * Class OrderPaymentCapture\n+ * @package Amazon\\Payment\\Observer\n+ */\n+class OrderPaymentCapture implements ObserverInterface\n+{\n+ /**\n+ * @param Observer $observer\n+ */\n+ public function execute(Observer $observer)\n+ {\n+ $payment = $observer->getPayment();\n+ $invoice = $observer->getInvoice();\n+\n+ // set custom invoice amount on the payment in the display currency, as Magento does everything on the base currency\n+ $payment->setAmazonDisplayInvoiceAmount($invoice->getGrandTotal());\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/OrderCurrencyComment.php",
"new_path": "src/PayV2/Plugin/OrderCurrencyComment.php",
"diff": "@@ -34,10 +34,17 @@ class OrderCurrencyComment\n{\nif ($subject->getMethod() == Config::CODE) {\n$order = $subject->getOrder();\n- if ($order->getBaseCurrencyCode() != $order->getOrderOrderCurrencyCode()) {\n+ if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) {\n+ if ($subject->getOrder()->getPayment()->getCreditmemo()) {\n+ $displayCurrencyAmount = $subject->getCreditmemo()->getGrandTotal();\n+ }\n+ else {\n+ $displayCurrencyAmount = $subject->getOrder()->getPayment()->getAmazonDisplayInvoiceAmount() ?: $subject->getAmountOrdered();\n+ }\n$messagePrependTo = __(\n$messagePrependTo->getText(),\n- $order->getBaseCurrency()->formatTxt($order->getBaseGrandTotal()) .' ['. $order->formatPriceTxt($subject->getAmountOrdered()) .']'\n+ $order->getBaseCurrency()\n+ ->formatTxt($messagePrependTo->getArguments()[0]) .' ['. $order->formatPriceTxt($displayCurrencyAmount) .']'\n);\nreturn [$messagePrependTo];\n@@ -61,7 +68,7 @@ class OrderCurrencyComment\n&& $subject->getMessage()->getText() == 'Canceled order online')\n|| strpos($subject->getTransactionId(), '-void') !== FALSE\n) {\n- return $result .' ['. $order->formatPriceTxt($subject->getAmountOrdered()) .']';\n+ return $result .' ['. $order->formatPriceTxt($subject->getCreditmemo()->getGrandTotal()) .']';\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/events.xml",
"new_path": "src/PayV2/etc/events.xml",
"diff": "<event name=\"sales_quote_merge_after\">\n<observer name=\"amazon_payv2_sales_quote_merge_after\" instance=\"Amazon\\PayV2\\Observer\\SalesQuoteMergeAfter\"/>\n</event>\n+ <event name=\"sales_order_payment_capture\">\n+ <observer name=\"amazon_payment_order_payment_capture\" instance=\"Amazon\\PayV2\\Observer\\OrderPaymentCapture\" />\n+ </event>\n</config>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-221 - V2 implementation of ASD-321 adjustments for display currency use on partial capture/refund, and comments |
21,241 | 22.09.2020 18:24:29 | 18,000 | a9942a4f3dbc87a8a1dc68ec5cfd9bf4840ae6ea | Fix bug with JPY where it was not rounded for the completeCheckoutSession call | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"new_path": "src/PayV2/Model/Adapter/AmazonPayV2Adapter.php",
"diff": "@@ -370,10 +370,7 @@ class AmazonPayV2Adapter\npublic function completeCheckoutSession($storeId, $sessionId, $amount, $currencyCode)\n{\n$payload = [\n- 'chargeAmount' => [\n- 'amount' => $amount,\n- 'currencyCode' => $currencyCode,\n- ]\n+ 'chargeAmount' => $this->createPrice($amount, $currencyCode),\n];\n$rawResponse = $this->clientFactory->create($storeId)->completeCheckoutSession($sessionId, json_encode($payload));\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-221 - Fix bug with JPY where it was not rounded for the completeCheckoutSession call |
21,264 | 25.09.2020 01:30:52 | 0 | a8be44b95bdf4e67d0c9a1507635b97a50587511 | Version increase to 2.3.0 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -113,4 +113,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.5.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.2.0 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.3.0 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.2.0\",\n+ \"version\": \"2.3.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.2.0\",\n+ \"version\": \"2.3.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.2.0\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.3.0\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | Version increase to 2.3.0 |
21,261 | 25.09.2020 14:19:18 | -7,200 | 06ae6a85744192d269a9bac2c93da07b474ddece | Update Branch version table V2Checkout | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -112,5 +112,5 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n-| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.5.0 |\n+| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.7.0 |\n| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.3.0 |\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | Update Branch version table V2Checkout |
21,241 | 25.09.2020 18:31:23 | 18,000 | 66f4d0bc9043dd3eb66baa0de641931a89adeeac | pass guest checkout enabled value with Amazon config instead of relying on customer's cart | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Block/Config.php",
"new_path": "src/PayV2/Block/Config.php",
"diff": "@@ -61,6 +61,7 @@ class Config extends \\Magento\\Framework\\View\\Element\\Template\n'is_method_available' => $this->amazonConfig->isPayButtonAvailableAsPaymentMethod(),\n'is_pay_only' => $this->amazonHelper->isPayOnly(),\n'is_lwa_enabled' => $this->isLwaEnabled(),\n+ 'is_guest_checkout_enabled' => $this->amazonConfig->isGuestCheckoutEnabled(),\n];\nreturn $config;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -27,7 +27,7 @@ define([\ncanCheckoutWithAmazon = false;\n// to use Amazon Pay: customer needs to be logged in, or guest checkout allowed, or Amazon Sign-in enabled\n- if (customer().firstname || cart().isGuestCheckoutAllowed === true || amazonStorage.isLwaEnabled) {\n+ if (customer().firstname || amazonStorage.isGuestCheckoutEnabled || amazonStorage.isLwaEnabled) {\ncanCheckoutWithAmazon = true;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"new_path": "src/PayV2/view/frontend/web/js/model/storage.js",
"diff": "@@ -30,10 +30,12 @@ define([\n};\nvar isLwaEnabled = amazonPayV2Config.getValue('is_lwa_enabled');\n+ var isGuestCheckoutEnabled = amazonPayV2Config.getValue('is_guest_checkout_enabled');\nreturn {\nisEnabled: isEnabled,\nisLwaEnabled: isLwaEnabled,\n+ isGuestCheckoutEnabled: isGuestCheckoutEnabled,\n/**\n* Is checkout using Amazon PAYV2?\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-511 - pass guest checkout enabled value with Amazon config instead of relying on customer's cart |
21,241 | 30.09.2020 11:34:31 | 18,000 | 693775830a83676a28d3cc1892ac1ff0391f06ec | bypass cache check in DepersonalizeChecker | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Controller/Checkout/CompleteSession.php",
"new_path": "src/PayV2/Controller/Checkout/CompleteSession.php",
"diff": "@@ -84,6 +84,9 @@ class CompleteSession extends \\Magento\\Framework\\App\\Action\\Action\n{\n$scope = $this->storeManager->getStore()->getId();\ntry {\n+ // Bypass cache check in \\Magento\\PageCache\\Model\\DepersonalizeChecker\n+ $this->getRequest()->setParams(['ajax' => 1]);\n+\n$orderId = $this->amazonCheckoutSession->completeCheckoutSession();\nif (!$orderId) {\nthrow new \\Exception(__('Something went wrong. Please try again.'));\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-467 - bypass cache check in DepersonalizeChecker |
21,241 | 30.09.2020 15:48:39 | 18,000 | b2f2fb4c91b8042788decfdfba8cff1519e5993e | do not alter button visibility on Checkout page | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -56,7 +56,7 @@ define([\nsandbox: checkoutSessionConfig['sandbox'],\n});\n- $(this.options.hideIfUnavailable).show();\n+ this.options.placement !== \"Checkout\" && $(this.options.hideIfUnavailable).show();\n} else {\n$(this.options.hideIfUnavailable).hide();\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-490 - do not alter button visibility on Checkout page |
21,241 | 30.09.2020 16:36:46 | 18,000 | af76355d94b37de1f9ff264c33c0f2870d427ae2 | code style change for clarity | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"new_path": "src/PayV2/view/frontend/web/js/amazon-button.js",
"diff": "@@ -56,7 +56,9 @@ define([\nsandbox: checkoutSessionConfig['sandbox'],\n});\n- this.options.placement !== \"Checkout\" && $(this.options.hideIfUnavailable).show();\n+ if (this.options.placement !== \"Checkout\") {\n+ $(this.options.hideIfUnavailable).show();\n+ }\n} else {\n$(this.options.hideIfUnavailable).hide();\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-490 - code style change for clarity |
21,241 | 01.10.2020 14:34:49 | 18,000 | c265c910e5568806d62cc17f0bacb4e7a85dcbcf | remove validator referenced from CV1 that is no longer used | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -300,12 +300,6 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$magentoAddress = $this->addressHelper->convertToMagentoEntity($amazonAddress);\nif ($isShippingAddress) {\n- $validator = $this->validatorFactory->createValidator('amazon_address', 'on_select');\n-\n- if (!$validator->isValid($magentoAddress)) {\n- throw new ValidatorException(null, null, [$validator->getMessages()]);\n- }\n-\n$countryCollection = $this->countryCollectionFactory->create();\n$collectionSize = $countryCollection->loadByStore()\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-500 - remove validator referenced from CV1 that is no longer used |
21,241 | 02.10.2020 11:48:56 | 18,000 | 6b83b647b130cfd354dbc946b4d3d50914f50bbc | use V2 js method for determining if in Amazon checkout flow | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/frontend/web/js/view/checkout/summary/grand-total-mixin.js",
"new_path": "src/PayV2/view/frontend/web/js/view/checkout/summary/grand-total-mixin.js",
"diff": "@@ -11,7 +11,7 @@ define([\n* @return {Boolean}\n*/\nisBaseGrandTotalDisplayNeeded: function () {\n- if (!amazonStorage.isAmazonAccountLoggedIn()) {\n+ if (!amazonStorage.isAmazonCheckout()) {\nreturn this._super();\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-521 - use V2 js method for determining if in Amazon checkout flow |
21,261 | 12.10.2020 16:12:01 | -7,200 | cbdfd092580137dd00bd6ee3dca26e0f8c37ca52 | moved V2checkout install instructions pointer | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -42,7 +42,7 @@ The module can be either installed via Composer (recommended), or manually. The\nIn `magento-root`, execute:\n```\n-$ composer require amzn/amazon-pay-v2-magento-2-module\n+$ composer require amzn/amazon-payments-magento-2-plugin:dev-V2checkout\n$ bin/magento module:enable Amazon_PayV2 --clear-static-content\n```\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | moved V2checkout install instructions pointer |
21,270 | 15.10.2020 13:28:25 | 25,200 | b193e3c6b84d8af86770033c830004e6818bc530 | adds AP refund success message | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Gateway/Response/RefundHandler.php",
"new_path": "src/PayV2/Gateway/Response/RefundHandler.php",
"diff": "namespace Amazon\\PayV2\\Gateway\\Response;\nuse Magento\\Payment\\Gateway\\Response\\HandlerInterface;\n+use Magento\\Framework\\Message\\ManagerInterface;\nuse Amazon\\PayV2\\Gateway\\Helper\\SubjectReader;\nuse Amazon\\PayV2\\Model\\AsyncManagement;\n@@ -32,17 +33,25 @@ class RefundHandler implements HandlerInterface\n*/\nprivate $asyncManagement;\n+ /**\n+ * @var ManagerInterface\n+ */\n+ private $messageManager;\n+\n/**\n* SettlementHandler constructor.\n* @param SubjectReader $subjectReader\n* @param AsyncManagement $asyncManagement\n+ * @param ManagerInterface $messageManager\n*/\npublic function __construct(\nSubjectReader $subjectReader,\n- AsyncManagement $asyncManagement\n+ AsyncManagement $asyncManagement,\n+ ManagerInterface $messageManager\n) {\n$this->subjectReader = $subjectReader;\n$this->asyncManagement = $asyncManagement;\n+ $this->messageManager = $messageManager;\n}\n/**\n@@ -59,6 +68,8 @@ class RefundHandler implements HandlerInterface\n// Verify refund via async\n$this->asyncManagement->queuePendingRefund($payment->getOrder()->getId(), $response['refundId']);\n+\n+ $this->messageManager->addSuccessMessage(__('Amazon Pay refund successful.'));\n}\n}\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-394 adds AP refund success message |
21,270 | 16.10.2020 15:22:57 | 25,200 | 8c2257119dd91744e4f3b4a62440e390f602eb12 | fixes declined orders after AP returns to complete checkout | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Controller/Checkout/CompleteSession.php",
"new_path": "src/PayV2/Controller/Checkout/CompleteSession.php",
"diff": "@@ -86,9 +86,14 @@ class CompleteSession extends \\Magento\\Framework\\App\\Action\\Action\ntry {\n// Bypass cache check in \\Magento\\PageCache\\Model\\DepersonalizeChecker\n$this->getRequest()->setParams(['ajax' => 1]);\n+ $result = $this->amazonCheckoutSession->completeCheckoutSession();\n+ if (!$result['success']) {\n+ $this->amazonCheckoutSession->clearCheckoutSessionId();\n+ $this->messageManager->addErrorMessage($result['message']);\n- $orderId = $this->amazonCheckoutSession->completeCheckoutSession();\n- if (!$orderId) {\n+ return $this->_redirect('checkout/cart', ['_scope' => $scope]);\n+ }\n+ else if(!$result['order_id']) {\nthrow new \\Exception(__('Something went wrong. Please try again.'));\n}\n$this->updateVersionCookie();\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -522,12 +522,30 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nif (!$cart->getCustomer()->getId()) {\n$cart->setCheckoutMethod(\\Magento\\Quote\\Api\\CartManagementInterface::METHOD_GUEST);\n}\n- $result = $this->cartManagement->placeOrder($cart->getId());\n- $order = $this->orderRepository->get($result);\n+\n+ // check the Amazon session one last time before placing the order\n+ $amazonSession = $this->amazonAdapter->getCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId());\n+ if ($amazonSession['statusDetails']['state'] == 'Canceled') {\n+ return [\n+ 'success' => false,\n+ 'message' => $amazonSession['statusDetails']['reasonDescription'],\n+ ];\n+ }\n+\n+ $orderId = $this->cartManagement->placeOrder($cart->getId());\n+ $order = $this->orderRepository->get($orderId);\n+ $result = [\n+ 'success' => true,\n+ 'order_id' => $orderId,\n+ ];\n+\n$amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getGrandTotal() , $cart->getQuoteCurrencyCode());\nif (array_key_exists('status', $amazonResult) && $amazonResult['status'] != 200) {\n// Something went wrong, but the order has already been placed\n- return $result;\n+ return [\n+ 'success' => false,\n+ 'message' => $amazonResult['message'],\n+ ];\n}\n$chargeId = $amazonResult['chargeId'];\n$amazonCharge = $this->amazonAdapter->getCharge($cart->getStoreId(), $chargeId);\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-529 fixes declined orders after AP returns to complete checkout |
21,270 | 19.10.2020 12:58:05 | 25,200 | 6e4955a68b6d35e287b35867bf5824e6cc50dc3d | displays correct messaging for canceled check | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -528,7 +528,7 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\nif ($amazonSession['statusDetails']['state'] == 'Canceled') {\nreturn [\n'success' => false,\n- 'message' => $amazonSession['statusDetails']['reasonDescription'],\n+ 'message' => $this->getCanceledMessage($amazonSession),\n];\n}\n@@ -581,4 +581,20 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n}\nreturn $result;\n}\n+\n+ /**\n+ * @param $amazonSession\n+ * @return \\Magento\\Framework\\Phrase|mixed\n+ */\n+ protected function getCanceledMessage($amazonSession)\n+ {\n+ if ($amazonSession['statusDetails']['reasonCode'] == 'BuyerCanceled') {\n+ return __(\"This transaction was cancelled. Please try again.\");\n+ }\n+ else if ($amazonSession['statusDetails']['reasonCode'] == 'Declined') {\n+ return __(\"This transaction was declined. Please try again using a different payment method.\");\n+ }\n+\n+ return $amazonSession['statusDetails']['reasonDescription'];\n+ }\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-529 displays correct messaging for canceled check |
21,264 | 20.10.2020 00:54:04 | 0 | 5254b26234b6014f88ebf23e39e880fae967356d | Version Increase, to 2.4.0. Fixes issue with declined transactions displaying incorrectly in Magento Admin. | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -113,4 +113,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.7.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.3.0 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.4.0 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.3.0\",\n+ \"version\": \"2.4.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.3.0\",\n+ \"version\": \"2.4.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.3.0\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.4.0\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | Version Increase, to 2.4.0. Fixes issue with declined transactions displaying incorrectly in Magento Admin. |
21,241 | 29.10.2020 14:41:09 | 18,000 | 2bd1c4e456053ac496eb964d91255e654c14cef9 | Add support for multicurrency to CV2 | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/AmazonConfig.php",
"new_path": "src/PayV2/Model/AmazonConfig.php",
"diff": "@@ -196,7 +196,9 @@ class AmazonConfig\n*/\npublic function isCurrentCurrencySupportedByAmazon($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n{\n- return $this->getCurrentCurrencyCode() == $this->getCurrencyCode($scope, $scopeCode);\n+ $regionCurrency = $this->getCurrentCurrencyCode();\n+ $currentCurrency = $this->getCurrencyCode($scope, $scopeCode);\n+ return ($currentCurrency === $regionCurrency) || $this->canUseCurrency($regionCurrency);\n}\n/**\n@@ -216,6 +218,31 @@ class AmazonConfig\nreturn array_key_exists($paymentRegion, $currencyCodeMap) ? $currencyCodeMap[$paymentRegion] : '';\n}\n+ /**\n+ * @param string $currencyCode\n+ * @param string $scope\n+ * @param string $scopeCode\n+ * @return boolean\n+ */\n+ public function canUseCurrency($currencyCode, $scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ $result = false;\n+ if ($this->multiCurrencyEnabled($scope, $scopeCode)) {\n+ $result = in_array($currencyCode, $this->getValidCurrencies($scope, $scopeCode));\n+ }\n+ return $result;\n+ }\n+\n+ /**\n+ * @param string $scope\n+ * @param string $scopeCode\n+ * @return array\n+ */\n+ public function getValidCurrencies($scope = ScopeInterface::SCOPE_STORE, $scopeCode = null)\n+ {\n+ return explode(',', $this->scopeConfig->getValue('multicurrency/currencies', $scope, $scopeCode));\n+ }\n+\n/**\n* Is debug logging enabled?\n*\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"diff": "<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n<actionGroup name=\"AmazonLoginActionGroup\">\n<waitForPageLoad stepKey=\"waitForAmazonLoginPageLoad\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.emailField}}\" stepKey=\"waitForEmailField\"/>\n<fillField selector=\"{{AmazonPageSection.emailField}}\" userInput=\"{{AmazonAccount.email}}\" stepKey=\"fillAmazonPageEmailField\"/>\n<fillField selector=\"{{AmazonPageSection.passwordField}}\" userInput=\"{{AmazonAccount.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n<click selector=\"{{AmazonPageSection.signInButton}}\" stepKey=\"clickAmazonPageSignInButton\"/>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Data/AmazonCountryData.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<entities xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd\">\n+ <entity name=\"SingleCountryAllowConfig\" type=\"amazon_country_allow_config\">\n+ <requiredEntity type=\"allow\">SingleCountryAllowValue</requiredEntity>\n+ </entity>\n+ <entity name=\"SingleCountryAllowValue\" type=\"allow\">\n+ <data key=\"value\">US</data>\n+ </entity>\n+ <entity name=\"DefaultCountryAllowConfig\" type=\"default_amazon_country_allow_config\">\n+ <requiredEntity type=\"amazonCountryAllowFlagZero\">DefaultCountryAllowFlagZero</requiredEntity>\n+ </entity>\n+ <entity name=\"DefaultCountryAllowFlagZero\" type=\"amazonCountryAllowFlagZero\">\n+ <data key=\"value\">1</data>\n+ </entity>\n+</entities>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Data/AmazonCurrencyData.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<entities xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd\">\n+ <entity name=\"AmazonAllowCurrencyValue\" type=\"allow\">\n+ <array key=\"value\">\n+ <item>USD</item>\n+ <item>EUR</item>\n+ </array>\n+ </entity>\n+ <entity name=\"AmazonAllowMultiCurrencyValue\" type=\"allow\">\n+ <array key=\"value\">\n+ <item>USD</item>\n+ <item>EUR</item>\n+ <item>GBP</item>\n+ <item>JPY</item>\n+ <item>NOK</item>\n+ <item>CZK</item>\n+ <item>EUR</item>\n+ </array>\n+ </entity>\n+ <entity name=\"EUAmazonCurrencyConfig\" type=\"amazon_currency_config\">\n+ <requiredEntity type=\"base\">EUAmazonBaseCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"default\">EUAmazonDefaultCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"allow\">AmazonAllowCurrencyValue</requiredEntity>\n+ </entity>\n+ <entity name=\"EUAmazonBaseCurrencyValue\" type=\"base\">\n+ <data key=\"value\">EUR</data>\n+ </entity>\n+ <entity name=\"EUAmazonDefaultCurrencyValue\" type=\"default\">\n+ <data key=\"value\">EUR</data>\n+ </entity>\n+ <entity name=\"DefaultAmazonCurrencyConfig\" type=\"default_amazon_currency_config\">\n+ <requiredEntity type=\"amazonCurrencyBaseFlagZero\">DefaultAmazonCurrencyBaseFlagZero</requiredEntity>\n+ <requiredEntity type=\"amazonCurrencyDefaultFlagZero\">DefaultAmazonCurrencyDefaultFlagZero</requiredEntity>\n+ <requiredEntity type=\"amazonCurrencyAllowFlagZero\">DefaultAmazonCurrencyAllowFlagZero</requiredEntity>\n+ </entity>\n+ <entity name=\"DefaultAmazonCurrencyBaseFlagZero\" type=\"amazonCurrencyBaseFlagZero\">\n+ <data key=\"value\">1</data>\n+ </entity>\n+ <entity name=\"DefaultAmazonCurrencyDefaultFlagZero\" type=\"amazonCurrencyDefaultFlagZero\">\n+ <data key=\"value\">1</data>\n+ </entity>\n+ <entity name=\"DefaultAmazonCurrencyAllowFlagZero\" type=\"amazonCurrencyAllowFlagZero\">\n+ <data key=\"value\">1</data>\n+ </entity>\n+</entities>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Data/AmazonPaymentConfigData.xml",
"new_path": "src/PayV2/Test/Mftf/Data/AmazonPaymentConfigData.xml",
"diff": "<entity name=\"SampleAmazonPaymentV2Sandbox\" type=\"sandbox\">\n<data key=\"value\">1</data>\n</entity>\n+\n+ <entity name=\"EUAmazonPaymentV2Config\" type=\"amazon_payment_v2_config\">\n+ <requiredEntity type=\"api_version\">SampleAmazonPaymentV2ApiVersion</requiredEntity>\n+ <requiredEntity type=\"active\">SampleAmazonPaymentV2Active</requiredEntity>\n+ <requiredEntity type=\"private_key\">EUAmazonPaymentV2PrivateKey</requiredEntity>\n+ <requiredEntity type=\"public_key_id\">EUAmazonPaymentV2PublicKeyId</requiredEntity>\n+ <requiredEntity type=\"merchant_id\">EUAmazonPaymentV2MerchantId</requiredEntity>\n+ <requiredEntity type=\"store_id\">EUAmazonPaymentV2StoreId</requiredEntity>\n+ <requiredEntity type=\"payment_region\">EUAmazonPaymentV2PaymentRegion</requiredEntity>\n+ <requiredEntity type=\"sandbox\">SampleAmazonPaymentV2Sandbox</requiredEntity>\n+ </entity>\n+ <entity name=\"EUAmazonPaymentV2PrivateKey\" type=\"private_key\">\n+ <data key=\"value\">{{_CREDS.amazon/v2_eu_private_key}}</data>\n+ </entity>\n+ <entity name=\"EUAmazonPaymentV2PublicKeyId\" type=\"public_key_id\">\n+ <data key=\"value\">{{_CREDS.amazon/v2_eu_public_key_id}}</data>\n+ </entity>\n+ <entity name=\"EUAmazonPaymentV2MerchantId\" type=\"merchant_id\">\n+ <data key=\"value\">{{_CREDS.amazon/v2_eu_merchant_id}}</data>\n+ </entity>\n+ <entity name=\"EUAmazonPaymentV2StoreId\" type=\"store_id\">\n+ <data key=\"value\">{{_CREDS.amazon/v2_eu_store_id}}</data>\n+ </entity>\n+ <entity name=\"EUAmazonPaymentV2PaymentRegion\" type=\"payment_region\">\n+ <data key=\"value\">{{_CREDS.amazon/v2_eu_region}}</data>\n+ </entity>\n+ <entity name=\"SampleAmazonPaymentV2Sandbox\" type=\"sandbox\">\n+ <data key=\"value\">1</data>\n+ </entity>\n</entities>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Metadata/AmazonCountryConfigMeta.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<operations xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:DataGenerator/etc/dataOperation.xsd\">\n+ <operation name=\"AmazonV2CountryAllowConfig\" dataType=\"amazon_country_allow_config\" type=\"create\" auth=\"adminFormKey\" url=\"/admin/system_config/save/section/general/\" method=\"POST\">\n+ <object key=\"groups\" dataType=\"amazon_country_allow_config\">\n+ <object key=\"country\" dataType=\"amazon_country_allow_config\">\n+ <object key=\"fields\" dataType=\"amazon_country_allow_config\">\n+ <object key=\"allow\" dataType=\"allow\">\n+ <field key=\"value\">string</field>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </operation>\n+ <operation name=\"DefaultAmazonV2CountryAllowConfig\" dataType=\"default_amazon_country_allow_config\" type=\"create\" auth=\"adminFormKey\" url=\"/admin/system_config/save/section/general/\" method=\"POST\">\n+ <object key=\"groups\" dataType=\"default_amazon_country_allow_config\">\n+ <object key=\"country\" dataType=\"default_amazon_country_allow_config\">\n+ <object key=\"fields\" dataType=\"default_amazon_country_allow_config\">\n+ <object key=\"allow\" dataType=\"default_amazon_country_allow_config\">\n+ <object key=\"inherit\" dataType=\"amazonCountryAllowFlagZero\">\n+ <field key=\"value\">integer</field>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </operation>\n+</operations>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Metadata/AmazonCurrencyConfigMeta.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<operations xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:DataGenerator/etc/dataOperation.xsd\">\n+ <operation name=\"AmazonV2CurrencyConfig\" dataType=\"amazon_currency_config\" type=\"create\" auth=\"adminFormKey\" url=\"/admin/system_config/save/section/currency/\" method=\"POST\">\n+ <object key=\"groups\" dataType=\"amazon_currency_config\">\n+ <object key=\"options\" dataType=\"amazon_currency_config\">\n+ <object key=\"fields\" dataType=\"amazon_currency_config\">\n+ <object key=\"base\" dataType=\"base\">\n+ <field key=\"value\">string</field>\n+ </object>\n+ <object key=\"default\" dataType=\"default\">\n+ <field key=\"value\">string</field>\n+ </object>\n+ <object key=\"allow\" dataType=\"allow\">\n+ <array key=\"value\">\n+ <value>string</value>\n+ </array>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </operation>\n+ <operation name=\"DefaultAmazonV2CurrencyConfig\" dataType=\"default_amazon_currency_config\" type=\"create\" auth=\"adminFormKey\" url=\"/admin/system_config/save/section/currency/\" method=\"POST\">\n+ <object key=\"groups\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"options\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"fields\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"base\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"inherit\" dataType=\"amazonCurrencyBaseFlagZero\">\n+ <field key=\"value\">integer</field>\n+ </object>\n+ </object>\n+ <object key=\"default\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"inherit\" dataType=\"amazonCurrencyDefaultFlagZero\">\n+ <field key=\"value\">integer</field>\n+ </object>\n+ </object>\n+ <object key=\"allow\" dataType=\"default_amazon_currency_config\">\n+ <object key=\"inherit\" dataType=\"amazonCurrencyAllowFlagZero\">\n+ <field key=\"value\">integer</field>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </object>\n+ </operation>\n+</operations>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Metadata/AmazonPaymentV2ConfigMeta.xml",
"new_path": "src/PayV2/Test/Mftf/Metadata/AmazonPaymentV2ConfigMeta.xml",
"diff": "</object>\n</object>\n</object>\n+ <object key=\"options\" dataType=\"amazon_payment_config_state\">\n+ <object key=\"fields\" dataType=\"amazon_payment_config_state\">\n+ <object key=\"active\" dataType=\"amazon_pay_active\">\n+ <field key=\"value\">string</field>\n+ </object>\n+ <object key=\"lwa_enabled\" dataType=\"lwa_enabled\">\n+ <field key=\"value\">string</field>\n+ </object>\n+ </object>\n+ </object>\n</object>\n</object>\n</operation>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonMulticurrencyCheckoutSuccessV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonMulticurrencyCheckoutSuccessV2\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Multicurrency Checkout\"/>\n+ <title value=\"Amazon Multicurrency Checkout Success V2\"/>\n+ <description value=\"User should be able to checkout with Amazon Pay.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ <group value=\"amazon_pay_v2_multicurrency\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"EUAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\" before=\"flushCache\"/>\n+ <createData entity=\"EUAmazonCurrencyConfig\" stepKey=\"SampleAmazonCurrencyConfig\" before=\"flushCache\"/>\n+ <!-- set default currency to one supported for multicurrency -->\n+ <magentoCLI command=\"config:set currency/options/default USD\" stepKey=\"setDefaultCurrency\" before=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <createData entity=\"DefaultAmazonCurrencyConfig\" stepKey=\"DefaultAmazonCurrencyConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"guestPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successGuestCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ </test>\n+</tests>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/config.xml",
"new_path": "src/PayV2/etc/config.xml",
"diff": "</minify_exclude>\n</js>\n</dev>\n+ <multicurrency>\n+ <regions>uk,de</regions>\n+ <currencies>AUD,GBP,DKK,EUR,HKD,JPY,NZD,NOK,ZAR,SEK,CHF,USD</currencies>\n+ </multicurrency>\n<payment>\n<amazon_payment_v2>\n<active>0</active>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/view/adminhtml/web/js/simplepath-mixin.js",
"new_path": "src/PayV2/view/adminhtml/web/js/simplepath-mixin.js",
"diff": "@@ -28,8 +28,6 @@ define([\n}\nvar apiVersion = $apiSelector.val();\nif (apiVersion > 1) {\n- $('#row_payment_' + country + '_amazon_payment_advanced_sales_options_multicurrency').hide();\n-\nGrandClass.prototype.initObservable.apply(this, arguments);\n} else {\nthis._super();\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-235 - Add support for multicurrency to CV2 |
21,241 | 30.10.2020 16:18:21 | 18,000 | 00ff2185e78520a7fa9a75d83fac06b21a904a80 | add tests for multicurrency in CV2 | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Data/AmazonCurrencyData.xml",
"new_path": "src/PayV2/Test/Mftf/Data/AmazonCurrencyData.xml",
"diff": "<item>NOK</item>\n<item>CZK</item>\n<item>EUR</item>\n+ <item>CZK</item>\n</array>\n</entity>\n<entity name=\"EUAmazonCurrencyConfig\" type=\"amazon_currency_config\">\n<requiredEntity type=\"default\">EUAmazonDefaultCurrencyValue</requiredEntity>\n<requiredEntity type=\"allow\">AmazonAllowCurrencyValue</requiredEntity>\n</entity>\n+ <entity name=\"EUAmazonMultiCurrencyConfig\" type=\"amazon_currency_config\">\n+ <requiredEntity type=\"base\">EUAmazonBaseCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"default\">EUAmazonDefaultMultiCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"allow\">AmazonAllowMultiCurrencyValue</requiredEntity>\n+ </entity>\n+ <entity name=\"EUAmazonInvalidMultiCurrencyConfig\" type=\"amazon_currency_config\">\n+ <requiredEntity type=\"base\">EUAmazonBaseCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"default\">EUAmazonNoMultiCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"allow\">AmazonAllowMultiCurrencyValue</requiredEntity>\n+ </entity>\n<entity name=\"EUAmazonBaseCurrencyValue\" type=\"base\">\n<data key=\"value\">EUR</data>\n</entity>\n<entity name=\"EUAmazonDefaultCurrencyValue\" type=\"default\">\n<data key=\"value\">EUR</data>\n</entity>\n+ <entity name=\"EUAmazonMultiCurrencyValue\" type=\"default\">\n+ <data key=\"value\">USD</data>\n+ </entity>\n+ <entity name=\"EUAmazonNoMultiCurrencyValue\" type=\"default\">\n+ <data key=\"value\">CZK</data>\n+ </entity>\n<entity name=\"DefaultAmazonCurrencyConfig\" type=\"default_amazon_currency_config\">\n<requiredEntity type=\"amazonCurrencyBaseFlagZero\">DefaultAmazonCurrencyBaseFlagZero</requiredEntity>\n<requiredEntity type=\"amazonCurrencyDefaultFlagZero\">DefaultAmazonCurrencyDefaultFlagZero</requiredEntity>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutDisabledNoButtonV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutDisabledNoButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Button\"/>\n+ <title value=\"Amazon Checkout Disabled No Button V2\"/>\n+ <description value=\"Amazon Button should not be present on checkout when disabled.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_button\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct\"/>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\"/>\n+ <magentoCLI command=\"config:set payment/amazon_payment_v2/active 0\" stepKey=\"disableAmazonPay\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <!--Go to product page-->\n+ <actionGroup ref=\"StorefrontOpenProductPageActionGroup\" stepKey=\"openProductStoreFront\">\n+ <argument name=\"productUrl\" value=\"$$createSimpleProduct.custom_attributes[url_key]$$\"/>\n+ </actionGroup>\n+ <!--Click on Add To Cart button-->\n+ <actionGroup ref=\"StorefrontAddToTheCartActionGroup\" stepKey=\"clickOnAddToCartButton\"/>\n+ <!--Go to checkout-->\n+ <actionGroup ref=\"GoToCheckoutFromMinicartActionGroup\" stepKey=\"goToCheckoutFromMiniCart\"/>\n+ <!--Verify we don't see either Amazon Button V2 or V1 button-->\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"dontSeeEnabledAmazonButton\"/>\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v1Checkout}}\" stepKey=\"dontSeeDisabledAmazonButton\"/>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutMulticurrencyCurrencyNoButtonV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutMulticurrencyCurrencyNoButtonV2\" extends=\"AmazonCheckoutDisabledNoButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Multicurrency Checkout No Button\"/>\n+ <title value=\"Amazon Multicurrency Checkout No Button V2\"/>\n+ <description value=\"User should not be able to checkout with Amazon Pay when not in an allowed multi-currency region.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ <group value=\"amazon_pay_v2_multicurrency\"/>\n+ </annotations>\n+\n+ <before>\n+ <!-- override config so Amazon Pay is active -->\n+ <magentoCLI command=\"config:set payment/amazon_payment_v2/active 1\" stepKey=\"disableAmazonPay\" before=\"flushCache\"/>\n+\n+ <createData entity=\"EUAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\" before=\"flushCache\"/>\n+ <createData entity=\"EUAmazonInvalidMultiCurrencyConfig\" stepKey=\"SampleAmazonCurrencyConfig\" before=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <createData entity=\"DefaultAmazonCurrencyConfig\" stepKey=\"DefaultAmazonCurrencyConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutMulticurrencyDisabledNoButtonV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutMulticurrencyDisabledNoButtonV2\" extends=\"AmazonCheckoutDisabledNoButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Checkout Multicurrency Currency No Button\"/>\n+ <title value=\"Amazon Checkout Multicurrency Currency No Button V2\"/>\n+ <description value=\"User should not be able to checkout with Amazon Pay when not using an allowed multi-currency currency.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ <group value=\"amazon_pay_v2_multicurrency\"/>\n+ </annotations>\n+\n+ <before>\n+ <!-- override config so Amazon Pay is active -->\n+ <magentoCLI command=\"config:set payment/amazon_payment_v2/active 1\" stepKey=\"disableAmazonPay\" before=\"flushCache\"/>\n+\n+ <createData entity=\"EUAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\" before=\"flushCache\"/>\n+ <createData entity=\"EUAmazonMultiCurrencyConfig\" stepKey=\"SampleAmazonCurrencyConfig\" before=\"flushCache\"/>\n+ <!-- disable multicurrency -->\n+ <magentoCLI command=\"config:set payment/amazon_payment/multicurrency 0\" stepKey=\"setMulticurrency\" before=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <createData entity=\"DefaultAmazonCurrencyConfig\" stepKey=\"DefaultAmazonCurrencyConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+ </test>\n+</tests>\n"
},
{
"change_type": "RENAME",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonMulticurrencyCheckoutSuccessV2Test.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutMulticurrencySuccessV2Test.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n- <test name=\"AmazonMulticurrencyCheckoutSuccessV2\" extends=\"AmazonCheckoutButtonV2\">\n+ <test name=\"AmazonCheckoutMulticurrencySuccessV2\" extends=\"AmazonCheckoutButtonV2\">\n<annotations>\n- <stories value=\"Amazon Multicurrency Checkout\"/>\n- <title value=\"Amazon Multicurrency Checkout Success V2\"/>\n- <description value=\"User should be able to checkout with Amazon Pay.\"/>\n+ <stories value=\"Amazon Checkout Multicurrency\"/>\n+ <title value=\"Amazon Checkout Multicurrency Success V2\"/>\n+ <description value=\"User should be able to checkout with Amazon Pay when multicurrency is enabled and they are using a supported currency.\"/>\n<severity value=\"CRITICAL\"/>\n<group value=\"amazon_pay_v2\"/>\n<group value=\"amazon_pay_v2_checkout\"/>\n<createData entity=\"EUAmazonCurrencyConfig\" stepKey=\"SampleAmazonCurrencyConfig\" before=\"flushCache\"/>\n<!-- set default currency to one supported for multicurrency -->\n<magentoCLI command=\"config:set currency/options/default USD\" stepKey=\"setDefaultCurrency\" before=\"flushCache\"/>\n+ <!-- disable multicurrency -->\n+ <magentoCLI command=\"config:set payment/amazon_payment/multicurrency 1\" stepKey=\"setMulticurrency\" before=\"flushCache\"/>\n</before>\n<after>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-236 - add tests for multicurrency in CV2 |
21,261 | 02.11.2020 11:06:56 | -3,600 | 6d99ce98f79eb5ba982f99681e65ea94c19976c6 | version increase to 2.5.0 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -17,7 +17,7 @@ This module will enable \"Amazon Pay Checkout v2\" on your Magento 2 installation.\nAmazon Pay offers a familiar and convenient buying experience that can help your customers spend more time shopping and less time checking out. Amazon Pay is used by large and small companies. From years of shopping safely with Amazon, customers trust their personal information will remain secure and know many transactions are covered by the Amazon A-to-z Guarantee. Businesses have the reassurance of our advanced fraud protection and payment protection policy.\nRequirements:\n-* Magento minimum version requirement: 2.4.0 and above\n+* Magento minimum version requirement: 2.5.0 and above\n* Amazon Pay plugin minimum version requirement: 4.0.2 and above\n* Supported PHP versions: 7.3 and 7.4\n@@ -112,5 +112,5 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n-| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.8.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.4.0 |\n+| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.9.0 |\n+| 2.5.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.5.0 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.4.0\",\n+ \"version\": \"2.5.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.4.0\",\n+ \"version\": \"2.5.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.4.0\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.5.0\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | version increase to 2.5.0 |
21,261 | 02.11.2020 12:15:51 | -3,600 | 0466ecffc4ff9907c6f6e56306596c15905d78f7 | revert m2 minimum version required | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -17,7 +17,7 @@ This module will enable \"Amazon Pay Checkout v2\" on your Magento 2 installation.\nAmazon Pay offers a familiar and convenient buying experience that can help your customers spend more time shopping and less time checking out. Amazon Pay is used by large and small companies. From years of shopping safely with Amazon, customers trust their personal information will remain secure and know many transactions are covered by the Amazon A-to-z Guarantee. Businesses have the reassurance of our advanced fraud protection and payment protection policy.\nRequirements:\n-* Magento minimum version requirement: 2.5.0 and above\n+* Magento minimum version requirement: 2.4.0 and above\n* Amazon Pay plugin minimum version requirement: 4.0.2 and above\n* Supported PHP versions: 7.3 and 7.4\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | revert m2 minimum version required |
21,261 | 02.11.2020 12:20:24 | -3,600 | 4fc3dc65f5e9dff166f782f067fb0abef909699c | update branch information table | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -113,4 +113,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.9.0 |\n-| 2.5.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.5.0 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.5.0 |\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | update branch information table |
21,241 | 03.11.2020 13:40:00 | 21,600 | 73f8eb94be6492e678811161b34e953c44080bac | replace MFTF waitForPageLoad which doesn't work correctly on Amazon hosted pages. Using 1 second hard wait because MFTF doesn't support codeceptions WaitForElementClickable | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"diff": "<fillField selector=\"{{AmazonPageSection.emailField}}\" userInput=\"{{AmazonAccount.email}}\" stepKey=\"fillAmazonPageEmailField\"/>\n<fillField selector=\"{{AmazonPageSection.passwordField}}\" userInput=\"{{AmazonAccount.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n<click selector=\"{{AmazonPageSection.signInButton}}\" stepKey=\"clickAmazonPageSignInButton\"/>\n- <waitForPageLoad stepKey=\"waitForAmazonPageLoad\"/>\n<!--Verify successful login by the presence of the checkout button-->\n- <seeElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"seeAmazonCheckoutButton\"/>\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"seeAmazonCheckoutButton\"/>\n</actionGroup>\n</actionGroups>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonShippingAddressTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonShippingAddressTest.xml",
"diff": "<actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n<!--Change shipping address-->\n<click selector=\"{{AmazonCheckoutSection.editShippingButton}}\" stepKey=\"clickAmazonEditShippingButton\"/>\n- <waitForPageLoad stepKey=\"waitForAmazonEditShippingPageLoad\"/>\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.changeAddressButton}}\" stepKey=\"waitForAmazonEditShippingPageLoad\"/>\n<click selector=\"{{AmazonPageSection.changeAddressButton}}\" stepKey=\"clickChangeAmazonAddressButton\"/>\n<click selector=\"{{AmazonPageSection.notSelectedAddress}}\" stepKey=\"clickNotSelectedAmazonAddress\"/>\n<click selector=\"{{AmazonPageSection.useAddressButton}}\" stepKey=\"clickUseAddressButton\"/>\n- <waitForPageLoad stepKey=\"waitForAmazonChangedShippingPageLoad\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForAmazonChangedShippingPageLoad\"/>\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate2\"/>\n<!--Come back to checkout with changed address-->\n<actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"ChangedAmazonCheckoutActionGroup\"/>\n</test>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-236 - replace MFTF waitForPageLoad which doesn't work correctly on Amazon hosted pages. Using 1 second hard wait because MFTF doesn't support codeceptions WaitForElementClickable |
21,241 | 04.11.2020 17:35:29 | 21,600 | 0e28a85c751c76a8a7a7efa5226dd3a63dd1dace | create base set of tests for CV2 Login with Amazon | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginActionGroup.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n<actionGroup name=\"AmazonLoginActionGroup\">\n- <waitForPageLoad stepKey=\"waitForAmazonLoginPageLoad\"/>\n<waitForElement selector=\"{{AmazonPageSection.emailField}}\" stepKey=\"waitForEmailField\"/>\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate1\"/>\n<fillField selector=\"{{AmazonPageSection.emailField}}\" userInput=\"{{AmazonAccount.email}}\" stepKey=\"fillAmazonPageEmailField\"/>\n<fillField selector=\"{{AmazonPageSection.passwordField}}\" userInput=\"{{AmazonAccount.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n<click selector=\"{{AmazonPageSection.signInButton}}\" stepKey=\"clickAmazonPageSignInButton\"/>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonLoginOnlyActionGroup.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n+ <actionGroup name=\"AmazonLoginOnlyActionGroup\">\n+ <waitForElement selector=\"{{AmazonPageSection.emailField}}\" stepKey=\"waitForEmailField\"/>\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate1\"/>\n+ <fillField selector=\"{{AmazonPageSection.emailField}}\" userInput=\"{{AmazonAccount.email}}\" stepKey=\"fillAmazonPageEmailField\"/>\n+ <fillField selector=\"{{AmazonPageSection.passwordField}}\" userInput=\"{{AmazonAccount.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n+ <click selector=\"{{AmazonPageSection.signInButton}}\" stepKey=\"clickAmazonPageSignInButton\"/>\n+ <!--Verify successful login by the presence of the continue button-->\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate2\"/>\n+ <waitForElement selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"seeAmazonConsentButton\"/>\n+ </actionGroup>\n+</actionGroups>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Data/AmazonPaymentConfigData.xml",
"new_path": "src/PayV2/Test/Mftf/Data/AmazonPaymentConfigData.xml",
"diff": "<requiredEntity type=\"store_id\">SampleAmazonPaymentV2StoreId</requiredEntity>\n<requiredEntity type=\"payment_region\">SampleAmazonPaymentV2PaymentRegion</requiredEntity>\n<requiredEntity type=\"sandbox\">SampleAmazonPaymentV2Sandbox</requiredEntity>\n+ <requiredEntity type=\"v2_lwa_enabled\">SampleAmazonPaymentV2LwaDisabled</requiredEntity>\n</entity>\n<entity name=\"SampleAmazonPaymentV2ApiVersion\" type=\"api_version\">\n<data key=\"value\">2</data>\n<entity name=\"SampleAmazonPaymentV2Sandbox\" type=\"sandbox\">\n<data key=\"value\">1</data>\n</entity>\n+ <entity name=\"SampleAmazonPaymentV2LwaEnabled\" type=\"v2_lwa_enabled\">\n+ <data key=\"value\">1</data>\n+ </entity>\n+ <entity name=\"SampleAmazonPaymentV2LwaDisabled\" type=\"v2_lwa_enabled\">\n+ <data key=\"value\">0</data>\n+ </entity>\n<entity name=\"EUAmazonPaymentV2Config\" type=\"amazon_payment_v2_config\">\n<requiredEntity type=\"api_version\">SampleAmazonPaymentV2ApiVersion</requiredEntity>\n<requiredEntity type=\"store_id\">EUAmazonPaymentV2StoreId</requiredEntity>\n<requiredEntity type=\"payment_region\">EUAmazonPaymentV2PaymentRegion</requiredEntity>\n<requiredEntity type=\"sandbox\">SampleAmazonPaymentV2Sandbox</requiredEntity>\n+ <requiredEntity type=\"v2_lwa_enabled\">SampleAmazonPaymentV2LwaDisabled</requiredEntity>\n</entity>\n<entity name=\"EUAmazonPaymentV2PrivateKey\" type=\"private_key\">\n<data key=\"value\">{{_CREDS.amazon/v2_eu_private_key}}</data>\n<entity name=\"SampleAmazonPaymentV2Sandbox\" type=\"sandbox\">\n<data key=\"value\">1</data>\n</entity>\n+\n+ <entity name=\"SampleAmazonPaymentV2ConfigLwa\" type=\"amazon_payment_v2_config\">\n+ <requiredEntity type=\"api_version\">SampleAmazonPaymentV2ApiVersion</requiredEntity>\n+ <requiredEntity type=\"active\">SampleAmazonPaymentV2Active</requiredEntity>\n+ <requiredEntity type=\"private_key\">SampleAmazonPaymentV2PrivateKey</requiredEntity>\n+ <requiredEntity type=\"public_key_id\">SampleAmazonPaymentV2PublicKeyId</requiredEntity>\n+ <requiredEntity type=\"merchant_id\">SampleAmazonPaymentV2MerchantId</requiredEntity>\n+ <requiredEntity type=\"store_id\">SampleAmazonPaymentV2StoreId</requiredEntity>\n+ <requiredEntity type=\"payment_region\">SampleAmazonPaymentV2PaymentRegion</requiredEntity>\n+ <requiredEntity type=\"sandbox\">SampleAmazonPaymentV2Sandbox</requiredEntity>\n+ <requiredEntity type=\"v2_lwa_enabled\">SampleAmazonPaymentV2LwaEnabled</requiredEntity>\n+ </entity>\n</entities>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Metadata/AmazonPaymentV2ConfigMeta.xml",
"new_path": "src/PayV2/Test/Mftf/Metadata/AmazonPaymentV2ConfigMeta.xml",
"diff": "</object>\n</object>\n</object>\n- </object>\n- <object key=\"options\" dataType=\"amazon_payment_config_state\">\n- <object key=\"fields\" dataType=\"amazon_payment_config_state\">\n- <object key=\"active\" dataType=\"amazon_pay_active\">\n+ <object key=\"options\" dataType=\"amazon_payment_v2_config\">\n+ <object key=\"fields\" dataType=\"amazon_payment_v2_config\">\n+ <object key=\"v2_lwa_enabled\" dataType=\"v2_lwa_enabled\">\n<field key=\"value\">string</field>\n</object>\n- <object key=\"lwa_enabled\" dataType=\"lwa_enabled\">\n- <field key=\"value\">string</field>\n</object>\n</object>\n</object>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Section/AmazonLoginSection.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<sections xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/sectionObjectSchema.xsd\">\n+ <section name=\"AmazonLoginSection\">\n+ <element name=\"v2Login\" type=\"button\" selector=\"#AmazonPayButton.login-with-amazon div\"/>\n+ <element name=\"consentButton\" type=\"button\" selector=\"#consent-form input[type=submit]\"/>\n+ </section>\n+</sections>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonDisabledTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSignInButtonDisabled\" extends=\"AmazonSignInButton\">\n+ <annotations>\n+ <stories value=\"Amazon Sign In Button Disabled\"/>\n+ <title value=\"Amazon Sign In Button Disabled\"/>\n+ <description value=\"Amazon Sign In button should not be visible on the login page when disabled\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigLwa\"/>\n+ </before>\n+\n+ <!--Verify Sign in with Amazon Button V2 is not present-->\n+ <dontSeeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSignInButton\">\n+ <annotations>\n+ <stories value=\"Amazon Sign In Button\"/>\n+ <title value=\"Amazon Sign In Button\"/>\n+ <description value=\"Amazon Sign In button should be visible on the login page when configured\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct\"/>\n+ <createData entity=\"SampleAmazonPaymentV2ConfigLwa\" stepKey=\"SampleAmazonPaymentV2ConfigLwa\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2Config\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <amOnPage url=\"{{StorefrontCustomerSignInPage.url}}\" stepKey=\"amOnSignInPage\"/>\n+ <waitForPageLoad time=\"30\" stepKey=\"waitPageFullyLoaded\"/>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present-->\n+ <seeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInCreateAccountTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSignInCreateAccount\" extends=\"AmazonSignInButton\">\n+ <annotations>\n+ <stories value=\"Amazon Sign In Create Account\"/>\n+ <title value=\"Amazon Sign In Create Account\"/>\n+ <description value=\"Amazon Sign In button should create an account when logging in\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <!--Verify Sign in with Amazon Button V2 is not present-->\n+ <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+\n+ <actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup\"/>\n+ <click selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"clickAmazonConsentButton\"/>\n+\n+ <waitForPageLoad stepKey=\"waitForMyAccountPageLoad\"/>\n+ <see userInput=\"My Account\" stepKey=\"seeMyAccount\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-224 - create base set of tests for CV2 Login with Amazon |
21,241 | 09.11.2020 10:33:47 | 21,600 | 72e6fce267bd7b21c0d6238dfbbaff3e5128133f | update mftf data node to have unique name | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Data/AmazonCurrencyData.xml",
"new_path": "src/PayV2/Test/Mftf/Data/AmazonCurrencyData.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<entities xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd\">\n- <entity name=\"AmazonAllowCurrencyValue\" type=\"allow\">\n+ <entity name=\"AmazonAllowCurrencyValueV2\" type=\"allow\">\n<array key=\"value\">\n<item>USD</item>\n<item>EUR</item>\n<entity name=\"EUAmazonCurrencyConfig\" type=\"amazon_currency_config\">\n<requiredEntity type=\"base\">EUAmazonBaseCurrencyValue</requiredEntity>\n<requiredEntity type=\"default\">EUAmazonDefaultCurrencyValue</requiredEntity>\n- <requiredEntity type=\"allow\">AmazonAllowCurrencyValue</requiredEntity>\n+ <requiredEntity type=\"allow\">AmazonAllowCurrencyValueV2</requiredEntity>\n</entity>\n<entity name=\"EUAmazonMultiCurrencyConfig\" type=\"amazon_currency_config\">\n<requiredEntity type=\"base\">EUAmazonBaseCurrencyValue</requiredEntity>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-236 - update mftf data node to have unique name |
21,241 | 09.11.2020 14:57:24 | 21,600 | afef60f42fde86eb19babd95cf5fd8d54768afab | add test for case where account exists in Magento with matching email address to the Sign in with Amazon account | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Data/AmazonAccountData.xml",
"new_path": "src/PayV2/Test/Mftf/Data/AmazonAccountData.xml",
"diff": "<data key=\"email\">{{_CREDS.amazon/test_account_eu_email}}</data>\n<data key=\"password\">{{_CREDS.amazon/test_account_eu_password}}</data>\n</entity>\n+ <entity name=\"Simple_Customer_With_Amazon_Account\" type=\"customer\">\n+ <data key=\"group_id\">1</data>\n+ <data key=\"email\">{{_CREDS.amazon/test_account_eu_email}}</data>\n+ <data key=\"firstname\">John</data>\n+ <data key=\"lastname\">Doe</data>\n+ <data key=\"fullname\">John Doe</data>\n+ <data key=\"password\">pwdTest123!</data>\n+ <data key=\"store_id\">0</data>\n+ <data key=\"website_id\">0</data>\n+ </entity>\n</entities>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Section/AmazonLoginSection.xml",
"new_path": "src/PayV2/Test/Mftf/Section/AmazonLoginSection.xml",
"diff": "<section name=\"AmazonLoginSection\">\n<element name=\"v2Login\" type=\"button\" selector=\"#AmazonPayButton.login-with-amazon div\"/>\n<element name=\"consentButton\" type=\"button\" selector=\"#consent-form input[type=submit]\"/>\n+ <element name=\"linkAccountPassword\" type=\"text\" selector=\".amazon-validate-container #password\"/>\n+ <element name=\"linkAccountButton\" type=\"button\" selector=\".amazon-validate-container button[type=submit]\"/>\n</section>\n</sections>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSignInCreateAccountTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInCreateAccountTest.xml",
"diff": "<group value=\"amazon_pay_v2_signin\"/>\n</annotations>\n- <!--Verify Sign in with Amazon Button V2 is not present-->\n+ <before>\n+ <actionGroup ref=\"AdminLoginActionGroup\" stepKey=\"loginToAdminPanel\"/>\n+ </before>\n+ <after>\n+ <actionGroup ref=\"DeleteCustomerByEmailActionGroup\" stepKey=\"deleteCustomer\" before=\"logout\">\n+ <argument name=\"email\" value=\"{{AmazonAccount.email}}\"/>\n+ </actionGroup>\n+ <actionGroup ref=\"AdminLogoutActionGroup\" stepKey=\"logout\"/>\n+ </after>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present-->\n<click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n<actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup\"/>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInExistingUnlinkedAccountTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSignInExistingUnlinkedAccount\" extends=\"AmazonSignInButton\">\n+ <annotations>\n+ <stories value=\"Amazon Sign In when there is an existing unlinked account\"/>\n+ <title value=\"Amazon Sign In when there is an existing unlinked account\"/>\n+ <description value=\"Amazon Sign In button should redirect to Link Account page\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"Simple_Customer_With_Amazon_Account\" stepKey=\"createCustomer\"/>\n+ </before>\n+\n+ <after>\n+ <deleteData createDataKey=\"createCustomer\" stepKey=\"deleteCustomer\"/>\n+ </after>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present-->\n+ <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+\n+ <actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup\"/>\n+ <click selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"clickAmazonConsentButton\"/>\n+\n+ <waitForPageLoad stepKey=\"waitForLinkAccountPageLoad\"/>\n+ <see userInput=\"A store account for this email address already exists\" stepKey=\"seeAnAccountExists\"/>\n+\n+ <fillField selector=\"{{AmazonLoginSection.linkAccountPassword}}\" userInput=\"{{Simple_Customer_With_Amazon_Account.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n+ <click selector=\"{{AmazonLoginSection.linkAccountButton}}\" stepKey=\"clickLinkAccountButton\"/>\n+\n+ <waitForPageLoad stepKey=\"waitForMyAccountPageLoad\"/>\n+ <see userInput=\"My Account\" stepKey=\"seeMyAccount\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-224 - add test for case where account exists in Magento with matching email address to the Sign in with Amazon account |
21,241 | 09.11.2020 16:12:57 | 21,600 | f35a5953c60f0148b12f0bf99f48f7b2918b1b77 | tests for logging in to existing accounts, and signing in during checkout | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSignInCreateAccountTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInCreateAccountTest.xml",
"diff": "</after>\n<!--Verify Sign in with Amazon Button V2 is present-->\n- <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+ <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"clickSignInWithAmazonButton\"/>\n<actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup\"/>\n<click selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"clickAmazonConsentButton\"/>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInToExistingTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSignInToExisting\" extends=\"AmazonSignInButton\">\n+ <annotations>\n+ <stories value=\"Amazon Sign In To Existing Account\"/>\n+ <title value=\"Amazon Sign In To Existing Account\"/>\n+ <description value=\"Amazon Sign In button should log into existing account\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <before>\n+ <actionGroup ref=\"AdminLoginActionGroup\" stepKey=\"loginToAdminPanel\"/>\n+ </before>\n+ <after>\n+ <actionGroup ref=\"DeleteCustomerByEmailActionGroup\" stepKey=\"deleteCustomer\" before=\"logout\">\n+ <argument name=\"email\" value=\"{{AmazonAccount.email}}\"/>\n+ </actionGroup>\n+ <actionGroup ref=\"AdminLogoutActionGroup\" stepKey=\"logout\"/>\n+ </after>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present-->\n+ <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"clickSignInWithAmazonButton\"/>\n+\n+ <actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup\"/>\n+ <click selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"clickAmazonConsentButton\"/>\n+\n+ <waitForPageLoad stepKey=\"waitForMyAccountPageLoad\"/>\n+ <see userInput=\"My Account\" stepKey=\"seeMyAccount\"/>\n+\n+ <!-- Log out and return to sign in page -->\n+ <actionGroup stepKey=\"logout\" ref=\"StorefrontCustomerLogoutActionGroup\"/>\n+ <waitForPageLoad time=\"30\" stepKey=\"waitLogoutPageFullyLoaded\"/>\n+ <amOnPage url=\"{{StorefrontCustomerSignInPage.url}}\" stepKey=\"amOnSignInPage2\"/>\n+ <waitForPageLoad time=\"30\" stepKey=\"waitPageFullyLoaded\"/>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present again-->\n+ <click selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"clickSignInWithAmazonButton2\"/>\n+\n+ <actionGroup ref=\"AmazonLoginOnlyActionGroup\" stepKey=\"AmazonLoginOnlyActionGroup2\"/>\n+ <click selector=\"{{AmazonLoginSection.consentButton}}\" stepKey=\"clickAmazonConsentButton2\"/>\n+\n+ <waitForPageLoad stepKey=\"waitForMyAccountPageLoad2\"/>\n+ <see userInput=\"My Account\" stepKey=\"seeMyAccount2\"/>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSigninCheckoutSuccessV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonSigninCheckoutSuccessV2\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Signin Enabled Checkout\"/>\n+ <title value=\"Amazon Signin Enabled Checkout Success V2\"/>\n+ <description value=\"User should be able to sign in during checkout with Amazon Pay.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_signin\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SampleAmazonPaymentV2ConfigLwa\" stepKey=\"SampleAmazonPaymentV2ConfigData\"/>\n+ </before>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order and see the logged in order number message-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"loggedInPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-224 - tests for logging in to existing accounts, and signing in during checkout |
21,241 | 10.11.2020 12:31:20 | 21,600 | 2237ee4efc7bee9ed7c476ab167e61799fe179e1 | update test to check both login and account create pages for the Sign in with Amazon button | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonDisabledTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonDisabledTest.xml",
"diff": "<createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigLwa\"/>\n</before>\n- <!--Verify Sign in with Amazon Button V2 is not present-->\n- <dontSeeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+ <!--Verify Sign in with Amazon Button V2 is not present on create or login pages-->\n+ <dontSeeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButtonCreate\"/>\n+ <dontSeeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButtonLogin\"/>\n</test>\n</tests>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInButtonTest.xml",
"diff": "<magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n</after>\n+ <!--Verify Sign in with Amazon Button V2 is present on account create-->\n+ <amOnPage url=\"{{StorefrontCustomerCreatePage.url}}\" stepKey=\"amOnCreateAccountPage\"/>\n+ <waitForPageLoad time=\"30\" stepKey=\"waitPageFullyLoaded2\"/>\n+ <seeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButtonCreate\"/>\n+\n+ <!--Verify Sign in with Amazon Button V2 is present on login page-->\n+ <!--Leave this as the last step as other tests start from the login page-->\n<amOnPage url=\"{{StorefrontCustomerSignInPage.url}}\" stepKey=\"amOnSignInPage\"/>\n<waitForPageLoad time=\"30\" stepKey=\"waitPageFullyLoaded\"/>\n-\n- <!--Verify Sign in with Amazon Button V2 is present-->\n- <seeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButton\"/>\n+ <seeElement selector=\"{{AmazonLoginSection.v2Login}}\" stepKey=\"seeSignInWithAmazonButtonLogin\"/>\n</test>\n</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-224 - update test to check both login and account create pages for the Sign in with Amazon button |
21,270 | 10.11.2020 11:21:52 | 28,800 | 63caf0a78565d18fb3c8f30592948b535f1307f6 | fixes wrong construct param on plugin | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Plugin/OrderCustomerManagement.php",
"new_path": "src/PayV2/Plugin/OrderCustomerManagement.php",
"diff": "*/\nnamespace Amazon\\PayV2\\Plugin;\n-use Amazon\\PayV2\\Helper\\Data;\nuse Amazon\\PayV2\\Api\\CustomerLinkManagementInterface;\nuse Amazon\\PayV2\\Helper\\Session as LoginSessionHelper;\nuse Amazon\\PayV2\\Gateway\\Config\\Config;\n@@ -50,13 +49,13 @@ class OrderCustomerManagement\n* @param LoginSessionHelper $loginSessionHelper\n* @param OrderRepositoryInterface $orderRepository\n* @param CustomerLinkManagementInterface $customerLinkManagement\n- * @param Data $amazonConfig\n+ * @param AmazonConfig $amazonConfig\n*/\npublic function __construct(\nLoginSessionHelper $loginSessionHelper,\nOrderRepositoryInterface $orderRepository,\nCustomerLinkManagementInterface $customerLinkManagement,\n- Data $amazonConfig\n+ AmazonConfig $amazonConfig\n) {\n$this->loginSessionHelper = $loginSessionHelper;\n$this->orderRepository = $orderRepository;\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-552 fixes wrong construct param on plugin |
21,241 | 11.11.2020 00:39:51 | 21,600 | 7a0a096b132fc6f9f213d302997a0d5743083a50 | add tests for cases when guest checkout is disabled | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutGuestCheckoutDisabledNoButtonV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutGuestCheckoutDisabledNoButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Button\"/>\n+ <title value=\"Amazon Checkout Guest Checkout Disabled No Button V2\"/>\n+ <description value=\"Amazon Button should not be present on checkout when both Guest Checkout and Sign in with Amazon are disabled.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_button\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct\"/>\n+ <!-- Sign in with Amazon is disabled in the Sample config, no need to explicitly disable -->\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\"/>\n+ <magentoCLI command=\"config:set checkout/options/guest_checkout 0\" stepKey=\"disableGuestCheckout\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <magentoCLI command=\"config:set checkout/options/guest_checkout 1\" stepKey=\"enableGuestCheckout\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <!--Go to product page-->\n+ <actionGroup ref=\"StorefrontOpenProductPageActionGroup\" stepKey=\"openProductStoreFront\">\n+ <argument name=\"productUrl\" value=\"$$createSimpleProduct.custom_attributes[url_key]$$\"/>\n+ </actionGroup>\n+ <!--Click on Add To Cart button-->\n+ <actionGroup ref=\"StorefrontAddToTheCartActionGroup\" stepKey=\"clickOnAddToCartButton\"/>\n+ <!--Go to checkout-->\n+ <actionGroup ref=\"GoToCheckoutFromMinicartActionGroup\" stepKey=\"goToCheckoutFromMiniCart\"/>\n+ <!--Verify we don't see either Amazon Button V2 or V1 button-->\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"dontSeeEnabledAmazonButton\"/>\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v1Checkout}}\" stepKey=\"dontSeeDisabledAmazonButton\"/>\n+ </test>\n+</tests>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutLoggedInNoGuestButtonV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutLoggedInNoGuestButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Button\"/>\n+ <title value=\"Amazon Checkout Logged In with Guest Checkout Disabled V2\"/>\n+ <description value=\"Amazon Pay should be available when Guest Checkout and Sign in with Amazon are both disabled only when signed in to Magento already.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_button\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct\"/>\n+ <createData entity=\"Simple_Customer_With_Amazon_Account\" stepKey=\"createCustomer\"/>\n+ <!-- Sign in with Amazon is disabled in the Sample config, no need to explicitly disable -->\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"SampleAmazonPaymentV2ConfigData\"/>\n+ <magentoCLI command=\"config:set checkout/options/guest_checkout 0\" stepKey=\"disableGuestCheckout\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <deleteData createDataKey=\"createCustomer\" stepKey=\"deleteCustomer\"/>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <magentoCLI command=\"config:set checkout/options/guest_checkout 1\" stepKey=\"enableGuestCheckout\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <!--Go to product page-->\n+ <actionGroup ref=\"StorefrontOpenProductPageActionGroup\" stepKey=\"openProductStoreFront\">\n+ <argument name=\"productUrl\" value=\"$$createSimpleProduct.custom_attributes[url_key]$$\"/>\n+ </actionGroup>\n+ <!--Click on Add To Cart button-->\n+ <actionGroup ref=\"StorefrontAddToTheCartActionGroup\" stepKey=\"clickOnAddToCartButton\"/>\n+ <!--Go to checkout-->\n+ <actionGroup ref=\"GoToCheckoutFromMinicartActionGroup\" stepKey=\"goToCheckoutFromMiniCart\"/>\n+\n+ <!--Verify we don't see either Amazon Button V2 or V1 button-->\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"dontSeeEnabledAmazonButton\"/>\n+ <dontSeeElement selector=\"{{AmazonButtonSection.v1Checkout}}\" stepKey=\"dontSeeDisabledAmazonButton\"/>\n+\n+ <!-- Log in via the modal -->\n+ <fillField selector=\"{{StorefrontCustomerSignInPopupFormSection.email}}\" userInput=\"{{Simple_Customer_With_Amazon_Account.email}}\" stepKey=\"fillAmazonPageEmailField\"/>\n+ <fillField selector=\"{{StorefrontCustomerSignInPopupFormSection.password}}\" userInput=\"{{Simple_Customer_With_Amazon_Account.password}}\" stepKey=\"fillAmazonPagePasswordField\"/>\n+ <click selector=\"{{StorefrontCustomerSignInPopupFormSection.signIn}}\" stepKey=\"clickSignInButton\"/>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <waitForElement selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"waitForAmazonChangedShippingPageLoad\"/>\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"loggedInPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ </test>\n+</tests>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSigninCheckoutSuccessV2Test.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSigninCheckoutSuccessV2Test.xml",
"diff": "<before>\n<createData entity=\"SampleAmazonPaymentV2ConfigLwa\" stepKey=\"SampleAmazonPaymentV2ConfigData\"/>\n+ <actionGroup ref=\"AdminLoginActionGroup\" stepKey=\"loginToAdminPanel\"/>\n</before>\n+ <after>\n+ <actionGroup ref=\"DeleteCustomerByEmailActionGroup\" stepKey=\"deleteCustomer\" before=\"logout\">\n+ <argument name=\"email\" value=\"{{AmazonAccount.email}}\"/>\n+ </actionGroup>\n+ <actionGroup ref=\"AdminLogoutActionGroup\" stepKey=\"logout\"/>\n+ </after>\n+\n<!--Go to Amazon Pay from the checkout and login-->\n<click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n<actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-224 - add tests for cases when guest checkout is disabled |
21,270 | 13.11.2020 14:44:39 | 28,800 | 13dd06ed7fe9f0cb2ef3f14a6908727749f6f1f6 | cancels order on any problem with the checkout session | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"new_path": "src/PayV2/Model/CheckoutSessionManagement.php",
"diff": "@@ -24,6 +24,7 @@ use Magento\\Quote\\Api\\Data\\CartInterface;\nuse Magento\\Framework\\Validator\\Exception as ValidatorException;\nuse Magento\\Framework\\Webapi\\Exception as WebapiException;\nuse Magento\\Sales\\Api\\OrderRepositoryInterface;\n+use Magento\\Sales\\Model\\Order\\Invoice;\nuse Magento\\Sales\\Model\\Order\\Payment;\nuse Magento\\Sales\\Api\\Data\\TransactionInterface as Transaction;\n@@ -506,6 +507,33 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->orderRepository->save($order);\n}\n+ /**\n+ * @param $order\n+ */\n+ private function cancelOrder($order)\n+ {\n+ // set order as cancelled\n+ $order->setState(\\Magento\\Sales\\Model\\Order::STATE_CANCELED)->setStatus(\n+ \\Magento\\Sales\\Model\\Order::STATE_CANCELED\n+ );\n+ $order->getPayment()->setIsTransactionClosed(true);\n+\n+ // cancel invoices\n+ foreach ($order->getInvoiceCollection() as $invoice) {\n+ $invoice->setState(Invoice::STATE_CANCELED);\n+ }\n+\n+ // delete order comments and add new one\n+ foreach ($order->getStatusHistories() as $history) {\n+ $history->delete();\n+ }\n+ $order->addStatusHistoryComment(\n+ __('Payment was unable to be successfully captured, the checkout session failed to complete.')\n+ );\n+\n+ $order->save();\n+ }\n+\n/**\n* {@inheritdoc}\n*/\n@@ -541,10 +569,17 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$amazonResult = $this->amazonAdapter->completeCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId(), $cart->getGrandTotal() , $cart->getQuoteCurrencyCode());\nif (array_key_exists('status', $amazonResult) && $amazonResult['status'] != 200) {\n- // Something went wrong, but the order has already been placed\n+ // Something went wrong, but the order has already been placed, so cancelling it\n+ $this->cancelOrder($order);\n+\n+ $session = $this->amazonAdapter->getCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId());\n+ if (isset($session['chargePermissionId'])) {\n+ $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'Canceled due to checkout session failed to complete', true);\n+ }\n+\nreturn [\n'success' => false,\n- 'message' => $amazonResult['message'],\n+ 'message' => __('Payment was unable to be successfully captured, the checkout session failed to complete.'),\n];\n}\n$chargeId = $amazonResult['chargeId'];\n@@ -572,10 +607,17 @@ class CheckoutSessionManagement implements \\Amazon\\PayV2\\Api\\CheckoutSessionMana\n$this->checkoutSessionRepository->save($checkoutSession);\n} catch (\\Exception $e) {\n$session = $this->amazonAdapter->getCheckoutSession($cart->getStoreId(), $checkoutSession->getSessionId());\n+\nif (isset($session['chargePermissionId'])) {\n- $response = $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'Canceled due to technical issue: ' . $e->getMessage(), true);\n+ $this->amazonAdapter->closeChargePermission($cart->getStoreId(), $session['chargePermissionId'], 'Canceled due to technical issue: ' . $e->getMessage(), true);\n}\n$this->cancelCheckoutSession($cartId);\n+\n+ // cancel order\n+ if (isset($order)) {\n+ $this->cancelOrder($order);\n+ }\n+\nthrow $e;\n}\n}\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | ASD-516 cancels order on any problem with the checkout session |
21,241 | 16.11.2020 12:04:48 | 21,600 | a73ce83bf00578ba2bebceb1b02a0ffea437e908 | add test for capturing multiple times on an order | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonInvoiceMultipleCapture.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonInvoiceMultipleCapture\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Pay Multiple Capture\"/>\n+ <title value=\"Admin user must be able to capture multiple times when configuration allows\"/>\n+ <description value=\"Admin user must be able to capture multiple times when configuration allows\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_invoice\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct2\" before=\"flushCache\"/>\n+ </before>\n+\n+ <!-- Product 1 is added to cart by AmazonCheckoutButtonV2 -->\n+\n+ <!-- Go to product 2 page and add to cart -->\n+ <actionGroup ref=\"StorefrontOpenProductPageActionGroup\" stepKey=\"openProduct2StoreFront\">\n+ <argument name=\"productUrl\" value=\"$$createSimpleProduct2.custom_attributes[url_key]$$\"/>\n+ </actionGroup>\n+ <actionGroup ref=\"StorefrontAddToTheCartActionGroup\" stepKey=\"addProduct2ToCart\"/>\n+\n+ <!--Go to checkout-->\n+ <actionGroup ref=\"GoToCheckoutFromMinicartActionGroup\" stepKey=\"goToCheckoutFromMiniCart2\"/>\n+\n+ <!--Go to Amazon Pay and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"guestPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successGuestCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ <grabTextFrom selector=\"{{CheckoutSuccessMainSection.orderNumber}}\" stepKey=\"grabOrderNumber\"/>\n+\n+ <!-- Login as admin -->\n+ <actionGroup ref=\"AdminLoginActionGroup\" stepKey=\"loginAsAdmin\"/>\n+\n+ <!-- Open created order in backend -->\n+ <amOnPage url=\"{{AdminOrdersPage.url}}\" stepKey=\"goToOrders\"/>\n+ <waitForPageLoad stepKey=\"waitForOrdersPageLoad\"/>\n+ <actionGroup ref=\"OpenOrderByIdActionGroup\" stepKey=\"filterOrderGridById\">\n+ <argument name=\"orderId\" value=\"$grabOrderNumber\"/>\n+ </actionGroup>\n+\n+ <!-- Create Invoice 1 -->\n+ <click selector=\"{{AdminOrderDetailsMainActionsSection.invoice}}\" stepKey=\"clickInvoice1\"/>\n+ <waitForPageLoad stepKey=\"waitForInvoicePage1\"/>\n+ <fillField stepKey=\"fillQty\" userInput=\"1\" selector=\"{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}\"/>\n+ <fillField stepKey=\"fillNoQty\" userInput=\"0\" selector=\"{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}\"/>\n+ <click selector=\"{{AdminInvoiceItemsSection.updateQty}}\" stepKey=\"updateQty\"/>\n+ <waitForPageLoad stepKey=\"waitPageToBeLoaded\"/>\n+ <click selector=\"{{AdminInvoiceMainActionsSection.submitInvoice}}\" stepKey=\"submitInvoice1\"/>\n+ <waitForPageLoad stepKey=\"waitForLoadPage1\"/>\n+ <see userInput=\"The invoice has been created.\" stepKey=\"seeMessage1\"/>\n+\n+ <!-- Create Invoice 2 -->\n+ <click selector=\"{{AdminOrderDetailsMainActionsSection.invoice}}\" stepKey=\"clickInvoice2\"/>\n+ <waitForPageLoad stepKey=\"waitForInvoicePage2\"/>\n+ <click selector=\"{{AdminInvoiceMainActionsSection.submitInvoice}}\" stepKey=\"submitInvoice2\"/>\n+ <waitForPageLoad stepKey=\"waitForLoadPage2\"/>\n+ <see userInput=\"The invoice has been created.\" stepKey=\"seeMessage2\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-223 - add test for capturing multiple times on an order |
21,264 | 16.11.2020 20:48:02 | 0 | 6af1010019563334ebe93126cc0b4cd50a2ce452 | Version increase from 2.5.0 to 2.6.0 | [
{
"change_type": "MODIFY",
"old_path": "README.md",
"new_path": "README.md",
"diff": "@@ -113,4 +113,4 @@ The following table provides an overview on which Git branch is compatible to wh\n| Magento Version | Github Branch | Latest release |\n| ------------- | ------------- | ------------- |\n| 2.2.6 - 2.3.x | [V2checkout-1.2.x](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout-1.2.x) | 1.9.0 |\n-| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.5.0 |\n+| 2.4.0 and above | [V2checkout](https://github.com/amzn/amazon-payments-magento-2-plugin/tree/V2checkout) | 2.6.0 |\n"
},
{
"change_type": "MODIFY",
"old_path": "composer.json",
"new_path": "composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-magento-2-module\",\n\"description\": \"Official Magento2 Plugin to integrate with Amazon Pay V2\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.5.0\",\n+ \"version\": \"2.6.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/composer.json",
"new_path": "src/PayV2/composer.json",
"diff": "\"name\": \"amzn/amazon-pay-v2-module\",\n\"description\": \"Amazon Pay V2 module\",\n\"type\": \"magento2-module\",\n- \"version\": \"2.5.0\",\n+ \"version\": \"2.6.0\",\n\"license\": [\n\"Apache-2.0\"\n],\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/etc/module.xml",
"new_path": "src/PayV2/etc/module.xml",
"diff": "*/\n-->\n<config xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:framework:Module/etc/module.xsd\">\n- <module name=\"Amazon_PayV2\" setup_version=\"2.5.0\" >\n+ <module name=\"Amazon_PayV2\" setup_version=\"2.6.0\" >\n<sequence>\n<module name=\"Amazon_Core\"/>\n<module name=\"Amazon_Login\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | Version increase from 2.5.0 to 2.6.0 |
21,241 | 16.11.2020 14:49:29 | 21,600 | 0fc4f3c4e2f96064f2378ee53bca57e0b365104c | test that admin cannot split invoice orders in EU | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonInvoiceOnlySingleCapture.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonInvoiceOnlySingleCapture\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Pay Only Single Capture\"/>\n+ <title value=\"Admin user must not be able to capture multiple times when configuration doesn't allow\"/>\n+ <description value=\"Admin user must not be able to capture multiple times when configuration doesn't allow\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_invoice\"/>\n+ </annotations>\n+\n+ <before>\n+ <createData entity=\"SimpleTwo\" stepKey=\"createSimpleProduct2\" before=\"flushCache\"/>\n+ <createData entity=\"EUAmazonPaymentV2Config\" stepKey=\"SingleInvoiceAmazonPaymentConfig\"/>\n+ <createData entity=\"EUAmazonCurrencyConfig\" stepKey=\"SingleInvoiceAmazonCurrencyConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </before>\n+\n+ <after>\n+ <createData entity=\"SampleAmazonPaymentV2Config\" stepKey=\"DefaultAmazonPaymentConfig\"/>\n+ <createData entity=\"DefaultAmazonCurrencyConfig\" stepKey=\"DefaultAmazonCurrencyConfig\"/>\n+ <magentoCLI command=\"cache:flush\" stepKey=\"flushCache\"/>\n+ </after>\n+\n+ <!-- Product 1 is added to cart by AmazonCheckoutButtonV2 -->\n+\n+ <!-- Go to product 2 page and add to cart -->\n+ <actionGroup ref=\"StorefrontOpenProductPageActionGroup\" stepKey=\"openProduct2StoreFront\">\n+ <argument name=\"productUrl\" value=\"$$createSimpleProduct2.custom_attributes[url_key]$$\"/>\n+ </actionGroup>\n+ <actionGroup ref=\"StorefrontAddToTheCartActionGroup\" stepKey=\"addProduct2ToCart\"/>\n+\n+ <!--Go to checkout-->\n+ <actionGroup ref=\"GoToCheckoutFromMinicartActionGroup\" stepKey=\"goToCheckoutFromMiniCart2\"/>\n+\n+ <!--Go to Amazon Pay and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"guestPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successGuestCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ <grabTextFrom selector=\"{{CheckoutSuccessMainSection.orderNumber}}\" stepKey=\"grabOrderNumber\"/>\n+\n+ <!-- Login as admin -->\n+ <actionGroup ref=\"AdminLoginActionGroup\" stepKey=\"loginAsAdmin\"/>\n+\n+ <!-- Open created order in backend -->\n+ <amOnPage url=\"{{AdminOrdersPage.url}}\" stepKey=\"goToOrders\"/>\n+ <waitForPageLoad stepKey=\"waitForOrdersPageLoad\"/>\n+ <actionGroup ref=\"OpenOrderByIdActionGroup\" stepKey=\"filterOrderGridById\">\n+ <argument name=\"orderId\" value=\"$grabOrderNumber\"/>\n+ </actionGroup>\n+\n+ <!-- Create Invoice -->\n+ <click selector=\"{{AdminOrderDetailsMainActionsSection.invoice}}\" stepKey=\"clickInvoice\"/>\n+ <waitForPageLoad stepKey=\"waitForInvoicePage\"/>\n+\n+ <!-- Verify invoice item qtys cannot be changed -->\n+ <dontSeeElement stepKey=\"dontSeeItemQtyToInvoice1\" selector=\"{{AdminInvoiceItemsSection.itemQtyToInvoice('1')}}\"/>\n+ <dontSeeElement stepKey=\"dontSeeItemQtyToInvoice2\" selector=\"{{AdminInvoiceItemsSection.itemQtyToInvoice('2')}}\"/>\n+ <dontSeeElement stepKey=\"dontSeeUpdateQty\" selector=\"{{AdminInvoiceItemsSection.updateQty}}\"/>\n+\n+ <!-- Submit and verify the invoice created -->\n+ <click selector=\"{{AdminInvoiceMainActionsSection.submitInvoice}}\" stepKey=\"submitInvoice\"/>\n+ <waitForPageLoad stepKey=\"waitForLoadPage\"/>\n+ <see userInput=\"The invoice has been created.\" stepKey=\"seeMessage\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-223 - test that admin cannot split invoice orders in EU |
21,241 | 16.11.2020 17:08:04 | 21,600 | 309c6ddd8e6a4911c6e1627dd0343f27aca06da8 | clear Amazon cookie in re-signin test to ensure logged out of Amazon | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonSignInToExistingTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonSignInToExistingTest.xml",
"diff": "<!-- Log out and return to sign in page -->\n<actionGroup stepKey=\"logout\" ref=\"StorefrontCustomerLogoutActionGroup\"/>\n<waitForPageLoad time=\"30\" stepKey=\"waitLogoutPageFullyLoaded\"/>\n+ <!-- make sure we are logged out from Amazon by clearing ubid-main cookie -->\n+ <resetCookie userInput=\"ubid-main\" parameterArray=\"['domainName' => '.amazon.com']\" stepKey=\"resetCookieForAmazon\"/>\n<amOnPage url=\"{{StorefrontCustomerSignInPage.url}}\" stepKey=\"amOnSignInPage2\"/>\n<waitForPageLoad time=\"30\" stepKey=\"waitPageFullyLoaded\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-242 - clear Amazon cookie in re-signin test to ensure logged out of Amazon |
21,241 | 17.11.2020 13:49:22 | 21,600 | 5064451d473d159e39cf856aec0f70b5b3a98724 | test Return to Standard Checkout | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup.xml",
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup.xml",
"diff": "<see selector=\"{{AmazonCheckoutSection.shippingAddress}}\" userInput=\"$amazonAddressZipCode\" stepKey=\"seeAmazonAddressZipCode\"/>\n<see selector=\"{{AmazonCheckoutSection.shippingAddress}}\" userInput=\"$amazonAddressCountryName\" stepKey=\"seeAmazonAddressCountryName\"/>\n<see selector=\"{{AmazonCheckoutSection.shippingAddress}}\" userInput=\"$amazonAddressPhoneNumber\" stepKey=\"seeAmazonAddressPhoneNumber\"/>\n+ <return value=\"{$amazonAddressZipCode}\" stepKey=\"returnAddressZip\"/>\n</actionGroup>\n</actionGroups>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Section/AmazonCheckoutSection.xml",
"new_path": "src/PayV2/Test/Mftf/Section/AmazonCheckoutSection.xml",
"diff": "<element name=\"editShippingButton\" type=\"button\" selector=\"#checkout-step-shipping .shipping-address-item.selected-item .edit-address-link\"/>\n<element name=\"v1Method\" type=\"input\" selector=\"#amazonlogin\"/>\n<element name=\"v2Method\" type=\"input\" selector=\"#amazon_payment_v2\"/>\n+ <element name=\"returnToStandardCheckout\" type=\"text\" selector=\"#checkout-step-shipping .revert-checkout\"/>\n</section>\n</sections>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutReturnToStandardTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutReturnToStandard\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Checkout Return to Standard\"/>\n+ <title value=\"Amazon Checkout Return to Standard\"/>\n+ <description value=\"User should be able to return to standard checkout instead of using Amazon Pay.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ </annotations>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+\n+ <click selector=\"{{AmazonCheckoutSection.returnToStandardCheckout}}\" stepKey=\"clickReturnToStandardCheckout\"/>\n+ <waitForPageLoad stepKey=\"waitForStandardCheckoutPageLoad\"/>\n+\n+\n+ <seeInField selector=\"{{CheckoutShippingSection.postcode}}\" userInput=\"$DefaultAmazonCheckoutActionGroup\" stepKey=\"seeAmazonAddressPostcode\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-240 - test Return to Standard Checkout |
21,241 | 18.11.2020 11:54:44 | 21,600 | f2e87f7a2bf7bc883dc237f574faf46cf8f3cc62 | Test for cancelling Amazon checkout at first step, then proceeding to place the order | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonAlreadyLoggedInActionGroup.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n+ <actionGroup name=\"AmazonAlreadyLoggedInActionGroup\">\n+ <!--Verify successful login by the presence of the checkout button-->\n+ <wait time=\"1\" stepKey=\"allowButtonToActivate\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"seeAmazonCheckoutButton\"/>\n+ </actionGroup>\n+</actionGroups>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Section/AmazonCheckoutSection.xml",
"new_path": "src/PayV2/Test/Mftf/Section/AmazonCheckoutSection.xml",
"diff": "<element name=\"shippingAddress\" type=\"text\" selector=\"#checkout-step-shipping .shipping-address-item.selected-item\"/>\n<element name=\"countryNameByCode\" type=\"text\" selector=\"select[name=country_id] option[value={{country_code}}]\" parameterized=\"true\"/>\n<element name=\"editShippingButton\" type=\"button\" selector=\"#checkout-step-shipping .shipping-address-item.selected-item .edit-address-link\"/>\n+ <element name=\"editPaymentButton\" type=\"button\" selector=\"#amazon-payment .action-edit-payment\"/>\n<element name=\"v1Method\" type=\"input\" selector=\"#amazonlogin\"/>\n<element name=\"v2Method\" type=\"input\" selector=\"#amazon_payment_v2\"/>\n<element name=\"returnToStandardCheckout\" type=\"text\" selector=\"#checkout-step-shipping .revert-checkout\"/>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Section/AmazonPageSection.xml",
"new_path": "src/PayV2/Test/Mftf/Section/AmazonPageSection.xml",
"diff": "<element name=\"passwordField\" type=\"input\" selector=\"#ap_password\"/>\n<element name=\"signInButton\" type=\"button\" selector=\"#signInSubmit\"/>\n<element name=\"checkoutButton\" type=\"button\" selector=\"#default-button-content input[type=submit]\"/>\n+ <element name=\"cancelButton\" type=\"button\" selector=\"#return_back_to_merchant_link\"/>\n<element name=\"addressId\" type=\"text\" selector=\"#default .default_address .address_id\"/>\n<element name=\"addressDetails\" type=\"text\" selector=\"#change-buyer-details li[data-address_id='{{address_id}}']\" parameterized=\"true\"/>\n<element name=\"changeAddressButton\" type=\"button\" selector=\"#change-address-button\"/>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutCancelledThenSuccessTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutCancelledThenSuccess\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Checkout Cancelled then Successful\"/>\n+ <title value=\"Amazon Checkout Cancelled then Successful\"/>\n+ <description value=\"User should be able to checkout with Amazon Pay after cancelling their checkout session.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ </annotations>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+\n+ <click selector=\"{{AmazonPageSection.cancelButton}}\" stepKey=\"cancelCheckout\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPageLoad\"/>\n+\n+ <!--Go back to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton2\"/>\n+ <actionGroup ref=\"AmazonAlreadyLoggedInActionGroup\" stepKey=\"AmazonLoginActionGroup2\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+\n+ <!-- Ensure we have a new checkout session by clicking Edit address, then return to checkout -->\n+ <click selector=\"{{AmazonCheckoutSection.editShippingButton}}\" stepKey=\"clickAmazonEditShippingButton\"/>\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup2\"/>\n+\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+\n+ <click selector=\"{{AmazonCheckoutSection.editPaymentButton}}\" stepKey=\"clickEditPaymentButton\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForContinueButton\"/>\n+ <click selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"clickAmazonCheckoutButton\"/>\n+ <waitForElement selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" stepKey=\"waitForCheckoutPaymentPageLoad2\"/>\n+\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <actionGroup ref=\"CheckoutPlaceOrderActionGroup\" stepKey=\"guestPlaceorder\">\n+ <argument name=\"orderNumberMessage\" value=\"CONST.successGuestCheckoutOrderNumberMessage\" />\n+ <argument name=\"emailYouMessage\" value=\"CONST.successCheckoutEmailYouMessage\" />\n+ </actionGroup>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-237 - Test for cancelling Amazon checkout at first step, then proceeding to place the order |
21,241 | 18.11.2020 16:19:00 | 21,600 | b08fdb8855e30e9213ec4ccbc3a5daa425d905eb | test canceling at edit shipping and payment steps, then re-starting checkout, ensuring that the checkout session ids changed | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutCancelledThenSuccessTest.xml",
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutCancelledThenSuccessTest.xml",
"diff": "<click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton2\"/>\n<actionGroup ref=\"AmazonAlreadyLoggedInActionGroup\" stepKey=\"AmazonLoginActionGroup2\"/>\n<!--Come back to checkout with default address-->\n- <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\"/>\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup2\"/>\n+\n+ <!-- Get the current checkout session ID -->\n+ <executeJS function=\"return localStorage.getItem('amzn-checkout-session')\" stepKey=\"getCheckoutSession2\"/>\n- <!-- Ensure we have a new checkout session by clicking Edit address, then return to checkout -->\n+ <!-- Ensure we have an active checkout session by clicking Edit address -->\n<click selector=\"{{AmazonCheckoutSection.editShippingButton}}\" stepKey=\"clickAmazonEditShippingButton\"/>\n- <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup2\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForCancelCheckout2\"/>\n+ <click selector=\"{{AmazonPageSection.cancelButton}}\" stepKey=\"cancelCheckout2\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPageLoad2\"/>\n+\n+ <!--Go back to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton3\"/>\n+ <actionGroup ref=\"AmazonAlreadyLoggedInActionGroup\" stepKey=\"AmazonLoginActionGroup3\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup3\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPageLoad3\"/>\n+\n+ <!-- Get the current checkout session ID and make sure it changed -->\n+ <executeJS function=\"return localStorage.getItem('amzn-checkout-session')\" stepKey=\"getCheckoutSession3\"/>\n+ <assertNotEquals stepKey=\"verifyChangedSession2\">\n+ <actualResult type=\"const\">$getCheckoutSession3</actualResult>\n+ <expectedResult type=\"const\">$getCheckoutSession2</expectedResult>\n+ </assertNotEquals>\n<!--Go to payment method-->\n<click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n<click selector=\"{{AmazonCheckoutSection.editPaymentButton}}\" stepKey=\"clickEditPaymentButton\"/>\n<waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForContinueButton\"/>\n- <click selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"clickAmazonCheckoutButton\"/>\n- <waitForElement selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" stepKey=\"waitForCheckoutPaymentPageLoad2\"/>\n+ <click selector=\"{{AmazonPageSection.cancelButton}}\" stepKey=\"cancelCheckout3\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPageLoad4\"/>\n+\n+ <!--Go back to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton4\"/>\n+ <actionGroup ref=\"AmazonAlreadyLoggedInActionGroup\" stepKey=\"AmazonLoginActionGroup4\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup4\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPageLoad5\"/>\n+\n+ <!-- Get the current checkout session ID and make sure it changed -->\n+ <executeJS function=\"return localStorage.getItem('amzn-checkout-session')\" stepKey=\"getCheckoutSession4\"/>\n+ <assertNotEquals stepKey=\"verifyChangedSession3\">\n+ <actualResult type=\"const\">$getCheckoutSession4</actualResult>\n+ <expectedResult type=\"const\">$getCheckoutSession3</expectedResult>\n+ </assertNotEquals>\n+\n+ <!--Go to payment method, edit payment, then proceed-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext2\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad2\"/>\n+ <click selector=\"{{AmazonCheckoutSection.editPaymentButton}}\" stepKey=\"clickEditPaymentButton2\"/>\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForContinueButton2\"/>\n+ <click selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"clickAmazonCheckoutButton2\"/>\n+ <waitForElement selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" stepKey=\"waitForCheckoutPaymentPageLoad3\"/>\n<!--Verify only Amazon Pay method is visible-->\n<seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-237 - test canceling at edit shipping and payment steps, then re-starting checkout, ensuring that the checkout session ids changed |
21,241 | 19.11.2020 11:55:45 | 21,600 | 759a8c243c6a116e106946a858c1ab3a6cf34bdf | add test for checkout decline | [
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup.xml",
"new_path": "src/PayV2/Test/Mftf/ActionGroup/AmazonCheckoutActionGroup.xml",
"diff": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<actionGroups xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/actionGroupSchema.xsd\">\n<actionGroup name=\"AmazonCheckoutActionGroup\">\n+ <arguments>\n+ <argument name=\"cc\" defaultValue=\"1111\" type=\"string\"/>\n+ </arguments>\n+\n<!--Get shipping address information-->\n<grabAttributeFrom selector=\"{{AmazonPageSection.addressId}}\" userInput=\"data-address_id\" stepKey=\"amazonAddressId\"/>\n<grabAttributeFrom selector=\"{{AmazonPageSection.addressDetails({$amazonAddressId})}}\" userInput=\"data-name_on_address\" stepKey=\"amazonAddressName\"/>\n<grabAttributeFrom selector=\"{{AmazonPageSection.addressDetails({$amazonAddressId})}}\" userInput=\"data-zip_code\" stepKey=\"amazonAddressZipCode\"/>\n<grabAttributeFrom selector=\"{{AmazonPageSection.addressDetails({$amazonAddressId})}}\" userInput=\"data-country\" stepKey=\"amazonAddressCountryCode\"/>\n<grabAttributeFrom selector=\"{{AmazonPageSection.addressDetails({$amazonAddressId})}}\" userInput=\"data-phone_number\" stepKey=\"amazonAddressPhoneNumber\"/>\n+\n+ <!-- choose card -->\n+ <click selector=\"{{AmazonPageSection.changePaymentButton}}\" stepKey=\"clickChangeAddress\"/>\n+ <executeJS function=\"document.querySelectorAll('#maxo_payment_methods .a-radio-label').forEach(function(v,i,o) { if (v.querySelector('.trail_number').innerText.includes('{{cc}}')) { v.click() } });\" stepKey=\"executeJsCc\"/>\n+ <click selector=\"{{AmazonPageSection.usePaymentButton}}\" stepKey=\"clickUsePaymentMethod\"/>\n+\n<!--Go back to checkout-->\n+ <waitForElement selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"waitForAmazonCheckoutButton\"/>\n+ <wait time=\"1\" stepKey=\"allowContinueButtonToActivate\"/>\n<click selector=\"{{AmazonPageSection.checkoutButton}}\" stepKey=\"clickAmazonCheckoutButton\"/>\n<waitForPageLoad stepKey=\"waitForCheckoutPageLoad\"/>\n<!--Filter out address data-->\n"
},
{
"change_type": "MODIFY",
"old_path": "src/PayV2/Test/Mftf/Section/AmazonPageSection.xml",
"new_path": "src/PayV2/Test/Mftf/Section/AmazonPageSection.xml",
"diff": "<element name=\"addressId\" type=\"text\" selector=\"#default .default_address .address_id\"/>\n<element name=\"addressDetails\" type=\"text\" selector=\"#change-buyer-details li[data-address_id='{{address_id}}']\" parameterized=\"true\"/>\n<element name=\"changeAddressButton\" type=\"button\" selector=\"#change-address-button\"/>\n+ <element name=\"changePaymentButton\" type=\"button\" selector=\"#change-payment-button\"/>\n<element name=\"notSelectedAddress\" type=\"button\" selector=\"#maxo_addresses li[data-selected=false]\"/>\n<element name=\"useAddressButton\" type=\"button\" selector=\"#buyer-action-button-bottom .a-button-input\"/>\n+ <element name=\"usePaymentButton\" type=\"button\" selector=\"#maxo_payment_methods #buyer-action-button-bottom .a-button-input\"/>\n</section>\n</sections>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutDeclinedV2Test.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutDeclined\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Checkout Declined\"/>\n+ <title value=\"Amazon Checkout Declined\"/>\n+ <description value=\"User should get declined message when Amazon Rejects the payment.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ </annotations>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\">\n+ <argument name=\"cc\" value=\"3434\" />\n+ </actionGroup>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <waitForElementVisible selector=\"{{CheckoutPaymentSection.placeOrder}}\" time=\"30\" stepKey=\"waitForPlaceOrderButton\"/>\n+ <click selector=\"{{CheckoutPaymentSection.placeOrder}}\" stepKey=\"clickPlaceOrder\"/>\n+\n+ <!--Wait for redirect to cart-->\n+ <waitForPageLoad stepKey=\"waitRedirect\"/>\n+ <seeInCurrentUrl url=\"{{CheckoutCartPage.url}}\" stepKey=\"assertUrl\"/>\n+ <waitForText userInput=\"transaction has been declined\" selector=\"{{AdminMessagesSection.errorMessage}}\" stepKey=\"waitForText\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-263 - add test for checkout decline |
21,241 | 19.11.2020 13:14:13 | 21,600 | 30812a7d6bc0897589279817151f3db046ad88d3 | add test for buyer canceled | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/PayV2/Test/Mftf/Test/AmazonCheckoutBuyerCanceledTest.xml",
"diff": "+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<tests xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"urn:magento:mftf:Test/etc/testSchema.xsd\">\n+ <test name=\"AmazonCheckoutBuyerCanceled\" extends=\"AmazonCheckoutButtonV2\">\n+ <annotations>\n+ <stories value=\"Amazon Checkout Buyer Canceled\"/>\n+ <title value=\"Amazon Checkout Buyer Canceled\"/>\n+ <description value=\"User should get declined message when buyer cancels the payment.\"/>\n+ <severity value=\"CRITICAL\"/>\n+ <group value=\"amazon_pay_v2\"/>\n+ <group value=\"amazon_pay_v2_checkout\"/>\n+ </annotations>\n+\n+ <!--Go to Amazon Pay from the checkout and login-->\n+ <click selector=\"{{AmazonButtonSection.v2Checkout}}\" stepKey=\"clickAmazonButton\"/>\n+ <actionGroup ref=\"AmazonLoginActionGroup\" stepKey=\"AmazonLoginActionGroup\"/>\n+ <!--Come back to checkout with default address-->\n+ <actionGroup ref=\"AmazonCheckoutActionGroup\" stepKey=\"DefaultAmazonCheckoutActionGroup\">\n+ <argument name=\"cc\" value=\"3064\" />\n+ </actionGroup>\n+ <!--Go to payment method-->\n+ <click selector=\"{{CheckoutShippingSection.next}}\" stepKey=\"clickCheckoutShippingNext\"/>\n+ <waitForPageLoad stepKey=\"waitForCheckoutPaymentPageLoad\"/>\n+ <!--Verify only Amazon Pay method is visible-->\n+ <seeNumberOfElements selector=\"{{CheckoutPaymentSection.availablePaymentSolutions}}\" userInput=\"1\" stepKey=\"seeSingleAvailablePaymentSolution\"/>\n+ <seeElement selector=\"{{AmazonCheckoutSection.v2Method}}\" stepKey=\"seeAmazonPaymentMethod\"/>\n+ <!--Place order-->\n+ <waitForElementVisible selector=\"{{CheckoutPaymentSection.placeOrder}}\" time=\"30\" stepKey=\"waitForPlaceOrderButton\"/>\n+ <click selector=\"{{CheckoutPaymentSection.placeOrder}}\" stepKey=\"clickPlaceOrder\"/>\n+\n+ <!--Wait for redirect to cart-->\n+ <waitForPageLoad stepKey=\"waitRedirect\"/>\n+ <seeInCurrentUrl url=\"{{CheckoutCartPage.url}}\" stepKey=\"assertUrl\"/>\n+ <waitForText userInput=\"transaction has been canceled\" selector=\"{{AdminMessagesSection.errorMessage}}\" stepKey=\"waitForText\"/>\n+ </test>\n+</tests>\n"
}
] | PHP | Apache License 2.0 | amzn/amazon-payments-magento-2-plugin | APF-263 - add test for buyer canceled |