♻️ Use EnvironmentConfig in ConnectionUrlGenerator

This commit is contained in:
Philipp Stracker 2025-01-03 13:48:26 +01:00
parent a1f80f1d3d
commit 3f691bea01
No known key found for this signature in database
6 changed files with 54 additions and 85 deletions

View file

@ -153,7 +153,7 @@ export const persist = function* () {
export const sandboxOnboardingUrl = function* () {
return yield {
type: ACTION_TYPES.DO_GENERATE_ONBOARDING_URL,
environment: 'sandbox',
useSandbox: true,
products: [ 'EXPRESS_CHECKOUT' ],
};
};
@ -167,7 +167,7 @@ export const sandboxOnboardingUrl = function* () {
export const productionOnboardingUrl = function* ( products = [] ) {
return yield {
type: ACTION_TYPES.DO_GENERATE_ONBOARDING_URL,
environment: 'production',
useSandbox: false,
products,
};
};

View file

@ -36,13 +36,13 @@ export const controls = {
async [ ACTION_TYPES.DO_GENERATE_ONBOARDING_URL ]( {
products,
environment,
useSandbox,
} ) {
try {
return apiFetch( {
path: REST_CONNECTION_URL_PATH,
method: 'POST',
data: { environment, products },
data: { useSandbox, products },
} );
} catch ( e ) {
return {