OrderValidatorsTrait ​
- Type
- Trait
- Namespace
- craft\commerce\elements\traits
- Implemented by
- craft\commerce\elements\Order
OrderValidatorsTrait implements the methods used in Order validation.
Public Methods ​
| Method | Description |
|---|---|
| validateAddress() | Validates addresses, and also adds prefixed validation errors to order |
| validateAddressCountry() | Validates that address country is in the allowed list. |
| validateAddressReuse() | Validates that shipping address isn't being set to be the same as billing address, when billing address is set to be shipping address |
| validateCouponCode() | |
| validateGatewayId() | |
| validateLineItems() | Validates line items, and also adds prefixed validation errors to order |
| validateOrganizationTaxIdAsVatId() | |
| validatePaymentCurrency() | |
| validatePaymentSourceId() |
validateAddress() ​
Validates addresses, and also adds prefixed validation errors to order
Arguments ​
$attribute(string) – The attribute being validated
Throws ​
validateAddressCountry() ​
Validates that address country is in the allowed list.
Arguments ​
$attribute(string) – The attribute being validated
validateAddressReuse() ​
Validates that shipping address isn't being set to be the same as billing address, when billing address is set to be shipping address
Arguments ​
$attribute(string) – The attribute being validated
validateCouponCode() ​
Arguments ​
$attribute(mixed)
Throws ​
validateGatewayId() ​
Arguments ​
$attribute(string)$params(mixed)$validator(yii\validators\Validator)
validateLineItems() ​
Validates line items, and also adds prefixed validation errors to order
validateOrganizationTaxIdAsVatId() ​
- Since
- 5.0.0
Arguments ​
$attribute(mixed)
Returns ​
void
Throws ​
validatePaymentCurrency() ​
Arguments ​
$attribute(string)$params(mixed)$validator(yii\validators\Validator)
validatePaymentSourceId() ​
Arguments ​
$attribute(string)$params(mixed)$validator(yii\validators\Validator)