| @@ -30,8 +30,15 @@ | ||
| 30 | 30 | public function get_payment_methods(): array { |
| 31 | 31 | return apply_filters( 'booktics_payment_methods', $this->payment_methods ); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | + /** | |
| 35 | + * Get a payment method by its ID | |
| 36 | + * | |
| 37 | + * @param string $id | |
| 38 | + * | |
| 39 | + * @return Payment_Method_Interface|null Returns the payment method instance or null if not found | |
| 40 | + */ | |
| 34 | 41 | public function get_payment_method( string $id ): ?Payment_Method_Interface { |
| 35 | 42 | $payment_methods = $this->get_payment_methods(); |
| 36 | 43 | if ( ! isset( $payment_methods[ $id ] ) ) { |
| 37 | 44 | return null; |