YOWO PAY Carrier Billing
开始集成
为出海 App 准备的运营商支付

让没有银行卡的用户,
用话费完成每一次付费。

YOWO PAY 是一套基于运营商直接计费(DCB)的安卓计费 SDK。用户无需绑卡、无需商店账户,一键从话费余额扣款。面向东南亚、中东、拉美与非洲那 70% 没有银行卡的付费人群。

DCB 代扣 · 已确认
− $0.99话费余额
运营商短号4072 345 678
商品100 Gold Coins
通道premium SMS / DCB
运营商已扣费 · Webhook 已送达
val m = SubscriptionManager(ctx, KEY)
m.purchaseOneTime(1, "gold_pack_01",
  "100 Gold Coins", userId, cb)
为什么是运营商计费

不是又一种钱包,而是另一条支付通路

DCB 把计费入口放在用户已经拥有的东西上——手机号与话费余额。它不替代信用卡,而是覆盖信用卡到不了的市场。

零门槛付费

点击即扣,不跳转、不绑卡。预付费 SIM 用户与信用卡用户走同一条转化路径。

一次性与订阅

purchaseOneTime 卖道具,subscribe 做周期会员,由系统 WorkManager 自动续期。

新兴市场优先

东南亚、中东、拉美、非洲的无卡用户,用预付费套餐即可完成小额付费。

回执驱动发货

运营商扣费后通过 Webhook 通知你的服务端,按交易号幂等发放,避免资损。


一次交易的生命周期

四步完成一次 DCB 代扣

SDK 负责短信代扣与后台调度;你只需在回执到来后发货。

1

集成 SDK

将 subscription.aar 放入 libs,声明 okhttp / gson / work-runtime 依赖与两项权限。

2

用户点击购买

客户端调用 purchaseOneTime 或 subscribe,SDK 向 yowo 后端请求运营商短号。

3

运营商代扣

应用代发计费短信至运营商短号,金额从用户话费余额中扣除。

4

回执与发货

运营商确认后 Webhook 通知你的服务端,按 transactionId 幂等发放权益。


适合的场景

小额、高频、无卡优先

游戏内道具

金币、复活、皮肤、去广告。把原本的激励视频场景升级为直接代扣,ARPU 更高。

内容订阅

月卡、会员通行证。subscribe 自动周期代扣,配合 cancelSubscription 管理退订。

数字商品

电子书、点券、解锁码。无商店抽成,适合非 Google Play 渠道分发。


接入

几行代码,完成第一次扣款

手动分发 .aar,声明依赖与权限,初始化后即可发起交易。

// 初始化(传入 Merchant API Key)
val manager = SubscriptionManager(this, "YOUR_API_KEY")

// 一次性购买:100 金币
manager.purchaseOneTime(
  smsCount = 1,
  productId = "gold_pack_01",
  productName = "100 Gold Coins",
  customerId = userId,
  object : PurchaseCallback {
    override fun onSuccess(t: Transaction) {
      // 仅代表已发起代扣,发货请以服务端 Webhook 为准
      uploadTxnId(t.transactionId)
    }
    override fun onError(e: Exception) { log(e) }
  }
)
  • 最低支持 Android 7(API 24)
  • 仅两项权限:INTERNET 与 SEND_SMS
  • 依赖 okhttp / gson / work-runtime / appcompat
  • API Key 由 SDK 加密存于内部 SharedPreferences
  • Development Mode 可无 SIM 卡模拟 Webhook 联调
  • onSuccess 仅代表发起代扣,需等 Webhook 再发货
下载DCB SDK

文档

Android SDK 集成指南

完整文档随页面本地加载,不跳转外部站点。

Relario Pay Android SDK · 集成指南

手动分发 · subscription.aar · Android 7+
本文档说明如何通过高级短信(premium SMS / DCB)为 Android 应用接入一次性购买与周期订阅。SDK 处理安全的支付请求与后台短信操作,请严格按步骤配置。

1 · 安装与配置

SDK 以编译好的 .aar 包手动分发,需手动加入工程并在 build 脚本中声明其开源依赖。

步骤 1:添加 .aar 文件
  1. 找到下载的 subscription.aar。
  2. 在应用模块目录(通常 app)下,若无 libs 目录则新建 app/libs/。
  3. 将 subscription.aar 直接粘贴进 libs 目录。
步骤 2:配置 build.gradle.kts(app 模块)
dependencies {
    // 1. 引用本地 SDK 二进制
    implementation(files("libs/subscription.aar"))

    // 2. 显式声明 transient 依赖
    implementation("com.squareup.okhttp3:okhttp:4.9.0")
    implementation("com.google.code.gson:gson:2.10")
    implementation("androidx.work:work-runtime:2.9.0")
    implementation("androidx.core:core:1.12.0")
    implementation("androidx.appcompat:appcompat:1.6.1")
}
步骤 3:设置 Android 目标平台

