toJSON

fun toJSON(): ERROR CLASS: Symbol not found for JsAny(source)

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

MDN Reference