Mobile SDKs
Omise provides native mobile SDKs for building secure payment integrations in iOS and Android applications. Our SDKs handle sensitive payment data collection and tokenization, ensuring PCI compliance while providing a seamless mobile payment experience.
概要
Mobile SDKs enable you to securely collect payment information from your mobile applications without having sensitive card data touch your servers. All SDKs follow platform-specific best practices and provide native UI components and APIs.
Key Features
- Native tokenization - Create secure payment tokens directly from mobile devices
- PCI compliant - Card data never touches your servers
- Platform-specific design - Native components following iOS and Android design guidelines
- 複数の決済方法 - カード、モバイルバンキング、代替決済方法をサポート
- Built-in validation - Client-side validation for card numbers, CVV, and expiry dates
- 3D Secure support - Built-in support for 3D Secure authentication flows
- 生体認証 - Touch ID、Face ID、指紋認証をサポート
- Error handling - Comprehensive error messages and handling
- Network resilience - Automatic retry logic and offline handling
利用可能なSDK
iOS SDK
Build secure payment experiences for iPhone and iPad applications.
- Languages: Swift 5.0+, Objective-C
- iOS Version: iOS 12.0 and later
- インストール: CocoaPods, Swift Package Manager, Carthage
- Repository: omise/omise-ios
Android SDK
Integrate payments into native Android applications.
- Languages: Kotlin, Java 8+
- Android Version: API Level 21 (Android 5.0) and later
- インストール: Gradle, Maven
- Repository: omise/omise-android
Get Started with Android SDK →
Flutter SDK
Create cross-platform payment solutions with Flutter.
- Language: Dart 2.12+
- Flutter Version: Flutter 2.0 and later
- Platforms: iOS and Android
- インストール: pub.dev
- Repository: omise/omise-flutter
Get Started with Flutter SDK →
Dart SDK
Server-side Dart integration for backend services.
- Language: Dart 2.12+
- Platform: Server-side Dart applications
- インストール: pub.dev
- Repository: omise/omise-dart
最小バージョン要件
証明書ピンニングの削除とセキュリティ更新により、少なくともこれらのSDKバージョンを使用する必要があります。古いバージョンではAPIリクエストが失敗する可能性があります。
| SDK | 最小バージョン | リリース日 |
|---|---|---|
| iOS SDK | 3.2.0 | 2019年8月29日 |
| Android SDK | 3.0.0 | 2019年10月31日 |
互換性を確保するため、アプリの依存関係を更新して再ビルドしてください。SSL/TLSエラーが発生した場合は、デバイスのルート証明書が最新であることを確認してください。
アーキテクチャ概要
All mobile SDKs follow a similar architectural pattern:
┌─────────────────┐
│ Mobile App │
│ │
│ ┌───────────┐ │
│ │ Omise SDK │ │
│ └─────┬─────┘ │
└────────┼────────┘
│
│ HTTPS (TLS 1.2+)
│
┌────▼────┐
│ Omise │
│ API │
└────┬────┘
│
┌────▼────────┐
│ Your Server │
└─────────────┘
Security Flow
- Customer enters payment details in your mobile app
- SDK validates the input client-side
- SDK sends encrypted data directly to Omise servers
- Omise returns a secure token to the mobile app
- App sends token to your server
- Your server creates a charge using the token
This flow ensures that sensitive card data never touches your servers, maintaining PCI compliance.
適切なSDKの選択
| Use Case | Recommended SDK | Reason |
|---|---|---|
| Native iOS app | iOS SDK | Best performance, native UI components |
| Native Android app | Android SDK | Best performance, native UI components |
| Cross-platform app | Flutter SDK | Write once, deploy to both platforms |
| Backend service in Dart | Dart SDK | Full API access for server operations |
| React Native app | iOS + Android SDKs | Use native modules with RN bridge |
一般的なユースケース
Tokenizing Credit Cards
All mobile SDKs provide methods to tokenize credit card information:
// iOS (Swift)
let request = Request(
name: "John Doe",
number: "4242424242424242",
expirationMonth: 12,
expirationYear: 2025,
securityCode: "123"
)
client.send(request) { result in
// Handle token
}
// Android (Kotlin)
val request = Token.CreateTokenRequest(
name = "John Doe",
number = "4242424242424242",
expirationMonth = 12,
expirationYear = 2025,
securityCode = "123"
)
client.send(request, callback)
// Flutter (Dart)
final token = await omise.createToken(
name: 'John Doe',
number: '4242424242424242',
expirationMonth: 12,
expirationYear: 2025,
securityCode: '123',
);
Creating Payment Sources
For alternative payment methods like mobile banking:
// iOS - インターネットバンキング
let request = CreateSourceRequest(
amount: 100000,
currency: "thb",
type: .internetBankingBay
)
// Android - Mobile Banking
val request = Source.CreateSourceRequest(
amount = 100000,
currency = "thb",
type = SourceType.InternetBankingBay
)
// Flutter - PromptPay
final source = await omise.createSource(
amount: 100000,
currency: 'thb',
type: 'promptpay',
);
クイックインストールリンク
iOS
# CocoaPods
pod 'OmiseSDK'
# Swift Package Manager
dependencies: [
.package(url: "https://github.com/omise/omise-ios", from: "5.0.0")
]
Android
dependencies {
implementation 'co.omise:omise-android:4.0.0'
}
Flutter
flutter pub add omise_flutter
Dart
dart pub add omise_dart
ベストプラクティス
Security
- Never log sensitive data - Don't log card numbers, CVV, or tokens
- Use HTTPS only - All SDKs enforce HTTPS connections
- Validate on server - Always validate tokens server-side before creating charges
- Implement rate limiting - Prevent brute-force attacks on payment forms
- Use public key only - Never embed your secret key in mobile apps