mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
✨ Add React logic for final ISU authentication
This commit is contained in:
parent
1246a02f07
commit
0d5832aa8b
5 changed files with 63 additions and 9 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue