getApiloPaymentTypeId( (int)$payment_method_id ); } public static function payment_methods_by_transport( $transport_method_id ) { $transport_method_id = (int)$transport_method_id; $cacheKey = 'payment_methods_by_transport' . $transport_method_id; $payments = \Cache::fetch( $cacheKey ); if ( $payments !== false && is_array( $payments ) ) { return $payments; } $payments = self::repo()->forTransport( $transport_method_id ); \Cache::store( $cacheKey, $payments ); return $payments; } public static function is_payment_active( $payment_method_id ) { return self::repo()->isActive( (int)$payment_method_id ); } public static function payment_method( $payment_method_id ) { $payment_method_id = (int)$payment_method_id; $cacheKey = 'payment_method' . $payment_method_id; $payment_method = \Cache::fetch( $cacheKey ); if ( $payment_method === false ) { $payment_method = self::repo()->findActiveById( $payment_method_id ); \Cache::store( $cacheKey, $payment_method ); } return $payment_method; } public static function payment_methods() { $cacheKey = 'payment_methods'; $payment_methods = \Cache::fetch( $cacheKey ); if ( $payment_methods !== false && is_array( $payment_methods ) ) { return $payment_methods; } $payment_methods = self::repo()->allActive(); \Cache::store( $cacheKey, $payment_methods ); return $payment_methods; } }