diff --git a/includes/payment-methods/class-wc-gateway-stripe-boleto.php b/includes/payment-methods/class-wc-gateway-stripe-boleto.php
new file mode 100644
index 0000000..bac1ba1
--- /dev/null
+++ b/includes/payment-methods/class-wc-gateway-stripe-boleto.php
@@ -0,0 +1,200 @@
+<?php
+if ( ! defined( 'ABSPATH' ) ) {
+	exit;
+}
+
+/**
+ * Class that handles Boleto payment method.
+ *
+ * @extends WC_Gateway_Stripe
+ *
+ * @since 5.8.0
+ */
+class WC_Gateway_Stripe_Boleto extends WC_Stripe_Payment_Gateway_Voucher {
+
+	/**
+	 * ID used by UPE
+	 *
+	 * @var string
+	 */
+	const ID = 'stripe_boleto';
+
+	/**
+	 * ID used by WooCommerce to identify the payment method
+	 *
+	 * @var string
+	 */
+	public $id = 'stripe_boleto';
+
+	/**
+	 * ID used by stripe
+	 */
+	protected $stripe_id = 'boleto';
+
+	/**
+	 * List of accepted currencies
+	 *
+	 * @var array
+	 */
+	protected $supported_currencies = [ 'BRL' ];
+
+	/**
+	 * List of accepted countries
+	 */
+	protected $supported_countries = [ 'BR' ];
+
+	/**
+	 * Constructor
+	 *
+	 * @since 5.8.0
+	 */
+	public function __construct() {
+		$this->method_title = __( 'Stripe Boleto', 'woocommerce-gateway-stripe' );
+		parent::__construct();
+
+		add_filter( 'wc_stripe_allowed_payment_processing_statuses', [ $this, 'add_allowed_payment_processing_statuses' ], 10, 2 );
+	}
+
+	/**
+	 * Add payment gateway voucher expiration to API request body.
+	 *
+	 * @param array $body API request body.
+	 * @return array
+	 */
+	protected function update_request_body_on_create_or_update_payment_intent( $body ) {
+		$body['payment_method_options'] = [
+			'boleto' => [
+				'expires_after_days' => $this->get_option( 'expiration' ),
+			],
+		];
+		return $body;
+	}
+
+	/**
+	 * Add payment gateway voucher expiration.
+	 *
+	 * @param array $settings Settings array.
+	 * @return array
+	 */
+	public function get_unique_settings( $settings ) {
+		$settings[ $this->id . '_expiration' ] = $this->get_option( 'expiration' );
+		return $settings;
+	}
+
+	/**
+	 * Updates payment gateway voucher expiration.
+	 *
+	 * @param WP_REST_Request $request Request object.
+	 * @return void
+	 */
+	public function update_unique_settings( WP_REST_Request $request ) {
+		$field_name  = $this->id . '_expiration';
+		$expiration = $request->get_param( $field_name );
+
+		if ( null === $expiration ) {
+			return;
+		}
+
+		$value = absint( $expiration );
+		$value = min( 60, $value );
+		$value = max( 0, $value );
+		$this->update_option( 'expiration', $value );
+	}
+
+	/**
+	 * Adds on-hold as accepted status during webhook handling on orders paid with voucher
+	 *
+	 * @param $allowed_statuses
+	 * @param $order
+	 *
+	 * @return mixed
+	 */
+	public function add_allowed_payment_processing_statuses( $allowed_statuses, $order ) {
+		if ( $this->stripe_id === $order->get_meta( '_stripe_upe_payment_type' ) && ! in_array( 'on-hold', $allowed_statuses ) ) {
+			$allowed_statuses[] = 'on-hold';
+		}
+
+		return $allowed_statuses;
+	}
+
+	/**
+	 * Payment_scripts function.
+	 *
+	 * @since 5.8.0
+	 */
+	public function payment_scripts() {
+		if ( ! is_cart() && ! is_checkout() && ! isset( $_GET['pay_for_order'] ) && ! is_add_payment_method_page() ) {
+			return;
+		}
+
+		parent::payment_scripts();
+		wp_enqueue_script( 'jquery-mask', plugins_url( 'assets/js/jquery.mask.min.js', WC_STRIPE_MAIN_FILE ), [], WC_STRIPE_VERSION );
+	}
+
+	/**
+	 * Payment form on checkout page
+	 *
+	 * @since 5.8.0
+	 */
+	public function payment_fields() {
+		$description = $this->get_description();
+		apply_filters( 'wc_stripe_description', wpautop( wp_kses_post( $description ) ), $this->id )
+
+		?>
+		<label>CPF/CNPJ: <abbr class="required" title="required">*</abbr></label><br>
+		<input id="stripe_boleto_tax_id" name="stripe_boleto_tax_id" type="text"><br><br>
+		<div class="stripe-source-errors" role="alert"></div>
+
+		<div id="stripe-boleto-payment-data"><?php echo $description; ?></div>
+		<?php
+	}
+
+	/**
+	 * Validates the minimum and maximum amount. Throws exception when out of range value is added
+	 *
+	 * @since 5.8.0
+	 *
+	 * @param $amount
+	 *
+	 * @throws WC_Stripe_Exception
+	 */
+	protected function validate_amount_limits( $amount ) {
+
+		if ( $amount < 5.00 ) {
+			/* translators: 1) amount (including currency symbol) */
+			throw new WC_Stripe_Exception( sprintf( __( 'Sorry, the minimum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( 5.00 ) ) );
+		} elseif ( $amount > 49999.99 ) {
+			/* translators: 1) amount (including currency symbol) */
+			throw new WC_Stripe_Exception( sprintf( __( 'Sorry, the maximum allowed order total is %1$s to use this payment method.', 'woocommerce-gateway-stripe' ), wc_price( 49999.99 ) ) );
+		}
+	}
+
+	/**
+	 * Gather the data necessary to confirm the payment via javascript
+	 * Override this when extending the class
+	 *
+	 * @param WC_Order $order
+	 *
+	 * @return array
+	 */
+	protected function get_confirm_payment_data( $order ) {
+		return [
+			'payment_method' => [
+				'boleto'          => [
+					'tax_id' => isset( $_POST['stripe_boleto_tax_id'] ) ? wc_clean( wp_unslash( $_POST['stripe_boleto_tax_id'] ) ) : null,
+				],
+				'billing_details' => [
+					'name'    => $order->get_formatted_billing_full_name(),
+					'email'   => $order->get_billing_email(),
+					'address' => [
+						'line1'       => $order->get_billing_address_1(),
+						'city'        => $order->get_billing_city(),
+						'state'       => $order->get_billing_state(),
+						'postal_code' => $order->get_billing_postcode(),
+						'country'     => $order->get_billing_country(),
+					],
+				],
+			],
+		];
+	}
+}
