Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Release 5.11.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
IngenicoEPayments committed Oct 16, 2023
1 parent 50953fb commit dc77b84
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 31 deletions.
2 changes: 1 addition & 1 deletion IngenicoConnectKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "IngenicoConnectKit"
s.version = "5.11.0"
s.version = "5.11.1"
s.summary = "Ingenico Connect Swift SDK"
s.description = <<-DESC
This native iOS SDK facilitates handling payments in your apps
Expand Down
4 changes: 4 additions & 0 deletions IngenicoConnectKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
73CBAE531F9E2CC500FAB37F /* CustomerDetailsError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73CBAE521F9E2CC500FAB37F /* CustomerDetailsError.swift */; };
7BC4941129657E5500F6138A /* ValidatorResidentIdNumberTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC4941029657E5500F6138A /* ValidatorResidentIdNumberTestCase.swift */; };
7BC494192965AA3C00F6138A /* ValidatorResidentIdNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC494182965AA3C00F6138A /* ValidatorResidentIdNumber.swift */; };
7BEEA28929BA2F160085406C /* AuthenticationIndicator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BEEA28829BA2F160085406C /* AuthenticationIndicator.swift */; };
7BFB26CE2954536D00A95841 /* OHHTTPStubs.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BFB26CB2954536C00A95841 /* OHHTTPStubs.xcframework */; };
7BFB26CF2954536D00A95841 /* OHHTTPStubs.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7BFB26CB2954536C00A95841 /* OHHTTPStubs.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
7BFB26D02954536D00A95841 /* CryptoSwift.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BFB26CC2954536C00A95841 /* CryptoSwift.xcframework */; };
Expand Down Expand Up @@ -263,6 +264,7 @@
73CBAE521F9E2CC500FAB37F /* CustomerDetailsError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CustomerDetailsError.swift; path = Models/PaymentProducts/CustomerDetailsError.swift; sourceTree = "<group>"; };
7BC4941029657E5500F6138A /* ValidatorResidentIdNumberTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ValidatorResidentIdNumberTestCase.swift; path = IngenicoConnectKitTests/Models/ValidatorResidentIdNumberTestCase.swift; sourceTree = "<group>"; };
7BC494182965AA3C00F6138A /* ValidatorResidentIdNumber.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ValidatorResidentIdNumber.swift; path = Models/PaymentProducts/ValidatorResidentIdNumber.swift; sourceTree = "<group>"; };
7BEEA28829BA2F160085406C /* AuthenticationIndicator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationIndicator.swift; sourceTree = "<group>"; };
7BFB26CB2954536C00A95841 /* OHHTTPStubs.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = OHHTTPStubs.xcframework; path = Carthage/Build/OHHTTPStubs.xcframework; sourceTree = "<group>"; };
7BFB26CC2954536C00A95841 /* CryptoSwift.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = CryptoSwift.xcframework; path = Carthage/Build/CryptoSwift.xcframework; sourceTree = "<group>"; };
7BFB26CD2954536C00A95841 /* Alamofire.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Alamofire.xcframework; path = Carthage/Build/Alamofire.xcframework; sourceTree = "<group>"; };
Expand Down Expand Up @@ -730,6 +732,7 @@
children = (
73AABACE1F1F806B00B76782 /* CustomerDetails.swift */,
73CBAE521F9E2CC500FAB37F /* CustomerDetailsError.swift */,
7BEEA28829BA2F160085406C /* AuthenticationIndicator.swift */,
73AABACF1F1F806B00B76782 /* DisplayElement.swift */,
6D7822651DF066C700B5A9AB /* DataRestrictions.swift */,
6D7822691DF067A900B5A9AB /* ToolTip.swift */,
Expand Down Expand Up @@ -953,6 +956,7 @@
6D4E7AA71DF5656600BAE336 /* BasicPaymentProductGroup.swift in Sources */,
735404512153C71700771041 /* PaymentProduct863SpecificData.swift in Sources */,
6D7822641DF0660B00B5A9AB /* PaymentItemDisplayHints.swift in Sources */,
7BEEA28929BA2F160085406C /* AuthenticationIndicator.swift in Sources */,
73AABAD11F1F806B00B76782 /* DisplayElement.swift in Sources */,
6D7822461DF03D2100B5A9AB /* FormElement.swift in Sources */,
B43C1F6D1DEC59E300E210DF /* Region.swift in Sources */,
Expand Down
24 changes: 24 additions & 0 deletions IngenicoConnectKit/AuthenticationIndicator.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AuthenticationIndicator.swift
// IngenicoConnectKit
//
// Created for Ingenico ePayments on 09/03/2023.
// Copyright © 2023 Global Collect Services. All rights reserved.
//

