Untitled

 avatar
unknown
plain_text
2 years ago
705 B
3
Indexable
                    let checkoutResult = CheckoutResult(success: response.success, type: response.type.rawValue, payload: response.payload)
                    result(checkoutResult.dictionaryRepresentation)



class CheckoutResult {
   
    var success: Bool = false
    var type: Int
    var payload: [String: Any]?

    /// Constructor
    init(success: Bool, type: Int, payload: [String: Any]?) {
        self.type = type;
        self.payload = payload;
        self.success = success
    }
    
    /// The dictionary representation of this class
    var dictionaryRepresentation : [String:Any] {
        return ["type" : self.type,  "success" : self.success, "payload": self.payload ?? nil]
    }
}