Flutter SDK
The Flutter SDK embeds Payment Platform checkout into a Flutter app via a WebView. It supports the Checkout protocol only and handles the full payment flow including 3DS app-to-app authentication and deep link callbacks.
The SDK is maintained at openpaymentplatform-net/flutter_openpaymentplatform.
Installation
Add the package to your pubspec.yaml:
dependencies:
openpaymentplatform_flutter: ^1.0.4
Then run:
flutter pub get
Initialize the SDK
Call initialize once at app startup before making any payment requests:
OpenPaymentPlatform().initialize(
backendUrl: 'https://your-checkout-url.example.com',
merchantKey: 'your-merchant-key',
password: 'your-api-password',
);
| Parameter | Description |
|---|---|
backendUrl | Your CHECKOUT_URL provided by your account manager |
merchantKey | Admin panel → Merchants → your merchant → Test key |
password | Admin panel → Merchants → your merchant → Password. Used for hash computation only — never sent in requests. |
Create a payment request
Build an OpenPaymentPlatformRequest with your order details and callback URLs:
final request = OpenPaymentPlatformRequest(
operation: OpenPaymentPlatformOperation.purchase,
successUrl: 'https://your-app.example/payment/success',
cancelUrl: 'https://your-app.example/payment/cancel',
errorUrl: 'https://your-app.example/payment/error',
order: OpenPaymentPlatformOrder(
number: 'ORDER-123',
amount: '10.00',
currency: 'USD',
),
);
Available operations
| Method | Description |
|---|---|
OpenPaymentPlatform().checkStatus(paymentId) | Retrieve the current status of a payment |
OpenPaymentPlatform().refundPayment(paymentId, amount) | Issue a full or partial refund |
OpenPaymentPlatform().voidPayment(paymentId) | Void an authorized payment before capture |
3DS handling
The SDK manages 3DS app-to-app authentication automatically. Configure your app to handle deep links for the redirect back from the card issuer. See your framework's deep link documentation for setup details.
Related
- Resources and configuration — full parameter reference for the session creation request
- Callbacks — server-to-server payment result notifications
- Redirects and returns — how
success_urlandcancel_urlwork