Class PaymentRequestEvent
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalPaymentRequestEvent interface of the {{domxref("Payment Handler API", "", "", "nocode")}} is the object passed to a payment handler when a PaymentRequest is made.
[Value("PaymentRequestEvent")]
public class PaymentRequestEvent : ExtendableEvent
- Inheritance
-
PaymentRequestEvent
- Inherited Members
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
Constructors
PaymentRequestEvent()
public PaymentRequestEvent()
PaymentRequestEvent(string, PaymentRequestEventInit)
NOTE
ExperimentalPaymentRequestEvent constructor creates a new PaymentRequestEvent object instance.
public PaymentRequestEvent(string type, PaymentRequestEventInit eventInitDict = null)
Parameters
typestringeventInitDictPaymentRequestEventInit
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
Properties
MethodData
NOTE
ExperimentalmethodData read-only property of thePaymentRequestEvent interface returns an array of
PaymentMethodData objects containing payment method identifiers for thepayment methods that the website accepts and any associated payment method-specific
data.
[Value("methodData")]
public PaymentMethodData[] MethodData { get; }
Property Value
- PaymentMethodData[]
An array of
PaymentMethodDataobjects. Each object contains the following properties:
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
Modifiers
NOTE
Experimentalmodifiers read-only property of thePaymentRequestEvent interface returns an {{jsxref("Array")}} of
PaymentDetailsModifier objects containing modifiers for payment details.
[Value("modifiers")]
public PaymentDetailsModifier[] Modifiers { get; }
Property Value
- PaymentDetailsModifier[]
An array of objects containing modifiers for payment details. These objects contain the following properties:
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
PaymentOptions
[Value("paymentOptions")]
public Object? PaymentOptions { get; }
Property Value
PaymentRequestId
NOTE
ExperimentalpaymentRequestId read-only property of thePaymentRequestEvent interface returns the ID of the
PaymentRequest object.
[Value("paymentRequestId")]
public string PaymentRequestId { get; }
Property Value
- string
A string containing the ID.
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
PaymentRequestOrigin
NOTE
ExperimentalpaymentRequestOrigin read-only property of thePaymentRequestEvent interface returns the origin where the
PaymentRequest object was initialized.
[Value("paymentRequestOrigin")]
public string PaymentRequestOrigin { get; }
Property Value
- string
A string.
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
ShippingOptions
[Value("shippingOptions")]
public PaymentShippingOption[]? ShippingOptions { get; }
Property Value
TopOrigin
NOTE
ExperimentaltopOrigin read-only property of thePaymentRequestEvent interface returns the top-level payee origin where
the PaymentRequest object was initialized.
[Value("topOrigin")]
public string TopOrigin { get; }
Property Value
- string
A string.
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
Total
NOTE
Experimentaltotal read-only property of the PaymentRequestEvent interface returns aPaymentCurrencyAmount object containing the total amount being requested for payment.
[Value("total")]
public Object Total { get; }
Property Value
- Object
A
PaymentCurrencyAmountobject. This object contains the following properties:
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
Methods
ChangePaymentMethod(string, Object?)
NOTE
ExperimentalchangePaymentMethod() method of the PaymentRequestEvent interface is used by the payment handler to get an updated total, given such payment method details as the billing address.
[Value("changePaymentMethod")]
public Task<PaymentRequestDetailsUpdate?> ChangePaymentMethod(string methodName, Object? methodDetails = null)
Parameters
Returns
- Task<PaymentRequestDetailsUpdate>
A Promise that resolves with a
PaymentRequestDetailsUpdateobject. This object contains the following properties:
Remarks
When this method is invoked, a PaymentMethodChangeEvent is fired.
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
ChangeShippingAddress(AddressInit)
[Value("changeShippingAddress")]
public Task<PaymentRequestDetailsUpdate?> ChangeShippingAddress(AddressInit shippingAddress = null)
Parameters
shippingAddressAddressInit
Returns
ChangeShippingOption(string)
[Value("changeShippingOption")]
public Task<PaymentRequestDetailsUpdate?> ChangeShippingOption(string shippingOption)
Parameters
shippingOptionstring
Returns
OpenWindow(string)
NOTE
ExperimentalopenWindow() method of the PaymentRequestEvent interface opens the specified URL in a new window, only if the given URL is on the same origin as the calling page. It returns a {{jsxref("Promise")}} that resolves with a reference to a WindowClient.
[Value("openWindow")]
public Task<WindowClient?> OpenWindow(string url)
Parameters
urlstring
Returns
- Task<WindowClient>
A Promise that resolves with a reference to a
WindowClient.
Remarks
-Web-based payment apps overview
-Setting up a payment method
-Life of a payment transaction
-Using the Payment Request API
-Payment processing concepts
RespondWith(Task<PaymentHandlerResponse>)
NOTE
ExperimentalrespondWith() method of the PaymentRequestEvent interface prevents the default event handling and allows you to provide a {{jsxref("Promise")}} for a payment handler response object yourself.
[Value("respondWith")]
public GlobalObject.Undefined RespondWith(Task<PaymentHandlerResponse> handlerResponsePromise)
Parameters
handlerResponsePromiseTask<PaymentHandlerResponse>