<% include( '/elements/header.html', 'Developer Documentation' ) %> <& /elements/menubar.html, 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html', 'Complete Index' => $fsurl.'docs/library/index.html', &>

FS::part_export::portaone

NAME

FS::part_export::portaone

SYNOPSIS

PortaOne integration for Freeside

DESCRIPTION

This export offers basic svc_phone provisioning for PortaOne.

This module also provides generic methods for working through the "PortaOne API".

PortaOne API

These methods allow access to the PortaOne API using the credentials set in the export options.

        $export->api_login;
        die $export->api_error if $export->api_error;

        my $customer_info = $export->api_call('Customer','get_customer_info',{
      'name' => $export->portaone_customer_name($cust_main),
    },'customer_info');
        die $export->api_error_logout if $export->api_error;

        return $export->api_logout;

api_call

Accepts $service, $method, $params hashref and optional $returnfield. Places an api call to the specified service and method with the specified params. Returns the decoded json object returned by the api call. If $returnfield is specified, returns only that field of the decoded object, and errors out if that field does not exist. Returns empty on failure; retrieve error messages using "api_error".

Must run "api_login" first.

api_error

Returns the error string set by "PortaOne API" methods, or a blank string if most recent call produced no errors.

api_error_logout

Attempts "api_logout", but returns "api_error" message from before logout was attempted. Useful for logging out properly after an error.

api_login

Initializes an api session using the credentials for this export. Always returns empty. Retrieve error messages using "api_error".

api_logout

Ends the current api session established by "api_login".

For convenience, returns "api_error".

api_update_account

Accepts $i_account and $svc_phone. Updates the account specified by $i_account with the current values of $svc_phone (currently only updates account_id.) Always returns empty. Retrieve error messages using "api_error".

api_update_customer

Accepts $i_customer and $cust_main. Updates the customer specified by $i_customer with the current values of $cust_main. Always returns empty. Retrieve error messages using "api_error".

portaone_customer_name

Accepts $cust_main and returns customer name with substitutions.

portaone_account_id

Accepts $svc_phone and returns account id with substitutions.

SEE ALSO

FS::part_export

AUTHOR

Jonathan Prykop jonathan@freeside.biz

<% include ('/elements/footer.html' ) %>