Package et.payproof:payproof-android. Your backend creates a checkout; the app opens a customizable bottom sheet that lists bank accounts, copies the reference code, uploads a receipt, and streams verification progress.
Requirements
| Item | Value |
|---|---|
| Min SDK | 24 |
| Compile SDK | 34 |
| Language | Kotlin + Jetpack Compose (bundled UI) |
| Artifact | et.payproof:payproof-android:0.4.2 |
Install
Add the PayProof Maven repository supplied during onboarding, then declare the dependency.
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
// Use the repository URL from your PayProof dashboard / onboarding email.
maven { url = uri("https://your-payproof-maven-host/releases") }
}
}dependencies {
implementation("et.payproof:payproof-android:0.4.2")
}Initialize
PayProof.init(
context = this,
config = PayProofConfig(
baseUrl = "https://api.payproof.et",
clientKey = "pk_live_...", // publishable key — safe in the app
appId = 1, // optional when the key is app-scoped
),
)Present the checkout sheet
val launcher = PayProofCheckout.register(this) { result ->
when (result) {
is PayProofCheckoutResult.Verified -> {
// result.publicId, referenceCode, amountEtb
}
is PayProofCheckoutResult.Canceled -> Unit
is PayProofCheckoutResult.Failed -> Unit
is PayProofCheckoutResult.ManualReview -> Unit
}
}
PayProofCheckout.present(
launcher = launcher,
context = this,
publicId = "cs_...",
appearance = PayProofAppearance(
primaryColor = "#0071e3",
ctaColor = "#0a2540",
cornerRadiusDp = 20f,
confirmButtonLabel = "Verify payment",
showPayProofBadge = true,
),
)What the sheet handles
| Step | API |
|---|---|
| Load checkout + banks | GET /api/public/gateway/checkouts/:id/ |
| Live status | GET …/status/ + WS /ws/gateway/checkouts/:id |
| Upload receipt | POST …/verify/ (multipart images) |
| Manual review | POST …/manual-review/ |
/api/public/gateway/checkouts/:public_id//api/public/gateway/checkouts/:public_id/verify/Same contract as the hosted pay page. Branding falls back to app.brand_color / logo from the checkout payload when appearance fields are null.
Appearance
| Field | Default | Notes |
|---|---|---|
| primaryColor | app brand / #0071e3 | Accent / selection hex |
| ctaColor | #0a2540 | Navy primary CTA buttons |
| onPrimaryColor | white | Text on primary buttons |
| surfaceColor | white | Sheet background (light mode) |
| onSurfaceColor | #0a2540 | Primary text |
| mutedColor | #425466 | Secondary text |
| cornerRadiusDp | 20 | Top corners of the sheet |
| titleOverride | PayProof Checkout | Header title |
| subtitleOverride | — | Unused in default layout |
| confirmButtonLabel | Verify payment | CTA when a receipt is selected |
| showPayProofBadge | true | “Secured · PayProof” footer |
Checkout results
| Result | When |
|---|---|
| Verified | Checkout status verified (after receipt check) |
| Canceled | User closed the sheet or RESULT_CANCELED |
| Failed | Terminal failure with optional failureCode / reason |
| ManualReview | Checkout entered manual_review |
| Partial | Some of the amount is paid. This is not an entitlement. |
Live catalog and purchase
Your app draws the paywall. PayProof returns the current packages and opens the sheet. You own the layout. PayProofPackageList is an optional row list, and PayProofStatusCard renders live billing state (period end, grace, overpay, renewal actions) anywhere in your UI.
val catalog = PayProof.getOfferings()
val monthly = (catalog as PayProofResult.Ok).value.current
?.packages?.first { it.identifier == "monthly" }
PayProof.purchase(
context = this,
launcher = launcher,
request = CreateCheckoutRequest(
appId = appId,
packageId = monthly?.id,
customerRef = userId,
),
)If the price changes while the sheet is open, the customer must tap Continue before a new checkout is created. Underpayment shows paid and remaining amounts and stays Partial until the receipt covers the full amount. Overpayment verifies the payment and then offers a refund form. Skipping the form still leaves the payment verified.
Optional client API
PayProof.client() exposes the same public gateway calls without UI. Creating checkouts with an API key is supported for demos only:
val created = PayProof.client().createCheckout(
CreateCheckoutRequest(
appId = 1,
productId = 6,
customerRef = "order_1001",
amountEtb = "2499.00", // dynamic one_time only
)
)
when (created) {
is PayProofResult.Ok -> PayProofCheckout.present(launcher, this, created.value.publicId)
is PayProofResult.Err -> { /* created.message */ }
}Subscription cancel/resume defaults to server-side secret-key calls. Publishable keys may call them only when the app enables client-side cancel/resume. ManageSubscriptionScreen gates the buttons on that setting.
// Prefer secret-key calls from your backend.
when (val res = PayProof.cancelSubscription()) {
is PayProofResult.Ok -> { /* res.value.cancelAtPeriodEnd */ }
is PayProofResult.Err -> { /* res.message */ }
}
PayProof.resumeSubscription()Webhook helper
val ok = WebhookSignature.verify(
secret = System.getenv("PAYPROOF_WEBHOOK_SECRET")!!,
rawBody = rawBodyBytes,
header = payProofSignatureHeader,
)Same algorithm as webhook signatures: HMAC-SHA256(secret, "$t.$rawBody") with header PayProof-Signature: t=…,v1=….
Diagnose
Run PayProof.diagnose() after initialization to confirm the key, its app binding, and server reachability. It returns the SDK version, key scopes, server time, and any error message in one map.
val report = PayProof.diagnose()
// report["ok"], report["sdkVersion"], report["key"], report["serverTime"], ...