mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The projection these were generated from predated the compute migration, so they described /v1/visor — which the API serves at zero paths now. No /v1/visor path survives here.
51 lines
2.4 KiB
Swift
51 lines
2.4 KiB
Swift
//
|
|
// Charged.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Charged: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** BalanceCents is the subject's balance AFTER the charge settled, in cents, so a caller does not have to re-read to show the new number. */
|
|
public var balanceCents: Int64?
|
|
/** ProcessorRef is the payment processor's own reference. It is the only field that proves money moved at the GATEWAY rather than merely in our ledger, which is why it is answered and not only logged. Absent where the processor returned none. */
|
|
public var processorRef: String?
|
|
/** Status is how the charge ended. Read it rather than inferring success from the HTTP status: the call succeeded whenever this field is present, and what the PROCESSOR did is what this says. */
|
|
public var status: String?
|
|
/** Test states which bucket was credited — sandbox money or real money — so no reader has to guess whether a receipt is real. Sandbox and live funds are physically separate ledgers, and a reader that conflates them restates the company's revenue. */
|
|
public var test: Bool?
|
|
/** TransactionID is the ledger entry this charge created. It is the handle a later read or a refund names, and it is minted by the ledger rather than by the caller. */
|
|
public var transactionId: String?
|
|
|
|
public init(balanceCents: Int64? = nil, processorRef: String? = nil, status: String? = nil, test: Bool? = nil, transactionId: String? = nil) {
|
|
self.balanceCents = balanceCents
|
|
self.processorRef = processorRef
|
|
self.status = status
|
|
self.test = test
|
|
self.transactionId = transactionId
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case balanceCents
|
|
case processorRef
|
|
case status
|
|
case test
|
|
case transactionId
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(balanceCents, forKey: .balanceCents)
|
|
try container.encodeIfPresent(processorRef, forKey: .processorRef)
|
|
try container.encodeIfPresent(status, forKey: .status)
|
|
try container.encodeIfPresent(test, forKey: .test)
|
|
try container.encodeIfPresent(transactionId, forKey: .transactionId)
|
|
}
|
|
}
|
|
|