import Foundation

public class AuthenticationIndicator: ResponseObjectSerializable {
public var name: String
public var value: String

public required init?(json: [String: Any]) {
guard let name = json["name"] as? String,
let value = json["value"] as? String else {
return nil
}

self.name = name
self.value = value
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<key>pp_logo_302</key>
<string>templates/master/global/css/img/ppimages/pp_logo_302_v1.png</string>
<key>pp_logo_320</key>
<string>templates/master/global/css/img/ppimages/pp_logo_320_v3.png</string>
<string>templates/master/global/css/img/ppimages/pp_logo_320_v4.png</string>
<key>pp_logo_402</key>
<string>templates/master/global/css/img/ppimages/pp_logo_402_v2.png</string>
<key>pp_logo_420</key>
Expand Down
Binary file modified IngenicoConnectKit/IngenicoConnectKit.bundle/pp_logo_320.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@ public class BasicPaymentProduct: Equatable, BasicPaymentItem, ResponseObjectSer
public var autoTokenized = false
public var allowsInstallments = false

public var authenticationIndicator: AuthenticationIndicator?

public var deviceFingerprintEnabled = false

public var minAmount: Int?
public var maxAmount: Int?

public var paymentMethod: String
public var mobileIntegrationLevel: String?
public var usesRedirectionTo3rdParty = false
public var paymentProductGroup: String?
public var supportsMandates = false

public var paymentProduct302SpecificData: PaymentProduct302SpecificData?
public var paymentProduct320SpecificData: PaymentProduct320SpecificData?
Expand Down Expand Up @@ -71,8 +81,17 @@ public class BasicPaymentProduct: Equatable, BasicPaymentItem, ResponseObjectSer
allowsRecurring = json["allowsRecurring"] as? Bool ?? false
autoTokenized = json["autoTokenized"] as? Bool ?? false
allowsInstallments = json["allowsInstallments"] as? Bool ?? false
authenticationIndicator = json["authenticationIndicator"] as? AuthenticationIndicator

deviceFingerprintEnabled = json["deviceFingerprintEnabled"] as? Bool ?? false

minAmount = json["minAmount"] as? Int
maxAmount = json["maxAmount"] as? Int

mobileIntegrationLevel = json["mobileIntegrationLevel"] as? String
usesRedirectionTo3rdParty = json["usesRedirectionTo3rdParty"] as? Bool ?? false
paymentProductGroup = json["paymentProductGroup"] as? String
supportsMandates = json["supportsMandates"] as? Bool ?? false

if let input = json["accountsOnFile"] as? [[String: Any]] {
for accountInput in input {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Foundation
public class PaymentProduct: BasicPaymentProduct, PaymentItem {

public var fields: PaymentProductFields = PaymentProductFields()
public var fieldsWarning: String?

public required init?(json: [String: Any]) {
super.init(json: json)
Expand All @@ -24,6 +25,8 @@ public class PaymentProduct: BasicPaymentProduct, PaymentItem {
fields.paymentProductFields.append(field)
}
}

fieldsWarning = json["fieldsWarning"] as? String
}

public func paymentProductField(withId: String) -> PaymentProductField? {
Expand Down
80 changes: 52 additions & 28 deletions IngenicoConnectKit/Session.swift
Original file line number Diff line number Diff line change
Expand Up @@ -409,42 +409,66 @@ public class Session {
}
}

public func publicKey(
success: @escaping (_ publicKeyResponse: PublicKeyResponse) -> Void,
failure: @escaping (_ error: Error) -> Void
) {
communicator.publicKey(
success: { publicKeyResponse in
success(publicKeyResponse)
},
failure: { error in
failure(error)
}
)

}

public func prepare(
_ paymentRequest: PaymentRequest,
success: @escaping (_ preparedPaymentRequest: PreparedPaymentRequest) -> Void,
failure: @escaping (_ error: Error) -> Void
) {
communicator.publicKey(success: { publicKeyResponse in
let publicKeyAsData = publicKeyResponse.encodedPublicKey.decode()
guard let strippedPublicKeyAsData = self.encryptor.stripPublicKey(data: publicKeyAsData) else {
failure(SessionError.RuntimeError("Failed to decode Public key."))
return
}
let tag = "globalcollect-sdk-public-key-swift"
self.publicKey(
success: { publicKeyResponse in
let publicKeyAsData = publicKeyResponse.encodedPublicKey.decode()
guard let strippedPublicKeyAsData = self.encryptor.stripPublicKey(data: publicKeyAsData) else {
failure(SessionError.RuntimeError("Failed to decode Public key."))
return
}
let tag = "globalcollect-sdk-public-key-swift"

self.encryptor.deleteRSAKey(withTag: tag)
self.encryptor.storePublicKey(publicKey: strippedPublicKeyAsData, tag: tag)
self.encryptor.deleteRSAKey(withTag: tag)
self.encryptor.storePublicKey(publicKey: strippedPublicKeyAsData, tag: tag)

guard let publicKey = self.encryptor.RSAKey(withTag: tag) else {
failure(SessionError.RuntimeError("Failed to find RSA Key."))
return
}
guard let publicKey = self.encryptor.RSAKey(withTag: tag) else {
failure(SessionError.RuntimeError("Failed to find RSA Key."))
return
}

let paymentRequestJSON =
self.preparePaymentRequestJSON(forClientSessionId: self.clientSessionId, paymentRequest: paymentRequest)
let encryptedFields =
self.joseEncryptor.encryptToCompactSerialization(
JSON: paymentRequestJSON,
withPublicKey: publicKey,
keyId: publicKeyResponse.keyId
)
let encodedClientMetaInfo = self.communicator.base64EncodedClientMetaInfo
let preparedRequest =
PreparedPaymentRequest(encryptedFields: encryptedFields, encodedClientMetaInfo: encodedClientMetaInfo)
success(preparedRequest)
}, failure: { error in
failure(error)
})
let paymentRequestJSON =
self.preparePaymentRequestJSON(
forClientSessionId: self.clientSessionId,
paymentRequest: paymentRequest
)
let encryptedFields =
self.joseEncryptor.encryptToCompactSerialization(
JSON: paymentRequestJSON,
withPublicKey: publicKey,
keyId: publicKeyResponse.keyId
)
let encodedClientMetaInfo = self.communicator.base64EncodedClientMetaInfo
let preparedRequest =
PreparedPaymentRequest(
encryptedFields: encryptedFields,
encodedClientMetaInfo: encodedClientMetaInfo
)
success(preparedRequest)
},
failure: { error in
failure(error)
}
)
}

private func preparePaymentRequestJSON(
Expand Down
2 changes: 1 addition & 1 deletion IngenicoConnectKit/Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Util {
public init() {
metaInfo = [
"platformIdentifier": platformIdentifier,
"sdkIdentifier": "SwiftClientSDK/v5.11.0",
"sdkIdentifier": "SwiftClientSDK/v5.11.1",
"sdkCreator": "Ingenico",
"screenSize": screenSize,
"deviceBrand": "Apple",
Expand Down

0 comments on commit dc77b84

Please sign in to comment.