Skip to content

Commit

Permalink
Merge pull request #93 from xendit/release/3.10.2
Browse files Browse the repository at this point in the history
Update empty checker for card data & force date checker to use Gregorian calendar
  • Loading branch information
ahmadAlfhajri authored Nov 21, 2024
2 parents 3d78112 + da6576f commit dc8b5bd
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Note that starting version 3.10.0, it requires minimum version of iOS 11. If you
Add this to your Podfile.

```ruby
pod 'Xendit', '~> 3.10.1'
pod 'Xendit', '~> 3.10.2'
```

**Important:** Import SDK in Objective-C project with CocoaPods integration, you can do as following
Expand Down
2 changes: 1 addition & 1 deletion Sources/Xendit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.10.1</string>
<string>3.10.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 0 additions & 4 deletions Sources/Xendit/Models/DTOs/XenditCardHolderInformation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ import Foundation
self.cardHolderPhoneNumber = cardHolderPhoneNumber
}

func isEmpty() -> Bool {
return self.cardHolderEmail != nil && self.cardHolderFirstName != nil && self.cardHolderLastName != nil && self.cardHolderPhoneNumber != nil
}

func toJsonObject() -> [String : Any] {
var json: [String: Any] = [:]
if cardHolderFirstName != nil { json["card_holder_first_name"] = cardHolderFirstName }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Xendit/Utils/CreditCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CreditCard {
let cardExpMonthValid = NSRegularExpression.regexCardNumberValidation(cardNumber: cardExpirationMonth)
let cardExpYearValid = NSRegularExpression.regexCardNumberValidation(cardNumber: cardExpirationYear)
if cardExpMonthValid && cardExpYearValid {
let calendar = Calendar.current
let calendar = Calendar(identifier: .gregorian)
let components = calendar.dateComponents([.month, .year], from: Date())
let currentMonth = components.month ?? 1
let currentYear = components.year ?? 2024
Expand Down
2 changes: 1 addition & 1 deletion Sources/Xendit/XDTApiClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class XDTApiClient {
internal static let CLIENT_TYPE = "SDK";
internal static let CLIENT_API_VERSION = "2.0.0";
internal static let CLIENT_IDENTIFIER = "Xendit iOS SDK";
internal static let CLIENT_SDK_VERSION = "3.10.1";
internal static let CLIENT_SDK_VERSION = "3.10.2";

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

Expand Down
4 changes: 2 additions & 2 deletions Sources/Xendit/XDTCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ public class XDTCards: CanTokenize, CanAuthenticate {
requestBody["card_cvn"] = cardCvn
}

if let cardData, !cardData.isEmpty() {
requestBody["card_data"] = cardData.toJsonObject()
if let cardDataJson = cardData?.toJsonObject(), !cardDataJson.isEmpty {
requestBody["card_data"] = cardDataJson
}

var extraHeaders: [String: String] = [:]
Expand Down
2 changes: 1 addition & 1 deletion Xendit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Xendit'
s.version = '3.10.1'
s.version = '3.10.2'
s.license = 'MIT'
s.homepage = 'https://www.xendit.co'
s.author = { 'Juan Gonzalez’' => '[email protected]' }
Expand Down

0 comments on commit dc8b5bd

Please sign in to comment.