Step 3: CheckOut
With the receiveCode from Step 2, pass it to the native SDK. The SDK opens Telebirr’s payment UI inside your app — the user enters their PIN and pays without leaving.
receiveCode format
TELEBIRR$BUYGOODS$<shortCode>$<amount>$<prepay_id>$<timeout>
Example:
TELEBIRR$BUYGOODS$500358$50.00$202307261139071684121154928791554$120mYou don’t assemble this — it comes straight from biz_content.receiveCode in the create-order response.
iOS
// Import the SDK
#import <EthiopiaPaySDK/EthiopiaPaySDK.h>
// Invoke payment
[EthiopiaPaySDK payWithReceiveCode:receiveCode
returnApp:@"your-url-scheme"
delegate:self];
// Handle result
- (void)onPayResult:(int)resultCode message:(NSString *)message {
if (resultCode == 0) {
// Payment succeeded — wait for server notification to fulfill
NSLog(@"Payment succeeded: %@", message);
} else {
// User cancelled or error
NSLog(@"Payment failed: %d %@", resultCode, message);
}
}⚠️
The SDK callback result is not authoritative. It can be spoofed or arrive before the server processes the payment. Always wait for the server-side notification (Step 4) before fulfilling the order.
Android
// Kotlin
EthiopiaPaySdk.pay(
context = this,
receiveCode = receiveCode,
callback = object : PayCallback {
override fun onResult(code: Int, message: String) {
when (code) {
0 -> handleSuccess() // payment succeeded locally
-3 -> handleCancelled() // user cancelled
else -> handleError(code, message)
}
}
}
)// Java
EthiopiaPaySdk.pay(
this,
receiveCode,
(code, message) -> {
if (code == 0) {
handleSuccess();
} else {
handleError(code, message);
}
}
);SDK result codes
| Code | Meaning |
|---|---|
0 | Payment succeeded (local SDK result) |
-1 | Unknown error |
-2 | Parameter error — check receiveCode format |
-3 | User cancelled payment |
-10 | Telebirr app not installed |
-11 | Installed Telebirr version doesn’t support this feature |
After the SDK callback fires, wait for your server’s notification endpoint to receive the signed callback from Telebirr. That’s the real source of truth.
Next: Step 4 — Notifications →