♻️ Rename REST endpoint for manual login

This commit is contained in:
Philipp Stracker 2025-01-02 14:35:24 +01:00
parent ff1df84ada
commit ef0e7e756c
No known key found for this signature in database
3 changed files with 12 additions and 8 deletions

View file

@ -35,14 +35,15 @@ export const REST_HYDRATE_MERCHANT_PATH = '/wc/v3/wc_paypal/common/merchant';
export const REST_PERSIST_PATH = '/wc/v3/wc_paypal/common';
/**
* REST path to perform the manual connection check, using client ID and secret,
* REST path to perform the manual connection authentication, using client ID and secret.
*
* Used by: Controls
* See: AuthenticateRestEndpoint.php
*
* @type {string}
*/
export const REST_MANUAL_CONNECTION_PATH = '/wc/v3/wc_paypal/authenticate';
export const REST_DIRECT_AUTHENTICATION_PATH =
'/wc/v3/wc_paypal/authenticate/direct';
/**
* REST path to generate an ISU URL for the PayPal-login.

View file

@ -11,7 +11,7 @@ import apiFetch from '@wordpress/api-fetch';
import {
REST_PERSIST_PATH,
REST_MANUAL_CONNECTION_PATH,
REST_DIRECT_AUTHENTICATION_PATH,
REST_CONNECTION_URL_PATH,
REST_HYDRATE_MERCHANT_PATH,
REST_REFRESH_FEATURES_PATH,
@ -56,7 +56,7 @@ export const controls = {
} ) {
try {
return await apiFetch( {
path: REST_MANUAL_CONNECTION_PATH,
path: REST_DIRECT_AUTHENTICATION_PATH,
method: 'POST',
data: {
clientId,