Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store account type during onboarding (4204) #3087

Merged
merged 12 commits into from
Feb 11, 2025

Conversation

stracker-phil
Copy link
Contributor

Description

Detects the account-type (business or personal) during authentication, at the end of the onboarding flow, and stores it in the database.

Usage

In PHP

$data = $container->get( 'settings.data.general' );

if ( $data->is_business_seller() ) {
  // This is a business account.
} elseif ( $data.>is_casual_seller() ) {
  // This is a personal account.
} else {
  // Neither business nor casual: We do not know the type.
}

In React

import { CommonHooks } from '../../../data';

// ...

const merchant = CommonHooks.useMerchant();

if ( merchant.isBusinessSeller ) {
  // Confirmed business seller account.
} else if ( merchant.isCasualSeller ) {
  // Confirmed casual seller account.
} else {
  // Unknown account type
}

@Dinamiko Dinamiko merged commit b500e34 into trunk Feb 11, 2025
6 checks passed
@Dinamiko Dinamiko deleted the PCP-4204-store-account-type-during-onboarding branch February 11, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants