-
Notifications
You must be signed in to change notification settings - Fork 3
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 #25 from checkout/refactor/risk-instance
Refactor folder structure and risk instance management
- Loading branch information
Showing
29 changed files
with
538 additions
and
307 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
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,12 @@ | ||
// | ||
// PublishRiskData.swift | ||
// | ||
// | ||
// Created by Precious Ossai on 30/10/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct PublishRiskData { | ||
public let deviceSessionId: String | ||
} |
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,13 @@ | ||
// | ||
// RiskIntegrationType.swift | ||
// | ||
// | ||
// Created by Precious Ossai on 20/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
enum RiskIntegrationType: String, Codable { | ||
case standalone = "RiskIosStandalone" | ||
case inFrames = "RiskIosInFramesIos" | ||
} |
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,39 @@ | ||
// | ||
// RiskSDKInternalConfig.swift | ||
// | ||
// | ||
// Created by Precious Ossai on 20/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
struct RiskSDKInternalConfig { | ||
let merchantPublicKey: String | ||
let deviceDataEndpoint: String | ||
let fingerprintEndpoint: String | ||
let integrationType: RiskIntegrationType | ||
let sourceType: SourceType | ||
let framesMode: Bool | ||
let environment: RiskEnvironment | ||
|
||
init(config: RiskConfig) { | ||
merchantPublicKey = config.publicKey | ||
environment = config.environment | ||
framesMode = config.framesMode | ||
integrationType = framesMode ? .inFrames : .standalone | ||
sourceType = framesMode ? .cardToken : .riskSDK | ||
|
||
switch environment { | ||
case .qa: | ||
deviceDataEndpoint = "https://prism-qa.ckotech.co/collect" | ||
fingerprintEndpoint = "https://fpjs.cko-qa.ckotech.co" | ||
case .sandbox: | ||
deviceDataEndpoint = "https://risk.sandbox.checkout.com/collect" | ||
fingerprintEndpoint = "https://fpjs.sandbox.checkout.com" | ||
case .production: | ||
deviceDataEndpoint = "https://risk.checkout.com/collect" | ||
fingerprintEndpoint = "https://fpjs.checkout.com" | ||
} | ||
} | ||
|
||
} |
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,13 @@ | ||
// | ||
// SourceType.swift | ||
// | ||
// | ||
// Created by Precious Ossai on 20/02/2024. | ||
// | ||
|
||
import Foundation | ||
|
||
enum SourceType: String { | ||
case cardToken = "card_token" | ||
case riskSDK = "riskios" | ||
} |
Oops, something went wrong.