mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Add can use Fastlane flag and pass it to welcome docs component
This commit is contained in:
parent
63b3c8a113
commit
109e6517f0
5 changed files with 12 additions and 4 deletions
|
@ -12,7 +12,7 @@ import AdvancedOptionsForm from '../Components/AdvancedOptionsForm';
|
|||
|
||||
const StepWelcome = ( { setStep, currentStep } ) => {
|
||||
const { storeCountry } = CommonHooks.useWooSettings();
|
||||
const { canUseCardPayments } = OnboardingHooks.useFlags();
|
||||
const { canUseCardPayments, canUseFastlane } = OnboardingHooks.useFlags();
|
||||
const nonAcdcIcons = [ 'paypal', 'visa', 'mastercard', 'amex', 'discover' ];
|
||||
|
||||
return (
|
||||
|
@ -54,7 +54,7 @@ const StepWelcome = ( { setStep, currentStep } ) => {
|
|||
<Separator className="ppcp-r-page-welcome-mode-separator" />
|
||||
<WelcomeDocs
|
||||
useAcdc={ canUseCardPayments }
|
||||
isFastlane={ true }
|
||||
isFastlane={ canUseFastlane }
|
||||
isPayLater={ true }
|
||||
storeCountry={ storeCountry }
|
||||
/>
|
||||
|
|
|
@ -24,6 +24,7 @@ const defaultTransient = Object.freeze( {
|
|||
canUseCardPayments: false,
|
||||
canUseSubscriptions: false,
|
||||
shouldSkipPaymentMethods: false,
|
||||
canUseFastlane: false,
|
||||
} ),
|
||||
} );
|
||||
|
||||
|
|
|
@ -69,13 +69,15 @@ return array(
|
|||
$can_use_subscriptions = $container->has( 'wc-subscriptions.helper' ) && $container->get( 'wc-subscriptions.helper' )
|
||||
->plugin_is_active();
|
||||
$should_skip_payment_methods = class_exists( '\WC_Payments' );
|
||||
$can_use_fastlane = $container->get( 'axo.eligible' );
|
||||
|
||||
return new OnboardingProfile(
|
||||
$can_use_casual_selling,
|
||||
$can_use_vaulting,
|
||||
$can_use_card_payments,
|
||||
$can_use_subscriptions,
|
||||
$should_skip_payment_methods
|
||||
$should_skip_payment_methods,
|
||||
$can_use_fastlane
|
||||
);
|
||||
},
|
||||
'settings.data.general' => static function ( ContainerInterface $container ) : GeneralSettings {
|
||||
|
|
|
@ -52,7 +52,8 @@ class OnboardingProfile extends AbstractDataModel {
|
|||
bool $can_use_vaulting = false,
|
||||
bool $can_use_card_payments = false,
|
||||
bool $can_use_subscriptions = false,
|
||||
bool $should_skip_payment_methods = false
|
||||
bool $should_skip_payment_methods = false,
|
||||
bool $can_use_fastlane = false
|
||||
) {
|
||||
parent::__construct();
|
||||
|
||||
|
@ -61,6 +62,7 @@ class OnboardingProfile extends AbstractDataModel {
|
|||
$this->flags['can_use_card_payments'] = $can_use_card_payments;
|
||||
$this->flags['can_use_subscriptions'] = $can_use_subscriptions;
|
||||
$this->flags['should_skip_payment_methods'] = $should_skip_payment_methods;
|
||||
$this->flags['can_use_fastlane'] = $can_use_fastlane;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,6 +83,9 @@ class OnboardingRestEndpoint extends RestEndpoint {
|
|||
'should_skip_payment_methods' => array(
|
||||
'js_name' => 'shouldSkipPaymentMethods',
|
||||
),
|
||||
'can_use_fastlane' => array(
|
||||
'js_name' => 'canUseFastlane',
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue