payment_methods = apply_filters( 'booktics_payment_methods', array() ); } /** * Get all registered payment methods * * @return array */ public function get_payment_methods(): array { return apply_filters( 'booktics_payment_methods', $this->payment_methods ); } /** * Get a payment method by its ID * * @param string $id * * @return Payment_Method_Interface|null Returns the payment method instance or null if not found */ public function get_payment_method( string $id ): ?Payment_Method_Interface { $payment_methods = $this->get_payment_methods(); if ( ! isset( $payment_methods[ $id ] ) ) { return null; } return new $payment_methods[ $id ](); } }