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

PP-12853 Use axios or request retry for Apple Pay Merchant validation depending on configuration #3877

Merged

Commits on Jul 29, 2024

  1. Use axios for ApplePay Merchant Validation with or without proxy

    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
    marcotranchino committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b088df5 View commit details
    Browse the repository at this point in the history
  2. Use axios or request retry for Apple Pay Merchant validation

    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 committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    3dfbcbe View commit details
    Browse the repository at this point in the history
  3. Pass certificate and key to HttpsProxyAgent via options

    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
    marcotranchino committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    9b124be View commit details
    Browse the repository at this point in the history