Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt api.PaymentResponse.onpayerdetailchange to new events structure #13602

Merged
merged 3 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8704,6 +8704,7 @@
/en-US/docs/Web/API/PaymentRequest/PaymentRequest.onmerchantvalidation /en-US/docs/Web/API/PaymentRequest/onmerchantvalidation
/en-US/docs/Web/API/PaymentRequest/shippingaddresschange /en-US/docs/Web/API/PaymentRequest/shippingaddresschange_event
/en-US/docs/Web/API/PaymentRequestEvent/topLevelOrigin /en-US/docs/Web/API/PaymentRequestEvent/topOrigin
/en-US/docs/Web/API/PaymentResponse/onpayerdetailchange /en-US/docs/Web/API/PaymentResponse/payerdetailchange_event
/en-US/docs/Web/API/PaymentResponse/payerdetail_event /en-US/docs/Web/API/PaymentResponse/payerdetailchange_event
/en-US/docs/Web/API/Performance.navigation /en-US/docs/Web/API/Performance/navigation
/en-US/docs/Web/API/Performance.now /en-US/docs/Web/API/Performance/now
Expand Down
8 changes: 0 additions & 8 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -65483,14 +65483,6 @@
"dgashmdn"
]
},
"Web/API/PaymentResponse/onpayerdetailchange": {
"modified": "2020-10-15T22:06:18.501Z",
"contributors": [
"chrisdavidmills",
"Sheppy",
"marcoscaceres"
]
},
"Web/API/PaymentResponse/payerEmail": {
"modified": "2020-10-15T21:48:29.059Z",
"contributors": [
Expand Down
1 change: 0 additions & 1 deletion files/en-us/web/api/paymentresponse/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Listen to this event using [`addEventListener()`](/en-US/docs/Web/API/EventTarge

- [`payerdetailchange`](/en-US/docs/Web/API/PaymentResponse/payerdetailchange_event){{securecontext_inline}}{{deprecated_inline}}
- : Fired during a retry when the user makes changes to their personal information while filling out a payment request form. Allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes.
Also available via the [`onpayerdetailchange`](/en-US/docs/Web/API/PaymentResponse/onpayerdetailchange) property.

## Specifications

Expand Down
119 changes: 0 additions & 119 deletions files/en-us/web/api/paymentresponse/onpayerdetailchange/index.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,39 @@ tags:
- Reference
- Response
- Validation
- events
- Event
- payerdetail
- payment
- validate
browser-compat: api.PaymentResponse.payerdetailchange_event
---
{{securecontext_header}}{{APIRef("Payment Request API")}}{{Deprecated_header}}{{Non-standard_header}}

**`payerdetailchange`** events are delivered by the [Payment Request API](/en-US/docs/Web/API/Payment_Request_API) to a {{domxref("PaymentResponse")}} object when the user makes changes to their personal information while filling out a payment request form.
A **`payerdetailchange`** event is fired by the [Payment Request API](/en-US/docs/Web/API/Payment_Request_API) to a {{domxref("PaymentResponse")}} object when the user makes changes to their personal information while filling out a payment request form. This can happen when the payer is retrying to submit its details after an error has been detected.

queengooborg marked this conversation as resolved.
Show resolved Hide resolved
The event handler for `payerdetailchange` should check each value in the form that has changed and ensure that the values are valid. If any are invalid, appropriate error messages should be configured and the {{domxref("PaymentResponse.retry", "retry()")}} method should be called on the {{domxref("PaymentResponse")}} to ask the user to update the invalid entries.
queengooborg marked this conversation as resolved.
Show resolved Hide resolved

<table class="properties">
<tbody>
<tr>
<th>Bubbles</th>
<td>No</td>
</tr>
<tr>
<th>Cancelable</th>
<td>No</td>
</tr>
<tr>
<th>Interface</th>
<td>{{DOMxRef("PaymentRequestUpdateEvent")}}</td>
</tr>
<tr>
<th>Event handler property</th>
<td>
<code
><a href="/en-US/docs/Web/API/PaymentResponse/onpayerdetailchange"
>onpayerdetailchange</a
></code
>
</td>
</tr>
</tbody>
</table>
This event is not cancelable and does not bubble.

## Syntax

Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.

```js
addEventListener('payerdetailchange', async event => { });

onpayerdetailchange = async event => { };
```

## Event type

A {{domxref("PaymentRequestUpdateEvent")}}. Inherits from {{domxref("Event")}}.

{{InheritanceDiagram("PaymentRequestUpdateEvent")}}

## Event properties

Although this event type is {{domxref("PaymentRequestUpdateEvent")}}, it doesn't implement any property that is not already on {{domxref("Event")}}.

## Examples

queengooborg marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -141,7 +136,6 @@ response.addEventListener("payerdetailchange", async ev => {
- [Payment Request API](/en-US/docs/Web/API/Payment_Request_API)
- [Using the Payment Request API](/en-US/docs/Web/API/Payment_Request_API/Using_the_Payment_Request_API)
- {{domxref("PaymentResponse")}}
- [`payerdetailchange`](/en-US/docs/Web/API/PaymentResponse/payerdetailchange_event)
- [`paymentmethodchange`](/en-US/docs/Web/API/PaymentRequest/paymentmethodchange_event)
- [`shippingaddresschange`](/en-US/docs/Web/API/PaymentRequest/shippingaddresschange_event)
- [`shippingoptionchange`](/en-US/docs/Web/API/PaymentRequest/shippingoptionchange_event)