Giter Club home page Giter Club logo

yookassa-payments-swift's Introduction

YooMoney for Business Payments SDK (YooKassaPayments)

Platform GitHub tag Documentation License

This library allows implementing payment acceptance into mobile apps on iOS and works as an extension to the YooMoney API.
The mobile SDK contains ready-made payment interfaces (the payment form and everything related to it).
Using the SDK, you can receive tokens for processing payments via bank cards, Apple Pay, Sberbank Online, or YooMoney wallets.


Changelog

Link to the Changelog

Migration guide

Link to the Migration guide

Adding dependencies

CocoaPods

  1. Install CocoaPods version 1.10.0 or higher.
gem install cocoapods

Official documentation for installing CocoaPods.
Available CocoaPods versions.

  1. Create Podfile

CocoaPods provides the pod init command for creating Podfile with default settings.

  1. Add dependencies to Podfile.
    Example of Podfile from the demo app.
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/yoomoney-tech/cocoa-pod-specs.git'

platform :ios, '10.0'
use_frameworks!

target 'Your Target Name' do
  pod 'YooKassaPayments',
    :git => 'https://github.com/yoomoney/yookassa-payments-swift.git',
    :tag => 'tag'
end

Your Target Name: name of the target in Xcode for your app.
tag: SDK version. You can find information about the latest version in the releases section on github.

If you use static linkage, you need to activate the cocoapods-user-defined-build-types plugin:

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/yoomoney-tech/cocoa-pod-specs.git'

plugin 'cocoapods-user-defined-build-types'
enable_user_defined_build_types!

platform :ios, '10.0'

target 'Your Target Name' do
  pod 'YooKassaPayments',
    :build_type => :dynamic_framework,
    :git => 'https://github.com/yoomoney/yookassa-payments-swift.git',
    :tag => 'tag'
end
  1. Run the pod install command

Carthage

At the moment, Carthage is not supported.

