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

Improve Client Configuration Docs #1325

Open
tpater opened this issue Feb 19, 2024 · 2 comments
Open

Improve Client Configuration Docs #1325

tpater opened this issue Feb 19, 2024 · 2 comments
Labels
do not stale Feature New feature or request

Comments

@tpater
Copy link

tpater commented Feb 19, 2024

Is your feature request related to a problem? Please describe.
I've been studying official docs of setting up my configuration before going live: https://docs.adyen.com/development-resources/live-endpoints/?tab=web_1#checkout-endpoints

It says I should know my live prefix generated in live environment backoffice.
Also I should initiate the client with a proper Adyen's environment name ( live, live-us, live-au etc) depending on the reqion/country my Merchant Account is being setup.
It looks like current version of Environment enum supports only TEST & LIVE values. Is this a mistake or intentional action?
https://github.com/Adyen/adyen-node-api-library/blob/main/src/typings/enums/environment.ts

Current Config class does not have documented properties so it is hard to guess what author had in mind:
https://github.com/Adyen/adyen-node-api-library/blob/main/src/config.ts

I could not find anywhere docs on which countries belong to which Adyen's live regions: e.g.
live-apse: ["SG", "HK", "TH" // any other?]

Describe the solution you'd like
Please, provide more than one official example of initialising the Client e.g. with production-like settings (region-aware)
Please, extend existing Environment enum or put appropriate info of the underlying logic (if there is one).
Please, document whether live api prefix should also be passed to Config object or in case I'm using your library it is not required.

Nice to have: static mapping files or some utility functions to be able to resolve proper environment based on the country of origin of my user. Example:

export const reqionToCountryMapping: Record<AdyenEnvironment, Country[]> = {
  [AdyenEnvironment.LIVE]: [/* european countries */],
  [AdyenEnvironment.LIVE_US]: [Country.UNITED_STATES_OF_AMERICA],
  [AdyenEnvironment.LIVE_AU]: [Country.AUSTRALIA],
  [AdyenEnvironment.LIVE_IN]: [Country.INDIA],
  [AdyenEnvironment.LIVE_APSE]: [
    Country.SINGAPORE,
    Country.HONG_KONG,
    Country.JAPAN,
    Country.MALAYSIA,
    Country.NEW_ZEALAND,
    Country.PHILIPPINES,
    Country.SOUTH_KOREA,
    Country.TAIWAN,
    Country.THAILAND,
    Country.VIETNAM,
    // which other countries?
  ],
};
@DjoykeAbyah
Copy link
Contributor

Hi @tpater!

Thank you for reaching out to us and providing some suggestions!
We will start an investigation regarding this, and I'll get back to you once I know more. In the meantime, you can find an example of the client setup when going live in the README here.

Regards

Djoyke
Adyen

@DjoykeAbyah DjoykeAbyah changed the title [FEATURE] Improve Client Configuration Docs ECP-9234: [FEATURE] Improve Client Configuration Docs Jun 6, 2024
@DjoykeAbyah DjoykeAbyah added the Feature New feature or request label Jun 6, 2024
@DjoykeAbyah DjoykeAbyah changed the title ECP-9234: [FEATURE] Improve Client Configuration Docs ECP-9234: Improve Client Configuration Docs Jun 6, 2024
@DjoykeAbyah DjoykeAbyah changed the title ECP-9234: Improve Client Configuration Docs Improve Client Configuration Docs Jun 7, 2024
@DjoykeAbyah
Copy link
Contributor

Hi @tpater, thank you for your patience while we reviewed your feature request.

The Environment Variable configures the front-end to interact with the correct regional back-end. By setting the appropriate environment variable (e.g., live, live-us, live-au), your front-end calls will be properly localized to the correct regional servers.

The live prefix you obtain from the Adyen live environment back office localizes your back-end API calls, directing them to the correct regional servers based on your merchant account’s configuration. Therefore, additional localized API URLs are not necessary.

While creating a feature like you suggested is not on our current roadmap, we have added it to our backlog for future consideration.

Thank you again for your feedback!

Regards,
Djoyke
Adyen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not stale Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants