-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from checkout/develop
Release 3.4.2
- Loading branch information
Showing
45 changed files
with
1,977 additions
and
28 deletions.
There are no files selected for viewing
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
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
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,46 @@ | ||
import Foundation | ||
import CheckoutEventLoggerKit | ||
|
||
enum FramesLogEvent { | ||
|
||
case paymentFormPresented | ||
|
||
var event: Event { | ||
Event(typeIdentifier: "com.checkout.frames-mobile-sdk.\(typeIdentifier)", | ||
time: time, | ||
monitoringLevel: monitoringLevel, | ||
properties: properties) | ||
} | ||
|
||
var providingMetadata: [String: String] { | ||
switch self { | ||
case .paymentFormPresented: | ||
return [:] | ||
} | ||
} | ||
|
||
private var typeIdentifier: String { | ||
switch self { | ||
case .paymentFormPresented: | ||
return "payment_form_presented" | ||
} | ||
} | ||
|
||
private var time: Date { | ||
Date() | ||
} | ||
|
||
private var monitoringLevel: MonitoringLevel { | ||
switch self { | ||
case .paymentFormPresented: | ||
return .info | ||
} | ||
} | ||
|
||
private var properties: [String: AnyCodable] { | ||
switch self { | ||
case .paymentFormPresented: | ||
return [:] | ||
} | ||
} | ||
} |
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,14 @@ | ||
import CheckoutEventLoggerKit | ||
|
||
extension CheckoutEventLogging { | ||
|
||
func log(_ framesLogEvent: FramesLogEvent) { | ||
|
||
framesLogEvent.providingMetadata.forEach { (metadata, value) in | ||
|
||
self.add(metadata: metadata, value: value) | ||
} | ||
|
||
self.log(event: framesLogEvent.event) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import UIKit | ||
|
||
protocol UIDevice { | ||
|
||
var modelName: String { get } | ||
var systemVersion: String { get } | ||
} | ||
|
||
extension UIKit.UIDevice: UIDevice { | ||
|
||
var modelName: String { | ||
// added simulator support from https://gist.github.com/SergLam/50c0e400877d76c499c2649b109b3890 | ||
#if targetEnvironment(simulator) | ||
if let identifier = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] { | ||
return identifier | ||
} | ||
#endif | ||
|
||
var systemInfo = utsname() | ||
uname(&systemInfo) | ||
let machineMirror = Mirror(reflecting: systemInfo.machine) | ||
return machineMirror.children.reduce("") { identifier, element in | ||
guard let value = element.value as? Int8, value != 0 else { return identifier } | ||
return identifier + String(UnicodeScalar(UInt8(value))) | ||
} | ||
} | ||
} |
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
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.