Skip to content

Commit 17a1eec

Browse files
Merge pull request #293 from skyflowapi/public-release/1.24.2
SK-1996 Public release/1.24.2
2 parents a3cb667 + 4ea28d1 commit 17a1eec

11 files changed

Lines changed: 44 additions & 31 deletions

File tree

.github/workflows/main_coverage_upload.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ jobs:
1515
- name: Checkout Repo
1616
uses: actions/checkout@v2
1717

18-
- name: Select Xcode 14
19-
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
18+
- name: Select Xcode 15
19+
run: sudo xcode-select --switch /Applications/Xcode_15.1.app/Contents/Developer
2020

21-
- name: Prepare iOS 16 Simulator
21+
- name: Prepare iOS 17 Simulator
2222
run: sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
23-
sudo ln -s /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 16.4.simruntime
23+
sudo ln -s /Applications/Xcode_15.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 17.0.1.simruntime
2424
xcrun simctl list runtimes
2525

2626
- name: Build and Test
27-
run: xcodebuild clean -workspace .swiftpm/xcode/package.xcworkspace -scheme Skyflow -enableCodeCoverage YES -destination "platform=iOS Simulator,OS=16.4,name=iPhone 14" VAULT_URL="${{ secrets.VAULT_URL }}" CAVV_TEST_TOKEN="${{ secrets.CAVV_TEST_TOKEN }}" PULL_FUNDS_INTEGRATION_CONNECTION_URL="${{ secrets.PULL_FUNDS_INTEGRATION_CONNECTION_URL }}" CVV_INTEGRATION_PATH="${{ secrets.CVV_INTEGRATION_PATH }}" CVV_INTEGRATION_CONNECTION_URL="${{ secrets.CVV_INTEGRATION_CONNECTION_URL }}" CONNECTION_URL="${{ secrets.CONNECTION_URL }}" TEST_EXPIRATION_DATE_TOKEN="${{ secrets.TEST_EXPIRATION_DATE_TOKEN }}" TEST_CARD_NUMBER="${{ secrets.TEST_CARD_NUMBER }}" TEST_SKYFLOW_ID1="${{ secrets.TEST_SKYFLOW_ID1 }}" TEST_SKYFLOW_ID2="${{ secrets.TEST_SKYFLOW_ID2 }}" TEST_SKYFLOW_ID3="${{ secrets.TEST_SKYFLOW_ID3 }}" TEST_SKYFLOW_ID4="${{ secrets.TEST_SKYFLOW_ID4 }}" DETOKENIZE_TEST_TOKEN="${{ secrets.DETOKENIZE_TEST_TOKEN }}" DETOKENIZE_TEST_VALUE="${{ secrets.DETOKENIZE_TEST_VALUE }}" TOKEN_ENDPOINT="${{ secrets.TOKEN_ENDPOINT }}" PULL_FUNDS_INTEGRATION_ID="${{ secrets.PULL_FUNDS_INTEGRATION_ID }}" VISA_BASIC_AUTH="${{ secrets.VISA_BASIC_AUTH }}" CVV_INTEGRATION_ID="${{ secrets.CVV_INTEGRATION_ID }}" VAULT_ID="${{ secrets.VAULT_ID }}" -quiet test
27+
run: xcodebuild clean -workspace .swiftpm/xcode/package.xcworkspace -scheme Skyflow -enableCodeCoverage YES -destination 'platform=iOS Simulator,OS=17.0.1,name=iPhone 15' VAULT_URL="${{ secrets.VAULT_URL }}" CAVV_TEST_TOKEN="${{ secrets.CAVV_TEST_TOKEN }}" PULL_FUNDS_INTEGRATION_CONNECTION_URL="${{ secrets.PULL_FUNDS_INTEGRATION_CONNECTION_URL }}" CVV_INTEGRATION_PATH="${{ secrets.CVV_INTEGRATION_PATH }}" CVV_INTEGRATION_CONNECTION_URL="${{ secrets.CVV_INTEGRATION_CONNECTION_URL }}" CONNECTION_URL="${{ secrets.CONNECTION_URL }}" TEST_EXPIRATION_DATE_TOKEN="${{ secrets.TEST_EXPIRATION_DATE_TOKEN }}" TEST_CARD_NUMBER="${{ secrets.TEST_CARD_NUMBER }}" TEST_SKYFLOW_ID1="${{ secrets.TEST_SKYFLOW_ID1 }}" TEST_SKYFLOW_ID2="${{ secrets.TEST_SKYFLOW_ID2 }}" TEST_SKYFLOW_ID3="${{ secrets.TEST_SKYFLOW_ID3 }}" TEST_SKYFLOW_ID4="${{ secrets.TEST_SKYFLOW_ID4 }}" DETOKENIZE_TEST_TOKEN="${{ secrets.DETOKENIZE_TEST_TOKEN }}" DETOKENIZE_TEST_VALUE="${{ secrets.DETOKENIZE_TEST_VALUE }}" TOKEN_ENDPOINT="${{ secrets.TOKEN_ENDPOINT }}" PULL_FUNDS_INTEGRATION_ID="${{ secrets.PULL_FUNDS_INTEGRATION_ID }}" VISA_BASIC_AUTH="${{ secrets.VISA_BASIC_AUTH }}" CVV_INTEGRATION_ID="${{ secrets.CVV_INTEGRATION_ID }}" VAULT_ID="${{ secrets.VAULT_ID }}" -quiet test
2828

