src/Helper/Monetico/Request/OrderContextClient.php line 192

  1. <?php
  2. namespace App\Helper\Monetico\Request;
  3. class OrderContextClient implements \JsonSerializable
  4. {
  5.     /**
  6.      * @var ?string
  7.      */
  8.     private $civility;
  9.     /**
  10.      * @var ?string
  11.      */
  12.     private $name;
  13.     /**
  14.      * @var ?string
  15.      */
  16.     private $firstName;
  17.     /**
  18.      * @var ?string
  19.      */
  20.     private $lastName;
  21.     /**
  22.      * @var ?string
  23.      */
  24.     private $middleName;
  25.     /**
  26.      * @var ?string
  27.      */
  28.     private $address;
  29.     /**
  30.      * @var ?string
  31.      */
  32.     private $addressLine1;
  33.     /**
  34.      * @var ?string
  35.      */
  36.     private $addressLine2;
  37.     /**
  38.      * @var ?string
  39.      */
  40.     private $addressLine3;
  41.     /**
  42.      * @var ?string
  43.      */
  44.     private $city;
  45.     /**
  46.      * @var ?string
  47.      */
  48.     private $postalCode;
  49.     /**
  50.      * @var ?string
  51.      */
  52.     private $country;
  53.     /**
  54.      * @var ?string
  55.      */
  56.     private $stateOrProvince;
  57.     /**
  58.      * @var ?string
  59.      */
  60.     private $countrySubdivision;
  61.     /**
  62.      * @var ?string
  63.      */
  64.     private $email;
  65.     /**
  66.      * @var ?string
  67.      */
  68.     private $birthLastName;
  69.     /**
  70.      * @var ?string
  71.      */
  72.     private $birthCity;
  73.     /**
  74.      * @var ?string
  75.      */
  76.     private $birthPostalCode;
  77.     /**
  78.      * @var ?string
  79.      */
  80.     private $birthCountry;
  81.     /**
  82.      * @var ?string
  83.      */
  84.     private $birthStateOrProvince;
  85.     /**
  86.      * @var ?string
  87.      */
  88.     private $birthCountrySubdivision;
  89.     /**
  90.      * @var ?\DateTime
  91.      */
  92.     private $birthdate;
  93.     /**
  94.      * @var ?string
  95.      */
  96.     private $phone;
  97.     /**
  98.      * @var ?string
  99.      */
  100.     private $nationalIDNumber;
  101.     /**
  102.      * @var ?bool
  103.      */
  104.     private $suspiciousAccountActivity;
  105.     /**
  106.      * @var ?string
  107.      */
  108.     private $authenticationMethod;
  109.     /**
  110.      * @var ?\DateTime
  111.      */
  112.     private $authenticationTimestamp;
  113.     /**
  114.      * @var ?string
  115.      */
  116.     private $priorAuthenticationMethod;
  117.     /**
  118.      * @var ?\DateTime
  119.      */
  120.     private $priorAuthenticationTimestamp;
  121.     /**
  122.      * @var ?\DateTime
  123.      */
  124.     private $paymentMeanAge;
  125.     /**
  126.      * @var ?int
  127.      */
  128.     private $lastYearTransactions;
  129.     /**
  130.      * @var ?int
  131.      */
  132.     private $last24HoursTransactions;
  133.     /**
  134.      * @var ?int
  135.      */
  136.     private $addCardNbLast24Hours;
  137.     /**
  138.      * @var ?int
  139.      */
  140.     private $last6MonthsPurchase;
  141.     /**
  142.      * @var ?\DateTime
  143.      */
  144.     private $lastPasswordChange;
  145.     /**
  146.      * @var ?\DateTime
  147.      */
  148.     private $accountAge;
  149.     /**
  150.      * @var ?\DateTime
  151.      */
  152.     private $lastAccountModification;
  153.     public function jsonSerialize()
  154.     {
  155.         return array_filter([
  156.             "civility" => $this->getCivility(),
  157.             "name" => $this->getName(),
  158.             "firstName" => $this->getFirstName(),
  159.             "lastName" => $this->getLastName(),
  160.             "middleName" => $this->getMiddleName(),
  161.             "address" => $this->getAddress(),
  162.             "addressLine1" => $this->getAddressLine1(),
  163.             "addressLine2" => $this->getAddressLine2(),
  164.             "addressLine3" => $this->getAddressLine3(),
  165.             "city" => $this->getCity(),
  166.             "postalCode" => $this->getPostalCode(),
  167.             "country" => $this->getCountry(),
  168.             "stateOrProvince" => $this->getStateOrProvince(),
  169.             "countrySubdivision" => $this->getCountrySubdivision(),
  170.             "email" => $this->getEmail(),
  171.             "birthLastName" => $this->getBirthLastName(),
  172.             "birthCity" => $this->getBirthCity(),
  173.             "birthPostalCode" => $this->getBirthPostalCode(),
  174.             "birthCountry" => $this->getBirthCountry(),
  175.             "birthStateOrProvince" => $this->getBirthStateOrProvince(),
  176.             "birthCountrySubdivision" => $this->getBirthCountrySubdivision(),
  177.             "birthdate" => $this->getFormatedBirthdate(),
  178.             "phone" => $this->getPhone(),
  179.             "nationalIDNumber" => $this->getNationalIDNumber(),
  180.             "suspiciousAccountActivity" => $this->getSuspiciousAccountActivity(),
  181.             "authenticationMethod" => $this->getAuthenticationMethod(),
  182.             "authenticationTimestamp" => $this->getFormatedAuthenticationTimestamp(),
  183.             "priorAuthenticationMethod" => $this->getPriorAuthenticationMethod(),
  184.             "priorAuthenticationTimestamp" => $this->getFormatedPriorAuthenticationTimestamp(),
  185.             "paymentMeanAge" => $this->getFormatedPaymentMeanAge(),
  186.             "lastYearTransactions" => $this->getLastYearTransactions(),
  187.             "last24HoursTransactions" => $this->getLast24HoursTransactions(),
  188.             "addCardNbLast24Hours" => $this->getAddCardNbLast24Hours(),
  189.             "last6MonthsPurchase" => $this->getLast6MonthsPurchase(),
  190.             "lastPasswordChange" => $this->getFormatedLastPasswordChange(),
  191.             "accountAge" => $this->getFormatedAccountAge(),
  192.             "lastAccountModification" => $this->getFormatedLastAccountModification()
  193.         ], function ($value) {
  194.             return !is_null($value);
  195.         });
  196.     }
  197.     /**
  198.      * @return string|null
  199.      */
  200.     public function getCivility(): ?string
  201.     {
  202.         return $this->civility;
  203.     }
  204.     /**
  205.      * @param string|null $civility
  206.      */
  207.     public function setCivility(?string $civility): void
  208.     {
  209.         $this->civility $civility;
  210.     }
  211.     /**
  212.      * @return string|null
  213.      */
  214.     public function getName(): ?string
  215.     {
  216.         return $this->name;
  217.     }
  218.     /**
  219.      * @param string|null $name
  220.      */
  221.     public function setName(?string $name): void
  222.     {
  223.         $this->name $name;
  224.     }
  225.     /**
  226.      * @return string|null
  227.      */
  228.     public function getFirstName(): ?string
  229.     {
  230.         return $this->firstName;
  231.     }
  232.     /**
  233.      * @param string|null $firstName
  234.      */
  235.     public function setFirstName(?string $firstName): void
  236.     {
  237.         $this->firstName $firstName;
  238.     }
  239.     /**
  240.      * @return string|null
  241.      */
  242.     public function getLastName(): ?string
  243.     {
  244.         return $this->lastName;
  245.     }
  246.     /**
  247.      * @param string|null $lastName
  248.      */
  249.     public function setLastName(?string $lastName): void
  250.     {
  251.         $this->lastName $lastName;
  252.     }
  253.     /**
  254.      * @return string|null
  255.      */
  256.     public function getMiddleName(): ?string
  257.     {
  258.         return $this->middleName;
  259.     }
  260.     /**
  261.      * @param string|null $middleName
  262.      */
  263.     public function setMiddleName(?string $middleName): void
  264.     {
  265.         $this->middleName $middleName;
  266.     }
  267.     /**
  268.      * @return string|null
  269.      */
  270.     public function getAddress(): ?string
  271.     {
  272.         return $this->address;
  273.     }
  274.     /**
  275.      * @param string|null $address
  276.      */
  277.     public function setAddress(?string $address): void
  278.     {
  279.         $this->address $address;
  280.     }
  281.     /**
  282.      * @return string|null
  283.      */
  284.     public function getAddressLine1(): ?string
  285.     {
  286.         return $this->addressLine1;
  287.     }
  288.     /**
  289.      * @param string|null $addressLine1
  290.      */
  291.     public function setAddressLine1(?string $addressLine1): void
  292.     {
  293.         $this->addressLine1 $addressLine1;
  294.     }
  295.     /**
  296.      * @return string|null
  297.      */
  298.     public function getAddressLine2(): ?string
  299.     {
  300.         return $this->addressLine2;
  301.     }
  302.     /**
  303.      * @param string|null $addressLine2
  304.      */
  305.     public function setAddressLine2(?string $addressLine2): void
  306.     {
  307.         $this->addressLine2 $addressLine2;
  308.     }
  309.     /**
  310.      * @return string|null
  311.      */
  312.     public function getAddressLine3(): ?string
  313.     {
  314.         return $this->addressLine3;
  315.     }
  316.     /**
  317.      * @param string|null $addressLine3
  318.      */
  319.     public function setAddressLine3(?string $addressLine3): void
  320.     {
  321.         $this->addressLine3 $addressLine3;
  322.     }
  323.     /**
  324.      * @return string|null
  325.      */
  326.     public function getCity(): ?string
  327.     {
  328.         return $this->city;
  329.     }
  330.     /**
  331.      * @param string|null $city
  332.      */
  333.     public function setCity(?string $city): void
  334.     {
  335.         $this->city $city;
  336.     }
  337.     /**
  338.      * @return string|null
  339.      */
  340.     public function getPostalCode(): ?string
  341.     {
  342.         return $this->postalCode;
  343.     }
  344.     /**
  345.      * @param string|null $postalCode
  346.      */
  347.     public function setPostalCode(?string $postalCode): void
  348.     {
  349.         $this->postalCode $postalCode;
  350.     }
  351.     /**
  352.      * @return string|null
  353.      */
  354.     public function getCountry(): ?string
  355.     {
  356.         return $this->country;
  357.     }
  358.     /**
  359.      * @param string|null $country
  360.      */
  361.     public function setCountry(?string $country): void
  362.     {
  363.         $this->country $country;
  364.     }
  365.     /**
  366.      * @return string|null
  367.      */
  368.     public function getStateOrProvince(): ?string
  369.     {
  370.         return $this->stateOrProvince;
  371.     }
  372.     /**
  373.      * @param string|null $stateOrProvince
  374.      */
  375.     public function setStateOrProvince(?string $stateOrProvince): void
  376.     {
  377.         $this->stateOrProvince $stateOrProvince;
  378.     }
  379.     /**
  380.      * @return string|null
  381.      */
  382.     public function getCountrySubdivision(): ?string
  383.     {
  384.         return $this->countrySubdivision;
  385.     }
  386.     /**
  387.      * @param string|null $countrySubdivision
  388.      */
  389.     public function setCountrySubdivision(?string $countrySubdivision): void
  390.     {
  391.         $this->countrySubdivision $countrySubdivision;
  392.     }
  393.     /**
  394.      * @return string|null
  395.      */
  396.     public function getEmail(): ?string
  397.     {
  398.         return $this->email;
  399.     }
  400.     /**
  401.      * @param string|null $email
  402.      */
  403.     public function setEmail(?string $email): void
  404.     {
  405.         $this->email $email;
  406.     }
  407.     /**
  408.      * @return string|null
  409.      */
  410.     public function getBirthLastName(): ?string
  411.     {
  412.         return $this->birthLastName;
  413.     }
  414.     /**
  415.      * @param string|null $birthLastName
  416.      */
  417.     public function setBirthLastName(?string $birthLastName): void
  418.     {
  419.         $this->birthLastName $birthLastName;
  420.     }
  421.     /**
  422.      * @return string|null
  423.      */
  424.     public function getBirthCity(): ?string
  425.     {
  426.         return $this->birthCity;
  427.     }
  428.     /**
  429.      * @param string|null $birthCity
  430.      */
  431.     public function setBirthCity(?string $birthCity): void
  432.     {
  433.         $this->birthCity $birthCity;
  434.     }
  435.     /**
  436.      * @return string|null
  437.      */
  438.     public function getBirthPostalCode(): ?string
  439.     {
  440.         return $this->birthPostalCode;
  441.     }
  442.     /**
  443.      * @param string|null $birthPostalCode
  444.      */
  445.     public function setBirthPostalCode(?string $birthPostalCode): void
  446.     {
  447.         $this->birthPostalCode $birthPostalCode;
  448.     }
  449.     /**
  450.      * @return string|null
  451.      */
  452.     public function getBirthCountry(): ?string
  453.     {
  454.         return $this->birthCountry;
  455.     }
  456.     /**
  457.      * @param string|null $birthCountry
  458.      */
  459.     public function setBirthCountry(?string $birthCountry): void
  460.     {
  461.         $this->birthCountry $birthCountry;
  462.     }
  463.     /**
  464.      * @return string|null
  465.      */
  466.     public function getBirthStateOrProvince(): ?string
  467.     {
  468.         return $this->birthStateOrProvince;
  469.     }
  470.     /**
  471.      * @param string|null $birthStateOrProvince
  472.      */
  473.     public function setBirthStateOrProvince(?string $birthStateOrProvince): void
  474.     {
  475.         $this->birthStateOrProvince $birthStateOrProvince;
  476.     }
  477.     /**
  478.      * @return string|null
  479.      */
  480.     public function getBirthCountrySubdivision(): ?string
  481.     {
  482.         return $this->birthCountrySubdivision;
  483.     }
  484.     /**
  485.      * @param string|null $birthCountrySubdivision
  486.      */
  487.     public function setBirthCountrySubdivision(?string $birthCountrySubdivision): void
  488.     {
  489.         $this->birthCountrySubdivision $birthCountrySubdivision;
  490.     }
  491.     /**
  492.      * @return \DateTime|null
  493.      */
  494.     public function getBirthdate(): ?\DateTime
  495.     {
  496.         return $this->birthdate;
  497.     }
  498.     /**
  499.      * @return string|null
  500.      */
  501.     public function getFormatedBirthdate(): ?string
  502.     {
  503.         if ($this->getBirthdate() instanceof \DateTime) {
  504.             return $this->getBirthdate()->format("Y-m-d");
  505.         }
  506.         return null;
  507.     }
  508.     /**
  509.      * @param \DateTime|null $birthdate
  510.      */
  511.     public function setBirthdate(?\DateTime $birthdate): void
  512.     {
  513.         $this->birthdate $birthdate;
  514.     }
  515.     /**
  516.      * @return string|null
  517.      */
  518.     public function getPhone(): ?string
  519.     {
  520.         return $this->phone;
  521.     }
  522.     /**
  523.      * @param string|null $phone
  524.      */
  525.     public function setPhone(?string $phone): void
  526.     {
  527.         $this->phone $phone;
  528.     }
  529.     /**
  530.      * @return string|null
  531.      */
  532.     public function getNationalIDNumber(): ?string
  533.     {
  534.         return $this->nationalIDNumber;
  535.     }
  536.     /**
  537.      * @param string|null $nationalIDNumber
  538.      */
  539.     public function setNationalIDNumber(?string $nationalIDNumber): void
  540.     {
  541.         $this->nationalIDNumber $nationalIDNumber;
  542.     }
  543.     /**
  544.      * @return bool|null
  545.      */
  546.     public function getSuspiciousAccountActivity(): ?bool
  547.     {
  548.         return $this->suspiciousAccountActivity;
  549.     }
  550.     /**
  551.      * @param bool|null $suspiciousAccountActivity
  552.      */
  553.     public function setSuspiciousAccountActivity(?bool $suspiciousAccountActivity): void
  554.     {
  555.         $this->suspiciousAccountActivity $suspiciousAccountActivity;
  556.     }
  557.     /**
  558.      * @return string|null
  559.      */
  560.     public function getAuthenticationMethod(): ?string
  561.     {
  562.         return $this->authenticationMethod;
  563.     }
  564.     /**
  565.      * @param string|null $authenticationMethod
  566.      */
  567.     public function setAuthenticationMethod(?string $authenticationMethod): void
  568.     {
  569.         $this->authenticationMethod $authenticationMethod;
  570.     }
  571.     /**
  572.      * @return \DateTime|null
  573.      */
  574.     public function getAuthenticationTimestamp(): ?\DateTime
  575.     {
  576.         return $this->authenticationTimestamp;
  577.     }
  578.     /**
  579.      * @return string|null
  580.      */
  581.     public function getFormatedAuthenticationTimestamp(): ?string
  582.     {
  583.         if ($this->getAuthenticationTimestamp() instanceof \DateTime) {
  584.             return $this->getAuthenticationTimestamp()->format("Y-m-d\TH:i:s\Z");
  585.         }
  586.         return null;
  587.     }
  588.     /**
  589.      * @param \DateTime|null $authenticationTimestamp
  590.      */
  591.     public function setAuthenticationTimestamp(?\DateTime $authenticationTimestamp): void
  592.     {
  593.         $this->authenticationTimestamp $authenticationTimestamp;
  594.     }
  595.     /**
  596.      * @return string|null
  597.      */
  598.     public function getPriorAuthenticationMethod(): ?string
  599.     {
  600.         return $this->priorAuthenticationMethod;
  601.     }
  602.     /**
  603.      * @param string|null $priorAuthenticationMethod
  604.      */
  605.     public function setPriorAuthenticationMethod(?string $priorAuthenticationMethod): void
  606.     {
  607.         $this->priorAuthenticationMethod $priorAuthenticationMethod;
  608.     }
  609.     /**
  610.      * @return \DateTime|null
  611.      */
  612.     public function getPriorAuthenticationTimestamp(): ?\DateTime
  613.     {
  614.         return $this->priorAuthenticationTimestamp;
  615.     }
  616.     /**
  617.      * @return string|null
  618.      */
  619.     public function getFormatedPriorAuthenticationTimestamp(): ?string
  620.     {
  621.         if ($this->getPriorAuthenticationTimestamp() instanceof \DateTime) {
  622.             return $this->getPriorAuthenticationTimestamp()->format("Y-m-d\TH:i:s\Z");
  623.         }
  624.         return null;
  625.     }
  626.     /**
  627.      * @param \DateTime|null $priorAuthenticationTimestamp
  628.      */
  629.     public function setPriorAuthenticationTimestamp(?\DateTime $priorAuthenticationTimestamp): void
  630.     {
  631.         $this->priorAuthenticationTimestamp $priorAuthenticationTimestamp;
  632.     }
  633.     /**
  634.      * @return \DateTime|null
  635.      */
  636.     public function getPaymentMeanAge(): ?\DateTime
  637.     {
  638.         return $this->paymentMeanAge;
  639.     }
  640.     /**
  641.      * @return string|null
  642.      */
  643.     public function getFormatedPaymentMeanAge(): ?string
  644.     {
  645.         if ($this->getPaymentMeanAge() instanceof \DateTime) {
  646.             return $this->getPaymentMeanAge()->format("Y-m-d");
  647.         }
  648.         return null;
  649.     }
  650.     /**
  651.      * @param \DateTime|null $paymentMeanAge
  652.      */
  653.     public function setPaymentMeanAge(?\DateTime $paymentMeanAge): void
  654.     {
  655.         $this->paymentMeanAge $paymentMeanAge;
  656.     }
  657.     /**
  658.      * @return int|null
  659.      */
  660.     public function getLastYearTransactions(): ?int
  661.     {
  662.         return $this->lastYearTransactions;
  663.     }
  664.     /**
  665.      * @param int|null $lastYearTransactions
  666.      */
  667.     public function setLastYearTransactions(?int $lastYearTransactions): void
  668.     {
  669.         $this->lastYearTransactions $lastYearTransactions;
  670.     }
  671.     /**
  672.      * @return int|null
  673.      */
  674.     public function getLast24HoursTransactions(): ?int
  675.     {
  676.         return $this->last24HoursTransactions;
  677.     }
  678.     /**
  679.      * @param int|null $last24HoursTransactions
  680.      */
  681.     public function setLast24HoursTransactions(?int $last24HoursTransactions): void
  682.     {
  683.         $this->last24HoursTransactions $last24HoursTransactions;
  684.     }
  685.     /**
  686.      * @return int|null
  687.      */
  688.     public function getAddCardNbLast24Hours(): ?int
  689.     {
  690.         return $this->addCardNbLast24Hours;
  691.     }
  692.     /**
  693.      * @param int|null $addCardNbLast24Hours
  694.      */
  695.     public function setAddCardNbLast24Hours(?int $addCardNbLast24Hours): void
  696.     {
  697.         $this->addCardNbLast24Hours $addCardNbLast24Hours;
  698.     }
  699.     /**
  700.      * @return int|null
  701.      */
  702.     public function getLast6MonthsPurchase(): ?int
  703.     {
  704.         return $this->last6MonthsPurchase;
  705.     }
  706.     /**
  707.      * @param int|null $last6MonthsPurchase
  708.      */
  709.     public function setLast6MonthsPurchase(?int $last6MonthsPurchase): void
  710.     {
  711.         $this->last6MonthsPurchase $last6MonthsPurchase;
  712.     }
  713.     /**
  714.      * @return \DateTime|null
  715.      */
  716.     public function getLastPasswordChange(): ?\DateTime
  717.     {
  718.         return $this->lastPasswordChange;
  719.     }
  720.     /**
  721.      * @return string|null
  722.      */
  723.     public function getFormatedLastPasswordChange(): ?string
  724.     {
  725.         if ($this->getLastPasswordChange() instanceof \DateTime) {
  726.             return $this->getLastPasswordChange()->format("Y-m-d");
  727.         }
  728.         return null;
  729.     }
  730.     /**
  731.      * @param \DateTime|null $lastPasswordChange
  732.      */
  733.     public function setLastPasswordChange(?\DateTime $lastPasswordChange): void
  734.     {
  735.         $this->lastPasswordChange $lastPasswordChange;
  736.     }
  737.     /**
  738.      * @return \DateTime|null
  739.      */
  740.     public function getAccountAge(): ?\DateTime
  741.     {
  742.         return $this->accountAge;
  743.     }
  744.     /**
  745.      * @return string|null
  746.      */
  747.     public function getFormatedAccountAge(): ?string
  748.     {
  749.         if ($this->getAccountAge() instanceof \DateTime) {
  750.             return $this->getAccountAge()->format("Y-m-d");
  751.         }
  752.         return null;
  753.     }
  754.     /**
  755.      * @param \DateTime|null $accountAge
  756.      */
  757.     public function setAccountAge(?\DateTime $accountAge): void
  758.     {
  759.         $this->accountAge $accountAge;
  760.     }
  761.     /**
  762.      * @return \DateTime|null
  763.      */
  764.     public function getLastAccountModification(): ?\DateTime
  765.     {
  766.         return $this->lastAccountModification;
  767.     }
  768.     /**
  769.      * @return string|null
  770.      */
  771.     public function getFormatedLastAccountModification(): ?string
  772.     {
  773.         if ($this->getLastAccountModification() instanceof \DateTime) {
  774.             return $this->getLastAccountModification()->format("Y-m-d");
  775.         }
  776.         return null;
  777.     }
  778.     /**
  779.      * @param \DateTime|null $lastAccountModification
  780.      */
  781.     public function setLastAccountModification(?\DateTime $lastAccountModification): void
  782.     {
  783.         $this->lastAccountModification $lastAccountModification;
  784.     }
  785. }