| Total Complexity | 4 |
| Total Lines | 65 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class Receipt implements ReceiptInterface |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * A unique ID which is given to the customer whenever the payment is done successfully. |
||
| 12 | * This ID can be used for financial follow up. |
||
| 13 | * |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $referenceId; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * payment driver's name. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $driver; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * payment date |
||
| 27 | * |
||
| 28 | * @var Carbon |
||
| 29 | */ |
||
| 30 | protected $date; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Receipt constructor. |
||
| 34 | * |
||
| 35 | * @param $driver |
||
| 36 | * @param $referenceId |
||
| 37 | */ |
||
| 38 | public function __construct($driver, $referenceId) |
||
| 39 | { |
||
| 40 | $this->driver = $driver; |
||
| 41 | $this->referenceId = $referenceId; |
||
| 42 | $this->date = Carbon::now(); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Retrieve driver's name |
||
| 47 | * |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | public function getDriver() : string |
||
| 51 | { |
||
| 52 | return $this->driver; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Retrieve payment reference code. |
||
| 57 | * |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | public function getReferenceId() : string |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Retrieve payment date |
||
| 67 | * |
||
| 68 | * @return Carbon |
||
| 69 | */ |
||
| 70 | public function getDate() : Carbon |
||
| 73 | } |
||
| 74 | } |
||
| 75 |