Webpay 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
Webpay 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

Webpay Payment Gateway Integration in Mobile Application

Webpay is a Belarusian payment gateway, one of the main ones for payments on Belarus market. Works with Belarusian rubles, supports Visa, Mastercard, Belkart cards and ERIP. No native mobile SDK — integration is implemented via WebView with payment form or via server API with tokenization.

Main Flow: WebView with Payment Form

Most common approach. Server forms POST request to Webpay, gets payment form URL, client opens it in WebView.

Request parameters:

POST https://payment.webpay.by/
wsb_storeid=your_store_id
&wsb_order_num=ORDER-1234
&wsb_currency_id=BYN
&wsb_version=2
&wsb_language_id=russian
&wsb_total=15.00
&wsb_return_url=yourapp://payment/success
&wsb_cancel_return_url=yourapp://payment/cancel
&wsb_notify_url=https://your-server.com/webpay/notify
&wsb_signature=md5_signature

Signature wsb_signature = MD5(wsb_seed + wsb_storeid + wsb_order_num + wsb_currency_id + wsb_total + wsb_include_service + secret_phrase).

// Android: open WebView
class PaymentWebViewActivity : AppCompatActivity() {

    private lateinit var webView: WebView

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        webView = WebView(this)

        webView.settings.javaScriptEnabled = true
        webView.settings.domStorageEnabled = true

        webView.webViewClient = object : WebViewClient() {
            override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean {
                val url = request.url.toString()
                // Intercept deeplink return
                if (url.startsWith("yourapp://payment/")) {
                    handlePaymentReturn(url)
                    return true
                }
                return false
            }
        }

        // POST form via data URI
        val postData = buildPostData()
        webView.postUrl("https://payment.webpay.by/", postData.toByteArray())
    }

    private fun handlePaymentReturn(url: String) {
        val uri = Uri.parse(url)
        when (uri.host) {
            "payment" -> when (uri.path) {
                "/success" -> {
                    // Verify payment status on server
                    verifyPaymentStatus(uri.getQueryParameter("wsb_order_num"))
                }
                "/cancel" -> finish()
            }
        }
    }
}
// iOS: WKWebView
import WebKit

class PaymentWebViewController: UIViewController, WKNavigationDelegate {

    private var webView: WKWebView!

    func loadPaymentForm(postParams: [String: String]) {
        webView = WKWebView(frame: view.bounds)
        webView.navigationDelegate = self
        view.addSubview(webView)

        var components = URLComponents(string: "https://payment.webpay.by/")!
        components.queryItems = postParams.map { URLQueryItem(name: $0.key, value: $0.value) }

        var request = URLRequest(url: URL(string: "https://payment.webpay.by/")!)
        request.httpMethod = "POST"
        request.httpBody = components.percentEncodedQuery?.data(using: .utf8)
        webView.load(request)
    }

    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction,
                 decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
        if let url = navigationAction.request.url?.absoluteString,
           url.hasPrefix("yourapp://payment/") {
            handleReturn(url: url)
            decisionHandler(.cancel)
            return
        }
        decisionHandler(.allow)
    }
}

Notification: wsb_notify_url

Webpay sends POST request to wsb_notify_url with transaction result. This is main confirmation mechanism — deeplink wsb_return_url is unreliable (user could close app).

Notification parameters include wsb_order_num, wsb_be_order_num (Webpay transaction ID), and wsb_result (0 = success, 1 = failure). Must verify notification signature:

MD5(wsb_seed + wsb_storeid + wsb_order_num + wsb_be_order_num + wsb_currency_id + wsb_total + secret_phrase)

Belkart: Special Notes

Belkart is processed same as Visa/Mastercard, but Webpay supports it only with appropriate contract with bank-acquirer. In test environment Belkart cards available via test credentials from Webpay documentation.

Work Scope

  • Server generation of parameters and signature for Webpay
  • WebView implementation with deeplink-return interception
  • Server handler for wsb_notify_url with signature verification
  • Testing in Webpay test environment
  • Error and timeout scenario handling

Timeline

2–3 days. Cost calculated individually.