PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / ValueObjects / Payment / Order.php

Order.php in The Innovative Form Builder – IvyForms 1.5, at backend/src/ValueObjects/Payment/Order.php

66 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\ValueObjects\Payment;
4
5 /**
6 * Immutable Square order record value object.
7 */
8 final class Order
9 {
10 public int $id;
11 public int $entryId;
12 public string $squareOrderId;
13 public string $status;
14 public ?string $squareCustomerId;
15 public int $amount;
16 public string $currency;
17 public ?string $dateCreated;
18
19 /**
20 * @param int $id
21 * @param int $entryId
22 * @param string $squareOrderId
23 * @param string $status
24 * @param string|null $squareCustomerId
25 * @param int $amount
26 * @param string $currency
27 * @param string|null $dateCreated
28 */
29 public function __construct(
30 int $id,
31 int $entryId,
32 string $squareOrderId,
33 string $status,
34 ?string $squareCustomerId,
35 int $amount,
36 string $currency,
37 ?string $dateCreated = null
38 ) {
39 $this->id = $id;
40 $this->entryId = $entryId;
41 $this->squareOrderId = $squareOrderId;
42 $this->status = $status;
43 $this->squareCustomerId = $squareCustomerId;
44 $this->amount = $amount;
45 $this->currency = $currency;
46 $this->dateCreated = $dateCreated;
47 }
48
49 /**
50 * @return mixed[]
51 */
52 public function toArray(): array
53 {
54 return [
55 'id' => $this->id,
56 'entryId' => $this->entryId,
57 'squareOrderId' => $this->squareOrderId,
58 'status' => $this->status,
59 'squareCustomerId' => $this->squareCustomerId,
60 'amount' => $this->amount,
61 'currency' => $this->currency,
62 'dateCreated' => $this->dateCreated,
63 ];
64 }
65 }
66