toJSON

The toJSON() method of the PaymentResponse interface is a Serialization; it returns a JSON representation of the PaymentResponse object.

MDN Reference