files/en-us/web/api/paymentmanager/enabledelegations/index.md
{{APIRef("Web-Based Payment Handler API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The enableDelegations() method of the {{domxref("PaymentManager")}} interface delegates responsibility for providing various parts of the required payment information to the payment app rather than collecting it from the browser (for example, via autofill).
For example, if the requestShipping option is set to true in the options object when invoking the {{domxref("PaymentRequest.PaymentRequest", "PaymentRequest()")}} constructor, a shipping address will be returned.
enableDelegations() was used to delegate shippingAddress, that address will come from the payment app.enableDelegations(delegations)
delegations {{optional_inline}}
payerEmail
payerName
payerPhone
shippingAddress
A {{jsxref("Promise")}} that resolves with a value of undefined.
navigator.serviceWorker.register("serviceworker.js").then((registration) => {
registration.paymentManager.userHint = "Card number should be 16 digits";
registration.paymentManager
.enableDelegations(["shippingAddress", "payerName"])
.then(() => {
// …
});
// …
});
{{Specifications}}
{{Compat}}