1 | <?php |
||
9 | class Payment extends Model |
||
10 | { |
||
11 | protected static $fields = PaymentFields::class; |
||
12 | |||
13 | /** |
||
14 | * The amount of a transaction must be converted into units of |
||
15 | * cents. For example, an amount of $1 must be entered as 100. |
||
16 | * If the amount was $100.50, this must be entered as 10050. |
||
17 | * @var int |
||
18 | */ |
||
19 | private $purchaseAmount; |
||
20 | |||
21 | /** |
||
22 | * This is a required field and may have a |
||
23 | * maximum of 34 alpha numeric characters. This will appear |
||
24 | * in the Shopping Transactions Report on the MA site and is |
||
25 | * a searchable field so should be used as the primary |
||
26 | * reference number for transactions, for example the order |
||
27 | * number, invoice number, or customer number. This field |
||
28 | * label is Transaction OrderInfo in the Sample Code. |
||
29 | * @var String |
||
30 | */ |
||
31 | private $orderInfo; |
||
32 | |||
33 | /** |
||
34 | * This is an optional field that can store up to 15 alpha |
||
35 | * numeric characters. |
||
36 | * @var String |
||
37 | */ |
||
38 | private $ticketNo; |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @param int $purchaseAmount |
||
43 | * @param String $orderInfo |
||
44 | * @param String $ticketNo |
||
45 | */ |
||
46 | 21 | public function __construct($purchaseAmount, $orderInfo, $ticketNo = '') |
|
56 | |||
57 | 21 | public function validate() : void |
|
70 | |||
71 | 6 | public function toArray() : array |
|
79 | } |
||
80 |