Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -268,15 +268,15 @@ class _RenewalTerm
|
||||
$otherTermDetails = $otherTerm->getTerm();
|
||||
foreach ( array( 'thisTermDetails', 'otherTermDetails' ) as $t )
|
||||
{
|
||||
if ( $$t['unit'] === 'y' )
|
||||
if ( ${$t}['unit'] === 'y' )
|
||||
{
|
||||
$$t['unit'] = 'm';
|
||||
$$t['term'] *= 12;
|
||||
${$t}['unit'] = 'm';
|
||||
${$t}['term'] *= 12;
|
||||
}
|
||||
if ( $$t['unit'] === 'w' )
|
||||
if ( ${$t}['unit'] === 'w' )
|
||||
{
|
||||
$$t['unit'] = 'd';
|
||||
$$t['term'] *= 7;
|
||||
${$t}['unit'] = 'd';
|
||||
${$t}['term'] *= 7;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,20 +347,21 @@ class _RenewalTerm
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
* @return array
|
||||
* @apiresponse string term 'd' for days; 'w' for weeks; 'm' for months; 'y' for years
|
||||
* @apiresponse int unit The number for term. For example, if the renewal term is every 6 months, term will be 'm' and unit will be 6
|
||||
* @apiresponse \IPS\nexus\Money price The renewal price
|
||||
* @apiresponse \IPS\nexus\Tax taxClass If the renewal price is taxed, the tax class that applies
|
||||
*/
|
||||
public function apiOutput()
|
||||
public function apiOutput( \IPS\Member $authorizedMember = NULL )
|
||||
{
|
||||
$term = $this->getTerm();
|
||||
return array(
|
||||
'term' => $term['term'],
|
||||
'unit' => $term['unit'],
|
||||
'price' => $this->cost->apiOutput(),
|
||||
'taxClass' => $this->tax ? $this->tax->apiOutput() : null,
|
||||
'price' => $this->cost->apiOutput( $authorizedMember ),
|
||||
'taxClass' => $this->tax ? $this->tax->apiOutput( $authorizedMember ) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user