Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
PaymentAbstract | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
createCharge | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
refundCharge | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
listCharges | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
addPaymentMethod | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
removePaymentMethod | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
modifyPaymentMethod | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
listPaymentMethods | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
addSubscription | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
removeSubscription | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
modifySubscription | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
listSubscriptions | n/a |
0 / 0 |
n/a |
0 / 0 |
0 |
1 | <?php |
2 | /** |
3 | * Jingga |
4 | * |
5 | * PHP Version 8.1 |
6 | * |
7 | * @package phpOMS\Api\Payment |
8 | * @copyright Dennis Eichhorn |
9 | * @license OMS License 2.0 |
10 | * @version 1.0.0 |
11 | * @link https://jingga.app |
12 | */ |
13 | declare(strict_types=1); |
14 | |
15 | namespace phpOMS\Api\Payment; |
16 | |
17 | /** |
18 | * Abstract payment. |
19 | * |
20 | * @package phpOMS\Api\Payment |
21 | * @license OMS License 2.0 |
22 | * @link https://jingga.app |
23 | * @since 1.0.0 |
24 | */ |
25 | abstract class PaymentAbstract |
26 | { |
27 | /** |
28 | * Create/execute a charge |
29 | * |
30 | * @param int $customer Customer id |
31 | * @param Charge $charge Charge to execute |
32 | * |
33 | * @return void |
34 | * |
35 | * @since 1.0.0 |
36 | */ |
37 | abstract public function createCharge(int $customer, Charge $charge) : void; |
38 | |
39 | /** |
40 | * Refund a charge |
41 | * |
42 | * @param int $customer Customer id |
43 | * @param Charge $charge Charge to execute |
44 | * |
45 | * @return void |
46 | * |
47 | * @since 1.0.0 |
48 | */ |
49 | abstract public function refundCharge(int $customer, Charge $charge) : void; |
50 | |
51 | /** |
52 | * Get all charges of a customer |
53 | * |
54 | * @param int $customer Customer id |
55 | * @param \DateTime $start Start date |
56 | * @param \DateTime $end End date |
57 | * |
58 | * @return void |
59 | * |
60 | * @since 1.0.0 |
61 | */ |
62 | abstract public function listCharges(int $customer, \DateTime $start, \DateTime $end) : void; |
63 | |
64 | /** |
65 | * Create/add a new payment method |
66 | * |
67 | * @param int $customer Customer id |
68 | * @param mixed $paymentMethod Payment method (e.g. cc card) |
69 | * |
70 | * @return void |
71 | * |
72 | * @since 1.0.0 |
73 | */ |
74 | abstract public function addPaymentMethod(int $customer, mixed $paymentMethod) : void; |
75 | |
76 | /** |
77 | * Remove a new payment method |
78 | * |
79 | * @param int $customer Customer id |
80 | * @param mixed $paymentMethod Payment method (e.g. cc card) |
81 | * |
82 | * @return void |
83 | * |
84 | * @since 1.0.0 |
85 | */ |
86 | abstract public function removePaymentMethod(int $customer, mixed $paymentMethod) : void; |
87 | |
88 | /** |
89 | * Modify a new payment method |
90 | * |
91 | * @param int $customer Customer id |
92 | * @param mixed $paymentMethod Payment method (e.g. cc card) |
93 | * |
94 | * @return void |
95 | * |
96 | * @since 1.0.0 |
97 | */ |
98 | abstract public function modifyPaymentMethod(int $customer, mixed $paymentMethod) : void; |
99 | |
100 | /** |
101 | * Get all payment methods of a customer |
102 | * |
103 | * @param int $customer Customer id |
104 | * |
105 | * @return void |
106 | * |
107 | * @since 1.0.0 |
108 | */ |
109 | abstract public function listPaymentMethods(int $customer) : void; |
110 | |
111 | /** |
112 | * Create/add a new subscription |
113 | * |
114 | * @param int $customer Customer id |
115 | * @param mixed $subscription Subscription details |
116 | * |
117 | * @return void |
118 | * |
119 | * @since 1.0.0 |
120 | */ |
121 | abstract public function addSubscription(int $customer, mixed $subscription) : void; |
122 | |
123 | /** |
124 | * Remove a new subscription |
125 | * |
126 | * @param int $customer Customer id |
127 | * @param mixed $subscription Subscription details |
128 | * |
129 | * @return void |
130 | * |
131 | * @since 1.0.0 |
132 | */ |
133 | abstract public function removeSubscription(int $customer, mixed $subscription) : void; |
134 | |
135 | /** |
136 | * Modify a new subscription |
137 | * |
138 | * @param int $customer Customer id |
139 | * @param mixed $subscription Subscription details |
140 | * |
141 | * @return void |
142 | * |
143 | * @since 1.0.0 |
144 | */ |
145 | abstract public function modifySubscription(int $customer, mixed $subscription) : void; |
146 | |
147 | /** |
148 | * Get all subscriptions of a customer |
149 | * |
150 | * @param int $customer Customer id |
151 | * |
152 | * @return void |
153 | * |
154 | * @since 1.0.0 |
155 | */ |
156 | abstract public function listSubscriptions(int $customer) : void; |
157 | } |