Skip to content

Commit

Permalink
Merge pull request #127 in MI/yandex-checkout-payments-swift from rel…
Browse files Browse the repository at this point in the history
…ease/3.3.0 to master

* commit '67db1cbba4f00b9e48c314b701d055c08efbd26d':
  [NO-TASK] Bump version, update CHANGELOG.md
  [MOC-386] Restrict expiry date validation to 01/20
AutoMergeBot authored and AutoMergeBot committed Apr 7, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 94e01c9 + 67db1cb commit e24726f
Showing 4 changed files with 20 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 3.3.0

1. Убрали ограничение для поля "Срок действия карты"

### 3.2.0

1. Поддержка `ThreatMetrix iOS SDK 6.0-91 With Bitcode`
2 changes: 1 addition & 1 deletion YandexCheckoutPayments.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'YandexCheckoutPayments'
s.version = '3.2.0'
s.version = '3.3.0'
s.homepage = 'https://github.com/yandex-money/yandex-checkout-payments-swift'
s.license = {
:type => "MIT",
6 changes: 3 additions & 3 deletions YandexCheckoutPayments.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -4244,7 +4244,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ./YandexCheckoutPayments/Public/Resources/Entitlements/YandexCheckoutPaymentsExamplePods.entitlements;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = 2752592HU5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4316,7 +4316,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ./YandexCheckoutPayments/Public/Resources/Entitlements/YandexCheckoutPaymentsExamplePods.debug.entitlements;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = 2752592HU5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -4345,7 +4345,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ./YandexCheckoutPayments/Public/Resources/Entitlements/YandexCheckoutPaymentsExamplePods.inhouse.entitlements;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = 2752592HU5;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
15 changes: 12 additions & 3 deletions YandexCheckoutPayments/Private/Services/CardService.swift
Original file line number Diff line number Diff line change
@@ -101,9 +101,18 @@ extension CardService {
guard let month = components.month, month <= 12, month > 0 else { throw ValidationError.invalidMonth }
guard let expiryDate = components.date else { throw ValidationError.expiryDateEmpty }

let currentDateComponents: DateComponents = Calendar.current.dateComponents([.year, .month], from: Date())
guard let currentDate = Calendar(identifier: .gregorian).date(from: currentDateComponents) else {
throw ValidationError.expirationDateIsExpired
// let currentDateComponents: DateComponents = Calendar.current.dateComponents([.year, .month], from: Date())
// guard let currentDate = Calendar(identifier: .gregorian).date(from: currentDateComponents) else {
// throw ValidationError.expirationDateIsExpired
// }

guard let currentDate = DateComponents(
calendar: .current,
timeZone: .current,
year: 2020,
month: 1
).date else {
throw ValidationError.expiryDateEmpty
}

if currentDate > expiryDate {

0 comments on commit e24726f

Please sign in to comment.