-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started with integration of partial payments for iOS
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
ios/Classes/dropIn/dropInAdvancedFlow/models/EncodableBalance.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,17 @@ | ||
import Adyen | ||
import Foundation | ||
|
||
extension Balance: Decodable { | ||
|
||
public init(from decoder: any Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
let availableAmount = try container.decode(Amount.self, forKey: .availableAmount) | ||
let transactionLimit = try container.decodeIfPresent(Amount.self, forKey: .transactionLimit) | ||
self = .init(availableAmount: availableAmount, transactionLimit: transactionLimit) | ||
} | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case availableAmount = "balance" | ||
case transactionLimit | ||
} | ||
} |
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