CartRuleApi
extends MenzzoApi
in package
Class CartRuleApi
Table of Contents
Properties
- $admin_password : mixed
- $admin_username : mixed
- $container : ContainerInterface
- $em : EntityManager
- $password : mixed
- $token_url : mixed
- $url : mixed
- $username : mixed
- $accessToken : string
- $apiKeyConfigCode : string
Methods
- __construct() : mixed
- Menzzo2Api constructor.
- addRepository() : void
- Add a repository to this service
- addService() : void
- Add a service to this service
- generateCoupon() : mixed
- getActivePromoBanners() : array<string|int, mixed>|false
- Collect active banner slider promo from Menzzo
- getApiToken() : bool|mixed
- Get Api Token
- getEntityManager() : EntityManager
- Getter of the Entity Manager
- getPromotionCodeDetails() : array<string|int, mixed>|false
- Get promotion code details from Magento 2
- getRuleDetails() : array<string|int, mixed>|false
- Get rule conditions from Magento 2
- getUsedTimes() : bool|mixed
- refreshApiToken() : bool|mixed|string
- Refreshing Api Access
- setEntityManager() : mixed
- Setter of the Entity Manager
- execute() : mixed
- formatResponse() : false|mixed
- Returning array from response
Properties
$admin_password
protected
mixed
$admin_password
Tags
$admin_username
protected
mixed
$admin_username
Tags
$container
protected
ContainerInterface
$container
$em
protected
EntityManager
$em
The Entity Manager
$password
protected
mixed
$password
Tags
$token_url
protected
mixed
$token_url
Tags
$url
protected
mixed
$url
Tags
$username
protected
mixed
$username
Tags
$accessToken
private
string
$accessToken
= ''
$apiKeyConfigCode
private
string
$apiKeyConfigCode
= 'MZ_MAGENTO_ACCESS_TOKEN'
Methods
__construct()
Menzzo2Api constructor.
public
__construct(mixed $base_url, mixed $token_url, mixed $username, mixed $password) : mixed
Parameters
- $base_url : mixed
- $token_url : mixed
- $username : mixed
- $password : mixed
addRepository()
Add a repository to this service
public
addRepository(int $key, string $class) : void
Parameters
- $key : int
-
Key
- $class : string
-
Class
addService()
Add a service to this service
public
addService(int $key, mixed $service) : void
Parameters
- $key : int
-
Key
- $service : mixed
generateCoupon()
public
generateCoupon(mixed $cartruleId[, mixed $qty = 1 ][, mixed $format = 'alpha' ][, mixed $length = 6 ][, mixed $prefix = 'PROMO' ]) : mixed
Parameters
- $cartruleId : mixed
- $qty : mixed = 1
- $format : mixed = 'alpha'
- $length : mixed = 6
- $prefix : mixed = 'PROMO'
getActivePromoBanners()
Collect active banner slider promo from Menzzo
public
getActivePromoBanners() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetApiToken()
Get Api Token
public
getApiToken(mixed $username, mixed $password) : bool|mixed
Parameters
- $username : mixed
- $password : mixed
Tags
Return values
bool|mixed —(string) token
getEntityManager()
Getter of the Entity Manager
public
getEntityManager() : EntityManager
Return values
EntityManagergetPromotionCodeDetails()
Get promotion code details from Magento 2
public
getPromotionCodeDetails(string $promoCode) : array<string|int, mixed>|false
Parameters
- $promoCode : string
Return values
array<string|int, mixed>|falsegetRuleDetails()
Get rule conditions from Magento 2
public
getRuleDetails(int $ruleId) : array<string|int, mixed>|false
Parameters
- $ruleId : int
Return values
array<string|int, mixed>|falsegetUsedTimes()
public
getUsedTimes(string $coupon) : bool|mixed
Parameters
- $coupon : string
Return values
bool|mixedrefreshApiToken()
Refreshing Api Access
public
refreshApiToken(mixed $username, mixed $password) : bool|mixed|string
Parameters
- $username : mixed
- $password : mixed
Tags
Return values
bool|mixed|stringsetEntityManager()
Setter of the Entity Manager
public
setEntityManager(EntityManager $em) : mixed
Parameters
- $em : EntityManager
-
the Entity Manager
execute()
protected
execute(mixed $requestType, mixed $endpoint[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ]) : mixed
Parameters
- $requestType : mixed
- $endpoint : mixed
- $body : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
formatResponse()
Returning array from response
protected
formatResponse(mixed $response) : false|mixed
Parameters
- $response : mixed