PaymentResponse Class
The response of the user who accepted a payment request (https://w3c.github.io/payment-request/#paymentresponse-interface): the page processes the payment, then calls PaymentResponse.Complete, or PaymentResponse.Retry to let the user fix errors.
public sealed class PaymentResponse : EventTarget- Inheritance
EventTargetPaymentResponse
Properties
| Name | Description |
|---|---|
| Details | Gets the response of the payment handler (a JavaScript object whose shape is defined by the payment method). |
| MethodName | Gets the identifier of the payment method that the user selected. |
| OnPayerDetailChange | Gets or sets the event handler of the payerdetailchange event. |
| PayerEmail | Gets the email address of the payer, or null when the request does not request it. |
| PayerName | Gets the name of the payer, or null when the request does not request it. |
| PayerPhone | Gets the phone number of the payer, or null when the request does not request it. |
| RequestId | Gets the identifier of the payment request. |
| ShippingAddress | Gets the full shipping address chosen by the user, or null when the request does not request shipping. |
| ShippingOption | Gets the identifier of the selected shipping option, or null when the request does not request shipping. |
Details
PaymentResponse.csGets the response of the payment handler (a JavaScript object whose shape is defined by the payment method).
public object Details { get; }MethodName
PaymentResponse.csGets the identifier of the payment method that the user selected.
public string MethodName { get; }OnPayerDetailChange
PaymentResponse.csGets or sets the event handler of the payerdetailchange event.
PayerEmail
PaymentResponse.csGets the email address of the payer, or null when the request does not request it.
public string? PayerEmail { get; }PayerName
PaymentResponse.csGets the name of the payer, or null when the request does not request it.
public string? PayerName { get; }PayerPhone
PaymentResponse.csGets the phone number of the payer, or null when the request does not request it.
public string? PayerPhone { get; }RequestId
PaymentResponse.csGets the identifier of the payment request.
public string RequestId { get; }ShippingAddress
PaymentResponse.csGets the full shipping address chosen by the user, or null when the request does not request shipping.
public ContactAddress? ShippingAddress { get; }ShippingOption
PaymentResponse.csGets the identifier of the selected shipping option, or null when the request does not request shipping.
public string? ShippingOption { get; }Property value
See also
Methods
| Name | Description |
|---|---|
| Complete(PaymentComplete, PaymentCompleteDetails?) | Tells the user agent that the payment is processed (https://w3c.github.io/payment-request/#complete-method): the payment sheet is closed (UserAgentUIBackend.CompletePaymentAsync). The task fails with an InvalidStateError DomException when the response is already complete or is being retried, and with an AbortError when the document is unloaded first. |
| Retry(PaymentValidationErrors?) | Asks the user to fix the errors of the response (https://w3c.github.io/payment-request/#retry-method): the payment sheet is shown again (UserAgentUIBackend.RetryPaymentAsync), and the task completes once the user accepts the payment again: the members of the response are updated. The task fails with an InvalidStateError DomException when the document is not fully active, the response is complete or is already being retried, with a NotSupportedError when the payment was not accepted in the payment sheet (Secure Payment Confirmation), and with an AbortError when the user dismisses the sheet. |
Complete(PaymentComplete, PaymentCompleteDetails?)
PaymentResponse.csTells the user agent that the payment is processed (https://w3c.github.io/payment-request/#complete-method): the payment sheet is closed (UserAgentUIBackend.CompletePaymentAsync). The task fails with an InvalidStateError DomException when the response is already complete or is being retried, and with an AbortError when the document is unloaded first.
public Task Complete(PaymentComplete result = PaymentComplete.Unknown, PaymentCompleteDetails? details = null)Retry(PaymentValidationErrors?)
PaymentResponse.csAsks the user to fix the errors of the response (https://w3c.github.io/payment-request/#retry-method): the payment sheet is shown again (UserAgentUIBackend.RetryPaymentAsync), and the task completes once the user accepts the payment again: the members of the response are updated. The task fails with an InvalidStateError DomException when the document is not fully active, the response is complete or is already being retried, with a NotSupportedError when the payment was not accepted in the payment sheet (Secure Payment Confirmation), and with an AbortError when the user dismisses the sheet.
public Task Retry(PaymentValidationErrors? errorFields = null)