在 defaultConfig 中确保最低支持 Android 7(API 24) 及以上。

步骤 4:配置应用权限

SDK 需联网校验并代发短信,在 AndroidManifest.xml 的 <application> 之外声明:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <application>
    </application>
</manifest>

2 · 鉴权与初始化

SDK 需要安全的 Merchant API Bearer Key 对交易签名。初始化时传入,SDK 会将其加密存于内部 SharedPreferences。

import com.relario.subscription.SubscriptionManager

class MainActivity : AppCompatActivity() {
    private lateinit var manager: SubscriptionManager
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val apiKey = "your_production_or_test_api_key_here"
        manager = SubscriptionManager(this, apiKey)
    }
}

3 · 公开 API 方法

3.1 一次性购买(purchaseOneTime)

为单个数字商品发起一条短信微交易,自动查询运营商短号并代发短信。

// 重载 A:异步回调
public void purchaseOneTime(int smsCount, String productId,
    String productName, String customerId, PurchaseCallback callback)

// 重载 B:即发即忘
public void purchaseOneTime(int smsCount, String productId,
    String productName, String customerId)
  • smsCount (int):达到目标金额所需的计费短信条数权重。
  • productId (String):商品 SKU 标识。
  • productName (String):商品展示名称。
  • customerId (String):你的应用用户唯一标识。
  • callback:处理成功回调或网络异常。
manager.purchaseOneTime(1, "gold_pack_01", "100 Gold Coins",
    "user_id_777", new PurchaseCallback() {
  public void onSuccess(Transaction t) {
    // SDK 会紧接着自动代发验证短信
  }
  public void onError(Exception e) { }
});
3.2 周期订阅(subscribe)

用 WorkManager 注册后台周期任务,跨应用关闭与设备重启持续代扣。

public void subscribe(int interval, String timeUnit,
    int smsCount, String productId, String productName, String customerId)
  • interval (int):间隔数值,如 15 / 24 / 1。
  • timeUnit (String):与 java.util.concurrent.TimeUnit 取值一致,如 "MINUTES" / "HOURS" / "DAYS"。
// 每 24 小时触发一次自动代扣
manager.subscribe(24, "HOURS", 1,
    "premium_sub_month", "Monthly Vip Pass", "user_id_777");
3.3 取消订阅(cancelSubscription)
public void cancelSubscription(String productId)
manager.cancelSubscription("premium_sub_month");
3.4 查询单笔交易(checkTransactionStatus)
public void checkTransactionStatus(String transactionId, TransactionDetailsCallback callback)
// transaction.getStatus() 返回 "ok" 等状态
// transaction.getPayments().size() 返回已确认回执数
3.5 查询交易历史(retrieveTransactions)
public void retrieveTransactions(TransactionHistoryCallback callback)
// 解析本地数据库并向服务端顺序查询,异步返回 JSON 数组

4 · 数据模型

Transaction 对象关键字段:

  • getTransactionId():交易唯一标识。
  • getStatus():服务端状态(如 "ok")。
  • getSmsBody():代发短信的验证文本。
  • getPhoneNumbersList():运营商短号列表。
  • getPayments():已确认的运营商回执列表。

5 · Webhook 异步回执

交易触发运营商扣费后,yowo 平台可异步通知你的服务端。在商户后台配置 Webhook URL 后,平台会 POST 如下结构:

{
  "paymentType": "sms",
  "transactionId": "120058355",
  "paymentId": 10072190,
  "productId": "prod_999",
  "productName": "Premium Access",
  "customerId": "user_11",
  "smsBody": "120058355:1e3a1a9830",
  "sourcePhoneNumber": "40723456789",
  "destinationPhoneNumber": "41766013299",
  "initiatedAt": 1781173691517
}
通过 Development Mode 测试 Webhook
  1. 在商户后台开启 Development Mode。
  2. 在 Webhook URL 设置中填入你的服务端路由。
  3. 选择 Transactions > Simulate transaction 构造模拟会话。
  4. 点击确认即可强制触发一条模拟 POST,验证服务端接收逻辑。
This SDK lets you monetize Android apps via premium SMS billing for both recurring subscriptions and one-time purchases. Follow these steps explicitly — the SDK handles secure payment requests and background telephony operations.

1 · Installation & Setup

The SDK is distributed manually as a compiled .aar archive. Add it to your project and declare its open-source dependencies in your app module build script.

Step 1: Add the .aar File
  1. Locate the downloaded subscription.aar.
  2. In your app module (usually app), create app/libs/ if missing.
  3. Paste subscription.aar into libs.
