src/Domain/Product/Model/WalletOperation.php line 15

Open in your IDE?
  1. <?php
  2. namespace Whater\Domain\Product\Model;
  3. use Whater\Domain\Common\Exception\InvalidUUIDException;
  4. use Ramsey\Uuid\Uuid;
  5. use Whater\Domain\Product\Exception\InvalidWalletOperationTypeException;
  6. use Whater\Domain\User\Model\User;
  7. use Whater\Domain\Whater\Model\WhaterOrganization;
  8. /**
  9. *
  10. * @package Whater\Domain\Product\Model
  11. */
  12. class WalletOperation
  13. {
  14. /**
  15. * See Readme.md#Wallet
  16. */
  17. const WOT_PURCHASE_WHATERCOINS = 'WOT_PURCHASE_WHATERCOINS';
  18. const WOT_GIFT_WHATERCOINS = 'WOT_GIFT_WHATERCOINS';
  19. const WOT_PURCHASE_PRODUCT_WITH_MONEY = 'WOT_PURCHASE_PRODUCT_WITH_MONEY';
  20. const WOT_PURCHASE_PRODUCT_WITH_COINS = 'WOT_PURCHASE_PRODUCT_WITH_COINS';
  21. const WOT_REFUND_PRODUCT_WITH_MONEY = 'WOT_REFUND_PRODUCT_WITH_MONEY';
  22. const WOT_REFUND_PRODUCT_WITH_COINS = 'WOT_REFUND_PRODUCT_WITH_COINS';
  23. const WOT_TRANSFER_COINS = 'WOT_TRANSFER_COINS';
  24. const WO_CURRENCY_EURO = 'EUR';
  25. /**
  26. * @var string
  27. */
  28. protected $uuid;
  29. /**
  30. * @var \DateTime
  31. */
  32. protected $operationDate;
  33. /**
  34. * @var string
  35. */
  36. protected $walletOperationType;
  37. // USER AND/OR WHATERORGANIZATION
  38. /**
  39. * @var User
  40. */
  41. protected $buyerUser;
  42. /**
  43. * @var WhaterOrganization
  44. */
  45. protected $buyerWhaterOrganization;
  46. /**
  47. * @var WhaterOrganization
  48. */
  49. protected $sellerWhaterOrganization;
  50. // MONEY
  51. /**
  52. * @var float
  53. */
  54. protected $buyerUserMoney;
  55. /**
  56. * @var float
  57. */
  58. protected $buyerWhaterOrganizationMoney;
  59. /**
  60. * @var float
  61. */
  62. protected $sellerWhaterOrganizationMoney;
  63. /**
  64. * @var float
  65. */
  66. protected $whaterAppMoney;
  67. /**
  68. * @var float
  69. */
  70. protected $stripeCommisionMoney;
  71. // WHATERCOINS
  72. /**
  73. * @var float
  74. */
  75. protected $buyerUserCoins;
  76. /**
  77. * @var float
  78. */
  79. protected $buyerWhaterOrganizationCoins;
  80. /**
  81. * @var float
  82. */
  83. protected $sellerWhaterOrganizationCoins;
  84. /**
  85. * @var float
  86. */
  87. protected $whaterAppCoins;
  88. // CURRENCY
  89. /**
  90. * @var string
  91. */
  92. protected $currency;
  93. /**
  94. * @var PaymentInstructionOrder
  95. */
  96. protected $paymentInstructionOrder;
  97. /**
  98. * @var string
  99. */
  100. protected $checksum;
  101. /**
  102. * @var string
  103. */
  104. protected $privateNote;
  105. /**
  106. * @var string
  107. */
  108. protected $publicNote;
  109. /**
  110. * @var \DateTime
  111. */
  112. protected $createdAt;
  113. /**
  114. * @var WalletLiquidationRequest
  115. */
  116. protected $walletLiquidationRequest;
  117. /**
  118. * WalletOperation constructor.
  119. */
  120. private function __construct(
  121. string $walletOperationId = null,
  122. \DateTime $operationDate,
  123. string $walletOperationType,
  124. User $buyerUser = null,
  125. WhaterOrganization $buyerWhaterOrganization = null,
  126. WhaterOrganization $sellerWhaterOrganization = null,
  127. float $buyerUserMoney = 0,
  128. float $buyerWhaterOrganizationMoney = 0,
  129. float $sellerWhaterOrganizationMoney = 0,
  130. float $whaterAppMoney = 0,
  131. float $stripeCommisionMoney = 0,
  132. string $currency = WalletOperation::WO_CURRENCY_EURO,
  133. float $buyerUserCoins = 0,
  134. float $buyerWhaterOrganizationCoins = 0,
  135. float $sellerWhaterOrganizationCoins = 0,
  136. float $whaterAppCoins = 0,
  137. ) {
  138. try {
  139. $this->uuid = Uuid::fromString($walletOperationId ?: Uuid::uuid4())->toString();
  140. } catch (\InvalidArgumentException $e) {
  141. throw new InvalidUUIDException();
  142. }
  143. $this->operationDate = $operationDate;
  144. switch ($walletOperationType) {
  145. case WalletOperation::WOT_PURCHASE_WHATERCOINS:
  146. $this->walletOperationType = $walletOperationType;
  147. $this->buyerUser = $buyerUser;
  148. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  149. $this->buyerUserMoney = $buyerUserMoney;
  150. $this->buyerWhaterOrganizationMoney = $buyerWhaterOrganizationMoney;
  151. $this->whaterAppMoney = $whaterAppMoney;
  152. $this->buyerUserCoins = $buyerUserCoins;
  153. $this->buyerWhaterOrganizationCoins = $buyerWhaterOrganizationCoins;
  154. $this->whaterAppCoins = $whaterAppCoins;
  155. break;
  156. case WalletOperation::WOT_GIFT_WHATERCOINS:
  157. $this->walletOperationType = $walletOperationType;
  158. $this->buyerUser = $buyerUser;
  159. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  160. $this->buyerUserCoins = $buyerUserCoins;
  161. $this->buyerWhaterOrganizationCoins = $buyerWhaterOrganizationCoins;
  162. $this->whaterAppCoins = $whaterAppCoins;
  163. break;
  164. case WalletOperation::WOT_PURCHASE_PRODUCT_WITH_MONEY:
  165. $this->walletOperationType = $walletOperationType;
  166. $this->buyerUser = $buyerUser;
  167. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  168. $this->sellerWhaterOrganization = $sellerWhaterOrganization;
  169. $this->buyerUserMoney = $buyerUserMoney;
  170. $this->buyerWhaterOrganizationMoney = $buyerWhaterOrganizationMoney;
  171. $this->sellerWhaterOrganizationMoney = $sellerWhaterOrganizationMoney;
  172. $this->whaterAppMoney = $whaterAppMoney;
  173. break;
  174. case WalletOperation::WOT_PURCHASE_PRODUCT_WITH_COINS:
  175. $this->walletOperationType = $walletOperationType;
  176. $this->buyerUser = $buyerUser;
  177. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  178. $this->sellerWhaterOrganization = $sellerWhaterOrganization;
  179. $this->buyerUserMoney = $buyerUserMoney;
  180. $this->buyerWhaterOrganizationMoney = $buyerWhaterOrganizationMoney;
  181. $this->sellerWhaterOrganizationMoney = $sellerWhaterOrganizationMoney;
  182. $this->whaterAppMoney = $whaterAppMoney;
  183. $this->buyerUserCoins = $buyerUserCoins;
  184. $this->buyerWhaterOrganizationCoins = $buyerWhaterOrganizationCoins;
  185. $this->sellerWhaterOrganizationCoins = $sellerWhaterOrganizationCoins;
  186. $this->whaterAppCoins = $whaterAppCoins;
  187. break;
  188. case WalletOperation::WOT_REFUND_PRODUCT_WITH_MONEY:
  189. $this->walletOperationType = $walletOperationType;
  190. $this->buyerUser = $buyerUser;
  191. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  192. $this->sellerWhaterOrganization = $sellerWhaterOrganization;
  193. $this->buyerUserMoney = $buyerUserMoney;
  194. $this->buyerWhaterOrganizationMoney = $buyerWhaterOrganizationMoney;
  195. $this->sellerWhaterOrganizationMoney = $sellerWhaterOrganizationMoney;
  196. $this->whaterAppMoney = $whaterAppMoney;
  197. break;
  198. case WalletOperation::WOT_REFUND_PRODUCT_WITH_COINS:
  199. $this->walletOperationType = $walletOperationType;
  200. $this->buyerUser = $buyerUser;
  201. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  202. $this->sellerWhaterOrganization = $sellerWhaterOrganization;
  203. $this->buyerUserMoney = $buyerUserMoney;
  204. $this->buyerWhaterOrganizationMoney = $buyerWhaterOrganizationMoney;
  205. $this->sellerWhaterOrganizationMoney = $sellerWhaterOrganizationMoney;
  206. $this->whaterAppMoney = $whaterAppMoney;
  207. $this->buyerUserCoins = $buyerUserCoins;
  208. $this->buyerWhaterOrganizationCoins = $buyerWhaterOrganizationCoins;
  209. $this->sellerWhaterOrganizationCoins = $sellerWhaterOrganizationCoins;
  210. $this->whaterAppCoins = $whaterAppCoins;
  211. break;
  212. case WalletOperation::WOT_TRANSFER_COINS:
  213. $this->walletOperationType = $walletOperationType;
  214. $this->buyerUser = $buyerUser;
  215. $this->buyerWhaterOrganization = $buyerWhaterOrganization;
  216. $this->sellerWhaterOrganization = $sellerWhaterOrganization;
  217. $this->buyerUserCoins = $buyerUserCoins;
  218. $this->buyerWhaterOrganizationCoins = $buyerWhaterOrganizationCoins;
  219. $this->sellerWhaterOrganizationCoins = $sellerWhaterOrganizationCoins;
  220. $this->whaterAppCoins = $whaterAppCoins;
  221. break;
  222. default:
  223. throw new InvalidWalletOperationTypeException();
  224. }
  225. $this->stripeCommisionMoney = $stripeCommisionMoney;
  226. if ($currency != null) {
  227. switch ($currency) {
  228. case WalletOperation::WO_CURRENCY_EURO:
  229. $this->currency = $currency;
  230. break;
  231. default:
  232. throw new InvalidWalletOperationTypeException();
  233. }
  234. }
  235. // Calculate checksum
  236. $operationDate = clone $this->operationDate();
  237. $operationDate->setTimezone(new \DateTimeZone('UTC'));
  238. $hash = md5($operationDate->format('dmYHis'));
  239. $hash = md5($hash . $this->walletOperationType());
  240. if ($this->buyerUser != null) {
  241. $hash = md5($hash . $this->buyerUser->id());
  242. }
  243. if ($this->buyerWhaterOrganization != null) {
  244. $hash = md5($hash . $this->buyerWhaterOrganization->id());
  245. }
  246. if ($this->sellerWhaterOrganization != null) {
  247. $hash = md5($hash . $this->sellerWhaterOrganization->id());
  248. }
  249. $this->checksum = $hash;
  250. $this->createdAt = new \DateTime();
  251. }
  252. public static function buildOperationForPurchaseOfCoins(
  253. \DateTime $operationDate,
  254. User $buyerUser = null,
  255. WhaterOrganization $buyerWhaterOrganization = null,
  256. float $money,
  257. float $coins,
  258. float $stripeCommisionMoney,
  259. string $currency
  260. ): WalletOperation {
  261. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  262. throw new InvalidWalletOperationTypeException();
  263. }
  264. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  265. throw new InvalidWalletOperationTypeException();
  266. }
  267. if ($buyerUser != null) {
  268. $buyerUserCoins = $coins;
  269. $buyerWhaterOrganizarionCoins = 0;
  270. $buyerUserMoney = -$money;
  271. $buyerWhaterOrganizationMoney = 0;
  272. } else if ($buyerWhaterOrganization != null) {
  273. $buyerUserCoins = 0;
  274. $buyerWhaterOrganizarionCoins = $coins;
  275. $buyerUserMoney = 0;
  276. $buyerWhaterOrganizationMoney = -$money;
  277. }
  278. $walletOperation = new WalletOperation(
  279. null,
  280. $operationDate,
  281. WalletOperation::WOT_PURCHASE_WHATERCOINS,
  282. $buyerUser,
  283. $buyerWhaterOrganization,
  284. null,
  285. $buyerUserMoney,
  286. $buyerWhaterOrganizationMoney,
  287. 0,
  288. $money,
  289. $stripeCommisionMoney,
  290. $currency,
  291. $buyerUserCoins,
  292. $buyerWhaterOrganizarionCoins,
  293. 0,
  294. -$coins
  295. );
  296. return $walletOperation;
  297. }
  298. public static function buildOperationForGitfOfCoins(
  299. \DateTime $operationDate,
  300. User $buyerUser = null,
  301. WhaterOrganization $buyerWhaterOrganization = null,
  302. float $coins
  303. ): WalletOperation {
  304. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  305. throw new InvalidWalletOperationTypeException();
  306. }
  307. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  308. throw new InvalidWalletOperationTypeException();
  309. }
  310. if ($buyerUser != null) {
  311. $buyerUserCoins = $coins;
  312. $buyerWhaterOrganizarionCoins = 0;
  313. } else if ($buyerWhaterOrganization != null) {
  314. $buyerUserCoins = 0;
  315. $buyerWhaterOrganizarionCoins = $coins;
  316. }
  317. $walletOperation = new WalletOperation(
  318. null,
  319. $operationDate,
  320. WalletOperation::WOT_GIFT_WHATERCOINS,
  321. $buyerUser,
  322. $buyerWhaterOrganization,
  323. null,
  324. 0,
  325. 0,
  326. 0,
  327. 0,
  328. 0,
  329. WalletOperation::WO_CURRENCY_EURO,
  330. $buyerUserCoins,
  331. $buyerWhaterOrganizarionCoins,
  332. 0,
  333. -$coins
  334. );
  335. return $walletOperation;
  336. }
  337. public static function buildOperationForPurchaseOfProductsWithMoney(
  338. \DateTime $operationDate,
  339. User $buyerUser = null,
  340. WhaterOrganization $buyerWhaterOrganization = null,
  341. WhaterOrganization $sellerWhaterOrganization = null,
  342. float $money,
  343. float $sellerMoney,
  344. float $stripeCommisionMoney,
  345. float $whaterAppCommisionMoney,
  346. string $currency
  347. ): WalletOperation {
  348. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  349. throw new InvalidWalletOperationTypeException();
  350. }
  351. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  352. throw new InvalidWalletOperationTypeException();
  353. }
  354. if ($sellerWhaterOrganization != null) {
  355. //if there is a sellerWhaterOrganization, check sellerMoney
  356. $m1 = -$money;
  357. $m2 = ($sellerMoney + $stripeCommisionMoney + $whaterAppCommisionMoney);
  358. if(($m1 - $m2) > PHP_FLOAT_EPSILON){
  359. throw new InvalidWalletOperationTypeException();
  360. }
  361. }
  362. if ($buyerUser != null) {
  363. $buyerUserMoney = $money;
  364. $buyerWhaterOrganizarionMoney = 0;
  365. } else if ($buyerWhaterOrganization != null) {
  366. $buyerUserMoney = 0;
  367. $buyerWhaterOrganizarionMoney = $money;
  368. }
  369. $walletOperation = new WalletOperation(
  370. null,
  371. $operationDate,
  372. WalletOperation::WOT_PURCHASE_PRODUCT_WITH_MONEY,
  373. $buyerUser,
  374. $buyerWhaterOrganization,
  375. $sellerWhaterOrganization,
  376. $buyerUserMoney,
  377. $buyerWhaterOrganizarionMoney,
  378. $sellerMoney,
  379. $whaterAppCommisionMoney,
  380. $stripeCommisionMoney,
  381. $currency,
  382. 0,
  383. 0,
  384. 0,
  385. 0
  386. );
  387. return $walletOperation;
  388. }
  389. public static function buildOperationForPurchaseOfProductsWithCoins(
  390. \DateTime $operationDate,
  391. User $buyerUser = null,
  392. WhaterOrganization $buyerWhaterOrganization = null,
  393. float $coins
  394. ): WalletOperation {
  395. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  396. throw new InvalidWalletOperationTypeException();
  397. }
  398. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  399. throw new InvalidWalletOperationTypeException();
  400. }
  401. if ($buyerUser != null) {
  402. $buyerUserCoins = -$coins;
  403. $buyerWhaterOrganizarionCoins = 0;
  404. } else if ($buyerWhaterOrganization != null) {
  405. $buyerUserCoins = 0;
  406. $buyerWhaterOrganizarionCoins = -$coins;
  407. }
  408. $walletOperation = new WalletOperation(
  409. null,
  410. $operationDate,
  411. WalletOperation::WOT_PURCHASE_PRODUCT_WITH_COINS,
  412. $buyerUser,
  413. $buyerWhaterOrganization,
  414. null,
  415. 0,
  416. 0,
  417. 0,
  418. 0,
  419. 0,
  420. WalletOperation::WO_CURRENCY_EURO,
  421. $buyerUserCoins,
  422. $buyerWhaterOrganizarionCoins,
  423. 0,
  424. $coins
  425. );
  426. return $walletOperation;
  427. }
  428. public static function buildOperationForRefundsOfProductsWithMoney(
  429. \DateTime $operationDate,
  430. User $buyerUser = null,
  431. WhaterOrganization $buyerWhaterOrganization = null,
  432. WhaterOrganization $sellerWhaterOrganization = null,
  433. float $money,
  434. float $sellerMoney,
  435. float $stripeCommisionMoney,
  436. float $whaterAppCommisionMoney,
  437. string $currency
  438. ): WalletOperation {
  439. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  440. throw new InvalidWalletOperationTypeException();
  441. }
  442. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  443. throw new InvalidWalletOperationTypeException();
  444. }
  445. if ($money != $sellerMoney) {
  446. throw new InvalidWalletOperationTypeException();
  447. }
  448. if ($buyerUser != null) {
  449. $buyerUserMoney = $money;
  450. $buyerWhaterOrganizarionMoney = 0;
  451. } else if ($buyerWhaterOrganization != null) {
  452. $buyerUserMoney = 0;
  453. $buyerWhaterOrganizarionMoney = $money;
  454. }
  455. $walletOperation = new WalletOperation(
  456. null,
  457. $operationDate,
  458. WalletOperation::WOT_REFUND_PRODUCT_WITH_MONEY,
  459. $buyerUser,
  460. $buyerWhaterOrganization,
  461. $sellerWhaterOrganization,
  462. $buyerUserMoney,
  463. $buyerWhaterOrganizarionMoney,
  464. -$sellerMoney,
  465. $whaterAppCommisionMoney,
  466. $stripeCommisionMoney,
  467. $currency,
  468. 0,
  469. 0,
  470. 0,
  471. 0
  472. );
  473. return $walletOperation;
  474. }
  475. public static function buildOperationForRefundsOfProductsWithCoins(
  476. \DateTime $operationDate,
  477. User $buyerUser = null,
  478. WhaterOrganization $buyerWhaterOrganization = null,
  479. WhaterOrganization $sellerWhaterOrganization,
  480. float $coins
  481. ): WalletOperation {
  482. if ($buyerUser == null && $buyerWhaterOrganization == null) {
  483. throw new InvalidWalletOperationTypeException();
  484. }
  485. if ($buyerUser != null && $buyerWhaterOrganization != null) {
  486. throw new InvalidWalletOperationTypeException();
  487. }
  488. if ($buyerUser != null) {
  489. $buyerUserCoins = $coins;
  490. $buyerWhaterOrganizarionCoins = 0;
  491. } else if ($buyerWhaterOrganization != null) {
  492. $buyerUserCoins = 0;
  493. $buyerWhaterOrganizarionCoins = $coins;
  494. }
  495. if ($sellerWhaterOrganization == null) {
  496. throw new InvalidWalletOperationTypeException();
  497. }
  498. $walletOperation = new WalletOperation(
  499. null,
  500. $operationDate,
  501. WalletOperation::WOT_REFUND_PRODUCT_WITH_COINS,
  502. $buyerUser,
  503. $buyerWhaterOrganization,
  504. $sellerWhaterOrganization,
  505. 0,
  506. 0,
  507. 0,
  508. 0,
  509. 0,
  510. WalletOperation::WO_CURRENCY_EURO,
  511. $buyerUserCoins,
  512. $buyerWhaterOrganizarionCoins,
  513. -$coins,
  514. 0
  515. );
  516. return $walletOperation;
  517. }
  518. public static function buildOperationForTransferCoins(
  519. \DateTime $operationDate,
  520. User $targetUser,
  521. WhaterOrganization $sourceWhaterOrganization,
  522. float $coins
  523. ): WalletOperation {
  524. $walletOperation = new WalletOperation(
  525. null,
  526. $operationDate,
  527. WalletOperation::WOT_TRANSFER_COINS,
  528. $targetUser,
  529. null,
  530. $sourceWhaterOrganization,
  531. 0,
  532. 0,
  533. 0,
  534. 0,
  535. 0,
  536. WalletOperation::WO_CURRENCY_EURO,
  537. $coins,
  538. 0,
  539. -$coins,
  540. 0
  541. );
  542. return $walletOperation;
  543. }
  544. public function updateNotes(
  545. string $privateNote = null,
  546. string $publicNote = null
  547. ) {
  548. $this->privateNote = $privateNote;
  549. $this->publicNote = $publicNote;
  550. return $this;
  551. }
  552. public function checkWalletOperationChecksum(): bool
  553. {
  554. // Calculate checksum
  555. $operationDate = clone $this->operationDate();
  556. $operationDate->setTimezone(new \DateTimeZone('UTC'));
  557. $hash = md5($operationDate->format('dmYHis'));
  558. $hash = md5($hash . $this->walletOperationType());
  559. if ($this->buyerUser != null) {
  560. $hash = md5($hash . $this->buyerUser->id());
  561. }
  562. if ($this->buyerWhaterOrganization != null) {
  563. $hash = md5($hash . $this->buyerWhaterOrganization->id());
  564. }
  565. if ($this->sellerWhaterOrganization != null) {
  566. $hash = md5($hash . $this->sellerWhaterOrganization->id());
  567. }
  568. if ($hash == $this->checksum) {
  569. return true;
  570. }
  571. return false;
  572. }
  573. /**
  574. * @return string
  575. */
  576. public function id(): string
  577. {
  578. return $this->uuid;
  579. }
  580. /**
  581. * @return User
  582. */
  583. public function buyerUser(): ?User
  584. {
  585. return $this->buyerUser;
  586. }
  587. /**
  588. * @return WhaterOrganization
  589. */
  590. public function buyerWhaterOrganization(): ?WhaterOrganization
  591. {
  592. return $this->buyerWhaterOrganization;
  593. }
  594. /**
  595. * @return WhaterOrganization
  596. */
  597. public function sellerWhaterOrganization(): ?WhaterOrganization
  598. {
  599. return $this->sellerWhaterOrganization;
  600. }
  601. /**
  602. * @return \DateTime
  603. */
  604. public function operationDate(): \DateTime
  605. {
  606. return $this->operationDate;
  607. }
  608. /**
  609. * @return string
  610. */
  611. public function walletOperationType(): string
  612. {
  613. return $this->walletOperationType;
  614. }
  615. /**
  616. * @return float
  617. */
  618. public function buyerUserMoney(): ?float
  619. {
  620. return $this->buyerUserMoney;
  621. }
  622. /**
  623. * @return float
  624. */
  625. public function buyerWhaterOrganizationMoney(): ?float
  626. {
  627. return $this->buyerWhaterOrganizationMoney;
  628. }
  629. /**
  630. * @return float
  631. */
  632. public function sellerWhaterOrganizationMoney(): ?float
  633. {
  634. return $this->sellerWhaterOrganizationMoney;
  635. }
  636. /**
  637. * @return float
  638. */
  639. public function whaterAppMoney(): ?float
  640. {
  641. return $this->whaterAppMoney;
  642. }
  643. /**
  644. * @return float
  645. */
  646. public function stripeCommisionMoney(): ?float
  647. {
  648. return $this->stripeCommisionMoney;
  649. }
  650. /**
  651. * @return float
  652. */
  653. public function buyerUserCoins(): ?float
  654. {
  655. return $this->buyerUserCoins;
  656. }
  657. /**
  658. * @return float
  659. */
  660. public function buyerWhaterOrganizationCoins(): ?float
  661. {
  662. return $this->buyerWhaterOrganizationCoins;
  663. }
  664. /**
  665. * @return float
  666. */
  667. public function sellerWhaterOrganizationCoins(): ?float
  668. {
  669. return $this->sellerWhaterOrganizationCoins;
  670. }
  671. /**
  672. * @return float
  673. */
  674. public function whaterAppCoins(): ?float
  675. {
  676. return $this->whaterAppCoins;
  677. }
  678. /**
  679. * @return string
  680. */
  681. public function currency(): string
  682. {
  683. return $this->currency;
  684. }
  685. /**
  686. * @return string
  687. */
  688. public function checksum(): string
  689. {
  690. return $this->checksum;
  691. }
  692. /**
  693. * @return string
  694. */
  695. public function privateNote(): ?string
  696. {
  697. return $this->privateNote;
  698. }
  699. /**
  700. * @return string
  701. */
  702. public function publicNote(): ?string
  703. {
  704. return $this->publicNote;
  705. }
  706. /**
  707. * @return \DateTime
  708. */
  709. public function createdAt(): \DateTime
  710. {
  711. return $this->createdAt;
  712. }
  713. /**
  714. * @return WalletLiquidationRequest
  715. */
  716. public function walletLiquidationRequest(): ?WalletLiquidationRequest
  717. {
  718. return $this->walletLiquidationRequest;
  719. }
  720. }