2929
- name: Upload coverage to Codecov
3030
uses: codecov/codecov-action@v4

.github/workflows/pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
- name: Checkout Repo
3636
uses: actions/checkout@v2
3737

38-
- name: Select Xcode 14
39-
run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer
40-
41-
- name: Prepare iOS 16 Simulator
38+
- name: Select Xcode 15
39+
run: sudo xcode-select --switch /Applications/Xcode_15.1.app/Contents/Developer
40+
41+
- name: Prepare iOS 17 Simulator
4242
run: sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
43-
sudo ln -s /Applications/Xcode_14.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 16.4.simruntime
43+
sudo ln -s /Applications/Xcode_15.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 17.0.1.simruntime
4444
xcrun simctl list runtimes
4545

4646
- name: Build and Test
47-
run: xcodebuild clean -workspace .swiftpm/xcode/package.xcworkspace -scheme Skyflow -enableCodeCoverage YES -destination "platform=iOS Simulator,OS=16.4,name=iPhone 14" VAULT_URL="${{ secrets.VAULT_URL }}" CAVV_TEST_TOKEN="${{ secrets.CAVV_TEST_TOKEN }}" PULL_FUNDS_INTEGRATION_CONNECTION_URL="${{ secrets.PULL_FUNDS_INTEGRATION_CONNECTION_URL }}" CVV_INTEGRATION_PATH="${{ secrets.CVV_INTEGRATION_PATH }}" CVV_INTEGRATION_CONNECTION_URL="${{ secrets.CVV_INTEGRATION_CONNECTION_URL }}" CONNECTION_URL="${{ secrets.CONNECTION_URL }}" TEST_EXPIRATION_DATE_TOKEN="${{ secrets.TEST_EXPIRATION_DATE_TOKEN }}" TEST_CARD_NUMBER="${{ secrets.TEST_CARD_NUMBER }}" TEST_SKYFLOW_ID1="${{ secrets.TEST_SKYFLOW_ID1 }}" TEST_SKYFLOW_ID2="${{ secrets.TEST_SKYFLOW_ID2 }}" TEST_SKYFLOW_ID3="${{ secrets.TEST_SKYFLOW_ID3 }}" TEST_SKYFLOW_ID4="${{ secrets.TEST_SKYFLOW_ID4 }}" DETOKENIZE_TEST_TOKEN="${{ secrets.DETOKENIZE_TEST_TOKEN }}" DETOKENIZE_TEST_VALUE="${{ secrets.DETOKENIZE_TEST_VALUE }}" TOKEN_ENDPOINT="${{ secrets.TOKEN_ENDPOINT }}" PULL_FUNDS_INTEGRATION_ID="${{ secrets.PULL_FUNDS_INTEGRATION_ID }}" VISA_BASIC_AUTH="${{ secrets.VISA_BASIC_AUTH }}" CVV_INTEGRATION_ID="${{ secrets.CVV_INTEGRATION_ID }}" VAULT_ID="${{ secrets.VAULT_ID }}" -quiet test
47+
run: xcodebuild clean -workspace .swiftpm/xcode/package.xcworkspace -scheme Skyflow -enableCodeCoverage YES -destination "platform=iOS Simulator,OS=17.0.1,name=iPhone 15" VAULT_URL="${{ secrets.VAULT_URL }}" CAVV_TEST_TOKEN="${{ secrets.CAVV_TEST_TOKEN }}" PULL_FUNDS_INTEGRATION_CONNECTION_URL="${{ secrets.PULL_FUNDS_INTEGRATION_CONNECTION_URL }}" CVV_INTEGRATION_PATH="${{ secrets.CVV_INTEGRATION_PATH }}" CVV_INTEGRATION_CONNECTION_URL="${{ secrets.CVV_INTEGRATION_CONNECTION_URL }}" CONNECTION_URL="${{ secrets.CONNECTION_URL }}" TEST_EXPIRATION_DATE_TOKEN="${{ secrets.TEST_EXPIRATION_DATE_TOKEN }}" TEST_CARD_NUMBER="${{ secrets.TEST_CARD_NUMBER }}" TEST_SKYFLOW_ID1="${{ secrets.TEST_SKYFLOW_ID1 }}" TEST_SKYFLOW_ID2="${{ secrets.TEST_SKYFLOW_ID2 }}" TEST_SKYFLOW_ID3="${{ secrets.TEST_SKYFLOW_ID3 }}" TEST_SKYFLOW_ID4="${{ secrets.TEST_SKYFLOW_ID4 }}" DETOKENIZE_TEST_TOKEN="${{ secrets.DETOKENIZE_TEST_TOKEN }}" DETOKENIZE_TEST_VALUE="${{ secrets.DETOKENIZE_TEST_VALUE }}" TOKEN_ENDPOINT="${{ secrets.TOKEN_ENDPOINT }}" PULL_FUNDS_INTEGRATION_ID="${{ secrets.PULL_FUNDS_INTEGRATION_ID }}" VISA_BASIC_AUTH="${{ secrets.VISA_BASIC_AUTH }}" CVV_INTEGRATION_ID="${{ secrets.CVV_INTEGRATION_ID }}" VAULT_ID="${{ secrets.VAULT_ID }}" -quiet test
4848

4949
- name: Upload coverage to Codecov
5050
uses: codecov/codecov-action@v4

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
All notable changes to this project will be documented in this file.
55

6+
## [1.24.2] - 2025-04-14
7+
8+
### Added
9+
- Flexibility to display the desired card brand scheme for card brand choice.
10+
611
## [1.24.1] - 2024-09-24
712

813
### Fixed

Skyflow.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |spec|
22

33
spec.name = "Skyflow"
44

5-
spec.version = "1.24.1"
5+
spec.version = "1.24.2"
66

77
spec.summary = "skyflow-iOS"
88

@@ -20,7 +20,7 @@ Pod::Spec.new do |spec|
2020

2121
spec.ios.deployment_target = "9.0"
2222

23-
spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.24.1" }
23+
spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.24.2" }
2424

2525
spec.source_files = "Sources/Skyflow/**/*.{swift}"
2626

Sources/Skyflow/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ import Foundation
1313

1414
var LangAndVersion = "iOS SDK v\(SDK_VERSION)"
1515

16-
var SDK_VERSION = "1.24.1"
16+
var SDK_VERSION = "1.24.2"

Sources/Skyflow/elements/TextField.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,16 @@ public class TextField: SkyflowElement, Element, BaseElement {
264264
listCardTypes = schemes
265265
if let cardTypes = listCardTypes, cardTypes.count >= 2 {
266266
getDropDownIcon()
267+
selectedCardBrand = listCardTypes?[0]
268+
} else {
269+
selectedCardBrand = nil
267270
}
268271
}
269272
}
270273
let t = self.textField.secureText!.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: " ", with: "")
271274
let card = CardType.forCardNumber(cardNumber: t).instance
272275
updateImage(name: card.imageName, cardNumber: t)
276+
self.onChangeHandler?((self.state as! StateforText).getStateForListener())
273277
}
274278
let t = self.textField.secureText!.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: " ", with: "")
275279
let card = CardType.forCardNumber(cardNumber: t).instance

Tests/skyflow-iOS-elementTests/skyflow_iOS_elementTests.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class skyflow_iOS_elementTests: XCTestCase {
209209
}
210210

211211
func testCardExpiryValidationMMYY() {
212-
let mmyy = "12/24"
212+
let mmyy = "12/30"
213213

214214
let cardexpValidation = SkyflowValidateCardExpirationDate(format: "mm/yy", error: "Invalid Card expiration date")
215215
XCTAssertTrue(SkyflowValidator.validate(input: mmyy, rules: ValidationSet(rules: [cardexpValidation])).isEmpty)
@@ -341,7 +341,7 @@ class skyflow_iOS_elementTests: XCTestCase {
341341

342342
textField.textFieldDidEndEditing(textField.textField)
343343
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
344-
XCTAssertTrue(textField.selectedCardBrand == nil)
344+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
345345
XCTAssertTrue(textField.listCardTypes?.count == 2)
346346
XCTAssertEqual(textField.listCardTypes, [CardType.AMEX, CardType.VISA])
347347
XCTAssertTrue(textField.dropdownButton.isHidden == false)
@@ -351,7 +351,7 @@ class skyflow_iOS_elementTests: XCTestCase {
351351

352352
textField.textFieldDidEndEditing(textField.textField)
353353
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
354-
XCTAssertTrue(textField.selectedCardBrand == nil)
354+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
355355
XCTAssertTrue(textField.listCardTypes?.count == 2)
356356
XCTAssertEqual(textField.listCardTypes, [CardType.AMEX, CardType.VISA])
357357
XCTAssertTrue(textField.dropdownButton.isHidden == false)
@@ -361,7 +361,7 @@ class skyflow_iOS_elementTests: XCTestCase {
361361

362362
textField.textFieldDidEndEditing(textField.textField)
363363
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
364-
XCTAssertTrue(textField.selectedCardBrand == nil)
364+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
365365
XCTAssertTrue(textField.listCardTypes != nil)
366366
XCTAssertEqual(textField.listCardTypes, [CardType.AMEX, CardType.VISA])
367367
XCTAssertFalse(textField.dropdownButton.isHidden)
@@ -391,7 +391,7 @@ class skyflow_iOS_elementTests: XCTestCase {
391391

392392
textField.textFieldDidEndEditing(textField.textField)
393393
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
394-
XCTAssertTrue(textField.selectedCardBrand == nil)
394+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
395395
XCTAssertTrue(textField.listCardTypes != nil)
396396
XCTAssertEqual(textField.listCardTypes, [CardType.AMEX, CardType.VISA])
397397
XCTAssertFalse(textField.dropdownButton.isHidden)
@@ -425,15 +425,15 @@ class skyflow_iOS_elementTests: XCTestCase {
425425
textField.textFieldDidEndEditing(textField.textField)
426426
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
427427
XCTAssertFalse(textField.dropdownButton.isHidden)
428-
XCTAssertEqual(textField.selectedCardBrand, nil)
428+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
429429
}
430430
func testDropdownClickAndMenuVisible() {
431431
let textField = getElementForDropDownTesting()
432432

433433
textField.textFieldDidEndEditing(textField.textField)
434434
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
435435
XCTAssertFalse(textField.dropdownButton.isHidden)
436-
XCTAssertEqual(textField.selectedCardBrand, nil)
436+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
437437
if #available(iOS 14.0, *) {
438438
XCTAssertEqual(textField.dropdownButton.menu?.children.count, 2)
439439
XCTAssertEqual((textField.dropdownButton.menu?.children.first as? UIAction)?.title, CardType.AMEX.instance.defaultName)
@@ -460,6 +460,7 @@ class skyflow_iOS_elementTests: XCTestCase {
460460
let textField = getElementForDropDownTestingWindow()
461461
textField.textFieldDidEndEditing(textField.textField)
462462
textField.update(updateOptions: CollectElementOptions(cardMetaData: ["scheme": [CardType.AMEX, CardType.VISA]]))
463+
XCTAssertEqual(textField.selectedCardBrand?.instance.defaultName, CardType.AMEX.instance.defaultName)
463464
if #available(iOS 14.0, *) {
464465
XCTAssertEqual(textField.dropdownButton.frame, CGRect(x: 50, y: 15, width: 12, height: 15))
465466
XCTAssertFalse(textField.dropdownButton.isHidden)

Tests/skyflow-iOS-utilTests/skyflow_iOS_collectUtilTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class skyflow_iOS_collectUtilTests: XCTestCase {
2626
}
2727

2828
func testOnSuccessInvalidUrl() {
29-
let expectation = XCTestExpectation()
29+
let expectation = XCTestExpectation(description: "Invalid URL should trigger failure")
3030
let callback = DemoAPICallback(expectation: expectation)
3131
self.collectCallback.apiClient.vaultURL = "Invalid url"
3232
self.collectCallback.callback = callback
@@ -35,7 +35,7 @@ final class skyflow_iOS_collectUtilTests: XCTestCase {
3535
wait(for: [expectation], timeout: 20.0)
3636

3737
let result = callback.receivedResponse
38-
XCTAssert(result.contains("Initialization failed. Invalid credentials. Specify a valid 'vaultURL'"))
38+
XCTAssert(result.contains("unsupported URL"))
3939
}
4040

4141
func testGetRequestSession() {

Tests/skyflow-iOS-utilTests/skyflow_iOS_getByIdUtilTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ final class skyflow_iOS_getByIdUtilTests: XCTestCase {
3131
func testApiCallbackInvalidUrl() {
3232
let expectation = XCTestExpectation(description: "expect invalid url failure")
3333
let failureCallback = DemoAPICallback(expectation: expectation)
34-
34+
let record = GetByIdRecord(ids: ["one", "two"], table: "table", redaction: "REDACTED")
35+
self.revealApiCallback.records = [record]
3536
self.revealApiCallback.connectionUrl = "invalid url"
37+
self.revealApiCallback.apiClient.vaultURL = "dummy"
3638
self.revealApiCallback.callback = failureCallback
3739
self.revealApiCallback.onSuccess("dummy_token")
3840

3941
wait(for: [expectation], timeout: 30.0)
4042
let result = failureCallback.data["errors"] as! [[String: NSError]]
41-
XCTAssertEqual(result[0]["error"], ErrorCodes.INVALID_URL().getErrorObject(contextOptions: ContextOptions()))
43+
XCTAssertEqual(result[0]["error"]?.localizedDescription, "unsupported URL")
4244
}
4345

4446
func testGetRequestSession() {

Tests/skyflow-iOS-utilTests/skyflow_iOS_getUtilTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ final class skyflow_iOS_getUtilTests: XCTestCase {
7474
func testApiCallbackInvalidUrl() {
7575
let expectation = XCTestExpectation(description: "expect invalid url failure")
7676
let failureCallback = DemoAPICallback(expectation: expectation)
77-
77+
let record = GetRecord(ids: ["one", "two"], table: "table", redaction: "REDACTED")
7878
self.getApiCallback.connectionUrl = "invalid url"
79+
self.getApiCallback.records = [record]
7980
self.getApiCallback.callback = failureCallback
8081
self.getApiCallback.onSuccess("dummy_token")
81-
8282
wait(for: [expectation], timeout: 30.0)
8383
let result = failureCallback.data["errors"] as! [[String: NSError]]
84-
XCTAssertEqual(result[0]["error"], ErrorCodes.INVALID_URL().getErrorObject(contextOptions: ContextOptions()))
84+
XCTAssertEqual(result[0]["error"]?.localizedDescription, "unsupported URL")
8585
}
8686

8787
func testGetRequestSession() {

0 commit comments

Comments
 (0)