-
Notifications
You must be signed in to change notification settings - Fork 12
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
PP-12853 Use axios or request retry for Apple Pay Merchant validation depending on configuration #3877
Merged
marcotranchino
merged 3 commits into
master
from
pp-12853-apple-pay-merchant-validation-two-ways
Jul 29, 2024
Merged
PP-12853 Use axios or request retry for Apple Pay Merchant validation depending on configuration #3877
marcotranchino
merged 3 commits into
master
from
pp-12853-apple-pay-merchant-validation-two-ways
Jul 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcotranchino
changed the title
Revert "Pp 12853 apple pay merchant validation revert changes"
Execute Apple Pay Merchant Validation normally or with axios depending on the environment
Jul 26, 2024
marcotranchino
force-pushed
the
pp-12853-apple-pay-merchant-validation-two-ways
branch
2 times, most recently
from
July 26, 2024 16:43
4195579
to
62d9d70
Compare
With this change, we are updating the controller in charge of operating the Apple Pay Merchant Validation so that it uses axios instead of request retry, and also so that it uses HttpsProxyAgent if a proxy URL is defined in the environment. This is needed because we have realised that the test environment uses a proxy, while the local environment does not, thus requiring us to use axios in two different ways depending on the presence or absence of a proxy. Further information in Jira. https://payments-platform.atlassian.net/browse/PP-12853
With this change, we are introducing a new environment variable to check whether the pay-frontend application should use axios for the Apple Pay Merchant Validation. By default the new variable will not exist on any environment, therefore pay-frontend will keep using request retry to operate the Apple Pay Merchant Validation. When the new variable is created and set to true, then pay-frontend will use Axios, with or without the use of HttpsProxyAgent, in order to operate the Apple Pay Merchant Validation. This will allow us to safely deploy this change to all environments including production, and crucially it will allow us to test the Apple Pay Merchant Validation using axios on the Test environment only by creating the new environment variable there and setting it to 'true'. Further work will be needed to remove the old code and the use of request retry once the validation will be successfully operated with axios in all environments. Note that for simplicity the old tests for the Apple Pay Merchant Validation using request retry have been saved in a new file called old-merchant-validation.controller.test.js, so that it will be easy to simply delete this file once the current way using request retry will be fully discontinued. Further information in Jira. https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
force-pushed
the
pp-12853-apple-pay-merchant-validation-two-ways
branch
from
July 29, 2024 11:07
62d9d70
to
3dfbcbe
Compare
marcotranchino
changed the title
Execute Apple Pay Merchant Validation normally or with axios depending on the environment
Use axios or request retry for Apple Pay Merchant validation depending on configuration
Jul 29, 2024
marcotranchino
changed the title
Use axios or request retry for Apple Pay Merchant validation depending on configuration
PP-12853 Use axios or request retry for Apple Pay Merchant validation depending on configuration
Jul 29, 2024
With this change, we are passing the merchant certificate and key to Axios using HttpsProxyAgent, including them in the options. Further information in JIRA. https://payments-platform.atlassian.net/browse/PP-12853
hjvoid
reviewed
Jul 29, 2024
test/controllers/web-payments/apple-pay/merchant-validation.controller.test.js
Show resolved
Hide resolved
hjvoid
reviewed
Jul 29, 2024
test/controllers/web-payments/apple-pay/merchant-validation.controller.test.js
Show resolved
Hide resolved
hjvoid
reviewed
Jul 29, 2024
test/controllers/web-payments/apple-pay/merchant-validation.controller.test.js
Show resolved
Hide resolved
hjvoid
approved these changes
Jul 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - nice one 💪
marcotranchino
deleted the
pp-12853-apple-pay-merchant-validation-two-ways
branch
July 29, 2024 15:18
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this change, we are introducing a new environment variable to check
whether the pay-frontend application should use
axios
for the Apple PayMerchant Validation.
By default the new variable will not exist on any environment, therefore
pay-frontend will keep using
request retry
to operate the Apple Pay MerchantValidation.
When the new variable is created and set to true, then pay-frontend will use
axios
, with or without the use of HttpsProxyAgent, in order to operate theApple Pay Merchant Validation.
This will allow us to safely deploy this change to all environments including
production, and crucially it will allow us to test the Apple Pay Merchant
Validation using
axios
on the Test environment only, by creating the newenvironment variable there and setting it to 'true'.
Further work will be needed to remove the old code and the use of request
retry once the validation will be successfully operated with
axios
in allenvironments.
Note that for simplicity the old tests for the Apple Pay Merchant Validation
using
request retry
have been saved in a new file calledold-merchant-validation.controller.test.js
, so that it will be easy to simplydelete this file once the current way using request retry will be fully
discontinued.
Further information in Jira.
https://payments-platform.atlassian.net/browse/PP-12853
screenshots of logs when request retry is used (default)
screenshots of logs when axios is used (to be enabled on test environment)