An unofficial Expo module for integrating Bill24 payment services into React Native applications. This library provides a seamless way to implement Bill24's instant payment and top-up functionality in your mobile apps.
- 🚀 Instant Payment: Quick payment processing with Bill24
- 💰 Top-up Payments: Wallet top-up functionality
- 🌍 Multi-language Support: English and Khmer language support
- 🌙 Dark Mode: Built-in dark mode support
- 🏗️ Environment Support: Production, staging, pilot, and demo environments
- 📱 Cross-platform: Works on both iOS and Android
- ⚡ Expo Compatible: Built as an Expo module
npm install react-native-bill24-sdk
You can override the B24PaymentSdk version used by this library by adding to your android/gradle.properties
:
b24paymentsdkVersion=1.2.0
No additional setup required for iOS.
import Bill24Sdk from 'react-native-bill24-sdk';
import {
Bill24InstantPaymentProps,
Bill24InstantPaymentTopUpProps
} from 'react-native-bill24-sdk';
Use this method to initiate a general instant payment:
const handleInstantPayment = async () => {
try {
const result = await Bill24Sdk.instantPaymentSdk({
userSyncCode: "your-user-sync-code",
refererKey: "your-referer-key",
language: "en", // "en" | "km"
isDarkMode: false,
isProduction: false, // Set to true for production
testingEnv: "DEMO" // "STAG" | "PRODUCTION" | "PILOT" | "DEMO"
});
if (result.success) {
console.log('Payment successful:', result.message);
} else {
console.log('Payment failed:', result.message);
}
} catch (error) {
console.error('Payment error:', error);
}
};
Use this method for wallet top-up payments:
const handleTopUpPayment = async () => {
try {
const result = await Bill24Sdk.instantPaymentSdkTopUp({
paymentMethodId: "payment-method-id", // Bill24 wallet ID
refererKey: "your-referer-key",
language: "en", // "en" | "km"
isDarkMode: false,
isProduction: false, // Set to true for production
testingEnv: "DEMO", // Ignored if isProduction is true
isDisplayCurrencySymbol: true // Display ៛1,000 vs KHR 1000
});
if (result.success) {
console.log('Top-up successful:', result.message);
} else {
console.log('Top-up failed:', result.message);
}
} catch (error) {
console.error('Top-up error:', error);
}
};
Property | Type | Required | Description |
---|---|---|---|
userSyncCode |
string |
✅ | User synchronization code from Bill24 |
refererKey |
string |
✅ | Referer key provided by Bill24 |
language |
"en" | "km" |
✅ | Interface language (English or Khmer) |
isDarkMode |
boolean |
✅ | Enable dark mode for payment UI |
isProduction |
boolean |
✅ | Production environment flag |
testingEnv |
"STAG" | "PRODUCTION" | "PILOT" | "DEMO" |
✅ | Testing environment (ignored if isProduction is true) |
Property | Type | Required | Description |
---|---|---|---|
paymentMethodId |
string |
✅ | Payment method ID (wallet ID) from Bill24 |
refererKey |
string |
✅ | Referer key provided by Bill24 |
language |
"en" | "km" |
✅ | Interface language (English or Khmer) |
isDarkMode |
boolean |
✅ | Enable dark mode for payment UI |
isProduction |
boolean |
✅ | Production environment flag |
testingEnv |
"STAG" | "PRODUCTION" | "PILOT" | "DEMO" |
✅ | Testing environment (ignored if isProduction is true) |
isDisplayCurrencySymbol |
boolean |
✅ | Show currency symbol (៛1,000 vs KHR 1000) |
Property | Type | Description |
---|---|---|
success |
boolean |
Payment operation success status |
message |
string? |
Result message or error description |
- DEMO: For development and testing
- STAG: Staging environment
- PILOT: Pilot testing environment
- PRODUCTION: Production environment (only used when
isProduction
is false)
When isProduction
is set to true
, the testingEnv
parameter is ignored and the SDK uses the production environment.
Library Version | Default B24PaymentSdk Version |
---|---|
0.1.0 | 1.1.46 |
- iOS 13.0+
- Swift 5.0+
- Xcode 15.0+
- minSdkVersion 24
- compileSdkVersion 36
- targetSdkVersion 36
Check out the example app in the example/
directory for a complete implementation:
cd example
npm install
npm run ios # For iOS
npm run android # For Android
- Ensure your
android/gradle.properties
has the correct B24PaymentSdk version - Check that your
minSdkVersion
is at least 24
- Make sure your deployment target is iOS 13.0+
- Run
cd ios && pod install
if using bare React Native
- Verify your
refererKey
is correct and active - Check that you're using the correct environment (
isProduction
setting) - Ensure
userSyncCode
orpaymentMethodId
are valid
- Never hardcode production
refererKey
in your app - Always validate payment results on your backend
- Use environment variables for sensitive configuration
- Implement proper error handling for failed payments
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For Bill24 SDK specific issues, please contact Bill24 support. For this library issues, please open an issue on GitHub.
Note: This is an unofficial library. Please refer to the official Bill24 documentation for the most up-to-date information about their payment services.