Step 2: Configure build.gradle.kts (App Module)
dependencies {
    // 1. Reference the local SDK binary
    implementation(files("libs/subscription.aar"))

    // 2. Declare transient dependencies
    implementation("com.squareup.okhttp3:okhttp:4.9.0")
    implementation("com.google.code.gson:gson:2.10")
    implementation("androidx.work:work-runtime:2.9.0")
    implementation("androidx.core:core:1.12.0")
    implementation("androidx.appcompat:appcompat:1.6.1")
}
Step 3: Set Android Target Platform

In defaultConfig, minimum supported platform is Android 7 (API 24) or higher.

Step 4: Configure App Permissions

Declare required permissions outside <application> in AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <application>
    </application>
</manifest>

2 · Authentication & Initialization

The SDK requires a secure Merchant API Bearer Key. Pass it at instantiation; the SDK persists it in an internal encrypted SharedPreferences container.

import com.relario.subscription.SubscriptionManager;

public class MainActivity extends AppCompatActivity {
    private SubscriptionManager subscriptionManager;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String key = "your_relario_production_or_test_api_key_here";
        subscriptionManager = new SubscriptionManager(this, key);
    }
}

3 · Public API Methods

3.1 One-Time Purchases (purchaseOneTime)

Initializes a standalone SMS microtransaction for a single digital item.

// Overload A: Asynchronous Callback Model
public void purchaseOneTime(int smsCount, String productId,
    String productName, String customerId, PurchaseCallback callback)

// Overload B: Fire-and-Forget Mode
public void purchaseOneTime(int smsCount, String productId,
    String productName, String customerId)
  • smsCount (int): Quantized premium message count to reach the payment target.
  • productId (String): Unique SKU token of the asset.
  • productName (String): Visible display title.
  • customerId (String): Your app's unique user reference.
  • callback: Handles success payloads or network exceptions.
subscriptionManager.purchaseOneTime(1, "gold_pack_01",
    "100 Gold Coins", "user_id_777", new PurchaseCallback() {
  public void onSuccess(Transaction t) {
    // SDK auto-dispatches the verification SMS next
  }
  public void onError(Exception e) { }
});
3.2 Schedule Recurring Subscriptions (subscribe)

Enqueues a persistent WorkManager task that wakes the app on a recurring schedule and executes billing across app close and device restart.

public void subscribe(int interval, String timeUnit,
    int smsCount, String productId, String productName, String customerId)
  • interval (int): Numeric spacing, e.g. 15 / 24 / 1.
  • timeUnit (String): Matches java.util.concurrent.TimeUnit values.
// Trigger every 24 Hours
subscriptionManager.subscribe(24, "HOURS", 1,
    "premium_sub_month", "Monthly Vip Pass", "user_id_777");
3.3 Terminate Recurring Subscriptions (cancelSubscription)
public void cancelSubscription(String productId)
subscriptionManager.cancelSubscription("premium_sub_month");
3.4 Query Single Transaction (checkTransactionStatus)
public void checkTransactionStatus(String transactionId, TransactionDetailsCallback callback)
// transaction.getStatus() returns "ok"
// transaction.getPayments().size() = confirmed receipts
3.5 Fetch Transaction History (retrieveTransactions)
public void retrieveTransactions(TransactionHistoryCallback callback)
// Parses local DB, polls server, returns JSON array

4 · Understanding Data Models

The core Transaction object:

  • getTransactionId(): Unique operation reference.
  • getStatus(): Server state (e.g. "ok").
  • getSmsBody(): Verification text payload sent.
  • getPhoneNumbersList(): Shortcode endpoints list.
  • getPayments(): Confirmed operator webhook receipts.

5 · Webhook Notifications

When a carrier payment hits, the platform can asynchronously inform your backend. Configure a Webhook URL in your merchant panel; the platform POSTs:

{
  "paymentType": "sms",
  "transactionId": "120058355",
  "paymentId": 10072190,
  "productId": "prod_999",
  "productName": "Premium Access",
  "customerId": "user_11",
  "smsBody": "120058355:1e3a1a9830",
  "sourcePhoneNumber": "40723456789",
  "destinationPhoneNumber": "41766013299",
  "initiatedAt": 1781173691517
}
Testing Webhooks via Development Mode
  1. Enable Development Mode in the merchant panel.
  2. Save your server route in the Webhook URL field.
  3. Select Transactions > Simulate transaction.
  4. Click confirm to force a simulated POST and verify capture.

横向对比

DCB 与主流支付方式

覆盖无卡用户、绕开商店抽成,是新兴市场分发的最优补充。

维度 yowo Pay DCB 信用卡 / 钱包 Google Play 结算
是否需要银行卡 否,话费即付 是 是(绑定 GP 账号)
无卡用户覆盖 高(预付费 SIM) 低 依赖绑卡
商店抽成 无(非 GP 渠道) 无 15%–30%
适用渠道 三方应用市场 / 线下广告 全渠道 仅 Google Play 上架版

把那 70% 没有银行卡的用户,变成付费用户。

下载 SDK,几行代码接入运营商直接计费。