mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +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
|
@ -44,6 +44,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
|
|||
const { productionOnboardingUrl } = CommonHooks.useProduction();
|
||||
const products = OnboardingHooks.useDetermineProducts();
|
||||
const { withActivity } = CommonHooks.useBusyState();
|
||||
const { connectViaAuthCode } = CommonHooks.useAuthentication();
|
||||
const [ onboardingUrl, setOnboardingUrl ] = useState( '' );
|
||||
const [ scriptLoaded, setScriptLoaded ] = useState( false );
|
||||
const timerRef = useRef( null );
|
||||
|
@ -112,7 +113,7 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
|
|||
|
||||
const setCompleteHandler = useCallback(
|
||||
( environment ) => {
|
||||
const onComplete = async ( authCode, shareId ) => {
|
||||
const onComplete = async ( authCode, sharedId ) => {
|
||||
/**
|
||||
* Until now, the full page is blocked by PayPal's semi-transparent, black overlay.
|
||||
* But at this point, the overlay is removed, while we process the sharedId and
|
||||
|
@ -126,14 +127,10 @@ export const useHandleOnboardingButton = ( isSandbox ) => {
|
|||
ACTIVITIES.CONNECT_ISU,
|
||||
'Validating the connection details',
|
||||
async () => {
|
||||
// TODO -- finish this!
|
||||
console.log(
|
||||
`${ environment }-boarding complete - AUTH: `,
|
||||
authCode
|
||||
);
|
||||
console.log(
|
||||
`${ environment }-boarding complete - SHARE:`,
|
||||
shareId
|
||||
await connectViaAuthCode(
|
||||
authCode,
|
||||
sharedId,
|
||||
environment
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue