Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECP-9230] Prevent refreshing Quote ID during page refresh on product page for express payment #93

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

SushmitaThakur
Copy link
Contributor

@SushmitaThakur SushmitaThakur commented Jun 14, 2024

Summary

On product page for express checkouts, the quote-id is being created every time the page is refreshed on the browser and as a result a multiple entries exist in the quote table for the same product. This happens for both logged in or guest user where quote id is maintained for the session but not through refresh. This PR includes storing the quote-id to JS local storage variable and accessing it whenever getRequest method is called, to check whether there is an existing quote-id, if not then let getRequest create a new one.

Tested scenarios

  1. Quote-id is retained on page refresh
  2. On visiting a different product page than the current one, the previous quote-id is removed

Fixed issue:

sushmita added 3 commits June 12, 2024 11:35
…nse before the call to setExpressMethods is made
…same page even after refresh, destroy the quote id if travel to another page
@SushmitaThakur SushmitaThakur requested a review from a team as a code owner June 14, 2024 12:09
@SushmitaThakur SushmitaThakur changed the title [ECP-9230] Save Quote ID during page refresh on product page for express payment [ECP-9230] Prevent refreshing Quote ID during page refresh on product page for express payment Jun 14, 2024
RokPopov
RokPopov previously approved these changes Jul 15, 2024
Copy link

@SushmitaThakur SushmitaThakur merged commit 4deb8c4 into develop Jul 17, 2024
7 checks passed
@SushmitaThakur SushmitaThakur deleted the ECP-9230 branch July 17, 2024 10:49
@RokPopov RokPopov added the Fix Indicates a bug fix label Jul 23, 2024
@RokPopov RokPopov mentioned this pull request Jul 23, 2024
@candemiralp candemiralp restored the ECP-9230 branch July 30, 2024 08:48
candemiralp pushed a commit that referenced this pull request Aug 2, 2024
… product page for express payment (#93)"

This reverts commit 4deb8c4.
raoulritter pushed a commit that referenced this pull request Aug 15, 2024
* [ECP-8715] Refactor initPayments JS action

* Revert "[ECP-9230] Prevent refreshing Quote ID during page refresh on product page for express payment (#93)"

This reverts commit 4deb8c4.

* Improve error handling on shipping details changes

* Revert ECP-9230

* Fix PDP payment issues and update endpoints

* Fix tax calculation issue on PayPal express

* Use billing address if the quote is virtual

* Fix /paymentMethods request amount value

---------

Co-authored-by: Can Demiralp <[email protected]>
khushboo-singhvi added a commit that referenced this pull request Aug 21, 2024
* [ECP-9072] Implement backend requirements of PayPal express (#84)

* [ECP-9072] Add new configuration values

* [ECP-9072] Refactor Button classes and create a new one for PayPal

* [ECP-9072] Implement an abstract config getter for showOn fields

* [ECP-9072] Define payment method variants

* [ECP-9072] Implement abstract observer and simplify the observer logic

* [ECP-9072] Add new event for PayPal observer

* [ECP-9072] Add new resolver for PayPal

* [ECP-9072] Rename the variable

* [ECP-9072] Create forced required frontend template file

* [ECP-8992] Remove setup_version constraint from the data patch

* [ECP-8992] Update configuration paths to reflect real Adyen tx_variants

* [ECP-8992] Implement abstract template for shortcut buttons

* [ECP-8992] Update abstract observer

* [ECP-8992] Create Magento frontend JS component for PayPal express

* [ECP-8992] Update frontend template

* [ECP-8992] Refactor code duplication

* [ECP-8992] Create abstract config route patcher

---------

Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9114] Implement /payments endpoint for express use cases (#88)

Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9082] Implement Checkout API's /paypal/updateOrder endpoint (#86)

* Implement Checkout API's /paypal/updateOrder endpoint

* [ECP-9082] Obtain order related information from backend and implement guest endpoint

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9072] Implement backend requirements of PayPal express (#84)

* [ECP-9072] Add new configuration values

* [ECP-9072] Refactor Button classes and create a new one for PayPal

* [ECP-9072] Implement an abstract config getter for showOn fields

* [ECP-9072] Define payment method variants

* [ECP-9072] Implement abstract observer and simplify the observer logic

* [ECP-9072] Add new event for PayPal observer

* [ECP-9072] Add new resolver for PayPal

* [ECP-9072] Rename the variable

* [ECP-9072] Create forced required frontend template file

* [ECP-8992] Remove setup_version constraint from the data patch

* [ECP-8992] Update configuration paths to reflect real Adyen tx_variants

* [ECP-8992] Implement abstract template for shortcut buttons

* [ECP-8992] Update abstract observer

* [ECP-8992] Create Magento frontend JS component for PayPal express

* [ECP-8992] Update frontend template

* [ECP-8992] Refactor code duplication

* [ECP-8992] Create abstract config route patcher

---------

Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9114] Implement /payments endpoint for express use cases (#88)

Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9082] Implement Checkout API's /paypal/updateOrder endpoint (#86)

