PaymentManager: thuộc tính userHint

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Thuộc tính userHint của giao diện PaymentManager cung cấp gợi ý cho trình duyệt hiển thị cùng với tên và biểu tượng của ứng dụng thanh toán trong giao diện Web-based Payment Handler.

Giá trị

Một chuỗi.

Ví dụ

js
navigator.serviceWorker.register("serviceworker.js").then((registration) => {
  registration.paymentManager.userHint = "Card number should be 16 digits";

  registration.paymentManager
    .enableDelegations(["shippingAddress", "payerName"])
    .then(() => {
      // …
    });

  // …
});

Thông số kỹ thuật

Specification
Web-based Payment Handler API
# dom-paymentmanager-userhint

Tương thích trình duyệt

Xem thêm