Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

@@ -64,10 +64,15 @@ abstract class _Item
public $paymentMethodIds;
/**
* @brief Key/Value array of extra details
* @brief Key/Value array of extra details to display on the invoice
*/
public $details = array();
/**
* @brief Key/Value array of extra details to store on the purchase
*/
public $purchaseDetails = array();
/**
* @brief Physical?
*/
@@ -359,6 +364,7 @@ abstract class _Item
/**
* 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 name Item name
* @apiresponse string itemApp Key for application. For example, 'nexus' for products and renewals; 'downloads' for Downloads files
@@ -385,7 +391,7 @@ abstract class _Item
* @apiresonse float commission If the payment for this item goes to another user (for example for Downloads files), the percentage of the price that will be retained by the site (in addition to fee)
* @apiresonse \IPS\nexus\Money fee If the payment for this item goes to another user (for example for Downloads files), the fee that will be deducted by the site (in addition to commission)
*/
public function apiOutput()
public function apiOutput( \IPS\Member $authorizedMember = NULL )
{
return array(
'name' => $this->name,
@@ -395,23 +401,23 @@ abstract class _Item
'itemUrl' => $this->url() ? ( (string) $this->url() ) : null,
'itemImage' => $this->image() ? ( (string) $this->image()->url ) : null,
'quantity' => $this->quantity,
'itemPrice' => $this->price->apiOutput(),
'linePrice' => $this->linePrice()->apiOutput(),
'taxClass' => $this->tax ? $this->tax->apiOutput() : null,
'itemPrice' => $this->price->apiOutput( $authorizedMember ),
'linePrice' => $this->linePrice()->apiOutput( $authorizedMember ),
'taxClass' => $this->tax ? $this->tax->apiOutput( $authorizedMember ) : null,
'physical' => $this->physical,
'weight' => isset( $this->weight ) ? $this->weight->kilograms : null,
'length' => isset( $this->length ) ? $this->length->metres : null,
'width' => isset( $this->width ) ? $this->width->metres : null,
'height' => isset( $this->height ) ? $this->height->metres : null,
'renewalTerm' => isset( $this->renewalTerm ) ? $this->renewalTerm->apiOutput() : null,
'renewalTerm' => isset( $this->renewalTerm ) ? $this->renewalTerm->apiOutput( $authorizedMember ) : null,
'expireDate' => isset( $this->expireDate ) ? $this->expireDate->rfc3339() : null,
'details' => $this->details,
'parentPurchase' => ( isset( $this->parent ) and $this->parent instanceof \IPS\nexus\Purchase ) ? $this->parent->apiOutput() : null,
'parentPurchase' => ( isset( $this->parent ) and $this->parent instanceof \IPS\nexus\Purchase ) ? $this->parent->apiOutput( $authorizedMember ) : null,
'parentItem' => ( isset( $this->parent ) and is_int( $this->parent ) ) ? $this->parent : null,
'groupWithParent' => isset( $this->groupWithParent ) ? $this->groupWithParent : false,
'payTo' => $this->payTo ? $this->payTo->apiOutput() : null,
'payTo' => $this->payTo ? $this->payTo->apiOutput( $authorizedMember ) : null,
'commission' => $this->commission,
'fee' => $this->fee ? $this->fee->apiOutput() : null,
'fee' => $this->fee ? $this->fee->apiOutput( $authorizedMember ) : null,
);
}
}