YooKassa Payment Gateway Integration in Mobile App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
YooKassa Payment Gateway Integration in Mobile App
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

YooKassa Payment Gateway Integration in Mobile Application

YooKassa (formerly Yandex.Kassa) is one of the most popular payment gateways for the Russian market. Mobile SDK supports card payment, SberPay, SBP, Apple Pay, Google Pay, and YooMoney wallet. Integration is built around payment data tokenization on the client with subsequent charge via server API.

Architecture: Tokenization Instead of Credentials

YooKassa does not transmit card data directly to your server. Client SDK creates a payment token — an encrypted object that works once and only for your store. The server uses this token to create a payment via YooKassa API.

iOS: YooKassaPayments SDK

// Podfile
pod 'YooKassaPayments'

// or SPM
.package(url: "https://github.com/yoomoney/yookassa-payments-swift", from: "7.x.x")

Launch payment screen:

import YooKassaPayments

let inputData = TokenizationModuleInputData(
    clientApplicationKey: "live_your_client_key",  // from YooKassa cabinet
    title: "Your Company",
    subtitle: "Order #1234",
    amount: Amount(value: 1500, currency: .rub),
    paymentTypes: [.bankCard, .sberbank, .sbp, .applePay, .yooMoney],
    savePaymentMethod: .on,   // or .off, .userSelects
    isLoggingEnabled: false
)

let viewController = TokenizationAssembly.makeModule(
    inputData: inputData,
    moduleOutput: self
)
present(viewController, animated: true)

Handle result:

extension PaymentViewController: TokenizationModuleOutput {
    func tokenizationModule(
        _ module: TokenizationModuleInput,
        didTokenize token: Tokens,
        paymentMethodType: PaymentMethodType
    ) {
        dismiss(animated: true)
        // token.paymentToken — send to server
        sendTokenToBackend(token.paymentToken, paymentMethodType: paymentMethodType.rawValue)
    }

    func didFinish(on module: TokenizationModuleInput, with error: YooKassaPaymentsError?) {
        dismiss(animated: true)
        if let error = error {
            print("YooKassa error: \(error)")
        }
    }
}

Android: YooKassa Payments SDK

// build.gradle
implementation("ru.yoomoney.sdk.kassa.payments:yookassa-android-sdk:7.x.x")
private val tokenizeLauncher = registerForActivityResult(
    ActivityResultContracts.StartActivityForResult()
) { result ->
    if (result.resultCode == Activity.RESULT_OK) {
        val token = Checkout.createTokenizationResult(result.data!!)
        sendTokenToBackend(
            token.paymentToken,
            token.paymentMethodType.name
        )
    }
}

fun startPayment() {
    val paymentParameters = PaymentParameters(
        amount = Amount(BigDecimal.valueOf(1500), Currency.getInstance("RUB")),
        title = "Your Company",
        subtitle = "Order #1234",
        clientApplicationKey = "live_your_client_key",
        shopId = "your_shop_id",
        savePaymentMethod = SavePaymentMethod.ON,
        paymentMethodTypes = setOf(
            PaymentMethodType.BANK_CARD,
            PaymentMethodType.SBERBANK,
            PaymentMethodType.SBP,
            PaymentMethodType.GOOGLE_PAY,
            PaymentMethodType.YOO_MONEY
        )
    )

    val intent = Checkout.createTokenizeIntent(this, paymentParameters)
    tokenizeLauncher.launch(intent)
}

Server Payment Confirmation

Token from client is passed to server, which creates a payment:

POST https://api.yookassa.ru/v3/payments
Authorization: Basic base64(shopId:secretKey)
Content-Type: application/json
Idempotence-Key: unique-uuid

{
    "amount": { "value": "1500.00", "currency": "RUB" },
    "capture": true,
    "payment_method_data": {
        "type": "bank_card"
    },
    "confirmation": {
        "type": "mobile_application",
        "return_url": "yourapp://payment/result"
    },
    "payment_token": "token_from_client",
    "description": "Order #1234"
}

If response contains status: pending and confirmation.type: redirect — 3DS requires confirmation. SDK handles this automatically, but with direct API integration need to open confirmation_url in SFSafariViewController / Custom Tabs.

Typical Pitfalls

clientApplicationKey vs secretKey. SDK takes only clientApplicationKey (starts with live_ or test_). secretKey only on server. Mix them up — API returns 401, but message not always obvious.

SavePaymentMethod and offer. With SavePaymentMethod.ON YooKassa requires user to accept recurring payment offer. SDK shows checkbox automatically, but skip it in custom UI — transaction will be rejected.

Work Scope

  • YooKassa SDK integration (iOS / Android / Flutter)
  • Payment types configuration per project needs
  • Server endpoint for payment creation and confirmation
  • Webhook setup for final status
  • Testing in YooKassa test store

Timeline

2–3 days. Cost calculated individually.