Veloria/Veloria/Libs/VPIAPManager/VPWaitRestoreModel.swift

46 lines
1.3 KiB
Swift

//
// VPWaitRestoreModel.swift
// Veloria
//
// Created by on 2025/6/5.
//
import UIKit
class VPWaitRestoreModel: VPModel, NSSecureCoding {
var orderCode: String?
var payId: String?
var productId: String?
var receipt: String?
var buyType: VPWalletAPI.BuyType?
required init() { }
static var supportsSecureCoding: Bool {
get {
return true
}
}
func encode(with coder: NSCoder) {
coder.encode(orderCode, forKey: "orderCode")
coder.encode(payId, forKey: "payId")
coder.encode(productId, forKey: "productId")
coder.encode(receipt, forKey: "receipt")
coder.encode(buyType?.rawValue, forKey: "buyType")
}
required init?(coder: NSCoder) {
super.init()
orderCode = coder.decodeObject(of: NSString.self, forKey: "orderCode") as? String
payId = coder.decodeObject(of: NSString.self, forKey: "payId") as? String
productId = coder.decodeObject(of: NSString.self, forKey: "productId") as? String
receipt = coder.decodeObject(of: NSString.self, forKey: "receipt") as? String
if let type = coder.decodeObject(of: NSString.self, forKey: "buyType") as? String {
buyType = VPWalletAPI.BuyType(rawValue: type)
}
}
}