atpCustom Reference

salesorder_api extends abstract_extension
in package

Extension: salesorder_api - API to interface with NetSuite - ATP Custom Plugin for WordPress

Tags
category

WordPress Plugin

author

Kevin Burkholder KBurkholder@EarthAsylum.com

copyright

Copyright (c) 2022 American Telecast Products

version
4.x
see
https://eacDoojigger.earthasylum.com/phpdoc/
used-by

\EarthAsylumConsulting\abstract_core

uses
abstract_extension

Table of Contents

VERSION  = '24.0307.1'
__construct()  : void
constructor method
addActionsAndFilters()  : void
Add filters and actions - called from main plugin
admin_options_settings()  : void
register options on options_settings_page
admin_sanity_check()  : void
admin sanity check on settings page - list orders in salesorders table
api_error()  : WP_Error
API error status
authentication()  : object
API Authentication
cancel_salesorder()  : void
woocommerce_order_status_cancelled - cancelled order, remove from salesorders table
daily_sanity_check()  : void
daily sanity check
get_salesorders()  : object
API Export salesorders - requested from NetSuite to get new, unprocessed orders
hourly_sanity_check()  : void
hourly sanity check - see if there are any unprocessed records sitting around for awhile
initialize()  : void
initialize method - called from main plugin
post_salesorders()  : object
API post salesorders results - orders returned from NetSuite after processing
register_salesorders_api()  : void
Register a WP REST api
test_salesorders()  : object
API test salesorders

Constants

Methods

__construct()

constructor method

public __construct(object $plugin) : void
Parameters
$plugin : object

main plugin object

Return values
void

addActionsAndFilters()

Add filters and actions - called from main plugin

public addActionsAndFilters() : void
Return values
void

admin_options_settings()

register options on options_settings_page

public admin_options_settings() : void
Tags
access

public

Return values
void

admin_sanity_check()

admin sanity check on settings page - list orders in salesorders table

public admin_sanity_check([mixed $returnArray = false ]) : void
Parameters
$returnArray : mixed = false
Return values
void

api_error()

API error status

public api_error(string $code[, string $description = '' ][, array<string|int, mixed> $params = array() ]) : WP_Error
Parameters
$code : string
  • http status code
$description : string = ''
  • message detail
$params : array<string|int, mixed> = array()
  • additional parameters
Return values
WP_Error

authentication()

API Authentication

public authentication(object $request) : object
Parameters
$request : object
  • WP_REST_Request Request object.
Return values
object

stdClass|WP_Error - Post object or WP_Error.

cancel_salesorder()

woocommerce_order_status_cancelled - cancelled order, remove from salesorders table

public cancel_salesorder(int $order_id) : void
Parameters
$order_id : int
  • woocommerce order id
Return values
void

get_salesorders()

API Export salesorders - requested from NetSuite to get new, unprocessed orders

public get_salesorders(object $request) : object
Parameters
$request : object
  • WP_REST_Request Request object.
Return values
object

stdClass|WP_Error - Post object or WP_Error.

hourly_sanity_check()

hourly sanity check - see if there are any unprocessed records sitting around for awhile

public hourly_sanity_check([bool $cumulative = false ]) : void
Parameters
$cumulative : bool = false

don't limit to last hour (true from daily sanity check)

Return values
void

initialize()

initialize method - called from main plugin

public initialize() : void
Return values
void

post_salesorders()

API post salesorders results - orders returned from NetSuite after processing

public post_salesorders(object $request) : object
Parameters
$request : object
  • WP_REST_Request Request object.
Return values
object

stdClass|WP_Error - Post object or WP_Error.

register_salesorders_api()

Register a WP REST api

public register_salesorders_api() : void
Return values
void

test_salesorders()

API test salesorders

public test_salesorders(object $request) : object
Parameters
$request : object
  • WP_REST_Request Request object.
Return values
object

stdClass|WP_Error - Post object or WP_Error.

Search results