APModuleCalc

Calc module

Access all of the API endpoints under the 'calc' path. Each module is loaded via {@link \APAPI\APLoader} and passed a reference to a {@link \APAPI\APAPI} instance to use. In practice, usage of SDK modules is as simple as:

$api->calc->initialize();
see

Methods

Constructor

__construct($pxAPIOb) 

When a module is requested via the API base class, it is automatically passed a reference to a {@link \APAPI\APAPI} instance to use.

Arguments

$pxAPIOb

initialize - POST calc

initialize(array $pxOptions = array()) : mixed

Setup the calculator and calculate the payment amount & APR

Arguments

$pxOptions

array

All calculator setup options

Response

mixed

AP calculator session ID

update - POST calc

update(string $pxSessionId, array $pxOptions = array()) : mixed

Update the calc setup for an existing session. It will also recalc payment & APR and return results

Arguments

$pxSessionId

string

The session ID to use. {@see initialize()}

$pxOptions

array

Calculator setup options

Response

mixed

transactions - GET calc/transactions

transactions(string $pxSessionId) : mixed

Return amortization schedule & loan transactions

Arguments

$pxSessionId

string

The session ID to use. {@see initialize()}

Response

mixed

paymentSummary - GET calc/paymentSummary

paymentSummary(string $pxSessionId) : mixed

Returns an array of the calculated payment summary

Arguments

$pxSessionId

string

The session ID to use. {@see initialize()}

Response

mixed

getPayoff - GET calc/payoff

getPayoff(string $pxSessionId, string $date = "") : mixed

Get the calculated payoff within a specified date.

Arguments

$pxSessionId

string

The calculator session to use

$date

string

The start date (defaults to first day of current month)

Response

mixed

getRollPayment

getRollPayment($pxSessionId, $amount) 

Arguments

$pxSessionId

$amount

getRollPaymentFixedTerm

getRollPaymentFixedTerm($pxSessionId) 

Arguments

$pxSessionId

Properties

api

api