Skip to main content

BUY BUTTON

Buy Button - Android

Two simple ways to add external payments to your Android app: redirect users to your Web Shop, or launch Pay Station's native in-app UI. Both are production-ready — pick the one that fits your workflow.

Buy Button Solution

Full payment UI handled natively inside your app — no browser redirect.

  • Want a fully native integration
  • Need 1,000+ payment methods out of the box
  • Prefer Xsolla to manage the payment UI
  • Want automatic regional compliance

important

To enable U.S.-only link-outs effective October 29, 2025, first detect the Google Play storefront country code — see the guide.

final Context context = // Your activity context
final String webshopUrl = "https://yourwebshop.xsolla.site";
final String sku = "money.100"; // Virtual item SKU from your Xsolla Catalog
final String userId = "user_12345"; // Current user's ID
final String redirectUrl = "yourgame://"; // Deep link back to your app

WebShop.launchBillingFlow(context, webshopUrl, sku, userId, redirectUrl,
new WebShop.ILaunchBillingFlowCallback() {
@Override
public void onLaunchBillingFlow(@NonNull final Either<Error, Void> result) {
result.voidFold(
err -> Log.e(TAG, "Link-out error: " + err.getMessage()),
__ -> Log.d(TAG, "Web Shop opened successfully")
);
}
}
);

This opens your Web Shop in the device browser. Fulfillment happens via your server-side webhooks — see webhook setup.

Still not sure?

Web Shop is great if you have an existing store or want to start with minimal changes. Pay Station is the fastest path to a fully native integration. Both support the same payment methods and regions worldwide.