SLP® phpDocs

MySLP_Customer_Profile extends SLP_Base_ReactObject
in package

MySLP_Customer_Profile class manages customer profiles and integrates various admin functionalities such as menu creation, plugin hooks, and actions specific to email settings and subscription handling.

Profile | Subscriptions | Update Card $_REQUEST['__stripe_mid'] = $_REQUEST['page'] = 'myslp_profile' $_REQUEST['stripeEmail'] = $REQUEST['stripeToken'] = tok

Table of Contents

Properties

$addon  : object
$buildDir  : string
$buildURL  : string
$myslp  : MySLP
$notifications  : array<string|int, mixed>
$pageName  : string
$scriptAssetFile  : string
$scriptFile  : string
$scriptURL  : string
$slplus  : SLPlus
$pluginDir  : mixed
$pluginURL  : mixed
$scriptFilebase  : mixed
$scriptHandle  : mixed
$slug  : mixed
$uses_myslp  : bool
$uses_slplus  : mixed
$wrapper_class  : mixed

Methods

__construct()  : mixed
__get()  : SLPlus_BaseClass_Object
__isset()  : bool
add_notification()  : void
Add Notification
extendReactVars()  : array<string|int, mixed>
Retrieves and modifies variables used for integration with React front-end.
get_instance()  : static
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
page_profile()  : void
Render the My Profile page.
render()  : void
Render admin page - default can be overriden.
set_properties()  : mixed
Set our properties.
enqueueReact()  : void
Things we normally want to do before each render
get_vars_for_react()  : array<string|int, mixed>
Pass data from PHP to React JavaScript environment.
initialize()  : void
Initialize the plugin by setting up hooks, filters, and actions.
cancel_subscription()  : void
Process the "cancel subscription" button.
change_plan()  : void
Change a subscription.
do_when_plugins_loaded()  : void
Things that run when plugins_loaded.
switch_to_stripe()  : void
PAYPAL: Process the "Switch To Stripe" button.
update_card()  : void
Update the card number for Stripe users.

Properties

$buildDir read-only

public string $buildDir

The build directory where the React script lives.

$pageName

public string $pageName

The page name for React, update with initialize() override.

$scriptAssetFile read-only

public string $scriptAssetFile

The fully qualified file name for the React script supporting asset PHP file.

$scriptFile read-only

public string $scriptFile

The fully qualified file name for the React script.

Methods

__construct()

public __construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

__isset()

public __isset(string $property) : bool
Parameters
$property : string
Return values
bool

add_notification()

Add Notification

public add_notification(string $severity, string $msg) : void
Parameters
$severity : string
$msg : string

extendReactVars()

Retrieves and modifies variables used for integration with React front-end.

public extendReactVars(mixed $vars) : array<string|int, mixed>
Parameters
$vars : mixed
Return values
array<string|int, mixed>

An associative array of variables including updated MySLP-specific data.

get_instance()

Return an instance of the object which is also registered to the slplus global less the SLP_ part.

public static get_instance([bool $no_global = false ][, mixed $params = array() ]) : static
Parameters
$no_global : bool = false

set to true to skip assigning object to SLP global as a property.

$params : mixed = array()

object init params

Return values
static

render()

Render admin page - default can be overriden.

public render() : void

Provide the DOM element where the React app will render: slp-full-page-react-app

set_properties()

Set our properties.

public set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
$options : array<string|int, mixed> = array()

enqueueReact()

Things we normally want to do before each render

protected enqueueReact() : void

get_vars_for_react()

Pass data from PHP to React JavaScript environment.

protected get_vars_for_react() : array<string|int, mixed>

Use this for one-time setup, things that are mostly static in PHP but you need to send to JS.

Return values
array<string|int, mixed>

initialize()

Initialize the plugin by setting up hooks, filters, and actions.

protected final initialize() : void
Tags
throws
ApiErrorException

cancel_subscription()

Process the "cancel subscription" button.

private cancel_subscription() : void
Tags
uses
MySLP_Stripe_Payments::cancel_subscription

change_plan()

Change a subscription.

private change_plan() : void
Tags
uses
MySLP_Customer_Profile::add_notification

do_when_plugins_loaded()

Things that run when plugins_loaded.

private do_when_plugins_loaded() : void

Since this object is invoked when 'plugins_loaded' is called, this runs from the constructor.

Update Card $_POST [stripeToken] => tok_1T1fa0BvHKfBw2LGtMLe2eRa [stripeEmail] => costarica@storelocatorplus.com

Tags
throws
ApiErrorException
uses
MySLP_Customer_Profile::cancel_subscription

switch_to_stripe()

PAYPAL: Process the "Switch To Stripe" button.

private switch_to_stripe() : void

update_card()

Update the card number for Stripe users.

private update_card() : void

For PayPal users (soon to be deprecated) this does nothing.

Tags
throws
ApiErrorException

        
On this page

Search results