2024-11-21 19:28:08 +01:00
import { _ _ } from '@wordpress/i18n' ;
2024-11-05 18:32:33 +01:00
import { Button } from '@wordpress/components' ;
2025-01-10 13:30:06 +01:00
import PaymentMethodIcons from '../../../ReusableComponents/PaymentMethodIcons' ;
2025-01-22 15:09:04 +01:00
import { Separator } from '../../../ReusableComponents/Elements' ;
2025-01-22 17:57:30 +01:00
import Accordion from '../../../ReusableComponents/AccordionSection' ;
2025-02-21 11:58:37 +01:00
import { CommonHooks , OnboardingHooks } from '../../../../data' ;
2025-01-10 13:30:06 +01:00
import BusyStateWrapper from '../../../ReusableComponents/BusyStateWrapper' ;
import OnboardingHeader from '../Components/OnboardingHeader' ;
import WelcomeDocs from '../Components/WelcomeDocs' ;
import AdvancedOptionsForm from '../Components/AdvancedOptionsForm' ;
2024-10-23 08:56:47 +02:00
2024-12-03 16:06:41 +01:00
const StepWelcome = ( { setStep , currentStep } ) => {
2024-12-12 17:54:38 +01:00
const { storeCountry } = CommonHooks . useWooSettings ( ) ;
2025-02-26 15:19:42 +01:00
const { canUseCardPayments , canUseFastlane } = OnboardingHooks . useFlags ( ) ;
2025-02-21 11:58:37 +01:00
const nonAcdcIcons = [ 'paypal' , 'visa' , 'mastercard' , 'amex' , 'discover' ] ;
2024-12-03 16:06:41 +01:00
2024-10-23 08:56:47 +02:00
return (
< div className = "ppcp-r-page-welcome" >
< OnboardingHeader
title = { _ _ (
'Welcome to PayPal Payments' ,
'woocommerce-paypal-payments'
) }
description = { _ _ (
2024-11-12 15:01:29 +01:00
'Your all-in-one integration for PayPal checkout solutions that enable buyers to pay via PayPal, Pay Later, all major credit/debit cards, Apple Pay, Google Pay, and more.' ,
2024-10-23 08:56:47 +02:00
'woocommerce-paypal-payments'
) }
/ >
< div className = "ppcp-r-inner-container" >
< WelcomeFeatures / >
2025-02-21 11:58:37 +01:00
< PaymentMethodIcons
icons = { canUseCardPayments ? 'all' : nonAcdcIcons }
/ >
2024-11-05 18:42:32 +01:00
< p className = "ppcp-r-button__description" >
{ _ _ (
` Click the button below to be guided through connecting your existing PayPal account or creating a new one.You will be able to choose the payment options that are right for your store. ` ,
'woocommerce-paypal-payments'
) }
< / p >
2024-12-09 18:16:13 +01:00
< BusyStateWrapper >
< Button
className = "ppcp-r-button-activate-paypal"
variant = "primary"
onClick = { ( ) => setStep ( currentStep + 1 ) }
>
{ _ _ (
'Activate PayPal Payments' ,
'woocommerce-paypal-payments'
) }
< / B u t t o n >
< / B u s y S t a t e W r a p p e r >
2024-10-23 08:56:47 +02:00
< / d i v >
2024-11-05 18:42:32 +01:00
< Separator className = "ppcp-r-page-welcome-mode-separator" / >
2024-11-12 19:23:30 +04:00
< WelcomeDocs
2025-02-21 11:58:37 +01:00
useAcdc = { canUseCardPayments }
2025-02-26 15:19:42 +01:00
isFastlane = { canUseFastlane }
2024-11-14 11:52:00 +01:00
isPayLater = { true }
2024-12-02 18:15:07 -04:00
storeCountry = { storeCountry }
2024-11-14 11:52:00 +01:00
/ >
2024-11-05 19:10:30 +01:00
< Separator text = { _ _ ( 'or' , 'woocommerce-paypal-payments' ) } / >
2025-01-22 17:57:30 +01:00
< Accordion
2024-11-05 19:10:30 +01:00
title = { _ _ (
'See advanced options' ,
'woocommerce-paypal-payments'
) }
2024-11-07 13:09:58 +01:00
className = "onboarding-advanced-options"
2025-01-23 17:51:15 +01:00
noCaps = { true }
2024-11-21 16:00:03 +01:00
id = "advanced-options"
2024-11-05 19:10:30 +01:00
>
2024-12-03 16:06:41 +01:00
< AdvancedOptionsForm / >
2025-01-22 17:57:30 +01:00
< / A c c o r d i o n >
2024-10-23 08:56:47 +02:00
< / d i v >
) ;
} ;
const WelcomeFeatures = ( ) => {
return (
< div className = "ppcp-r-welcome-features" >
< div className = "ppcp-r-welcome-features__col" >
< span > { _ _ ( 'Deposits' , 'woocommerce-paypal-payments' ) } < / s p a n >
< p > { _ _ ( 'Instant' , 'woocommerce-paypal-payments' ) } < / p >
< / d i v >
< div className = "ppcp-r-welcome-features__col" >
< span >
{ _ _ ( 'Payment Capture' , 'woocommerce-paypal-payments' ) }
< / s p a n >
< p >
{ _ _ (
'Authorize only or Capture' ,
'woocommerce-paypal-payments'
) }
< / p >
< / d i v >
< div className = "ppcp-r-welcome-features__col" >
< span >
{ _ _ (
'Recurring payments' ,
'woocommerce-paypal-payments'
) }
< / s p a n >
< p > { _ _ ( 'Supported' , 'woocommerce-paypal-payments' ) } < / p >
< / d i v >
< / d i v >
) ;
} ;
export default StepWelcome ;