SubscriptionAddOn extends RecurlyResource
Table of Contents
- $array_hints : mixed
- $_add_on : mixed
- $_add_on_source : mixed
- $_created_at : mixed
- $_expired_at : mixed
- $_id : mixed
- $_object : mixed
- $_percentage_tiers : mixed
- $_quantity : mixed
- $_response : mixed
- $_revenue_schedule_type : mixed
- $_subscription_id : mixed
- $_tier_type : mixed
- $_tiers : mixed
- $_unit_amount : mixed
- $_unit_amount_decimal : mixed
- $_updated_at : mixed
- $_usage_calculation_type : mixed
- $_usage_percentage : mixed
- $_usage_timeframe : mixed
- __construct() : mixed
- Constructor
- __debugInfo() : array<string|int, mixed>
- Override of the magic method __debugInfo that will only return the relevant attributes of the \Recurly\RecurlyResource
- __set() : void
- Guard against setting invalid properties
- cast() : RecurlyResource
- Recursively converts a response object into a \Recurly\RecurlyResource.
- fromBinary() : BinaryFile
- Converts a binary response into a Recurly BinaryFile
- fromEmpty() : EmptyResource
- Returns a \Recurly\EmptyResource for API requests that do not have a response body.
- fromResponse() : RecurlyResource
- Converts a Recurly response object into a \Recurly\RecurlyResource.
- getAddOn() : AddOnMini|null
- Getter method for the add_on attribute.
- getAddOnSource() : string|null
- Getter method for the add_on_source attribute.
- getCreatedAt() : string|null
- Getter method for the created_at attribute.
- getExpiredAt() : string|null
- Getter method for the expired_at attribute.
- getId() : string|null
- Getter method for the id attribute.
- getObject() : string|null
- Getter method for the object attribute.
- getPercentageTiers() : array<string|int, mixed>
- Getter method for the percentage_tiers attribute.
- getQuantity() : int|null
- Getter method for the quantity attribute.
- getResponse() : Response
- Getter for the Recurly HTTP Response
- getRevenueScheduleType() : string|null
- Getter method for the revenue_schedule_type attribute.
- getSubscriptionId() : string|null
- Getter method for the subscription_id attribute.
- getTiers() : array<string|int, mixed>
- Getter method for the tiers attribute.
- getTierType() : string|null
- Getter method for the tier_type attribute.
- getUnitAmount() : float|null
- Getter method for the unit_amount attribute.
- getUnitAmountDecimal() : string|null
- Getter method for the unit_amount_decimal attribute.
- getUpdatedAt() : string|null
- Getter method for the updated_at attribute.
- getUsageCalculationType() : string|null
- Getter method for the usage_calculation_type attribute.
- getUsagePercentage() : float|null
- Getter method for the usage_percentage attribute.
- getUsageTimeframe() : string|null
- Getter method for the usage_timeframe attribute.
- setAddOn() : void
- Setter method for the add_on attribute.
- setAddOnSource() : void
- Setter method for the add_on_source attribute.
- setCreatedAt() : void
- Setter method for the created_at attribute.
- setExpiredAt() : void
- Setter method for the expired_at attribute.
- setId() : void
- Setter method for the id attribute.
- setObject() : void
- Setter method for the object attribute.
- setPercentageTiers() : void
- Setter method for the percentage_tiers attribute.
- setQuantity() : void
- Setter method for the quantity attribute.
- setRevenueScheduleType() : void
- Setter method for the revenue_schedule_type attribute.
- setSubscriptionId() : void
- Setter method for the subscription_id attribute.
- setTiers() : void
- Setter method for the tiers attribute.
- setTierType() : void
- Setter method for the tier_type attribute.
- setUnitAmount() : void
- Setter method for the unit_amount attribute.
- setUnitAmountDecimal() : void
- Setter method for the unit_amount_decimal attribute.
- setUpdatedAt() : void
- Setter method for the updated_at attribute.
- setUsageCalculationType() : void
- Setter method for the usage_calculation_type attribute.
- setUsagePercentage() : void
- Setter method for the usage_percentage attribute.
- setUsageTimeframe() : void
- Setter method for the usage_timeframe attribute.
- encodeApiKey() : string
- Base64 encodes the API key
- getUserAgent() : string
- Generates User-Agent for API requests
- hintArrayType() : string
- The hintArrayType method will provide type hinting for setter methods that have array parameters.
- resourceClass() : string
- Converts a string into a representation of a Recurly Resource
- setResponse() : void
- Setter for the Recurly HTTP Response
- setterParamClass() : string
- Uses the Reflection API to determine what \Recurly\RecurlyResource is the expected parameter for the given method.
- titleize() : string
- Capitalizes all the words in the $input.
Properties
$array_hints
protected
static mixed
$array_hints
= ['setPercentageTiers' => '\Recurly\Resources\SubscriptionAddOnPercentageTier', 'setTiers' => '\Recurly\Resources\SubscriptionAddOnTier']
$_add_on
private
mixed
$_add_on
$_add_on_source
private
mixed
$_add_on_source
$_created_at
private
mixed
$_created_at
$_expired_at
private
mixed
$_expired_at
$_id
private
mixed
$_id
$_object
private
mixed
$_object
$_percentage_tiers
private
mixed
$_percentage_tiers
$_quantity
private
mixed
$_quantity
$_response
private
mixed
$_response
$_revenue_schedule_type
private
mixed
$_revenue_schedule_type
$_subscription_id
private
mixed
$_subscription_id
$_tier_type
private
mixed
$_tier_type
$_tiers
private
mixed
$_tiers
$_unit_amount
private
mixed
$_unit_amount
$_unit_amount_decimal
private
mixed
$_unit_amount_decimal
$_updated_at
private
mixed
$_updated_at
$_usage_calculation_type
private
mixed
$_usage_calculation_type
$_usage_percentage
private
mixed
$_usage_percentage
$_usage_timeframe
private
mixed
$_usage_timeframe
Methods
__construct()
Constructor
public
final __construct() : mixed
Return values
mixed —__debugInfo()
Override of the magic method __debugInfo that will only return the relevant attributes of the \Recurly\RecurlyResource
public
__debugInfo() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —__set()
Guard against setting invalid properties
public
__set(string $key, mixed $value) : void
Parameters
- $key : string
-
The parameter name that is being set
- $value : mixed
-
The parameter value that is being set
Tags
Return values
void —cast()
Recursively converts a response object into a \Recurly\RecurlyResource.
public
static cast(object $data) : RecurlyResource
Parameters
- $data : object
-
PHP Object containing the decoded JSON
Return values
RecurlyResource —An instance of a Recurly Resource
fromBinary()
Converts a binary response into a Recurly BinaryFile
public
static fromBinary(string $data, Response $response) : BinaryFile
Parameters
- $data : string
-
The binary file data
- $response : Response
-
(optional) The Recurly HTTP Response
Return values
BinaryFile —An instance of a Recurly BinaryFile
fromEmpty()
Returns a \Recurly\EmptyResource for API requests that do not have a response body.
public
static fromEmpty(Response $response) : EmptyResource
Parameters
- $response : Response
-
(optional) The Recurly HTTP Response
Return values
EmptyResource —fromResponse()
Converts a Recurly response object into a \Recurly\RecurlyResource.
public
static fromResponse(Response $response[, object $json = null ]) : RecurlyResource
Parameters
- $response : Response
-
The Recurly HTTP Response
- $json : object = null
-
(optional) JSON payload to use instead of the $response's. Primarily used for errors
Return values
RecurlyResource —An instance of a Recurly Resource
getAddOn()
Getter method for the add_on attribute.
public
getAddOn() : AddOnMini|null
Just the important parts.
Return values
AddOnMini|null —getAddOnSource()
Getter method for the add_on_source attribute.
public
getAddOnSource() : string|null
Used to determine where the associated add-on data is pulled from. If this value is set to
plan_add_on
or left blank, then add-on data will be pulled from the plan's add-ons. If the associated
plan
has allow_any_item_on_subscriptions
set to true
and this field is set to item
, then
the associated add-on data will be pulled from the site's item catalog.
Return values
string|null —getCreatedAt()
Getter method for the created_at attribute.
public
getCreatedAt() : string|null
Created at
Return values
string|null —getExpiredAt()
Getter method for the expired_at attribute.
public
getExpiredAt() : string|null
Expired at
Return values
string|null —getId()
Getter method for the id attribute.
public
getId() : string|null
Subscription Add-on ID
Return values
string|null —getObject()
Getter method for the object attribute.
public
getObject() : string|null
Object type
Return values
string|null —getPercentageTiers()
Getter method for the percentage_tiers attribute.
public
getPercentageTiers() : array<string|int, mixed>
If percentage tiers are provided in the request, all existing percentage tiers on the Subscription Add-on will be
removed and replaced by the percentage tiers in the request. Use only if add_on.tier_type is tiered or volume and
add_on.usage_type is percentage. There must be one tier without an ending_amount
value which represents the final tier.
This feature is currently in development and requires approval and enablement, please contact support.
Return values
array<string|int, mixed> —getQuantity()
Getter method for the quantity attribute.
public
getQuantity() : int|null
Add-on quantity
Return values
int|null —getResponse()
Getter for the Recurly HTTP Response
public
getResponse() : Response
Return values
Response —The Recurly HTTP Response
getRevenueScheduleType()
Getter method for the revenue_schedule_type attribute.
public
getRevenueScheduleType() : string|null
Revenue schedule type
Return values
string|null —getSubscriptionId()
Getter method for the subscription_id attribute.
public
getSubscriptionId() : string|null
Subscription ID
Return values
string|null —getTiers()
Getter method for the tiers attribute.
public
getTiers() : array<string|int, mixed>
If tiers are provided in the request, all existing tiers on the Subscription Add-on will be
removed and replaced by the tiers in the request. If add_on.tier_type is tiered or volume and
add_on.usage_type is percentage use percentage_tiers instead.
There must be one tier without an ending_quantity
value which represents the final tier.
Return values
array<string|int, mixed> —getTierType()
Getter method for the tier_type attribute.
public
getTierType() : string|null
The pricing model for the add-on. For more information, click here. See our Guide for an overview of how to configure quantity-based pricing models.
Return values
string|null —getUnitAmount()
Getter method for the unit_amount attribute.
public
getUnitAmount() : float|null
Supports up to 2 decimal places.
Return values
float|null —getUnitAmountDecimal()
Getter method for the unit_amount_decimal attribute.
public
getUnitAmountDecimal() : string|null
Supports up to 9 decimal places.
Return values
string|null —getUpdatedAt()
Getter method for the updated_at attribute.
public
getUpdatedAt() : string|null
Updated at
Return values
string|null —getUsageCalculationType()
Getter method for the usage_calculation_type attribute.
public
getUsageCalculationType() : string|null
The type of calculation to be employed for an add-on. Cumulative billing will sum all usage records created in the current billing cycle. Last-in-period billing will apply only the most recent usage record in the billing period. If no value is specified, cumulative billing will be used.
Return values
string|null —getUsagePercentage()
Getter method for the usage_percentage attribute.
public
getUsagePercentage() : float|null
The percentage taken of the monetary amount of usage tracked. This can be up to 4 decimal places. A value between 0.0 and 100.0. Required if add_on_type is usage and usage_type is percentage.
Return values
float|null —getUsageTimeframe()
Getter method for the usage_timeframe attribute.
public
getUsageTimeframe() : string|null
The time at which usage totals are reset for billing purposes.
Return values
string|null —setAddOn()
Setter method for the add_on attribute.
public
setAddOn(AddOnMini $add_on) : void
Parameters
- $add_on : AddOnMini
Return values
void —setAddOnSource()
Setter method for the add_on_source attribute.
public
setAddOnSource(string $add_on_source) : void
Parameters
- $add_on_source : string
Return values
void —setCreatedAt()
Setter method for the created_at attribute.
public
setCreatedAt(string $created_at) : void
Parameters
- $created_at : string
Return values
void —setExpiredAt()
Setter method for the expired_at attribute.
public
setExpiredAt(string $expired_at) : void
Parameters
- $expired_at : string
Return values
void —setId()
Setter method for the id attribute.
public
setId(string $id) : void
Parameters
- $id : string
Return values
void —setObject()
Setter method for the object attribute.
public
setObject(string $object) : void
Parameters
- $object : string
Return values
void —setPercentageTiers()
Setter method for the percentage_tiers attribute.
public
setPercentageTiers(array<string|int, mixed> $percentage_tiers) : void
Parameters
- $percentage_tiers : array<string|int, mixed>
Return values
void —setQuantity()
Setter method for the quantity attribute.
public
setQuantity(int $quantity) : void
Parameters
- $quantity : int
Return values
void —setRevenueScheduleType()
Setter method for the revenue_schedule_type attribute.
public
setRevenueScheduleType(string $revenue_schedule_type) : void
Parameters
- $revenue_schedule_type : string
Return values
void —setSubscriptionId()
Setter method for the subscription_id attribute.
public
setSubscriptionId(string $subscription_id) : void
Parameters
- $subscription_id : string
Return values
void —setTiers()
Setter method for the tiers attribute.
public
setTiers(array<string|int, mixed> $tiers) : void
Parameters
- $tiers : array<string|int, mixed>
Return values
void —setTierType()
Setter method for the tier_type attribute.
public
setTierType(string $tier_type) : void
Parameters
- $tier_type : string
Return values
void —setUnitAmount()
Setter method for the unit_amount attribute.
public
setUnitAmount(float $unit_amount) : void
Parameters
- $unit_amount : float
Return values
void —setUnitAmountDecimal()
Setter method for the unit_amount_decimal attribute.
public
setUnitAmountDecimal(string $unit_amount_decimal) : void
Parameters
- $unit_amount_decimal : string
Return values
void —setUpdatedAt()
Setter method for the updated_at attribute.
public
setUpdatedAt(string $updated_at) : void
Parameters
- $updated_at : string
Return values
void —setUsageCalculationType()
Setter method for the usage_calculation_type attribute.
public
setUsageCalculationType(string $usage_calculation_type) : void
Parameters
- $usage_calculation_type : string
Return values
void —setUsagePercentage()
Setter method for the usage_percentage attribute.
public
setUsagePercentage(float $usage_percentage) : void
Parameters
- $usage_percentage : float
Return values
void —setUsageTimeframe()
Setter method for the usage_timeframe attribute.
public
setUsageTimeframe(string $usage_timeframe) : void
Parameters
- $usage_timeframe : string
Return values
void —encodeApiKey()
Base64 encodes the API key
protected
static encodeApiKey(string $key) : string
Parameters
- $key : string
-
The API key to encode
Return values
string —base64 encoded API key
getUserAgent()
Generates User-Agent for API requests
protected
static getUserAgent() : string
Return values
string —Recurly client User-Agent string
hintArrayType()
The hintArrayType method will provide type hinting for setter methods that have array parameters.
protected
static hintArrayType(string $key) : string
Parameters
- $key : string
-
The property to get teh type hint for.
Return values
string —The class name of the expected array type.
resourceClass()
Converts a string into a representation of a Recurly Resource
protected
static resourceClass(string $type) : string
Parameters
- $type : string
-
A string to convert to a Recurly Resource
Return values
string —The string representation of a Recurly Resource
setResponse()
Setter for the Recurly HTTP Response
protected
setResponse(Response $response) : void
Parameters
- $response : Response
-
The Recurly HTTP Response
Return values
void —setterParamClass()
Uses the Reflection API to determine what \Recurly\RecurlyResource is the expected parameter for the given method.
protected
static setterParamClass(string $method) : string
Parameters
- $method : string
-
The name of the setter method to find the type hint for
Return values
string —The \Recurly\RecurlyResource that the setter method expects
titleize()
Capitalizes all the words in the $input.
protected
static titleize(string $input[, string $prefix = '' ]) : string
Parameters
- $input : string
-
The string to titleize
- $prefix : string = ''
-
(optional) Prefix to add to the beginning of the titleized string. The prefix will not be titleized.
Return values
string —The titleized $input wtih the prepended $prefix