Skip to content

Commit dc8b5bd

Browse files
Merge pull request #93 from xendit/release/3.10.2
Update empty checker for card data & force date checker to use Gregorian calendar
2 parents 3d78112 + da6576f commit dc8b5bd

File tree

7 files changed

+7
-11
lines changed

7 files changed

+7
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Note that starting version 3.10.0, it requires minimum version of iOS 11. If you
1919
Add this to your Podfile.
2020

2121
```ruby
22-
pod 'Xendit', '~> 3.10.1'
22+
pod 'Xendit', '~> 3.10.2'
2323
```
2424

2525
**Important:** Import SDK in Objective-C project with CocoaPods integration, you can do as following

Sources/Xendit/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>3.10.1</string>
18+
<string>3.10.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

Sources/Xendit/Models/DTOs/XenditCardHolderInformation.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ import Foundation
3333
self.cardHolderPhoneNumber = cardHolderPhoneNumber
3434
}
3535

36-
func isEmpty() -> Bool {
37-
return self.cardHolderEmail != nil && self.cardHolderFirstName != nil && self.cardHolderLastName != nil && self.cardHolderPhoneNumber != nil
38-
}
39-
4036
func toJsonObject() -> [String : Any] {
4137
var json: [String: Any] = [:]
4238
if cardHolderFirstName != nil { json["card_holder_first_name"] = cardHolderFirstName }

Sources/Xendit/Utils/CreditCard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CreditCard {
4848
let cardExpMonthValid = NSRegularExpression.regexCardNumberValidation(cardNumber: cardExpirationMonth)
4949
let cardExpYearValid = NSRegularExpression.regexCardNumberValidation(cardNumber: cardExpirationYear)
5050
if cardExpMonthValid && cardExpYearValid {
51-
let calendar = Calendar.current
51+
let calendar = Calendar(identifier: .gregorian)
5252
let components = calendar.dateComponents([.month, .year], from: Date())
5353
let currentMonth = components.month ?? 1
5454
let currentYear = components.year ?? 2024

Sources/Xendit/XDTApiClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class XDTApiClient {
3838
internal static let CLIENT_TYPE = "SDK";
3939
internal static let CLIENT_API_VERSION = "2.0.0";
4040
internal static let CLIENT_IDENTIFIER = "Xendit iOS SDK";
41-
internal static let CLIENT_SDK_VERSION = "3.10.1";
41+
internal static let CLIENT_SDK_VERSION = "3.10.2";
4242

4343
private static let WEBAPI_FLEX_BASE_URL = "https://sandbox.webapi.visa.com"
4444

Sources/Xendit/XDTCards.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ public class XDTCards: CanTokenize, CanAuthenticate {
213213
requestBody["card_cvn"] = cardCvn
214214
}
215215

216-
if let cardData, !cardData.isEmpty() {
217-
requestBody["card_data"] = cardData.toJsonObject()
216+
if let cardDataJson = cardData?.toJsonObject(), !cardDataJson.isEmpty {
217+
requestBody["card_data"] = cardDataJson
218218
}
219219

220220
var extraHeaders: [String: String] = [:]

Xendit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Xendit'
3-
s.version = '3.10.1'
3+
s.version = '3.10.2'
44
s.license = 'MIT'
55
s.homepage = 'https://www.xendit.co'
66
s.author = { 'Juan Gonzalez’' => '[email protected]' }

0 commit comments

Comments
 (0)