MDN self-hosted library · e01.org

PaymentResponse: toJSON() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
payment.show().then((paymentResponse) => {
  const json = paymentResponse.toJSON();
  console.log(json); // A plain object
  console.log(typeof json); // "object"
  console.log(json.methodName); // Same value as paymentResponse.methodName
});
js
console.log(JSON.stringify(paymentResponse));