         self.isManaged = true
     }
     
+    var bytes: [UInt8] {
+        var bytes = [UInt8](repeating: 0, count: BRPaymentProtocolRequestSerialize(cPtr, nil, 0))
+        BRPaymentProtocolRequestSerialize(cPtr, &bytes, bytes.count)
+        return bytes
+    }
+
     var version: UInt32 { // default is 1
         return cPtr.pointee.version
     }

        self.isManaged = true
    }
    
    var network: String { // "main" or "test", default is "main"
        return String(cString: cPtr.pointee.network)
    }

        self.isManaged = true
    }
    
    var bytes: [UInt8] {
        var bytes = [UInt8](repeating: 0, count: BRPaymentProtocolPaymentSerialize(cPtr, nil, 0))
        BRPaymentProtocolPaymentSerialize(cPtr, &bytes, bytes.count)
        return bytes
    }

    var merchantData: [UInt8]? { // from request->details->merchantData, optional
        guard cPtr.pointee.merchantData != nil else { return nil }
        return [UInt8](UnsafeBufferPointer(start: cPtr.pointee.merchantData, count: cPtr.pointee.merchDataLen))
