Add React logic for final ISU authentication

This commit is contained in:
Philipp Stracker 2025-01-02 18:22:09 +01:00
parent 1246a02f07
commit 0d5832aa8b
No known key found for this signature in database
5 changed files with 63 additions and 9 deletions

View file

@ -189,6 +189,34 @@ export const connectViaSecret = function* () {
};
};
/**
* Side effect. Completes the ISU login by authenticating the user via the one time sharedId and
* authCode provided by PayPal.
*
* This action accepts parameters instead of fetching data from the Redux state because all
* parameters are dynamically generated during the authentication process, and not managed by our
* Redux store.
*
* @param {string} sharedId - One-time authentication ID that PayPal "shares" with us.
* @param {string} authCode - Matching one-time authentication code to validate the login.
* @param {string} environment - [production|sandbox].
* @return {Action} The action.
*/
export const connectViaAuthCode = function* (
sharedId,
authCode,
environment
) {
const useSandbox = 'sandbox' === environment;
return yield {
type: ACTION_TYPES.DO_ISU_AUTHENTICATION,
sharedId,
authCode,
useSandbox,
};
};
/**
* Side effect. Clears and refreshes the merchant data via a REST request.
*