-
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 Validate Apple Pay passing HttpsProxyAgent to Axios post #3885
Merged
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
With this change, we are making a new attempt at using Axios with HttpsProxyAgent to operate an Apple Pay Merchant validation when there is a proxy, which is the configuration in place for all of our environments on AWS. The Apple Pay validation with Axios is switched on only on the Test environment, not on production, therefore this change is safe to deploy because it does not change the validation with `request retry` which is used for production. This new version passes the HttpsProxyAgent within the post method, in the third parameter, together with headers. Further information in the Axios documentation[1], which unfortunately does not have examples with HttpsProxyAgent, and in the Jira ticket[2]. [1] https://axios-http.com/docs/post_example [2] https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
commented
Aug 2, 2024
} | ||
|
||
} else { |
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.
Note that there is no change to the implementation using request retry which is used in production.
SandorArpa
approved these changes
Aug 2, 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.
LOKTM
marcotranchino
added a commit
that referenced
this pull request
Aug 2, 2024
With the previous PR[1], we have made some progress in communicating with Apple Pay via Axios and HttpsProxyAgent and we have tested that the validation is initiated correctly but then fails with the following message from Apple: `Apple Pay Merchant ID not valid`. See screenshot in the new PR[2]. With this change, we are now adding the charset to the Content-Type header in the post request, in case that is what is expected by Apple Pay, and we are also adding the status to the error log, to have a little bit more information back. Further information in JIRA[3]. [1] #3885 [2] #3886 [3] https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
added a commit
that referenced
this pull request
Aug 2, 2024
With the previous PR[1], we have made some progress in communicating with Apple Pay via Axios and HttpsProxyAgent and we have tested that the validation is initiated correctly but then fails with the following message from Apple: `Apple Pay Merchant ID not valid`. See screenshot in the new PR[2]. With this change, we are now adding the charset to the Content-Type header in the post request, in case that is what is expected by Apple Pay, and we are also adding the status to the error log, to have a little bit more information back. Further information in JIRA[3]. [1] #3885 [2] #3886 [3] https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
added a commit
that referenced
this pull request
Aug 2, 2024
With the previous PRs[1][2], we have made some progress in communicating with Apple Pay via Axios and HttpsProxyAgent and we have tested that the validation is initiated correctly but then fails with the following message from Apple: `Apple Pay Merchant ID not valid`. See screenshot in the second PR[2]. With this change, we are now passing the certificate and key to the Proxy Agent via additional options. Further information in JIRA[3]. [1] #3885 [2] #3886 [3] https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
added a commit
that referenced
this pull request
Aug 5, 2024
…axios With the previous PRs[1][2][3], we have made some progress in communicating with Apple Pay via Axios and HttpsProxyAgent and we have tested that the validation is initiated correctly but then fails with the following message: `Apple Pay Merchant ID not valid`. See screenshot in the second PR[2]. With this change, we are now creating the HttpsProxyAgent with just the proxy URL as an argument for its constructor, passing it together with the certificate and key to the HttpsAgent, as arguments for its constructor, and then creating an `axios` instance, passing the HttpsAgent to it. Further information in JIRA[3]. [1] #3885 [2] #3886 [3] #3887 [4] https://payments-platform.atlassian.net/browse/PP-12853
marcotranchino
added a commit
that referenced
this pull request
Aug 5, 2024
…axios With the previous PRs[1][2][3], we have made some progress in communicating with Apple Pay via Axios and HttpsProxyAgent and we have tested that the validation is initiated correctly but then fails with the following message: `Apple Pay Merchant ID not valid`. See screenshot in the second PR[2]. With this change, we are now creating the HttpsProxyAgent with just the proxy URL as an argument for its constructor, passing it together with the certificate and key to the HttpsAgent, as arguments for its constructor, and then creating an `axios` instance, passing the HttpsAgent to it. Further information in JIRA[3]. [1] #3885 [2] #3886 [3] #3887 [4] https://payments-platform.atlassian.net/browse/PP-12853
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 making a new attempt at using Axios with HttpsProxyAgent to operate an Apple Pay Merchant validation when there is a proxy, which is the configuration in place for all of our environments on AWS.
The Apple Pay validation with Axios is switched on only on the Test environment, not on production, therefore this change is safe to deploy because it does not change the validation with
request retry
which is used for production.This new version passes the HttpsProxyAgent within the post method, in the third parameter, together with headers.
Further information in the Axios documentation[1], which unfortunately does not have examples with HttpsProxyAgent, and in the Jira ticket[2].
[1]
https://axios-http.com/docs/post_example
[2]
https://payments-platform.atlassian.net/browse/PP-12853