-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4100b8e
commit 38c99ab
Showing
16 changed files
with
1,344 additions
and
6 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
162 changes: 162 additions & 0 deletions
162
Sources/code/platform/Models/Payment/ReasonDetailPaymentPlatformModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
|
||
|
||
import Foundation | ||
|
||
|
||
public extension PlatformClient.Payment { | ||
/* | ||
Model: ReasonDetail | ||
Used By: Payment | ||
*/ | ||
|
||
class ReasonDetail: Codable { | ||
|
||
|
||
public var code: String? | ||
|
||
public var description: String? | ||
|
||
|
||
public enum CodingKeys: String, CodingKey { | ||
|
||
case code = "code" | ||
|
||
case description = "description" | ||
|
||
} | ||
|
||
public init(code: String? = nil, description: String? = nil) { | ||
|
||
self.code = code | ||
|
||
self.description = description | ||
|
||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
do { | ||
code = try container.decode(String.self, forKey: .code) | ||
|
||
} catch DecodingError.typeMismatch(let type, let context) { | ||
print("Type '\(type)' mismatch:", context.debugDescription) | ||
print("codingPath:", context.codingPath) | ||
} catch { | ||
|
||
} | ||
|
||
|
||
|
||
do { | ||
description = try container.decode(String.self, forKey: .description) | ||
|
||
} catch DecodingError.typeMismatch(let type, let context) { | ||
print("Type '\(type)' mismatch:", context.debugDescription) | ||
print("codingPath:", context.codingPath) | ||
} catch { | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
|
||
try? container.encodeIfPresent(code, forKey: .code) | ||
|
||
|
||
|
||
|
||
try? container.encodeIfPresent(description, forKey: .description) | ||
|
||
|
||
} | ||
|
||
} | ||
} | ||
|
||
|
||
|
||
public extension PlatformClient.ApplicationClient.Payment { | ||
/* | ||
Model: ReasonDetail | ||
Used By: Payment | ||
*/ | ||
|
||
class ReasonDetail: Codable { | ||
|
||
|
||
public var code: String? | ||
|
||
public var description: String? | ||
|
||
|
||
public enum CodingKeys: String, CodingKey { | ||
|
||
case code = "code" | ||
|
||
case description = "description" | ||
|
||
} | ||
|
||
public init(code: String? = nil, description: String? = nil) { | ||
|
||
self.code = code | ||
|
||
self.description = description | ||
|
||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
do { | ||
code = try container.decode(String.self, forKey: .code) | ||
|
||
} catch DecodingError.typeMismatch(let type, let context) { | ||
print("Type '\(type)' mismatch:", context.debugDescription) | ||
print("codingPath:", context.codingPath) | ||
} catch { | ||
|
||
} | ||
|
||
|
||
|
||
do { | ||
description = try container.decode(String.self, forKey: .description) | ||
|
||
} catch DecodingError.typeMismatch(let type, let context) { | ||
print("Type '\(type)' mismatch:", context.debugDescription) | ||
print("codingPath:", context.codingPath) | ||
} catch { | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
|
||
try? container.encodeIfPresent(code, forKey: .code) | ||
|
||
|
||
|
||
|
||
try? container.encodeIfPresent(description, forKey: .description) | ||
|
||
|
||
} | ||
|
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.