diff --git a/Cloudpayments-SDK-iOS.podspec b/Cloudpayments-SDK-iOS.podspec index d63b2d1..877b440 100644 --- a/Cloudpayments-SDK-iOS.podspec +++ b/Cloudpayments-SDK-iOS.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.name = "Cloudpayments" - spec.version = "1.2.10" + spec.version = "1.2.11" spec.summary = "Core library that allows you to use internet acquiring from CloudPayments in your app" spec.description = "Core library that allows you to use internet acquiring from CloudPayments in your app!" diff --git a/demo/demo/ViewControllers/Main/MainViewController.swift b/demo/demo/ViewControllers/Main/MainViewController.swift index 6989a3d..be506b0 100644 --- a/demo/demo/ViewControllers/Main/MainViewController.swift +++ b/demo/demo/ViewControllers/Main/MainViewController.swift @@ -99,27 +99,9 @@ class MainViewController: BaseViewController, UICollectionViewDataSource, UIColl let product = products[indexPath.item] - // cell.image.sd_cancelCurrentImageLoad() cell.image.image = nil cell.activityIndicator.stopAnimating() - -// if let image = product.images?.first?.src { -// cell.activityIndicator.startAnimating() -// cell.image.alpha = 0 -// /cell.image.sd_setImage(with: URL.init(string: image), placeholderImage: nil, options: .avoidAutoSetImage) { (image, error, cacheType, url) in -// cell.activityIndicator.stopAnimating() -// -// if cacheType == .none { -// cell.image.image = image -// UIView.animate(withDuration: 0.2, animations: { -// cell.image.alpha = 1 -// }) -// } else { -// cell.image.image = image -// cell.image.alpha = 1 -// } -// } -// } + cell.name.text = product.name cell.price.text = "\(product.price ?? "0") Руб." diff --git a/sdk/Cloudpayments.podspec b/sdk/Cloudpayments.podspec index c63016e..ae854fb 100644 --- a/sdk/Cloudpayments.podspec +++ b/sdk/Cloudpayments.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.name = "Cloudpayments" - spec.version = "1.2.10" + spec.version = "1.2.11" spec.summary = "Core library that allows you to use internet acquiring from CloudPayments in your app" spec.description = "Core library that allows you to use internet acquiring from CloudPayments in your app!" diff --git a/sdk/Sources/PaymentForm/PaymentOptionsForm.swift b/sdk/Sources/PaymentForm/PaymentOptionsForm.swift index e8448e0..5739d1b 100644 --- a/sdk/Sources/PaymentForm/PaymentOptionsForm.swift +++ b/sdk/Sources/PaymentForm/PaymentOptionsForm.swift @@ -84,7 +84,7 @@ class PaymentOptionsForm: PaymentForm, PKPaymentAuthorizationViewControllerDeleg // Укажите скругления для кнопки (по умолчанию - 8px) button.layer.cornerRadius = 8 - + // Установите layout для кнопки yandexPayContainer.addSubview(button) button.bindFrameToSuperviewBounds() @@ -253,53 +253,15 @@ class PaymentOptionsForm: PaymentForm, PKPaymentAuthorizationViewControllerDeleg // Оплата была совершена успешно if let decodedData = Data(base64Encoded: paymentInfo.paymentToken), let decodedToken = String(data: decodedData, encoding: .utf8) { - if (configuration.useDualMessagePayment) { - self.auth(cardCryptogramPacket: decodedToken, email: nil) { [weak self] status, canceled, transaction, errorMessage in - guard let self = self else { - return - } - - let state: PaymentProcessForm.State - - if status { - state = .succeeded(self.resultTransaction) - } else { - state = .failed(self.errorMessage) - } + let parent = self.presentingViewController + self.dismiss(animated: true) { [weak self] in + guard let self = self else { + return - let parent = self.presentingViewController - self.dismiss(animated: true) { [weak self] in - guard let self = self else { - return - } - if parent != nil { - PaymentProcessForm.present(with: self.configuration, cryptogram: nil, email: nil, state: state, from: parent!, completion: nil) - } - } } - } else { - self.charge(cardCryptogramPacket: decodedToken, email: nil) { [weak self] status, canceled, transaction, errorMessage in - guard let self = self else { - return - } - - let state: PaymentProcessForm.State - - if status { - state = .succeeded(self.resultTransaction) - } else { - state = .failed(self.errorMessage) - } - - let parent = self.presentingViewController - self.dismiss(animated: true) { [weak self] in - guard let self = self else { - return - } - if parent != nil { - PaymentProcessForm.present(with: self.configuration, cryptogram: nil, email: nil, state: state, from: parent!, completion: nil) - } - } + + if parent != nil { + PaymentProcessForm.present(with: self.configuration, cryptogram: decodedToken, email: nil, state: .inProgress, from: parent!, completion: nil) } } }