CloudPayments Payment Gateway Integration in Mobile Application
CloudPayments is a Russian payment gateway with native SDKs for iOS and Android. Out of the box supports 3DS2, SBP, QR payment, Apple Pay, and Google Pay. For most mobile applications, integration takes 1–2 days if you understand how the flow works.
SDK and Basic Configuration
// Android, build.gradle
implementation("ru.cloudpayments:sdk-android:1.x.x")
// iOS, SPM or Podfile
pod 'SDK-iOS', :git => 'https://github.com/cloudpayments/CloudPayments-SDK-iOS'
Main Flow: Card Cryptogram
CloudPayments does not store card details on your server. Card data on the client is transformed into a cryptogram via your merchant's PublicID, the cryptogram is passed to your server, and your server transmits it to CloudPayments API.
// Android
val cardCryptogram = Card.cardCryptogram(
cardNumber = "4111111111111111",
cardDate = "12/25",
cardCvv = "123",
merchantPublicId = "pk_your_public_id"
)
// Send cardCryptogram to your backend
// iOS
let cryptogram = CPCryptogramPacket.makePacket(
cardNumber: "4111111111111111",
expirationDateString: "12/25",
cvv: "123",
merchantPublicID: "pk_your_public_id"
)
On the backend, call CloudPayments API:
POST https://api.cloudpayments.ru/payments/cards/charge
{
"Amount": 1500,
"Currency": "RUB",
"InvoiceId": "ORDER-1234",
"CardCryptogramPacket": "...",
"Name": "IVAN IVANOV"
}
3DS2: Handling AcsUrl
If the bank requires 3DS verification, CloudPayments API returns status 3ds with fields AcsUrl, PaReq, TransactionId. Show 3DS WebView:
// Android — SDK provides ready ThreeDsDialogFragment
ThreeDsDialogFragment.newInstance(
acsUrl = response.acsUrl,
transactionId = response.transactionId,
paReq = response.paReq
).show(supportFragmentManager, "3ds")
// iOS — D3DSViewController from SDK
let d3ds = D3DSViewController()
d3ds.acsUrl = response.acsUrl
d3ds.paReq = response.paReq
d3ds.transactionId = response.transactionId
d3ds.delegate = self
present(d3ds, animated: true)
After 3DS WebView confirmation, SDK returns PaRes — pass it to CloudPayments API to complete the transaction:
POST /payments/cards/post3ds
{ "TransactionId": "...", "PaRes": "..." }
Ready Payment UI from SDK
CloudPayments SDK includes ready PaymentForm — card input screen with payment system logos and built-in validation. Useful if resources for custom design are limited.
val intent = PaymentActivity.getStartIntent(
context,
cpApiPublicId = "pk_your_public_id",
totalAmount = "1500",
currency = Currency.RUB,
invoiceId = "ORDER-1234",
description = "Оплата заказа"
)
startActivityForResult(intent, REQUEST_CODE_PAYMENT)
Work Scope
- CloudPayments SDK integration (iOS / Android / Flutter)
- Cryptogram generation and server transmission implementation
- 3DS handling via SDK components
- Optional: Apple Pay / Google Pay via CloudPayments
- Testing with CloudPayments test cards (test PublicID)
Timeline
2–3 days. Cost calculated individually after requirements analysis.







