Skip to Content
👋 Welcome to 100Pay Developers

Flutter SDK

The hundredpay Flutter package lets you accept crypto payments in iOS and Android apps with a single method call. It opens the 100Pay Checkout UI inside your app using a native webview.

  • Supports Android and iOS
  • Minimal setup — just pass customer and billing info
  • Built on webview_flutter under the hood

Package: pub.dev/packages/hundredpay 

Getting Started

Create a 100Pay Account

Sign up or log in  to your 100Pay account and obtain your Public API Key from the Developer Settings .

Add the Dependency

In your pubspec.yaml:

dependencies: hundredpay: ^latest

Then run:

flutter pub get

Android Compatibility

Your minSdkVersion must be 19 or higher. Open android/app/build.gradle and update:

android { defaultConfig { applicationId "com.yourapp.id" minSdkVersion 19 // Must be 19 or higher targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionVersion } }

Make a Payment

Import the package and call HundredPay.makePayment():

import 'package:hundredpay/hundredpay.dart'; // Generate a unique reference ID per transaction final String refId = DateTime.now().millisecondsSinceEpoch.toString(); await HundredPay.makePayment( customerEmail: "[email protected]", customerPhoneNumber: "0800000000", customerName: "Jane Doe", customerUserId: "user_123", // Your internal user ID amount: "49.99", userId: "12345", // Your 100Pay user/app ID refId: refId, // Unique per transaction description: "Monthly subscription", apiKey: "LIVE;PK;your_public_key", // From Developer Settings currency: "NGN", // e.g. "USD", "NGN", "GHS" country: "NG", // ISO country code chargeSource: "api", callBackUrl: "https://yourapp.com/payment/callback", onError: (error) { print("Payment error: $error"); }, onComplete: ({ completed }) { if (completed) { print("Payment completed successfully!"); // Verify payment on your backend using the refId } }, context: context, );

Parameters

ParameterTypeRequiredDescription
customerEmailString✅Customer’s email address
customerPhoneNumberString✅Customer’s phone number
customerNameString✅Customer’s display name
customerUserIdString✅Your app’s internal user ID
amountString✅Payment amount as a string (e.g. "49.99")
userIdString✅Your 100Pay user/app identifier
refIdString✅Unique transaction reference — generate a new one per payment
descriptionString✅Short description of the payment
apiKeyString✅Your Public API Key from the Developer Settings  — format: "LIVE;PK;..."
currencyString✅Currency code (e.g. "NGN", "USD", "GHS")
countryString✅ISO 3166-1 alpha-2 country code (e.g. "NG", "US")
chargeSourceString✅Always "api" for SDK-initiated payments
callBackUrlString✅URL invoked after payment completes
onErrorFunction(error)✅Called if an error occurs during payment
onCompleteFunction({completed})✅Called on completion — completed: true means the user finished the flow
contextBuildContext✅Flutter BuildContext from the calling widget

onComplete fires when the checkout UI closes — not necessarily when the payment is confirmed. Always verify the payment on your server using the refId before fulfilling orders or granting access.

API Key Format

Your API key includes a mode prefix. It looks like:

LIVE;PK;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
  • LIVE — production mode (TEST for sandbox)
  • PK — public key type (SK for secret key — never use server-side keys here)
  • The token after the second ; is the actual key payload

Copy the full string from your Developer Settings .

After Payment: Verify on Your Server

The onComplete callback is client-side only. Use the refId you passed in to verify the payment via your backend:

onComplete: ({ completed }) async { if (completed) { final result = await http.post( Uri.parse("https://yourapp.com/api/verify-payment"), body: jsonEncode({ "refId": refId }), headers: { "Content-Type": "application/json" }, ); final data = jsonDecode(result.body); if (data["success"] == true) { // Unlock feature / navigate to success screen } } },

See Verify Payments for the server-side verification guide using the 100pay.js SDK.

Dependencies

The hundredpay package relies on:

PackagePurpose
webview_flutterRenders the checkout UI inside a native webview
httpHTTP client for API communication
flutter_spinkitLoading indicators
plugin_platform_interfaceFlutter plugin interface

Next Steps

  • Verify Payments — confirm payments server-side after checkout
  • Pay Checkout JS — web equivalent of this SDK
  • 100pay.js — server-side Node.js SDK for transfers, subaccounts, and more
Last updated on