* Implement Checkout API's /paypal/updateOrder endpoint

* [ECP-9082] Obtain order related information from backend and implement guest endpoint

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>

* [ECP-9143] Configure the place for the express components (PDP, minicart, summary), (#91)

* [ECP-9143] Configure the place for the express components (PDP, minicart, summary),

* [ECP-9143] Adding braces for if else block

* Update Observer/AddGooglePayShortcuts.php

Removing unwanted ,

Co-authored-by: Rok Popov Ledinski <[email protected]>

* [ECP-8400] Support virtual products on express payments (#78)

* [ECP-8400] Implement virtualQuoteModel to obtain quote type

* [ECP-8400] Fix pdp virtual quote condition

* [ECP-8400] Fix placing order with virtual product

* [ECP-8400] Handle payment status

* [ECP-8400] Support virtual products on Apple Pay express

* [ECP-8400] Update the related callbacks

* [ECP-8400] Fix virtualQuote model

* [ECP-8400] Fix virtualQuote model

* [ECP-8400] Fix virtualQuote model

---------

Co-authored-by: Can Demiralp <[email protected]>

* Add onAvailable event for Apple Pay (#82)

Co-authored-by: Dimitri BOUTEILLE <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>

* Version bump 2.1.0

* [ECP-9143] Configure the place for the express components (PDP, minicart, summary),

# Conflicts:
#	Observer/AddApplePayShortcuts.php
#	Observer/AddGooglePayShortcuts.php

* Solving sonarcloud pipeline

---------

Co-authored-by: Rok Popov Ledinski <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Dimitri BOUTEILLE <[email protected]>
Co-authored-by: Dimitri BOUTEILLE <[email protected]>
Co-authored-by: RokPopov <[email protected]>

* [ECP-9079] Implementing frontend logic for Paypal Express (#95)

* [ECP-9079] Adding frontend component to Paypal

* [ECP-9079] Adding frontend component to Paypal

* [ECP-9079] Adding frontend component to Paypal

* [ECP-9079] Adding frontend component to Paypal

* [ECP-9079] Adding frontend component to Paypal

* [ECP-9079] Adding frontend component to Paypal - adding new Observer to change the payment method name back to paypal and set status as New.

* Abstracting the code, removing the console.logs

* Adding payment-details call block for express and not using module-payment one, bcoz it incorrectly checks the loggedIn User logic

* Removing isMultishipping parameter, as this is not a valid use case for Express

* Removing duplicates

* Removing useless comments

Co-authored-by: Ángel Campos <[email protected]>

* Resolving comments on PR by not passing amount from frontend rather getting the subtotal from the quote for the /payments call and also removing unwanted comments and getting the order status dynamically from the state

* Updating naming conventions to prevent confusions for future.

* Updating assignments within the condition check

* Found the refence here https://docs.adyen.com/development-resources/client-side-authentication/migrate-from-origin-key-to-client-key/

* Update button.js

Removing unwanted console.log

* Update AdyenInitPayments.php

Getting the currency also from the Quote instead of chargedQuoteCurrency

---------

Co-authored-by: Ángel Campos <[email protected]>

* Enabling Paypal Express on PDP (#102)

Solving some of the obvious sonarcloud suggestions

* Providing telemetry's endpoint expressPage field to payment method component configurations (#103)

* Refactoring the code and removing deprecated facades

* Updating changes for PDP for logged in user

* [ECP-9381] Fix PDP payment, discounted price and tax calculation (#104)

* [ECP-8715] Refactor initPayments JS action

* Revert "[ECP-9230] Prevent refreshing Quote ID during page refresh on product page for express payment (#93)"

This reverts commit 4deb8c4.

* Improve error handling on shipping details changes

* Revert ECP-9230

* Fix PDP payment issues and update endpoints

* Fix tax calculation issue on PayPal express

* Use billing address if the quote is virtual

* Fix /paymentMethods request amount value

---------

Co-authored-by: Can Demiralp <[email protected]>

* Adding missing semicolons

* Removing unused versions

* Beautifying the code

---------

Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: Can Demiralp <[email protected]>
Co-authored-by: raoulritter <[email protected]>
Co-authored-by: khushboos <[email protected]>
Co-authored-by: Dimitri BOUTEILLE <[email protected]>
Co-authored-by: Dimitri BOUTEILLE <[email protected]>
Co-authored-by: Ángel Campos <[email protected]>
@candemiralp candemiralp deleted the ECP-9230 branch October 2, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Indicates a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ECP-9155] Apple Pay on product page creates a new quote every time the page is loaded
3 participants