Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Json
  • PricingPresenter

Class PricingPresenter

Presenter for pricing information to be converted into a common format

Package: blesta\components\json
Copyright: Copyright (c) 2015, Phillips Data, Inc.
License: The Blesta License Agreement
Uses: Proration Requires the Proration class be autoloaded
Link: Blesta
Located at components/pricing_presenter/pricing_presenter.php

Methods summary

public
# __construct( array $settings, array $tax_rules = array(), array $coupons = array(), array $options = array() )

Sets taxes, coupons, and settings necessary for formatting data

Sets taxes, coupons, and settings necessary for formatting data

Parameters

$settings
array
$settings An array containing all client and company settings as key/value pairs
$tax_rules
array
$tax_rules An array of stdClass objects representing each tax rule that applies, containing: - id The tax ID - company_id The company Id - level The tax level - name The name of the tax - amount The tax amount - type The tax type (inclusive, exclusive) - status The tax status
$coupons
array
$coupons An array of stdClass objects representing each coupon that applies, containing: - id The coupon ID - code The coupon code - used_qty The number of times the coupon has been used - max_qty The max number of coupon uses - start_date The date the coupon begins - end_date The date the coupon ends - status The coupon status - type The type of coupon as it applies to packages (exclusive, inclusive) - recurring 1 or 0, whether the coupon applies to recurring services - limit_recurring 1 or 0, whether the coupon limitations apply to recurring services - apply_package_options 1 or 0, whether the coupon applies to a service's package options - amounts An array of stdClass objects representing each coupon amount, containing: - coupon_id The coupon ID - currency The coupon amount currency - amount The coupon amount - type The coupon amount type (percent, amount) - packages An array of stdClass objects representing each assigned coupon package, containing: - coupon_id The coupon ID - package_id The assigned package ID
$options
array
$options An array of custom options - recur Boolean true/false. Whether the pricing items are recurring, or if they are being added for the first time (default false)
public array
# formatService( stdClass $service )

Formats service pricing for a service and its service options

Formats service pricing for a service and its service options

Parameters

$service
stdClass
$service An stdClass object representing the service, including: - name The service's name - qty The service quantity - override_price The service's override price - override_currency The service's override currency - date_renews The service renew date - options An array of service options, each option an stdClass object containing: - id The option value ID - service_id The service ID - option_pricing_id The option's pricing ID - qty The option quantity - option_value The option value - option_value_name The option value name - option_id The option's ID - option_label The option's label - option_name The name of the option - option_type The type of option - option_pricing_term The option's pricing term - option_pricing_period The option's pricing period - option_pricing_price The option's pricing price - option_pricing_setup_fee The option's pricing setup fee - option_pricing_currency The option's pricing currency - package_pricing An stdClass object representing the service's package pricing, including: - id The package pricing ID - package_id The package ID - term The pricing term - period The pricing period - setup_fee The pricing setup fee - cancel_fee The pricing cancelation fee - currency The pricing currency - package An stdClass object representing the service's package, including: - name The package name - taxable 1 or 0, whether the package is taxable - prorata_day The package pro rata day - prorata_cutoff The package pro rata cutoff day

Returns

array
An array of formatted service items
public array
# formatServiceData( array $vars, stdClass $package, stdClass $package_pricing, array $package_options )

Formats service pricing for a package and its package options

Formats service pricing for a package and its package options

Parameters

$vars
array
$vars An array of input data, including: - pricing_id The ID of the selected package pricing - override_price The new override price - override_currency The new override currency - configoptions An array of config options where each key is the option ID and the value is the selected option value
$package
stdClass
$package An stdClass object representing the package selected for use, including: - id The package ID - name The package's name - taxable 1 or 0, whether the package is taxable - prorata_day The package pro rata day - prorata_cutoff The package pro rata cutoff day
$package_pricing
stdClass
$package_pricing An stdClass object representing the selected package pricing, including: - id The package pricing ID - package_id The package ID - term The pricing term - period The pricing period - setup_fee The pricing setup fee - cancel_fee The pricing cancelation fee - currency The pricing currency
$package_options
array
$package_options An array of stdClass objects representing all package options, each including: - id The option ID - label The option label - name The option name - type The option type - values An array of stdClass objects representing each option value, including: - id The option value ID - option_id The option ID - value The option value - min The minimum value - max The maximum value - step The step value - pricing An array whose first index contains an stdClass object representing the option value pricing, including: - id The option value pricing ID - pricing_id The pricing ID - option_value_id The option value ID - term The pricing term - period The pricing period - price The option value price - setup_fee The option value setup fee - cancel_fee The option value cancelation fee - currency The option value currency

Returns

array
An array of formatted service items
public array
# formatServiceChange( stdClass $service, array $vars, stdClass $new_package, stdClass $new_package_pricing, array $new_package_options )

Formats service pricing changes given the current service and input to change the service to

Formats service pricing changes given the current service and input to change the service to

Parameters

$service
stdClass
$service An stdClass object representing the original service, including: - name The service's name - qty The service quantity - override_price The service's override price - override_currency The service's override currency - date_renews The service renew date - options An array of service options, each option an stdClass object containing: - id The option value ID - service_id The service ID - option_pricing_id The option's pricing ID - qty The option quantity - option_value The option value - option_value_name The option value name - option_id The option's ID - option_label The option's label - option_name The name of the option - option_type The type of option - option_pricing_term The option's pricing term - option_pricing_period The option's pricing period - option_pricing_price The option's pricing price - option_pricing_setup_fee The option's pricing setup fee - option_pricing_currency The option's pricing currency - package_pricing An stdClass object representing the service's package pricing, including: - id The package pricing ID - package_id The package ID - term The pricing term - period The pricing period - setup_fee The pricing setup fee - cancel_fee The pricing cancelation fee - currency The pricing currency - package An stdClass object representing the service's package, including: - name The package name - taxable 1 or 0, whether the package is taxable - prorata_day The package pro rata day - prorata_cutoff The package pro rata cutoff day
$vars
array
$vars An array of input data, including: - pricing_id The ID of the selected package pricing - override_price The new override price - override_currency The new override currency - configoptions An array of new config options where each key is the option ID and the value is the selected option value
$new_package
stdClass
$new_package An stdClass object representing the new package being changed to, including: - id The package ID - name The package's name - taxable 1 or 0, whether the package is taxable - prorata_day The package pro rata day - prorata_cutoff The package pro rata cutoff day
$new_package_pricing
stdClass
$new_package_pricing An stdClass object representing the new service's package pricing, including: - id The package pricing ID - package_id The package ID - term The pricing term - period The pricing period - setup_fee The pricing setup fee - cancel_fee The pricing cancelation fee - currency The pricing currency
$new_package_options
array
$new_package_options An array of stdClass objects representing all new service package options, each including: - id The option ID - label The option label - name The option name - type The option type - values An array of stdClass objects representing each option value, including: - id The option value ID - option_id The option ID - value The option value - min The minimum value - max The maximum value - step The step value - pricing An array whose first index contains an stdClass object representing the option value pricing, including: - id The option value pricing ID - pricing_id The pricing ID - option_value_id The option value ID - term The pricing term - period The pricing period - price The option value price - setup_fee The option value setup fee - cancel_fee The option value cancelation fee - currency The option value currency

Returns

array
An array of formatted items for the service, its options; the new package, and its options

Magic methods summary

Blesta API documentation generated by ApiGen 2.8.0