CartAddon
extends Addon
in package
implements
JsonSerializable
Table of Contents
Interfaces
- JsonSerializable
Constants
- KEY_COUPON = "coupon"
- KEY_CREDIT = "credit"
- KEY_CREDIT_PROMO = "credit_promo"
- KEY_CREDIT_REFUND = "credit_refund"
- KEY_DISCOUNT_ON_INVOICE = "discount_on_invoice"
- KEY_ON_INVOICE = "on_invoice"
- KEY_ON_ITEM = "on_item"
- KEY_SETUP_COST = "setup_cost"
- KEY_SUBTOTAL = "subtotal"
- KEY_TOTAL = "total"
- KEY_UNIT_PRICE = "unit_price"
- MAP_CREDIT_APPLY_TO = [\Vatjar\Checkout\DTO\Balance::NAME_PROMOTIONAL_CREDITS => self::KEY_CREDIT_PROMO, \Vatjar\Checkout\DTO\Balance::NAME_REFUNDABLE_CREDITS => self::KEY_CREDIT_REFUND]
Properties
- $coupons : array<string|int, Coupon>
- $vat : array<string|int, mixed>
- $countryId : int
- $serviceTypeId : int
Methods
- __construct() : mixed
- getChargeBeeId() : string
- getCountryId() : int
- Get the value of countryId
- getCoupons() : array<string|int, Coupon>
- getDiscount() : mixed
- getDiscountAmountFor() : int|null
- getDiscountFor() : mixed
- getGross() : mixed
- getGrossFor() : mixed
- getGrossForAmount() : mixed
- getId() : mixed
- getIsRecurring() : bool
- getListPriceFor() : mixed
- getNet() : mixed
- getNetFor() : mixed
- getNetVatGrossArrayFor() : mixed
- getPeriodUnitId() : int|null
- getPrice() : mixed
- getQuantity() : int
- getServiceTypeId() : int
- Get the value of serviceTypeId
- getUnitPrice() : int
- getVat() : mixed
- getVatFor() : mixed
- getVatForAmount() : mixed
- jsonSerialize() : mixed
- jsonSerializeDiscounts() : array<string|int, mixed>|null
- jsonSerializeExtraFields() : array<string|int, mixed>
- jsonSerializeLineItems() : array<string|int, mixed>
- jsonSerializeTotal() : array<string|int, mixed>
- serializeLineItemFor() : array<string|int, mixed>
- setCountryId() : self
- Set the value of countryId
- setCoupons() : self
- setDiscountFor() : mixed
- setGrossFor() : mixed
- setNetAndVatFor() : mixed
- setNetFor() : mixed
- setQuantity() : self
- setServiceTypeId() : self
- Set the value of serviceTypeId
- setVatFor() : mixed
- centToEur() : mixed
- hasVat() : mixed
Constants
KEY_COUPON
public
mixed
KEY_COUPON
= "coupon"
KEY_CREDIT
public
mixed
KEY_CREDIT
= "credit"
KEY_CREDIT_PROMO
public
mixed
KEY_CREDIT_PROMO
= "credit_promo"
KEY_CREDIT_REFUND
public
mixed
KEY_CREDIT_REFUND
= "credit_refund"
KEY_DISCOUNT_ON_INVOICE
public
mixed
KEY_DISCOUNT_ON_INVOICE
= "discount_on_invoice"
KEY_ON_INVOICE
public
mixed
KEY_ON_INVOICE
= "on_invoice"
KEY_ON_ITEM
public
mixed
KEY_ON_ITEM
= "on_item"
KEY_SETUP_COST
public
mixed
KEY_SETUP_COST
= "setup_cost"
KEY_SUBTOTAL
public
mixed
KEY_SUBTOTAL
= "subtotal"
KEY_TOTAL
public
mixed
KEY_TOTAL
= "total"
KEY_UNIT_PRICE
public
mixed
KEY_UNIT_PRICE
= "unit_price"
MAP_CREDIT_APPLY_TO
public
mixed
MAP_CREDIT_APPLY_TO
= [\Vatjar\Checkout\DTO\Balance::NAME_PROMOTIONAL_CREDITS => self::KEY_CREDIT_PROMO, \Vatjar\Checkout\DTO\Balance::NAME_REFUNDABLE_CREDITS => self::KEY_CREDIT_REFUND]
Properties
$coupons
protected
array<string|int, Coupon>
$coupons
= []
$vat
protected
array<string|int, mixed>
$vat
= []
$countryId
private
int
$countryId
$serviceTypeId
private
int
$serviceTypeId
Methods
__construct()
public
__construct(int $id, string $chargeBeeId, int $unitPrice, bool $isRecurring, int|null $periodUnitId) : mixed
Parameters
- $id : int
- $chargeBeeId : string
- $unitPrice : int
- $isRecurring : bool
- $periodUnitId : int|null
getChargeBeeId()
public
getChargeBeeId() : string
Return values
stringgetCountryId()
Get the value of countryId
public
getCountryId() : int
Return values
intgetCoupons()
public
getCoupons() : array<string|int, Coupon>
Return values
array<string|int, Coupon>getDiscount()
public
getDiscount() : mixed
getDiscountAmountFor()
public
getDiscountAmountFor([mixed $element = null ][, mixed $source = null ]) : int|null
Parameters
- $element : mixed = null
- $source : mixed = null
Return values
int|nullgetDiscountFor()
public
getDiscountFor(mixed $element[, mixed $source = null ][, mixed $group = null ]) : mixed
Parameters
- $element : mixed
- $source : mixed = null
- $group : mixed = null
getGross()
public
getGross() : mixed
getGrossFor()
public
getGrossFor(mixed $key) : mixed
Parameters
- $key : mixed
getGrossForAmount()
public
getGrossForAmount(mixed $amount[, mixed $rate = null ]) : mixed
Parameters
- $amount : mixed
- $rate : mixed = null
getId()
public
getId() : mixed
getIsRecurring()
public
getIsRecurring() : bool
Return values
boolgetListPriceFor()
public
getListPriceFor(mixed $key) : mixed
Parameters
- $key : mixed
getNet()
public
getNet() : mixed
getNetFor()
public
getNetFor(mixed $key) : mixed
Parameters
- $key : mixed
getNetVatGrossArrayFor()
public
final getNetVatGrossArrayFor(string $key) : mixed
Parameters
- $key : string
getPeriodUnitId()
public
getPeriodUnitId() : int|null
Return values
int|nullgetPrice()
public
getPrice() : mixed
getQuantity()
public
getQuantity() : int
Return values
intgetServiceTypeId()
Get the value of serviceTypeId
public
getServiceTypeId() : int
Return values
intgetUnitPrice()
public
getUnitPrice() : int
Return values
intgetVat()
public
getVat() : mixed
getVatFor()
public
getVatFor(mixed $key) : mixed
Parameters
- $key : mixed
getVatForAmount()
public
getVatForAmount(mixed $amount[, mixed $rate = null ]) : mixed
Parameters
- $amount : mixed
- $rate : mixed = null
jsonSerialize()
public
jsonSerialize() : mixed
jsonSerializeDiscounts()
public
jsonSerializeDiscounts() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nulljsonSerializeExtraFields()
public
jsonSerializeExtraFields() : array<string|int, mixed>
Return values
array<string|int, mixed>jsonSerializeLineItems()
public
jsonSerializeLineItems() : array<string|int, mixed>
Return values
array<string|int, mixed>jsonSerializeTotal()
public
jsonSerializeTotal() : array<string|int, mixed>
Return values
array<string|int, mixed>serializeLineItemFor()
public
serializeLineItemFor(string $key) : array<string|int, mixed>
Parameters
- $key : string
Return values
array<string|int, mixed>setCountryId()
Set the value of countryId
public
setCountryId(int $countryId) : self
Parameters
- $countryId : int
Return values
selfsetCoupons()
public
setCoupons(array<string|int, Coupon> $coupons) : self
Parameters
- $coupons : array<string|int, Coupon>
Return values
selfsetDiscountFor()
public
setDiscountFor(mixed $element, mixed $source, mixed $group, mixed $discount) : mixed
Parameters
- $element : mixed
- $source : mixed
- $group : mixed
- $discount : mixed
setGrossFor()
public
setGrossFor(mixed $key, mixed $amount) : mixed
Parameters
- $key : mixed
- $amount : mixed
setNetAndVatFor()
public
setNetAndVatFor(mixed $key, mixed $netAmount, mixed $vatAmount) : mixed
Parameters
- $key : mixed
- $netAmount : mixed
- $vatAmount : mixed
setNetFor()
public
setNetFor(mixed $key, mixed $amount) : mixed
Parameters
- $key : mixed
- $amount : mixed
setQuantity()
public
setQuantity(int $quantity) : self
Parameters
- $quantity : int
Return values
selfsetServiceTypeId()
Set the value of serviceTypeId
public
setServiceTypeId(int $serviceTypeId) : self
Parameters
- $serviceTypeId : int
Return values
selfsetVatFor()
public
setVatFor(mixed $key, mixed $amount) : mixed
Parameters
- $key : mixed
- $amount : mixed
centToEur()
private
centToEur(mixed $data) : mixed
Parameters
- $data : mixed
hasVat()
private
hasVat() : mixed