Quick integration

  1. Create TokenizationModuleInputData (you'll need a key for client apps from the YooMoney Merchant Profile). Payment parameters (currency and amount) and payment form parameters which users will see during the payment (payment methods, store name, and order description) are specified in this model.

To work with YooKassaPayments entities, import dependencies to the original file

import YooKassaPayments

Example for creating TokenizationModuleInputData:

let clientApplicationKey = "<Key for client apps>"
let amount = Amount(value: 999.99, currency: .rub)
let tokenizationModuleInputData =
          TokenizationModuleInputData(clientApplicationKey: clientApplicationKey,
                                      shopName: "Space objects",
                                      purchaseDescription: """
                                                            An extra bright comet, rotation period: 112 years
                                                            """,
                                      amount: amount,
                                      savePaymentMethod: .on)
  1. Create TokenizationFlow with the .tokenization case and enter TokenizationModuleInputData.

Example of creating TokenizationFlow:

let inputData: TokenizationFlow = .tokenization(tokenizationModuleInputData)
  1. Create ViewController from TokenizationAssembly and put it on the screen.
let viewController = TokenizationAssembly.makeModule(inputData: inputData,
                                                       moduleOutput: self)
present(viewController, animated: true, completion: nil)

You need to specify the object which implements the TokenizationModuleOutput in moduleOutput.

  1. Implement the TokenizationModuleOutput protocol.
extension ViewController: TokenizationModuleOutput {
    func tokenizationModule(
        _ module: TokenizationModuleInput,
        didTokenize token: Tokens,
        paymentMethodType: PaymentMethodType
    ) {
        DispatchQueue.main.async { [weak self] in
            guard let self = self else { return }
            self.dismiss(animated: true)
        }
        // Send the token to your system
    }

    func didFinish(
        on module: TokenizationModuleInput,
        with error: YooKassaPaymentsError?
    ) {
        DispatchQueue.main.async { [weak self] in
            guard let self = self else { return }
            self.dismiss(animated: true)
        }
    }

    func didSuccessfullyConfirmation(
        paymentMethodType: PaymentMethodType
    ) {
        DispatchQueue.main.async { [weak self] in
            guard let self = self else { return }
            // Create a success screen after confirmation is completed (3DS or SberPay)
            self.dismiss(animated: true)
            // Display the success screen
        }
    }
}

Close the SDK module and send the token to your system. After that, create a payment via the YooMoney API, enter the token you received in the SDK in the payment_token parameter. When a payment is created, the confirmation method depends on the payment method selected by the user. It's sent with the token in paymentMethodType.

Available payment methods

The following payment methods are currently supported in SDK for iOS:

.yooMoney: YooMoney (payments via the wallet or linked cards)
.bankCard: bank cards (cards can be scanned)
.sberbank: SberPay (with confirmation via the Sberbank Online mobile app if it's installed; otherwise, payments will be confirmed via text messages)
.applePay: Apple Pay

Setting up payment methods

You can configure payment methods.
To do that, you need to enter a model of the TokenizationSettings type in the tokenizationSettings parameter when creating TokenizationModuleInputData.

Additional configuration is required for some payment methods (see below).
By default, all available payment methods are used.

// Create empty OptionSet PaymentMethodTypes
var paymentMethodTypes: PaymentMethodTypes = []

if <Condition for bank cards> {
    // Adding the `.bankCard` element to paymentMethodTypes
    paymentMethodTypes.insert(.bankCard)
}

if <Condition for Sberbank Online> {
    // Adding the `.sberbank` element to paymentMethodTypes
    paymentMethodTypes.insert(.sberbank)
}

if <Condition for YooMoney> {
    // Adding the `.yooMoney` element to paymentMethodTypes
    paymentMethodTypes.insert(.yooMoney)
}

if <Condition for Apple Pay> {
    // Adding the `.applePay` element to paymentMethodTypes
    paymentMethodTypes.insert(.applePay)
}

let tokenizationSettings = TokenizationSettings(paymentMethodTypes: paymentMethodTypes)

Now use tokenizationSettings when initializing TokenizationModuleInputData.

YooMoney

To add YooMoney as a payment method, you need to:

  1. Receive client id of the YooMoney authorization center.
  2. Enter client id in the moneyAuthClientId parameter when creating TokenizationModuleInputData

How to get client id of the YooMoney authorization center

  1. Sign in at yookassa.ru
  2. Go to the page for signing up in the authorization center: yookassa.ru/oauth/v2/client
  3. Click Sign up
  4. Fill in the following fields:
    4.1. "Name": a required field, it's displayed in the list of apps and when rights are provided.
    4.2. "Description": an optional field, it's displayed to the user in the list of apps.
    4.3. "Link to app's website": an optional field, it's displayed to the user in the list of apps.
    4.4. "Confirmation code": select Specify in Callback URL, you can enter any value, for example, a link to a website.
  5. Select accesses:
    5.1. YooMoney wallet -> View
    5.2. YooMoney account -> View
  6. Click Sign up

Entering client id in the moneyAuthClientId parameter

Enter client id in the moneyAuthClientId parameter when creating TokenizationModuleInputData

let moduleData = TokenizationModuleInputData(
    ...
    moneyAuthClientId: "client_id")

To process a payment:

  1. Enter .yooMoney as the value in paymentMethodTypes. when creating TokenizationModuleInputData
  2. Receive a token.
  3. Create a payment with the token via the YooMoney API.

Support of authorization via the mobile app

  1. You need to specify applicationScheme, the scheme for returning to the app after a successful sign-in to YooMoney via the mobile app, in TokenizationModuleInputData.

Example of applicationScheme:

let moduleData = TokenizationModuleInputData(
    ...
    applicationScheme: "examplescheme://"
  1. Import the YooKassaPayments dependency in AppDelegate:

    import YooKassaPayments
  2. Add processing links via YKSdk in AppDelegate:

func application(
    _ application: UIApplication,
    open url: URL,
    sourceApplication: String?,
    annotation: Any
) -> Bool {
    return YKSdk.shared.handleOpen(
        url: url,
        sourceApplication: sourceApplication
    )
}

@available(iOS 9.0, *)
func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
    return YKSdk.shared.handleOpen(
        url: url,
        sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
    )
}
  1. Add the following rows to Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
	<string>yoomoneyauth</string>
</array>
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleTypeRole</key>
		<string>Editor</string>
		<key>CFBundleURLName</key>
		<string>${BUNDLE_ID}</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>examplescheme</string>
		</array>
	</dict>
</array>

where examplescheme is the scheme for opening your app that you specified in applicationScheme when creating TokenizationModuleInputData. This scheme will be used to open you app after a successful sign-in to YooMoney via the mobile app.

Bank cards

  1. Enter .bankcard as the value in paymentMethodTypes when creating TokenizationModuleInputData.
  2. Receive a token.
  3. Create a payment with the token via the YooMoney API.

SberPay

Using the SDK, you can process payments via Sberbank's "Mobile banking". Payments are confirmed via the Sberbank Online app if it's installed or otherwise via text messages.

You need to specify applicationScheme, the scheme for returning to the app after a successful payment via SberPay in the Sberbank Online app, in TokenizationModuleInputData.

Example of applicationScheme:

let moduleData = TokenizationModuleInputData(
    ...
    applicationScheme: "examplescheme://"

To process a payment:

  1. Enter .sberbank as the value in paymentMethodTypes when creating TokenizationModuleInputData.
  2. Receive a token.
  3. Create a payment with the token via the YooMoney API.

Payment confirmation via the Sberbank Online app:

  1. Import the YooKassaPayments dependency in AppDelegate:

    import YooKassaPayments
  2. Add processing link via YKSdk in AppDelegate:

func application(
    _ application: UIApplication,
    open url: URL,
    sourceApplication: String?,
    annotation: Any
) -> Bool {
    return YKSdk.shared.handleOpen(
        url: url,
        sourceApplication: sourceApplication
    )
}

@available(iOS 9.0, *)
func application(
    _ app: UIApplication,
    open url: URL,
    options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
    return YKSdk.shared.handleOpen(
        url: url,
        sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
    )
}
  1. Add the following rows to Info.plist:
<key>LSApplicationQueriesSchemes</key>
<array>
	<string>sberpay</string>
</array>
<key>CFBundleURLTypes</key>
<array>
	<dict>
		<key>CFBundleTypeRole</key>
		<string>Editor</string>
		<key>CFBundleURLName</key>
		<string>${BUNDLE_ID}</string>
		<key>CFBundleURLSchemes</key>
		<array>
			<string>examplescheme</string>
		</array>
	</dict>
</array>

where examplescheme is the scheme for opening your app that you specified in applicationScheme when creating TokenizationModuleInputData. This scheme will be used to open you app after a successful payment via SberPay.

  1. Implement the didSuccessfullyConfirmation(paymentMethodType:) method of the TokenizationModuleOutput protocol which will be called after a successful payment confirmation (see Setting up payment confirmation).

Apple Pay

  1. To implement Apple Pay, you need to provide a certificate, using which Apple will encrypt bank card details, to YooMoney.

In order to do it:

  • Contact your manager and ask them to create a request for a certificate (.csr) for you.
  • Create a certificate in Apple Developer Tools (use .csr).
  • Download the certificate you created and send it to your manager.

Full manual (see Section 2. Exchanging certificates with Apple)

  1. Enable Apple Pay in Xcode.

To process a payment:

  1. You need to enter the apple pay identifier in the applePayMerchantIdentifier parameter when initializing the TokenizationModuleInputData object.
let moduleData = TokenizationModuleInputData(
    ...
    applePayMerchantIdentifier: "com.example.identifier"
  1. Receive a token.
  2. Create a payment with the token via the YooMoney API.

Description of public parameters

TokenizationFlow

Enum which determines the logic of how the SDK operates.

Case Type Description
tokenization TokenizationFlow Receives the TokenizationModuleInputData model as input. Logic for tokenizing multiple payment method options: Bank card, YooMoney, Sberbank Online, or Apple Pay
bankCardRepeat TokenizationFlow Receives the BankCardRepeatModuleInputDatamodel as input. Logic for tokenizing saved payment methods using the payment method ID

YooKassaPaymentsError

Enum with possible errors which can be processed in the func didFinish(on module:, with error:) method

Case Type Description
paymentMethodNotFound Error No saved payment methods were found using paymentMethodId.

TokenizationModuleInputData

Required parameters:

Parameter Type Description
clientApplicationKey String Key for client apps from the YooMoney Merchant Profile
shopName String Store name in the payment form
purchaseDescription String Order description in the payment form
amount Amount Object containing the order amount and currency
savePaymentMethod SavePaymentMethod Object containing the logic for determining if it's going to be a recurring payment

Optional parameters:

Parameter Type Description
gatewayId String By default: nil. Used if you have multiple payment gateways with different IDs.
tokenizationSettings TokenizationSettings The standard initializer with all the payment methods is used by default. This parameter is used for setting up tokenization (payment methods and the YooMoney logo).
testModeSettings TestModeSettings By default: nil. Test mode settings.
cardScanning CardScanning By default: nil. Feature of scanning bank cards.
applePayMerchantIdentifier String By default: nil. Apple Pay merchant ID (required for payments via Apple Pay).
returnUrl String By default: nil. URL of the page (only https supported) where you need to return after completing 3-D Secure. Only required for custom implementation of 3-D Secure. If you use startConfirmationProcess(confirmationUrl:paymentMethodType:), don't specify this parameter.
isLoggingEnabled Bool By default: false. Enables logging of network requests.
userPhoneNumber String By default: nil. User's phone number.
customizationSettings CustomizationSettings The blueRibbon color is used by default. Color of the main elements, button, switches, and input fields.
moneyAuthClientId String By default: nil. ID for the center of authorizationin the YooMoney system
applicationScheme String By default: nil. Scheme for returning to the app after a successful payment via Sberpay in the Sberbank Online app or after a successful sign-in to YooMoney via the mobile app.
customerId String By default: nil. Unique customer id for your system, ex: email or phone number. 200 symbols max. Used by library to save user payment method and display saved methods. It is your responsibility to make sure that a particular customerId identifies the user, which is willing to make a purchase. For example use two-factor authentication. Using wrong id will let the user to use payment methods that don't belong to this user.

BankCardRepeatModuleInputData

Required parameters:

Parameter Type Description
clientApplicationKey String Key for client apps from the YooMoney Merchant Profile
shopName String Store name in the payment form
purchaseDescription String Order description in the payment form
paymentMethodId String ID of the saved payment method
amount Amount Object containing the order amount and currency
savePaymentMethod SavePaymentMethod Object containing the logic for determining if it's going to be a recurring payment

Optional parameters:

Parameter Type Description
testModeSettings TestModeSettings By default: nil. Test mode settings.
returnUrl String By default: nil. URL of the page (only https supported) where you need to return after completing 3-D Secure. Only required for custom implementation of 3-D Secure. If you use startConfirmationProcess(confirmationUrl:paymentMethodType:), don't specify this parameter.
isLoggingEnabled Bool By default: false. Enables logging of network requests.
customizationSettings CustomizationSettings The blueRibbon color is used by default. Color of the main elements, button, switches, and input fields.
gatewayId String By default: nil. Used if you have multiple payment gateways with different IDs.

TokenizationSettings

You can configure the list of payment methods and how the YooMoney logo is displayed in the app.

Parameter Type Description
paymentMethodTypes PaymentMethodTypes By default: .all. Payment methods available to the user in the app.
showYooKassaLogo Bool By default: true. It determines if the YooMoney logo is displayed. By default, the logo is displayed.

TestModeSettings

Parameter Type Description
paymentAuthorizationPassed Bool It determines if the payment authorization has been completed for payments via YooMoney.
cardsCount Int Number of cards linked to the YooMoney wallet.
charge Amount Payment amount and currency.
enablePaymentError Bool It determines if the payment is completed with an error.

Amount

Parameter Type Description
value Decimal Payment amount
currency Currency Payment currency

Currency

Parameter Type Description
rub String ₽ - Russian ruble
usd String $ - U.S. dollar
eur String € - Euro
custom String The value you entered will be displayed

CustomizationSettings

Parameter Type Description
mainScheme UIColor The blueRibbon color is used by default. Color of the main elements, button, switches, and input fields.

SavePaymentMethod

Parameter Type Description
on SavePaymentMethod Save the payment method for processing recurring payments. Only payment methods which support saving will be available to the user. A notification that the payment method will be saved will be displayed on the contract screen.
off SavePaymentMethod It doesn't allow the user to choose if the payment method should be saved or not.
userSelects SavePaymentMethod User chooses if the payment method should be saved or not. If the payment method can be saved, a switch will appear on the contract screen.

Scanning bank cards

If you want users to be able to scan bank cards when making payments, you need to:

  1. Create an entity and implement the CardScanning protocol.
class CardScannerProvider: CardScanning {
    weak var cardScanningDelegate: CardScanningDelegate?

    var cardScanningViewController: UIViewController? {

        // Create and return scanner view controller

        viewController.delegate = self
        return viewController
    }
}
  1. Set up receiving data from your tool for scanning bank cards.
    Example for CardIO:
extension CardScannerProvider: CardIOPaymentViewControllerDelegate {
    public func userDidProvide(_ cardInfo: CardIOCreditCardInfo!,
                               in paymentViewController: CardIOPaymentViewController!) {
        let scannedCardInfo = ScannedCardInfo(number: cardInfo.cardNumber,
                                              expiryMonth: "\(cardInfo.expiryMonth)",
                                              expiryYear: "\(cardInfo.expiryYear)")
        cardScanningDelegate?.cardScannerDidFinish(scannedCardInfo)
    }

    public func userDidCancel(_ paymentViewController: CardIOPaymentViewController!) {
        cardScanningDelegate?.cardScannerDidFinish(nil)
    }
}
  1. Enter an instance of the CardScannerProvider object in TokenizationModuleInputData in the cardScanning: parameter.
let inputData = TokenizationModuleInputData(
    ...
    cardScanning: CardScannerProvider())

Setting up payment confirmation

If you'd like to use our implementation of payment confirmation, don't close the SDK module after receiving the token.
Send the token to your server and close the module after a successful payment.
If your server stated that the payment needs to be confirmed (i.e. the payment with the pending was received), call the startConfirmationProcess(confirmationUrl:paymentMethodType:) method.

After the payment confirmation is completed successfully, the didSuccessfullyConfirmation(paymentMethodType:) method of the TokenizationModuleOutput protocol will be called.

Code examples:

  1. Save the tokenization module.
self.tokenizationViewController = TokenizationAssembly.makeModule(inputData: inputData,
                                                                 moduleOutput: self)
present(self.tokenizationViewController, animated: true, completion: nil)
  1. Don't close the tokenization module after receiving the token.
func tokenizationModule(_ module: TokenizationModuleInput,
                        didTokenize token: Tokens,
                        paymentMethodType: PaymentMethodType) {
    // Send the token to your server.
}
  1. Call payment confirmation if necessary.
self.tokenizationViewController.startConfirmationProcess(
    confirmationUrl: confirmationUrl,
    paymentMethodType: paymentMethodType
)
  1. After the payment is confirmed successfully, the method will be called.
func didSuccessfullyConfirmation(paymentMethodType: PaymentMethodType) {
    DispatchQueue.main.async { [weak self] in
        guard let self = self else { return }

        // Now close tokenization module
        self.dismiss(animated: true)
    }
}

Logging

You can enable logging of all network requests.
To do that, you need to enter isLoggingEnabled: true when creating TokenizationModuleInputData

let moduleData = TokenizationModuleInputData(
    ...
    isLoggingEnabled: true)

Test mode

You can launch the mobile SDK in test mode.
In test mode, no network requests are made and response from the server is emulated.

If you'd like to run the SDK in test mode, you need to:

  1. Configure an object with the TestModeSettings type.
let testModeSettings = TestModeSettings(paymentAuthorizationPassed: false,
                                        cardsCount: 2,
                                        charge: Amount(value: 999, currency: .rub),
                                        enablePaymentError: false)
  1. Enter it in TokenizationModuleInputData in the testModeSettings: parameter
let moduleData = TokenizationModuleInputData(
    ...
    testModeSettings: testModeSettings)

Launching Example

To launch the Example app, you need to:

  1. Make a git clone of the repository.
git clone https://github.com/yoomoney/yookassa-payments-swift.git
  1. Go to the project folder and run the following commands in console:
gem install bundler
bundle
pod install
  1. Open YooKassaPayments.xcworkspace.
  2. Select and launch the YooKassaPaymentsDemoApp scheme.

Interface customization

The blueRibbon color is used by default. Color of the main elements, button, switches, and input fields.

  1. Configure an CustomizationSettings object and enter it in the customizationSettings parameter of the TokenizationModuleInputData object.
let moduleData = TokenizationModuleInputData(
    ...
    customizationSettings: CustomizationSettings(mainScheme: /* UIColor */ ))

Payments via bank cards linked to the store with an additional CVC/CVV request

  1. Create BankCardRepeatModuleInputData.
let bankCardRepeatModuleInputData = BankCardRepeatModuleInputData(
            clientApplicationKey: oauthToken,
            shopName: translate(Localized.name),
            purchaseDescription: translate(Localized.description),
            paymentMethodId: "24e4eca6-000f-5000-9000-10a7bb3cfdb2",
            amount: amount,
            testModeSettings: testSettings,
            isLoggingEnabled: true,
            customizationSettings: CustomizationSettings(mainScheme: .blueRibbon)
        )
  1. Create TokenizationFlow with the .bankCardRepeat case and enter BankCardRepeatModuleInputData.
let inputData: TokenizationFlow = .bankCardRepeat(bankCardRepeatModuleInputData)
  1. Create ViewController from TokenizationAssembly and put it on the screen.
let viewController = TokenizationAssembly.makeModule(
    inputData: inputData,
    moduleOutput: self
)
present(viewController, animated: true, completion: nil)

License

YooMoney for Business Payments SDK (YooKassaPayments) is available under the MIT license. See the LICENSE file for additional information.

yookassa-payments-swift's People

Contributors

dependabot[bot] avatar hardenn avatar metalheadsanya avatar oltv00 avatar starxor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yookassa-payments-swift's Issues

Duplicate Assets.car - конфликт с новой билд системой (New Build System)

Существует проблема конфликта ассетов разных фреймворков в проекте собираемым новой билд системой Xcode. Подробнее можно почитать issue на сам CocoaPods. То, с чем я столкнулся интегрируя ваш фреймворк, полностью совпадает с проблемой описанной в issue. Быстрым решением является отказ от новой билд системы, более сложные решения опять же можно почитать в issue на сам CocoaPods.

Cannot build project

Привет. I can understand a lot in Russian, but asking questions in Russian is too difficult for me.

I installed the pods and TrustDefender, but I cannot build the project. I get a number of errors.

in PaymentService:
Cannot invoke initializer for type 'Tokens.Method' with an argument list of type '(oauthToken: String, paymentMethodData: PaymentMethodDataBankCard, tmxSessionId: String, amount: MonetaryAmount?)'

in MockPaymentService:
Type of expression is ambiguous without more context
in reference to PaymentInstrumentYandexMoneyLinkedBankCard, PaymentInstrumentYandexMoneyWallet, PaymentOption

SOLVED: updating to 2.1.0 fixed the problem

YandexCheckoutPaymentsApi 1.1.0 issue

После обновления подов, а именно после того как обновился YandexCheckoutPaymentsApi 1.1.0
появились ошибки:
image
Версия YandexCheckoutPayments - 1.3.7

Ошибка - No such module 'TMXProfiling'

Добрый день!

Устанавливаю библиотеку через Cocoapods. Установилась версия 3.5.0
При сборке получаю ошибку No such module 'TMXProfiling'.
Но таких библиотек в проекте нет. Подскажите пожалуйста, где их можно получить?

Не загружается страница банка для ввода 3ds кода из смс

Добрый день!

Периодически не загружается страница банка для ввода кода из смс:
https://geel.pro/yandex.png
Если через некоторое время вернуться на предыдущую страницу по нажатию кнопки "банковская карта" и повторить платеж (не меняя данных) - с большой вероятностью повторный платеж пройдет успешно. Но иногда пауза затягивается до пары часов.

TrustDefender

Здравствуйте, вот тут, в инструкции интеграции сдк написано, что необходимо установить через cocoapods и добавить TrustDefender.framework

где, собственно можно взять данный фреймворк? на гитхабе я нашел, но его яндекс не хочет признавать.

в выкачаном ExampleProject после установки подов та же проблема - отсутствие этого фреймворка.

Язык интерфейса на английском

Как поменять язык интерфейса платежки?
Он на английском языке почему-то.

П.С. У моего коллеги при интеграции сдк для Андроид, язык изначально был русским.
IMG_2719

Undefined symbols for architecture x86_64

Возникает ошибка при попытке сборки

Undefined symbols for architecture x86_64:
"OBJC_CLASS$_THMTrustDefender", referenced from:
objc-class-ref in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMProfileStatus", referenced from:
function signature specialization <Arg[1] = Dead> of static YandexCheckoutPayments.ThreatMetrixService.(handleProfilingResult in _494410973FF5E845E89AB1306ACCEB6D)([Swift.AnyHashable : Any]?) -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMSessionID", referenced from:
function signature specialization <Arg[1] = Dead> of static YandexCheckoutPayments.ThreatMetrixService.(handleProfilingResult in _494410973FF5E845E89AB1306ACCEB6D)([Swift.AnyHashable : Any]?) -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMOrgID", referenced from:
function signature specialization <Arg[0] = Dead> of closure #1 () -> () in static YandexCheckoutPayments.ThreatMetrixService.configure() -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMFingerprintServer", referenced from:
function signature specialization <Arg[0] = Dead> of closure #1 () -> () in static YandexCheckoutPayments.ThreatMetrixService.configure() -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMTimeout", referenced from:
function signature specialization <Arg[0] = Dead> of closure #1 () -> () in static YandexCheckoutPayments.ThreatMetrixService.configure() -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMLocationServices", referenced from:
function signature specialization <Arg[0] = Dead> of closure #1 () -> () in static YandexCheckoutPayments.ThreatMetrixService.configure() -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
"_THMUseNSURLSession", referenced from:
function signature specialization <Arg[0] = Dead> of closure #1 () -> () in static YandexCheckoutPayments.ThreatMetrixService.configure() -> () in libYandexCheckoutPayments.a(ThreatMetrixService.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Получаю "no available payment methods"

На и тестовом ключе, и на live_ та же самая проблема, нет доступных методов оплаты. Пробовал не задавать tokenizationSettings вообще, пробовал руками в
tokenizationSettings: TokenizationSettings(paymentMethodTypes: paymentMethodTypes)
ставить 1-2 метода, не помогает.

Только с параметром testModeSettings есть методы оплаты. Что может быть?

Повторная оплата

Добрый день!
У класса BankCardRepeatPresenter пустые реализации методов start3dsProcess. Какой процесс должен быть для повторной оплаты c 3ds и без в приложении, если бэкенд проекта интегированный с Яндекс Кассой, возвращает мне paymentMethodID?

Кастомизация

Можно ли использовать сторонний дизайн, к примеру, для ввода суммы денег и так же ввода данных карты ?

Не работает Apple Pay в версии 2.0.6

При токенизации сервер кассы выдает ошибку:

response: {

    status: "400 (bad request)",

    headers: {

      Keep-Alive: "timeout=10000, max=100",

      Transfer-Encoding: "Identity",

      Connection: "close",

      Date: "Fri, 14 Jun 2019 15:57:23 GMT",

      Content-Type: "application/json;charset=UTF-8"

    },

    body: "{

  "type" : "error",

  "id" : "3e266462-9c62-49ad-a5cd-69944c5badbd",

  "code" : "invalid_request",

  "description" : "Illegal payment data",

  "parameter" : "payment_method_data.payment_data"

}

При этом сам токен в payment_data выглядит нормально.

Не работает русская локализация

  1. Создаю новый проект и подключаю туда yandex-checkout-payments-swift
  2. Убираю английский язык и устанавливаю русский в настройках проекта

Снимок экрана 2019-10-17 в 15 43 21

3. Захожу в настройку сборки и указываю явное использование русского языка

Снимок экрана 2019-10-17 в 15 43 35

4. Запускаю приложение и при показе формы оплаты, вижу английский текст, в то время как вся остальная часть приложения локализована

Снимок экрана 2019-10-17 в 15 50 41

Что я делаю не так, чтобы локализовать библиотеку?

No such module TMXProfiling in YandexCheckoutPayments

В абсолютно новый Single View iOS проект добавлена зависимость на это pod v 3.5.0, pod init.
В проект закинуты TMXProfiling и TMXProfilingConnections. Добавлен Run Script, присланный с этими фреймворками.
Все как описано в "Подключение зависимостей" и "Подключение TMXProfiling и TMXProfilingConnections".

Но! Хоть ты тресни, No such module TMXProfiling в модуле YandexCheckoutPayments.

Screenshot 2020-05-15 at 15 10 43

Я, конечно понимаю, что я один такой одаренный и у всех остальных все нормально собирается, но можно еще раз для тупых пояснить - каким боком модуль YandexCheckoutPayments должен получить доступ к зависимостям основного проекта?
На скриншотах видно, что frameworks search path из этого пода смотрит типа туда куда вы хотели ($(PODS_ROOT)/../Frameworks), но это не особо помогает.

Из любопытства я закинул TMXProfiling в проект Pods с таргетом на фреймворк-аггрегатор, и проект стал собираться. Но в рантайме он конечно же падает с ошибкой dylib image not found, что не удивительно.

Перезагружать икскоды и чистить derived data не предлагать.

cocoapods v 1.9.1
macOS 10.15.4 (19E287) Xcode 11.4.1 (11E503a)
YandexCheckoutPayments 3.5.0

Не создаётся платёж с банковской карты без авторизации: запрос на пополнение кошелька пользователя

SUBJECT

Не создаётся p2p платёж согласно документации
https://yandex.ru/dev/money/doc/dg/reference/request-external-payment-docpage/

STEPS TO REPRODUCE

  1. Регистрирую новое тестовое приложение, фиксирую его client_id.
  2. Делаю два запроса (1 - регистрирую экземпляр приложения, 2 - создаю платёж с только-что полученным instance_id):
$ curl 'https://money.yandex.ru/api/instance-id' \ 
-X POST \ 
-H 'Host: money.yandex.ru' \ 
-H 'Content-Type: application/x-www-form-urlencoded' \ 
--data 'client_id=A0BA3B0A3B822611B0D2A02CB308B5CFCE65034D20331F0F25C2F50E04B01DFC'

#=> {"instance_id":"2bIgswj/yp7ktL5TbwJxlF9NOYGErs4v2CsDcWYSiuVwTX+AialUFgkPhysiGq6p","status":"success"}

$ curl 'https://money.yandex.ru/api/request-external-payment' \ 
-X POST \ 
-H 'Host: money.yandex.ru' \ 
-H 'Content-Type: application/x-www-form-urlencoded' \
--data 'instance_id=2bIgswj/yp7ktL5TbwJxlF9NOYGErs4v2CsDcWYSiuVwTX+AialUFgkPhysiGq6p&pattern_id=p2p&to=410011625585402&amount_due=100.00'

#=> {"status":"refused","error":"illegal_param_instance_id"}

ФАКТИЧЕСКИЙ РЕЗУЛЬТАТ

{"status":"refused","error":"illegal_param_instance_id"}

ОЖИДАЕМЫЙ РЕЗУЛЬТАТ

{
    "status": "success",
    "request_id": "3931303833373438395f34343431646631386461623661
3236363063386361663834336137386537643935383639383062635f3330363
333323938",
    "contract_amount": 100.00,
    "title": "Оплата услуг NNNN"
}

SDK отдает токен для невалидной платежной карты

Фейковая карта, подобрал случайно при тесте:
5280 3800 5555 5888
MM/YY: 08/22,
CVC: 123

Ее вводим во ViewController из TokenizationAssembly и получаем токен в реализованном делегате TokenizationModuleOutput:

func tokenizationModule(_ module: TokenizationModuleInput,
                            didTokenize token: Tokens,
                            paymentMethodType: PaymentMethodType)

В API когда отдаем этот токен он конечно валится, статус платежа сразу приходит как canceled:

object(YandexCheckout\Request\Payments\CreatePaymentResponse)#691 (17) {
 [“_id”:“YandexCheckout\Model\Payment”:private]=>
 string(36) “23592e46-000f-5000-a000-1be239929c27”
 [“_status”:“YandexCheckout\Model\Payment”:private]=>
 string(8) “canceled”
 [“_recipient”:“YandexCheckout\Model\Payment”:private]=>
 object(YandexCheckout\Model\Recipient)#689 (3) {
   [“_accountId”:“YandexCheckout\Model\Recipient”:private]=>
   string(5) “18344”
   [“_gatewayId”:“YandexCheckout\Model\Recipient”:private]=>
   string(6) “118743"
   [“unknownProperties”:“YandexCheckout\Common\AbstractObject”:private]=>
   array(0) {
   }
 }
...

Это запланированное поведение? В TokenizationModuleOutput непредусмотрено даже какого-то каллбека на случай ошибки или невалидной карты. Как нам такой токен проверять на валидность, каждый раз слать на бек?

Использование нескольких касс

Хотелось бы узнать, можно ли провести платеж ApplePay на разные яндекс кассы с одного устройства ?

К примеру, есть список проектов для пожертвования, и эти проекты с разных фондов, где у каждого фонда свой ключ для яндекс кассы, пользователь тапаем и хочет сделать пожертвования через ApplePay, на данный момент выдает ошибку и хотим с этим разобраться.

Проблема с библиотекой

Получили доступ на использование библиотеки у ваших менеджеров, поставили, и после того как мы создали платежный токен и отправили его на сервер, в ответ получаем ссылку для переадресации на 3DSecure и в этот момент приложение падает с ошибкой в файле ResourceLoader.swift (Подробнее на скриншоте)
2018-07-24 16 33 02

Устанавливали все по инструкции. Версия 1.3.1.
После получения токена в tokenizationModule окно не закрывалось.

Undefined symbols for architecture arm64

Обновил с 2.3.1 до 3.5.0. TrustDefender был заменен TMXProfiling и TMXProfilingConnections with bitcode и остальные шаги в соответствии с инструкцией.

Проект собирается/запускается, всё работает.

Архивируется, успешно проходит валидацию, отправляется App Store Connect, но уже в App Store Connect на этапе обработки фэйлится.



Вот такой отчет приходит на почту:

While processing your iOS app, MyApp, errors occurred in the app thinning process, and your app couldn’t be thinned. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store. For information that may help resolve this issue, see Tech Note 2432.



При попытке дистрибьюции методом Development тоже фэйлится.
 Вот часть отчета:


-= Output =-
ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version
Undefined symbols for architecture arm64:
"__yandex_impl__vkDestroyDescriptorSetLayout", referenced from:
_hidden#135293 in 1956.o
"__yandex_impl__vkCreateDescriptorSetLayout", referenced from:
_hidden#136070 in 1956.o
"__yandex_impl__vkCreateSwapchainKHR", referenced from:
_hidden#136059 in 1954.o
"__yandex_impl__vkGetDeviceQueue", referenced from:
_hidden#136047 in 1953.o
"__yandex_impl__vkEnumeratePhysicalDevices", referenced from:
_hidden#136009 in 1949.o
"__yandex_impl__vkGetPhysicalDeviceFormatProperties", referenced from:
_hidden#136009 in 1949.o
"__yandex_impl__vkWaitForFences", referenced from:
_hidden#135741 in 1948.o
_hidden#136008 in 1948.o
"__yandex_impl__vkResetFences", referenced from:
_hidden#135742 in 1948.o
"__yandex_impl__vkCreateFence", referenced from:
_hidden#136006 in 1948.o
"__yandex_impl__vkCreateIOSSurfaceMVK", referenced from:
_hidden#135995 in 1946.o
"__yandex_impl__vkGetPhysicalDeviceSurfacePresentModesKHR", referenced from:
_hidden#135995 in 1946.o
"__yandex_impl__vkDestroySurfaceKHR", referenced from:
_hidden#135995 in 1946.o
_hidden#135998 in 1946.o
"__yandex_impl__vkUpdateDescriptorSets", referenced from:
_hidden#135198 in 1943.o
"__yandex_impl__vkCreatePipelineLayout", referenced from:
_hidden#135956 in 1940.o
"__yandex_impl__vkDestroyInstance", referenced from:
_hidden#135907 in 1936.o
"__yandex_impl__vkEnumerateInstanceLayerProperties", referenced from:
_hidden#135904 in 1936.o
"__yandex_impl__vkDestroySwapchainKHR", referenced from:
_hidden#135717 in 1954.o
"__yandex_impl__vkDestroySampler", referenced from:
_hidden#135248 in 1933.o
"__yandex_impl__vkCreateSemaphore", referenced from:
_hidden#135728 in 1930.o
"__yandex_impl__vkDestroyImage", referenced from:
_hidden#135385 in 1929.o
_hidden#135719 in 1929.o
_hidden#135720 in 1929.o
"__yandex_impl__vkGetPhysicalDeviceSurfaceFormatsKHR", referenced from:
_hidden#135995 in 1946.o
"__yandex_impl__vkEnumerateInstanceExtensionProperties", referenced from:
_hidden#135904 in 1936.o
"__yandex_impl__vkAcquireNextImageKHR", referenced from:
_hidden#135566 in 1928.o
"__yandex_impl__vkCreateSampler", referenced from:
_hidden#135893 in 1933.o
"__yandex_impl__vkCreateShaderModule", referenced from:
_hidden#135688 in 1925.o
"__yandex_impl__vkDestroyFramebuffer", referenced from:
_hidden#135687 in 1924.o
"__yandex_impl__vkGetPhysicalDeviceSurfaceCapabilitiesKHR", referenced from:
_hidden#135995 in 1946.o
_hidden#135700 in 1946.o
"__yandex_impl__vkCreateFramebuffer", referenced from:
_hidden#135684 in 1924.o
"__yandex_impl__vkGetPhysicalDeviceProperties", referenced from:
_hidden#136009 in 1949.o
"__yandex_impl__vkQueueSubmit", referenced from:
_hidden#135952 in 1938.o
"__yandex_impl__vkDestroySemaphore", referenced from:
_hidden#135731 in 1930.o
"__yandex_impl__vkQueuePresentKHR", referenced from:
_hidden#135572 in 1923.o
"__yandex_impl__vkFreeMemory", referenced from:
_hidden#135518 in 1916.o
_hidden#135519 in 1916.o
"__yandex_impl__vkDestroyRenderPass", referenced from:
_hidden#135584 in 1921.o
"__yandex_impl__vkCreateInstance", referenced from:
_hidden#135903 in 1936.o
"__yandex_impl__vkDestroyShaderModule", referenced from:
_hidden#135691 in 1925.o
"__yandex_impl__vkCreateRenderPass", referenced from:
_hidden#135651 in 1921.o
"__yandex_impl__vkCreateGraphicsPipelines", referenced from:
_hidden#135645 in 1920.o
"__yandex_impl__vkAllocateDescriptorSets", referenced from:
_hidden#135195 in 1919.o
"__yandex_impl__vkDeviceWaitIdle", referenced from:
_hidden#135549 in 1917.o
_hidden#135554 in 1917.o
_hidden#135562 in 1917.o
"__yandex_impl__vkUnmapMemory", referenced from:
_hidden#135521 in 1916.o
"__yandex_impl__vkCreateImageView", referenced from:
_hidden#135391 in 1947.o
"__yandex_impl__vkDestroyPipeline", referenced from:
_hidden#135648 in 1920.o
"__yandex_impl__vkMapMemory", referenced from:
_hidden#135520 in 1916.o
"__yandex_impl__vkAllocateMemory", referenced from:
_hidden#135513 in 1916.o
"__yandex_impl__vkCreateBuffer", referenced from:
_hidden#135512 in 1916.o
"__yandex_impl__vkDestroyDevice", referenced from:
_hidden#135225 in 1902.o
_hidden#135229 in 1902.o
"__yandex_impl__vkEndCommandBuffer", referenced from:
_hidden#135215 in 1910.o
"__yandex_impl__vkGetBufferMemoryRequirements", referenced from:
_hidden#135512 in 1916.o
"__yandex_impl__vkBindBufferMemory", referenced from:
_hidden#135512 in 1916.o
"__yandex_impl__vkResetDescriptorPool", referenced from:
_hidden#135640 in 1919.o
"__yandex_impl__vkCmdBeginRenderPass", referenced from:
_hidden#135189 in 1910.o
"__yandex_impl__vkDestroyCommandPool", referenced from:
_hidden#135338 in 1911.o
"__yandex_impl__vkGetPhysicalDeviceMemoryProperties", referenced from:
_hidden#135511 in 1916.o
"__yandex_impl__vkAllocateCommandBuffers", referenced from:
_hidden#135340 in 1911.o
"__yandex_impl__vkCmdBindVertexBuffers", referenced from:
_hidden#135210 in 1910.o
_hidden#135212 in 1910.o
"__yandex_impl__vkFreeCommandBuffers", referenced from:
_hidden#135363 in 1911.o
"__yandex_impl__vkDestroyFence", referenced from:
_hidden#135744 in 1948.o
"__yandex_impl__vkCreateCommandPool", referenced from:
_hidden#135335 in 1911.o
"__yandex_impl__vkCmdBindIndexBuffer", referenced from:
_hidden#135212 in 1910.o
"__yandex_impl__vkCmdBindDescriptorSets", referenced from:
_hidden#135199 in 1910.o
"__yandex_impl__vkGetSwapchainImagesKHR", referenced from:
_hidden#135709 in 1954.o
"__yandex_impl__vkCmdDraw", referenced from:
_hidden#135208 in 1910.o
_hidden#135210 in 1910.o
"__yandex_impl__vkGetPhysicalDeviceSurfaceSupportKHR", referenced from:
_hidden#135254 in 1906.o
_hidden#135255 in 1906.o
"__yandex_impl__vkBeginCommandBuffer", referenced from:
_hidden#135329 in 1910.o
"__yandex_impl__vkDestroyPipelineLayout", referenced from:
_hidden#135649 in 1940.o
"__yandex_impl__vkGetInstanceProcAddr", referenced from:
_hidden#135903 in 1936.o
_hidden#135905 in 1936.o
"__yandex_impl__vkCmdPushConstants", referenced from:
_hidden#135205 in 1910.o
"__yandex_impl__vkCmdDrawIndexed", referenced from:
_hidden#135212 in 1910.o
"__yandex_impl__vkCreateDescriptorPool", referenced from:
_hidden#135639 in 1919.o
"__yandex_impl__vkCmdBindPipeline", referenced from:
_hidden#135192 in 1910.o
"__yandex_impl__vkDestroyDescriptorPool", referenced from:
_hidden#135635 in 1919.o
"__yandex_impl__vkCmdSetViewport", referenced from:
_hidden#135192 in 1910.o
"__yandex_impl__vkCmdCopyBuffer", referenced from:
_hidden#135331 in 1910.o
"__yandex_impl__vkDestroyImageView", referenced from:
_hidden#135398 in 1947.o
_hidden#136002 in 1947.o
_hidden#136003 in 1947.o
"__yandex_impl__vkCmdSetScissor", referenced from:
_hidden#135192 in 1910.o
"__yandex_impl__vkGetImageMemoryRequirements", referenced from:
_hidden#135514 in 1916.o
"__yandex_impl__vkCmdEndRenderPass", referenced from:
_hidden#135214 in 1910.o
"__yandex_impl__vkCmdCopyBufferToImage", referenced from:
_hidden#135332 in 1910.o
"__yandex_impl__vkCreateImage", referenced from:
_hidden#135514 in 1916.o
"__yandex_impl__vkCmdPipelineBarrier", referenced from:
_hidden#135330 in 1910.o
"__yandex_impl__vkGetPhysicalDeviceQueueFamilyProperties", referenced from:
_hidden#135255 in 1906.o
"__yandex_impl__vkDestroyBuffer", referenced from:
_hidden#135251 in 1905.o
"__yandex_impl__vkCreateDevice", referenced from:
_hidden#135225 in 1902.o
"__yandex_impl__vkBindImageMemory", referenced from:
_hidden#135514 in 1916.o
ld: symbol(s) not found for architecture arm64
Exited with 1

Failed to compile bundle: /var/folders/05/vs11370j15q46m1fz9xjy9m40000gn/T/MyApp3bfa0j_b/MyApp.arm64.xar

Stderr:

/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:297:in `run'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2706:in `block in CompileOrStripBitcodeInBundle'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2645:in `each'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2645:in `CompileOrStripBitcodeInBundle'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2905:in `block in ProcessIPA'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2867:in `each'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2867:in `ProcessIPA'
/Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:3814:in `<main>'

confirmation_url в мобильный SDK.

У меня тут такое дело, что после проведение платежа, все запросы проходят с ответом success, получаю токен в методе tokenizationModule(_ module: TokenizationModuleInput, didTokenize token: Tokens, paymentMethodType: PaymentMethodType), но, с сервера получаю ответ типа

{
 {
    "watched": true,
    "order_total": "7.0000",
    "payment": {
        "id": "....-000f-5000-.....-....",
        "status": "pending",
        "recipient": {
            "account_id": "644698",
            "gateway_id": "1631220"
        },
        "amount": {
            "value": "7.00",
            "currency": "RUB"
        },
        "created_at": "2020-01-23T15:16:05+00:00",
        "confirmation": {
            "enforce": false,
            "confirmation_url": "https://money.yandex.ru/api-pages/v2/payment-confirm/epl?orderId=25bbcc75-....-5000-a000-......",
            "type": "redirect"
        },
        "paid": false,
        "refundable": false,
        "metadata": {
            "currency": "RUB",
            "order_id": "585",
            "value": "7.0000"
        }
    }
}
}

И не получается понять в чем проблема. Деньги с карты так же не списываются.

Ошибка сборки на девайс (Bitcode)

Верия 2.3.1
При выборе девайса для сборки получаю ошибку:

ld: '/Users/_/Temp/Xcode/DerivedData/Gold585-geomhprrhafvopdglqntcmdffbvd/Build/Products/Debug-iphoneos/YandexCheckoutPayments/YandexCheckoutPayments.framework/YandexCheckoutPayments' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/_/Temp/Xcode/DerivedData/Gold585-geomhprrhafvopdglqntcmdffbvd/Build/Products/Debug-iphoneos/YandexCheckoutPayments/YandexCheckoutPayments.framework/YandexCheckoutPayments' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Решается включением Bitcode в таргете:

Снимок экрана 2019-12-10 в 15 26 17

Не подключается Trust Defender

Были выполнены все шаги из инструкции https://checkout.yandex.com/developers/payment-forms/ios-sdk
А также из обсуждения #31
Проект при билде падает с 33+ ошибками внутри фреймворка
Снимок экрана 2020-02-07 в 1 02 48

Внутрь проекта фреймворк не добавлен как и говорилось в обсуждении, папку как оставлял виртуальной, так и менял ей path на одноименную в корне проекта.
Снимок экрана 2020-02-07 в 1 04 05

Писал в техподдержку там предложили подключить slice скрипт, что и было сделано
photo_2020-02-03_16-25-18

Сам фреймворк имеет внутри нормальную структуру и виден внутри проекта, без проблем импортируется
Снимок экрана 2020-02-07 в 1 10 03

Также в framework search paths был добавлен - $(PROJECT_DIR)/Frameworks
что абсолютно не решило проблему
Снимок экрана 2020-02-07 в 1 11 15

На просьбу прислать более детальную инструкцию или помочь с образовавшейся проблемой поддержка ответила отказом сказав что инструкция итак достаточно детальная.

strip_framework.sh

  1. Добавьте в Build Phases -> New Run Script Phase, и добавьте скрипт из файла strip_framework.sh

Подскажите, где найти этот strip_framework.sh

Кнопка "Отмена" при оплате ApplePay показывает окошки оплаты снова

Проблема: при отмени оплаты ApplePay, это окошко покывается заново и так снова и снова.

Посмотрел код, который доступен, при нажатии на кнопку отмены дергается делегат PKPaymentAuthorizationViewControllerDelegate, точнее его метод paymentAuthorizationViewControllerDidFinish. Посмотрел, что происходит:
1.

func paymentAuthorizationViewControllerDidFinish(_ controller: PKPaymentAuthorizationViewController) {
        if case .failed = paymentResult {
            output?.presentPaymentMethodsModule()
        }
    }
func presentPaymentMethodsModule() {
        let paymentMethodsInputData
            = PaymentMethodsModuleInputData(clientApplicationKey: inputData.clientApplicationKey,
                                            gatewayId: inputData.gatewayId,
                                            amount: inputData.amount,
                                            tokenizationSettings: inputData.tokenizationSettings,
                                            testModeSettings: inputData.testModeSettings)

        DispatchQueue.main.async { [weak self] in
            guard let strongSelf = self else { return }
            strongSelf.router.presentPaymentMethods(inputData: paymentMethodsInputData,
                                                    moduleOutput: strongSelf)
        }
    }
func presentPaymentMethods(inputData: PaymentMethodsModuleInputData,
                               moduleOutput: PaymentMethodsModuleOutput) {
        if let module = transitionHandler?.modules.last as? PaymentMethodsViewController {
            let paymentMethodsModule = PaymentMethodsAssembly.makeModule(inputData: inputData,
                                                                         moduleOutput: moduleOutput,
                                                                         view: module)
            paymentMethodsModule.output.setupView()
        } else {
            let paymentMethodsModule = PaymentMethodsAssembly.makeModule(inputData: inputData,
                                                                         moduleOutput: moduleOutput)
            transitionHandler?.show(paymentMethodsModule, sender: self)
        }
    }

Если я ничего не упустил, тут просто показывается снова окошко оплаты? И как тогда отменить ApplePay?

Русская локализация

Добрый день!

Подскажите, как "включить" русский язык в интерфейсе (в примере - "банковская карта", "к оплате" и т.д., в собственном проекте - "bank card", to be paid"...)?

Есть ли подробная документация или описание?

Бесконечный loader после отмены/подтверждения оплаты на экране ввода кода из смс

День добрый.
После обновления YandexCheckoutPayments с версии 1.3.6 до 2.0.4 столкнулись с бесконечным loader'ом после того, как отменяем/подтверждаем покупку на экране ввода смс кода. https://dsh.re/e6bbb1
Ожидаем получать как раньше (1.3.6) ошибку или успех.

Не закрывается окно оплаты

Снимок экрана 2019-09-05 в 10 25 00

Показываю viewController вот так

DispatchQueue.main.async {
    self.viewController = TokenizationAssembly.makeModule(
        inputData: inputData,
        moduleOutput: self
    )
    let rootViewController = UIApplication.shared.keyWindow!.rootViewController!
    rootViewController.present(self.viewController!, animated: true, completion: nil)
}

Он отображается как всплывающее окно, но не закрывается, когда нажимаешь в пустое место над экраном.
что нужно поменять, чтобы он закрывался?

Краш с TrustDefender v.5.4.84

TL;DR: при запуске приложение краш с TrustDefender v.5.4.84, а релиз был позавчера.

Ранее использовал другую версию TrustDefender, но с появлением ios 13 при попытке оплаты банковской картой приложение (даже example) крашилось.

image
На скрине версия sdk - 2.2.1, ios 13, xcode 11.0.
Естественно, написал в саппорт. Там подсказали следующее:

"Ошибка происходит где то в недрах TrustDefender, возможно поможет интеграция новой версии."

Позже рекомендовали интегрировать новую версию TrustDefender.
Получил новую (для меня) версию TrustDefender (5.4.84). Проблема осталась. Отписал в саппорт.

Разработчики, на данный момент, пытаются воспроизвести Вашу проблему.
Пока порекомендовали сделать чистку в derived data.

Дропнул всё, что мог. Почистил все кеши и даже больше. Example взлетел - я был счастлив и рад. Интегрировал в свой проект - вернулся к привычному состоянию боли и грусти.
Создал отдельный проект. Позже отдельного юзера. Результат один:

dyld: Library not loaded: @rpath/TrustDefender.framework/TrustDefender
Referenced from: /Users/testUser/Library/Developer/CoreSimulator/Devices/4978321E-4047-43F7-9C90-89235F0C4EF7/data/Containers/Bundle/Application/BCF80D79-A078-43C4-933D-A32BDFB1392A/testesttest.app/Frameworks/YandexCheckoutPayments.framework/YandexCheckoutPayments
Reason: image not found

  • Всё подключение по инструкции, очевидно.
  • Папка Frameworks там, где надо (рядом с Pods).
  • Ссылок в проекте (в тестовом и основном) на TrustDefender нигде нет.

Вернул старую версию TrustDefender - вернулся к старой проблеме при попытке совершить оплату банковской картой. Скрин краша был выше.

Итого:

  • Новый TrustDefender не дает запустить приложение.
  • Старый TrustDefender не дает провести оплату с помощью банковской карты.

Попытка сборки на реальное устройство

При попытке собрать проект на реальное устройство, получаю ошибку:

YandexCheckoutPayments/YandexCheckoutPayments.framework/YandexCheckoutPayments' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target.

YandexCheckoutPayments/YandexCheckoutPayments.framework/YandexCheckoutPayments' for architecture arm64

Здесь проблема в самой либе, как мне кажется. Как можно ее устранить ?
Пытался запускать на устройстве 5S, 12.4

Сборка проекта

Установил SDK через CocoaPods как указано https://kassa.yandex.ru/docs/client-sdks/#sdk-dlq-ios
TrustDefender.framework - не указано , где брать етот фреймворк - поискав немного взял его из Github , подключаеться он не так как в инструкции так как ошибку вибивает как раз на модуль yandex-checkout-payments-swift - на него и нада делать подключение TrustDefender'а . После етого видно что фреймоврк импортируеться но проблеми з файлом ThreatMetrixService.swift - там используються необявление типи - например THMProfileHandle и проект не может собраться в среде Xcode.

Хочется странного... Qiwi не работает

В api для mSDK сказано -

/// All the available methods.
public static let all: PaymentMethodTypes = [.bankCard, .yandexMoney, .applePay, .sberbank]

Также, определен enum:

public enum PaymentMethodType: String, Codable {
/// Bank Card.
case bankCard = "bank_card"
/// Cash.
case cash
/// Qiwi.
case qiwi
/// Alfabank.
case alfabank
/// Webmoney.
case webmoney
/// Yandex Money.
case yandexMoney = "yandex_money"
/// Sberbank.
case sberbank
/// ApplePay.
case applePay = "apple_pay"
}

Как проводить платежи через qiwi кошелек, при условии, что нет доступного qiwi в PaymentMethodTypes ?

Qiwi не поддерживается ???

P.S. Красивые Казашки не могут платить через банковские карты. Там вообще, через карты фиг заплатишь, так как банки по умолчанию блокируют все интернет платежи. Зато qiwi там живет и царствует. Все платят кивёй. Поэтому хочется удовлетворить казашек... И это серьезно. Сам в шоке...

Вручную импортировать проект без CocoaPods

Добрый день, у меня проект на react-native, и cocoapods уже заточен под него, use_frameworks использовать затруднительно. Есть ли возможность вручную вкатить проект Yandex Checkout Payments SDK в workspace? Все зависимости я уже собрал с помощью carthage (FunctionalSwift, When и т.д) TrustDefender тоже выдали.

Русификация интерфейса.

Подключил яндекс кассу (3.3.0) к проекту на objective-c, но есть одна проблема, не удается русифицировать интерфейс. Русификация приложения не помогла. На устройстве смена языков ни как не влияет на локализацию в интерфейсе яндекс кассы. Есть решение, подскажите, пожалуйста?

Payment button is not visible on iOS 10

Hey!

This screen doesn't show payment button on iOS 10 (iOS 11 is all good). So next step is blocked.

Note: don't forget to check button presence after fix when turning back from 3ds web view.

2018-08-16 18 41 48

3DSecure incorrect code inside CardSecInteractor.swift

Функция содержит некорректный код, по моему мнению

func shouldProcessRequest(_ request: URLRequest) -> Bool {
        let path = request.url?.absoluteString ?? ""
        return redirectPaths.contains(path)
}

Как результат, сразу после успешного прохождения 3dsecure, происходит перенаправление на return_url из настроек магазина. Это перенаправление не отслеживается этим кодом, и результат http запроса к return_url отображается в виде web страницы. Эту страницу невозможно закрыть. И вообще, веб страница содержит множество элементов управления, которых недолжно быть.

Почему я считаю код не правильным иллюстрирует Playground.
В Playground есть две функции, одна старая, вторая переписанная ( пусть криво, но рабочая )

https://yadi.sk/i/tCWhxl_YF4fy1g

Сам код из Playground:

import UIKit

fileprivate let redirectUrl: String = "https://site.address.com/payment/return"

fileprivate var redirectPaths = [
    redirectUrl,
]

let requestUrl = URL(string: "https://site.address.com/payment/return?status=success&blablabla=yes")
let request = URLRequest(url: requestUrl!)

func shouldProcessRequest(_ request: URLRequest) -> Bool {
    let path = request.url?.absoluteString ?? ""
    return redirectPaths.contains(path)
}

func shouldProcessRequestFIXED(_ request: URLRequest) -> Bool {
    let path = request.url?.absoluteString ?? ""
    //return redirectPaths.contains(path)
    let result = path.contains(redirectPaths[0])
    return result
}

let should1 = shouldProcessRequest(request)
let should2 = shouldProcessRequestFIXED(request)

print(should1)
print(should2)

После изменения код в CardSecInteractor.swift на

func shouldProcessRequest(_ request: URLRequest) -> Bool {
    let path = request.url?.absoluteString ?? ""
    if (redirectPaths.count == 0) {
       return false
    } else {
        return path.contains(self.redirectPaths[0])
    }
}

У меня корректно заработал 3DSecure, а именно, сразу после успешного прохождения 3DSecure, окно с WebBrowserPresenter закрывается и вызывается функция didSuccessfullyPassedCardSec, которая ранее никогда не вызывалась!

На самом деле это была очень серьезная проблема.

Problem with install pods

Please check code below, problem downloading YandexMobileMetrica.

Also could I delete these pods?
YandexLoginSDK (2.0.2)
Installing YandexMobileMetrica (3.1.2)

I want use only payment in my app.

`Installing YandexMobileMetrica (3.1.2)

[!] Error installing YandexMobileMetrica
[!] /usr/bin/curl -f -L -o /var/folders/7v/f8d9tpr572q2b0szq1b5dn400000gn/T/d20181125-79702-15s6rzi/file.zip https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/128534/YandexMobileMetrica-3.1.2-ios-0ed40305-b027-4c82-9401-865906c14d3f.zip --create-dirs --netrc-optional --retry 2

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:01:15 --:--:-- 0curl: (7) Failed to connect to storage.mds.yandex.net port 443: Operation timed out

Thanks
`

TrustDefender.framework not found

При подключении библиотеки в свободном доступе не найти эту библиотеку. Где ее можно скачать?

В iOS 13 падает TrustDefender

Добрый день!
В iOS 13 падает модуль TrustDefender, в 12 и более ранних все ок.
Скрин: https://prnt.sc/pkbtyl
Секция podfile:
pod 'FunctionalSwift'
pod 'CardIO', :git => 'https://github.com/card-io/card.io-iOS-SDK.git', :tag => '5.4.1'
pod 'SwiftLint'
pod 'YandexCheckoutPayments',
:git => 'https://github.com/yandex-money/yandex-checkout-payments-swift.git', :tag => '2.2.2'
pod 'YandexMobileMetricaPush/Dynamic', '0.8.0'
pod 'YandexMobileMetrica/Dynamic', '~> 3.7.0'

Есть ли возможность стилизации ViewController'а возвращаемого TokenizationAssembly?

Добрый день! Спасибо за библиотеку, всё работает отлично.
Возник следующий вопрос: существует ли какая-нибудь возможность стилизации ViewController'а возвращаемого TokenizationAssembly.makeModule?
Мы используем только оплату через Apple Pay и желтый цвет индикатора не очень вписывается в дизайн приложения.
Поэтому очень хотелось бы немного изменить цвет индикатора либо скрыть этот ViewController.
Заранее спасибо за ответ.

Размер приложения

Здравствуйте!

Такая ситуация: у нас приложение написано на Objective-C, на устройстве занимает 5 мегабайт. Интегрировали ваш SDK, приложение стало занимать 41 мегабайт.

Есть какие-то варианты уменьшения размера? Кроме тех, которые указаны тут https://developer.apple.com/library/archive/qa/qa1795/_index.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.