Methods |
public
|
__construct()
void __construct(void)
|
#
|
public
|
get_payment_method(): null|string
Get current payment method
Get current payment method
Returns
current payment method, enum: [credit, check, paypal, cash, other]
|
#
|
public
|
get_next_payment(): array
Next payment date and amount for the account
Next payment date and amount for the account
Array fields-
date: date of next payment for account. In the event the
information cannot be found (reseller account for example),
-1 is returned.
amount: amount for next payment
|
#
|
public
|
list_payments(): array
array list_payments
array list_payments
Sample response:
Array
(
[0] => Array
(
[date] => 1469937612
[amount] => 65.00
[service] => Webhosting->Developer
[number] => C-2ALQUJ67SSQXIDJEESZFRMZ
[note] =>
[type] => credit
)
)
|
#
|
public
|
get_billing_status(string $invoice = ''): int
Fetch billing status from backend billing server
Fetch billing status from backend billing server
|
#
|
public
|
get_status(string $invoice = ''): int
int get_standing_status()
int get_standing_status()
Fetch recurring subscription status from billing server
1 - subscription in good standing
-1 - subscription cancelled, account within 90 days of expiring
0 - subscription cancelled, account outside 90 days of expiring
null - cannot find subscription
|
#
|
public
|
is_billed(): bool
bool is_billed()
|
#
|
public
|
get_hosting_subscription(): mixed|NULL
Currently active subscription number attached to invoice
Currently active subscription number attached to invoice
|
#
|
public
|
is_referred(string $invoice): bool
Account was referred by another
Account was referred by another
|
#
|
public
|
get_payment_information(string $transnum, int $date, string $type = 'paypal'): array
array get_payment_information(string)
array get_payment_information(string)
Sample response:
Array
(
[date] => 1469937612
[amount] => 65
[domain] => apnscp.com
[service_level] => Developer
[name] => Tark Sammons
[email] => tark.sammons@apnscp.com
[note] =>
[service_type] => Webhosting
[method] => recurring
[payment_method] => credit
[reference] => C-2ALQUJ67SSQXIDJEESZFRMZ
[txn_id] => 11111
[invoice] => APNSCP-CJKFHECZO35
[cc_type] => visa
[cc_number] => 1111
[cc_exp] => 03/20
)
Parameters
$transnum |
transaction number
|
$date |
unix timestamp of date of transaction
|
$type |
payment method type
|
|
#
|
public
|
edit_referral_profile(array $credentials): bool
Update profile information
Update profile information
|
#
|
public
|
referral_profile_exists(): bool
Check if referral profile exists
Check if referral profile exists
|
#
|
public
|
get_referral_username(): string|null
Get referral username
|
#
|
public
|
edit_payout_amount(float $amount): bool
Set minimum balance for a payout
Set minimum balance for a payout
|
#
|
public
|
get_payout_amount(): float|null
float get_payout_amount()
float get_payout_amount()
|
#
|
public
|
get_minimum_payout_amount(): float
float get_minimum_payout_amount
float get_minimum_payout_amount
|
#
|
public
|
referral_balance(): float
Get current referral balance
Get current referral balance
|
#
|
public
|
referral_multiplier(): float
Get multiplier used in commission credit
Get multiplier used in commission credit
|
#
|
public
|
referral_upgrade_needed(): array
Minimum requirement for next referral level
array(2) {
["method"] => 254
["client"] => 2
}
Minimum requirement for next referral level
array(2) {
["method"] => 254
["client"] => 2
}
|
#
|
public
|
get_referrals(): array
Get earned commissions
Get earned commissions
Sample response
array(1) {
[0]=>
array(5) {
["domain"]=>
string(8) "apnscp.com"
["accrued"]=>
string(5) "30.00"
["level"]=>
string(5) "Basic"
["maturity"]=>
int(1172293200)
["status"]=>
NULL
}
domain (string):
accrued (float)
|
#
|
public
|
get_customer_referral_information(): null|array
array get_customer_referral_information()
array get_customer_referral_information()
|
#
|
public
|
create_referral_profile(string $username, array $personal = []): bool
Create initial referral profile
Create initial referral profile
Parameters
|
#
|
public
|
change_payout_preference(string $pref, mixed $val): bool
Change referral payout options
Change referral payout options
Parameters
$pref |
preference ['frozen', 'tender']
|
$val |
payment preference ['paypal', 'check']
|
|
#
|
public
|
get_payout_preference(string $pref): string|null
Fetch payout option
|
#
|
public
|
add_referral(string $invoice, string $pinvoice): bool
Record a new referral
Parameters
$invoice |
new account invoice
|
$pinvoice |
parent invoice (referral profile)
|
|
#
|
public
|
get_credit_from_invoice(string $invoice): float|null
Get referral credit by invoice
Get referral credit by invoice
|
#
|
public
|
get_credit_from_package_type(string $package): float
Get referral credit by package type
Get referral credit by package type
Parameters
|
#
|
public
|
get_invoice_from_domain(string $domain): string|null
Get hosting invoice by domain
Get hosting invoice by domain
Parameters
|
#
|
public
|
get_renewal_hash(string $invoice = null): string|null
Retrieve latest billing renewal hash for service
Retrieve latest billing renewal hash for service
|
#
|
public
|
get_renewal_link(string|null $invoice = null): string
Get billing renewal link
Get billing renewal link
Link must provide direct access to billing portal
Parameters
$invoice |
leave blank for current outstanding invoice
|
|
#
|
public
|
get_customer_since(): int
Get customer since
Returns
unix timestamp or -1 for connectivity issues
|
#
|
public
|
get_billing_information(): array
Get billing information attached to account
Get billing information attached to account
Array
(
[first_name] => Tark
[last_name] => Sammons
[city] => Atlanta
[state] => Georgia
[zip_code] => 30308
[country] => US
[company] =>
[address] => 123 Anywhere St
[phone] => 867-5309
[email] => tark.sammons@apnscp.com
)
|
#
|
public
|
get_credit_card_information(): array|false
Get billing details
|
#
|
public
|
change_credit_card_information(
int $expyear,
int $expmonth,
string|null $cvm = null,
int|null $number = null,
string|null $type = null,
): bool
Update billing details
Parameters
$cvm |
cvm number, with or without leading zeroes
|
|
#
|
public
|
change_billing_information(array $details): bool
Update billing information on account
Update billing information on account
|
#
|
public
|
get_package_type(): string|null
Get current package
|
#
|
public
|
get_package_by_invoice(string $invoice): mixed|null
Get package name from invoice
Get package name from invoice
|
#
|
public
|
claim_referral(string $token): bool
Claim referral from token
Claim referral from token
|
#
|
public
|
claim_metadata(string $token): array|bool
Get data about a referral
Sample return:
Array(
[domain] => apnscp.com
[revenue] => 20.00
[maturity] =>…
Get data about a referral
Sample return:
Array(
[domain] => apnscp.com
[revenue] => 20.00
[maturity] => 1469937612
)
|
#
|
public
|
configured(): bool
Used by TemplateEngine to confirm module is setup
Used by TemplateEngine to confirm module is setup
|
#
|
public
|
_verify_conf(ConfigurationContext $ctx): bool
|
#
|
public
|
_create()
|
#
|
public
|
_delete()
|
#
|
public
|
_edit()
|
#
|
public
|
_create_user(string $user)
|
#
|
public
|
_delete_user(string $user)
|
#
|
public
|
_edit_user(string $userold, string $usernew, array $oldpwd)
|
#
|
public
|
get_invoice(): null|string
Invariant invoice tied to an account
Invariant invoice tied to an account
|
#
|