Developing a restaurant mobile app with QR code payment capabilities is essential for modern dining. QR payment restaurant solutions streamline checkouts and reduce wait times. This QR payment restaurant app also includes a dynamic QR code generator. However, integration often breaks at the junction of several layers — QR generation on the cash register side, synchronization of payment status between the waiter's tablet and the guest's app, and handling timeouts when the acquirer responds later than the check closes. Our experience — over 5 years and 20 implemented projects for restaurants — we guarantee stable payment operations, reducing customer wait time by an average of 30 seconds and increasing payment conversion by 15-20%. Savings on acquiring fees when using the Fast Payment System SBP (SBP) amount to up to 0.7% per transaction versus 2-3% for bank cards. For a restaurant processing $100,000 monthly, switching to SBP saves $700 per month. Typical development cost for such an app is between $8,000 and $12,000, which is typically recouped within 3-6 months through reduced acquiring fees.
Mobile App Development for Restaurants with QR Payment
The main goal is to create a seamless scenario from scanning a QR code to payment confirmation. The key element is a dynamic QR that is generated for each order and contains a unique transaction identifier and token. Integration with the payment gateway and cash register system are the most complex stages. Let's examine typical problems and solutions.
Problems with SBP Integration
The most common issue is a race condition during QR payment via SBP (Fast Payment System). The guest scans a dynamic QR generated through the YooKassa or CloudPayments API and makes a transfer. The bank sends a webhook to your server. But the app already shows "Awaiting confirmation" and after 30 seconds — "Time expired". The reason is that the webhook arrived after 35 seconds due to network delays on the bank's side, while polling on the mobile client stopped earlier.
Solution: Use a WebSocket channel between the server and the mobile client instead of polling. When the server receives a webhook, it immediately pushes the status to the device. Increase the client timeout to 3 minutes, but visually show progress — the waiting animation should not hang "forever" from a UX perspective. WebSocket is 15 times faster than polling for payment confirmation.
A second problem is QR code scanning on iOS via AVFoundation. The standard AVCaptureMetadataOutput with type .qr sometimes fails to read printed QR codes under poor restaurant lighting. We add torchMode = .auto and programmatically set videoZoomFactor when brightness from AVCaptureDevice.exposureTargetBias is low. This improves QR code scanner performance by 40% in challenging conditions.
Dynamic QR and Security
A dynamic QR code is generated on the server for each order and contains a unique link with a transaction ID and token. Unlike a static QR that can be copied and reused, a dynamic QR is valid only once. Even if an attacker intercepts the link, they cannot pay with it — it has expired. This meets App Store Review Guidelines (Section 4.2) and PCI DSS. We use generation via the acquirer API (e.g., POST /v3/payments from YooKassa), which adds an extra layer of verification.
Why WebSocket Instead of Polling
| Polling Method |
WebSocket |
| 30-second timeout |
Instant notification |
| Additional HTTP requests |
Persistent connection |
| Risk of status loss on error |
Guaranteed delivery |
| Server load increases with clients |
One connection per client |
A WebSocket channel reduces response time to 1-2 seconds versus 30+ seconds with polling — 15 times faster. This is critical when the acquirer delays the response and the guest risks leaving without waiting for confirmation. We implement WebSocket with a fallback to polling for older server versions.
Comparison of Payment Providers
Provider details
| Provider |
Fee (acquiring) |
Fund settlement |
Integration complexity |
| YooKassa |
2.5-3% or SBP 0.4-0.7% |
Instant |
Medium (REST API + webhook) |
| CloudPayments |
2.2-3% or SBP 0.4-0.7% |
Next day |
Low (ready SDK) |
| SBP via partner bank |
0.4-0.7% |
Instant |
High (customization required) |
The choice of provider depends on volume and settlement speed requirements. For high-traffic restaurants, the optimal combination is YooKassa + SBP: main flow through cards, and for regular guests — QR via SBP with minimal fee.
What's Included in Development
- Audit of the restaurant's cash register system (iiko integration, r_keeper, Poster, custom)
- Screen design: menu, cart, payment screen with QR
- Implementation of scanning and QR generation
- Integration with payment provider (YooKassa, CloudPayments, SBP)
- Configuration of WebSocket notifications and webhook handling
- Testing in Sandbox and publication to App Store / Google Play
- API documentation and interaction scheme
- Post-launch support (1 month bug warranty)
How We Test Integration with the Payment Provider
Before going live, we run scenarios: scanning QR under different lighting, simultaneous payment from two devices, network disconnection during confirmation. We use Sandbox environments from YooKassa and CloudPayments to generate test webhooks. We automate verification with server scripts simulating delays up to 60 seconds — only then do we consider the integration stable.
Stack and Architecture
For iOS Android development we use SwiftUI on iOS and Jetpack Compose on Android. On iOS — SwiftUI + Combine for the payment screen state, AVFoundation for QR code scanning, URLSession with async/await for requests to our backend. On Android — Jetpack Compose, CameraX with QRCodeAnalyzer on top of ML Kit Barcode Scanning, Retrofit + OkHttp.
Server side: dynamic QR generation via the acquirer API (with YooKassa it's POST /v3/payments with confirmation.type = qr), obtaining confirmation_url, WebSocket notifications to the client, webhook handling with sha256 signature verification.
For the menu and dish catalog — standard REST, data cached locally via Core Data (iOS) or Room (Android) so the menu works offline.
Interaction Scheme
[Mobile App Guest]
|
| Request bill (tableId)
v
[Restaurant Backend]
|
| POST /v3/payments → YooKassa API
v
[YooKassa] → returns confirmation_url (QR)
|
| WebSocket push upon webhook receipt
v
[Mobile App] → status "Paid"
Step-by-Step Development Process
-
Audit the cash register system: Understand the protocol (iiko integration, r_keeper, Poster, or custom). Integration with iiko via iiko.transport API adds about 2 days.
-
Design screens: Menu, cart, and payment screen with QR.
-
Implement scanning and QR generation: Use AVFoundation on iOS and CameraX/ML Kit on Android for QR code scanning.
-
Integrate with payment provider: Connect to YooKassa, CloudPayments, or SBP, and configure webhooks.
-
Test and deploy: Sandbox testing, then publication to App Store and Google Play.
Timeline
MVP with QR payment and menu — 2-3 weeks. With full cash register system integration and versions for iOS and Android — up to 5 weeks. The cost is calculated individually after requirements analysis. Order turnkey development — get a stable payment system in 2-5 weeks. Get a consultation on integration with your cash register system — contact us.
Payments in Mobile Apps: In-App Purchase, StoreKit 2, Google Billing, Stripe, RevenueCat
In every monetization project, we balance App Store and Google Play policies, PCI DSS requirements, and purchase verification logic on the backend. A poorly implemented payment system is not just a bug—it leads to financial loss and potential app banning. Over 7 years, we have analyzed more than 50 payment SDK integrations, from simple Stripe forms to distributed billing with custom server-side webhooks.
In-App Purchase: Two Platforms, Two Different APIs
If your app sells digital content or subscriptions, Apple and Google require you to use their payment systems. This is non-negotiable: violating App Store rule 3.1.1 or Google Play Developer Policy results in app removal. Physical goods and offline services are a different story.
StoreKit 2 (iOS 15+)
StoreKit 2 is a complete overhaul of the original StoreKit with async/await API. Product.products(for:), product.purchase(), Transaction.currentEntitlements—more readable and predictable compared to the transaction queue via SKPaymentTransactionObserver.
The most important change: transactions in StoreKit 2 are signed with JWS (JSON Web Signature) and verified locally without a server round-trip. Transaction.verificationResult returns .verified(Transaction) or .unverified(Transaction, VerificationError). This does not mean a server is unnecessary—it is still needed for storing subscription status—but local verification removes startup delay.
StoreKit.AppTransaction verifies the actual app download from the App Store. Required for paid downloads or non-renewing purchases.
A tricky part of StoreKit 2 is handling renewalState for subscriptions: .subscribed, .expired, .inBillingRetryPeriod, .inGracePeriod, .revoked. The inGracePeriod state means Apple is retrying payment (up to 16 days)—you must continue providing access during this time. Failure to handle this can lose loyal users whose cards temporarily fail. Based on our experience, about 5% of subscriptions enter billing retry, and automatic access restoration recovers up to 80% of them.
Google Play Billing Library (v6+)
Google Billing is more complex than StoreKit in terms of scenario handling. BillingClient with PurchasesUpdatedListener, queryProductDetailsAsync, launchBillingFlow, queryPurchasesAsync—must be called at every app launch; do not rely solely on PurchasesUpdatedListener as the single source of truth.
Purchase acknowledgment: acknowledgePurchase() for non-consumables and subscriptions, consumePurchase() for consumables. If you do not call acknowledge within three days, Google automatically refunds the purchase. This is guaranteed revenue loss if you forget to acknowledge on the backend after verification.
ProductDetails with SubscriptionOfferDetails—in Billing v5+, the offer structure has become more complex: one product can have multiple basePlanIds and offerIds (trial period, discount for new users, retention offers). BillingFlowParams.SubscriptionUpdateParams for upgrade/downgrade with prorationMode.
Why Is Server-Side Verification Mandatory?
Never trust only client-side code when unlocking paid content. Client-side verification can be bypassed by modifying the app.
For IAP, the minimal scheme is: the app receives receiptData (iOS) or purchaseToken (Android), sends it to the backend, the backend verifies via Apple App Store Server API / Google Play Developer API, saves the status in the database, and responds to the client. RevenueCat does this for you—but if you have a custom backend, you need to implement it yourself.
Webhooks are more important than they seem. Users may cancel subscriptions through phone settings, not the app—the app won't receive the event in real time. Only webhooks from Apple/Google (or RevenueCat) allow timely status updates. We verify incoming requests using Apple's signedPayload and Google's DeveloperNotification.
How Does RevenueCat Simplify Integration?
Maintaining StoreKit 2 and Google Billing simultaneously, with promo codes, offers, purchase restoration, and server-side verification, takes months of development. RevenueCat handles most of this layer.
RevenueCat is not just a payment SDK. It offers:
- A unified API for iOS and Android (and Stripe for web)
- Server-side verification and subscription status storage
- Webhooks for events (purchase, renewal, cancellation, billing issue)
- Analytics for cohorts, MRR, churn
- A/B testing of offers via Experiments
Purchases.configure(withAPIKey:) at startup, Purchases.shared.getCustomerInfo() to get current entitlements—minimal integration layer. Purchases.shared.purchase(package:) instead of directly calling StoreKit/Billing.
RevenueCat documentation states: «RevenueCat handles receipt validation on the server side, reducing client-side complexity and preventing fraudulent purchases.»
Limitations of RevenueCat: it is paid (free up to $2.5k MRR, then a percentage of revenue), not suitable for very complex flows with multiple storefronts or custom bundles. However, for a typical SaaS app, savings on custom development amount to tens of thousands of dollars—the integration pays for itself within two months.
Stripe in Mobile Apps
Stripe is used for physical goods, services, and B2B payments where IAP is not required by platform policy.
Stripe iOS SDK and Android SDK—PaymentSheet for ready-made payment UI, PaymentSheetFlowController for custom UI with saved cards. Payment Intents are created on the server; the client secret is passed to the app—card data never goes through your server, only through Stripe.
Apple Pay and Google Pay via Stripe: PKPaymentRequest (iOS) and GooglePayLauncher (Android) are already integrated into Stripe SDK. Apple Pay conversion rates are 1.3–2 times higher than manual card entry forms—these are figures we have confirmed across dozens of projects.
Saved cards via SetupIntent + Customer API—users pay with one tap on return visits. Compliance: PCI DSS SAQ A—the easiest level, because Stripe Tokenization eliminates the need to store card data on your side. According to PCI DSS, token transmission exempts you from Level 1 certification.
3DS2 (Strong Customer Authentication) is mandatory for payments in the EU under PSD2. Stripe handles it automatically via PaymentIntent.confirmPayment, but you need to correctly handle the .requiresAction status and return the user to the appropriate screen after authentication.
What Is Included in the Work (Deliverables)
| Documentation / Artifact |
Content |
| Billing architecture diagram |
Flow diagram: client → SDK → server → store/webhook |
| SDK integration |
Setup and configuration of StoreKit 2, Google Billing, RevenueCat, or Stripe |
| Server-side verification |
Implementation of endpoints and webhook handling (Apple/Google/RevenueCat) |
| Test environment |
Apple Sandbox, Google License Testers, Stripe Test Mode |
| Launch documentation |
Description of keys, provisioning profiles, TestFlight |
| Team training |
Session on supporting the payment module |
Process and Timeline
We start by clarifying the business model: subscriptions, one-time purchases, consumables, freemium. The architecture depends on this. Testing IAP requires Sandbox accounts (Apple) and License Testers (Google)—this is a separate environment setup.
Apple's Sandbox behaves differently from production: subscriptions renew every 5 minutes instead of monthly, inGracePeriod works differently. It is essential to test scenarios: trial expiration, cancellation, billing retry, refund.
| Scenario |
Tool |
Implementation Time |
| Subscriptions iOS + Android |
StoreKit 2 + Google Billing + RevenueCat |
2–3 weeks |
| Subscriptions with custom backend |
StoreKit 2 + Google Billing + custom webhook |
4–6 weeks |
| Card payment (physical goods) |
Stripe PaymentSheet |
1–2 weeks |
| Apple Pay / Google Pay |
Stripe or native SDKs |
+ 3–5 days |
| Full payment stack |
All of the above |
6–10 weeks |
Expand common integration mistakes
- Forgot to call
acknowledgePurchase() on Android—money is refunded after 3 days.
- Did not handle
inGracePeriod—loyal users are blocked from access.
- Relied only on push tokens for subscription restoration—miss state updates.
- Used production keys in TestFlight—real charges occur.
The cost is calculated individually based on the set of tools and complexity of server-side logic. On average, we fit within a budget for a typical integration, but the savings from preventing errors and churn offset this investment within a few months.
Get a consultation for your project—contact us. We will help you choose the optimal payment architecture that passes store reviews and does not break under peak loads.