WC_Payment_Gateway::get_saved_payment_method_option_html()publicWC 2.6.0

Gets saved payment method HTML from a token.

Метод класса: WC_Payment_Gateway{}

Возвращает

Строку. Generated payment method HTML

Использование

$WC_Payment_Gateway = new WC_Payment_Gateway();
$WC_Payment_Gateway->get_saved_payment_method_option_html( $token );
$token(WC_Payment_Token) (обязательный)
Payment Token.

Список изменений

С версии 2.6.0 Введена.

Код WC_Payment_Gateway::get_saved_payment_method_option_html() WC 9.3.3

public function get_saved_payment_method_option_html( $token ) {
	$html = sprintf(
		'<li class="woocommerce-SavedPaymentMethods-token">
			<input id="wc-%1$s-payment-token-%2$s" type="radio" name="wc-%1$s-payment-token" value="%2$s" style="width:auto;" class="woocommerce-SavedPaymentMethods-tokenInput" %4$s />
			<label for="wc-%1$s-payment-token-%2$s">%3$s</label>
		</li>',
		esc_attr( $this->id ),
		esc_attr( $token->get_id() ),
		esc_html( $token->get_display_name() ),
		checked( $token->is_default(), true, false )
	);

	/**
	 * Filter the saved payment method HTML.
	 *
	 * @since 2.6.0
	 * @param string $html HTML for the saved payment methods.
	 * @param string $token Token.
	 * @param WC_Payment_Gateway $this Payment gateway instance.
	 * @return string
	 */
	return apply_filters( 'woocommerce_payment_gateway_get_saved_payment_method_option_html', $html, $token, $this );
}