Total Complexity | 3 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | trait PreparesPaymentMethods |
||
14 | { |
||
15 | /** |
||
16 | * Prepare the customer. |
||
17 | * |
||
18 | * @param Model $model |
||
19 | * |
||
20 | * @return Customer |
||
21 | */ |
||
22 | 3 | public function makeCustomerUsing(Model $model): Customer |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * Update the default payment method. |
||
29 | * |
||
30 | * @param Model $model |
||
31 | * @param PaymentMethod|string $paymentMethod |
||
32 | * |
||
33 | * @return CashierPaymentMethod |
||
34 | */ |
||
35 | 5 | public function setPaymentMethodFor(Model $model, PaymentMethod|string $paymentMethod): CashierPaymentMethod |
|
36 | { |
||
37 | 5 | return call($model)->updateDefaultPaymentMethod($paymentMethod); |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * Attach the payment method to the customer. |
||
42 | * |
||
43 | * @param PaymentMethodAttachmentData $data |
||
44 | * |
||
45 | * @return PaymentMethod |
||
46 | */ |
||
47 | 3 | public function attachPaymentMethodToCustomer(PaymentMethodAttachmentData $data): PaymentMethod |
|
55 | ); |
||
56 | } |
||
58 |