Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: SpawnJSObject
Source: JSObjects/PaymentMethodData.cs
MDN Reference: PaymentMethodData on MDN
https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequestEvent/methodData#value
| Signature | Description |
|---|---|
PaymentMethodData() |
Creates a new instance |
| Property | Type | Access | Description |
|---|---|---|---|
SupportedMethods |
string? |
get | A payment method identifier for a payment method that the merchant website accepts. |
Data |
SpawnJSObject? |
get | An object that provides optional information that might be needed by the supported payment methods. If supplied, it will be JSON-serialized. |
| Method | Return Type | Description |
|---|---|---|
GetData() |
T |
Get data as T |
SetData(object data) |
void |
Set data value |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<PaymentMethodData>(...)or constructornew PaymentMethodData(...)
self.addEventListener("paymentrequest", (e) => {
console.log(e.methodData);
});