MySLP_Payment_Processor
extends SLPlus_BaseClass_Object
in package
implements
MySLP_Payment_Processor_Interface
Class MySLP_Payment_Processor
Provides functionality for managing payment processing, including subscriptions, customer details, and API integration within the application.
Implements methods to manage subscriptions, retrieve API version information, fetch customer details, and handle readiness checks for the payment processor.
Table of Contents
Interfaces
- MySLP_Payment_Processor_Interface
- Interface MySLP_Payment_Processor_Interface
Properties
- $addon : object
- $myslp : MySLP
- $slplus : SLPlus
- $uses_myslp : bool
- $uses_slplus : bool
- $slug : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- cancel_subscription() : mixed
- Cancel an existing subscription.
- change_subscription() : mixed
- Change an existing subscription.
- create_subscription() : mixed
- Create a subscription for a user.
- get_api_version() : mixed
- Get the API Version
- get_customer_details() : WP_Error|Customer
- Get the customer ID.
- get_instance() : static
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- get_subscription_details() : mixed
- Get the subscription details from the payment processor.
- is_ready() : bool
- Is this processor ready? Check base settings and return true if it is ready to go.
- set_properties() : mixed
- Set our properties.
- initialize() : mixed
- Do these things when this object is invoked. Override in your class.
Properties
$addon
public
object
$addon
$myslp
public
MySLP
$myslp
$slplus
public
SLPlus
$slplus
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slug
protected
mixed
$slug
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolcancel_subscription()
Cancel an existing subscription.
public
cancel_subscription() : mixed
It should return a WP_Error if there are any problems.
change_subscription()
Change an existing subscription.
public
change_subscription(string $new_plan) : mixed
It should return a WP_Error if there are any problems.
Parameters
- $new_plan : string
create_subscription()
Create a subscription for a user.
public
create_subscription(WP_REST_Request $request) : mixed
This method should talk to the payment processor to set up a recurring billing agreement.
It should return an array with the details of the billing agreement that came back from the processor.
It should return a WP_Error if there are any problems.
Parameters
- $request : WP_REST_Request
get_api_version()
Get the API Version
public
get_api_version() : mixed
This method should use the payment processor API library and read the version.
It should return a string with the API version.
It should return a WP_Error if there are any problems.
get_customer_details()
Get the customer ID.
public
get_customer_details(string $customer_id) : WP_Error|Customer
Parameters
- $customer_id : string
Return values
WP_Error|Customerget_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
staticget_subscription_details()
Get the subscription details from the payment processor.
public
get_subscription_details(string $subscription_id) : mixed
Parameters
- $subscription_id : string
is_ready()
Is this processor ready? Check base settings and return true if it is ready to go.
public
is_ready() : bool
Return values
boolset_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
initialize()
Do these things when this object is invoked. Override in your class.
protected
initialize() : mixed