SDK overview
Two official SDKs wrap the gateway today. Both ship a drop-in checkout widget, both target the same payment endpoints, and both expose lower-level service classes for custom flows.
| Flutter | Angular | |
|---|---|---|
| Package | pdirect_pay | @mms/pdirect-pay |
| Latest | 3.0.0 | 1.2.2 |
| Auth model | Auth-v3 (per-checkout session tokens) | Auth-v2 (app-key header) |
| Platforms | Android (API 21+), iOS (12.0+) | Browsers via Angular 17–21 |
| Web/Desktop | Not supported | Web only (Angular’s domain) |
Auto-attach Idempotency-Key | ✅ | ❌ (manual) |
Auto-attach X-Device-Fingerprint | ✅ | ❌ |
| TLS pinning | Roadmap (config field exists) | N/A (browser TLS) |
| Theme tokens | PdirectPayThemeConfig | PdirectPayThemeConfig |
| Languages | en, fr, es, ru, zh, ln | en, fr, es, ru, zh, ln |
Which one to choose
Section titled “Which one to choose”- Building a mobile app → Flutter SDK. It’s the only SDK on Auth-v3, and it ships device-fingerprint binding plus idempotency out of the box.
- Building a web app in Angular 17+ → Angular SDK, with the caveat that you’re on the legacy auth model until v2.0.0.
- Building anything else (React web, Vue web, native iOS/Android outside Flutter, server-rendered pages without an Angular framework) → use the HTTP API directly. The SDKs don’t add anything you can’t replicate in 200 lines of HTTP client code.
Auth model parity gap
Section titled “Auth model parity gap”Surface comparison
Section titled “Surface comparison”Both SDKs expose roughly the same shape. Names match where possible.
| Concept | Flutter | Angular |
|---|---|---|
| One-time init | PdirectPay.init(config) | PdirectPayModule.forRoot(config) or standalone provider |
| Per-checkout config | PdirectPayConfigs | PdirectPayConfig |
| Payment body | PdirectPaymentBody | PdirectPaymentBody |
| Drop-in widget | PdirectPayCheckout | <pdirect-pay-checkout> |
| Theme | PdirectPayThemeConfig | PdirectPayThemeConfig |
| HTTP client | PdirectHttpClient | PdirectHttpClientService |
| Direct payment service | PdirectPaymentService | PdirectPaymentService |
| Status enum | PdirectPaymentStatus | PdirectPaymentStatus |
| Error code enum | PdirectPayApiResponseCode | PdirectPayApiResponseCode |
| Success callback | onResponse: (PdirectPayOnResponse) => | (response)="..." (EventEmitter<PdirectPayOnResponse>) |
| Error callback | onError: (PdirectPayOnError) => | (error)="..." (EventEmitter<PdirectPayOnError>) |
Cross-references with the HTTP API
Section titled “Cross-references with the HTTP API”Every public method on either SDK corresponds to a documented
endpoint in the API reference. The mapping table
is in each endpoint’s x-sdk-methods extension and surfaces in the
Scalar UI as “SDK”.
The high-traffic mappings:
| HTTP endpoint | Flutter | Angular |
|---|---|---|
POST /payments/collect | PdirectPaymentService.createPayment | PdirectPaymentService.createPayment |
POST /payments/submit | PdirectPaymentService.submitPaymentDetails | PdirectPaymentService.submitPaymentDetails |
POST /payments/verify-otp | PdirectPaymentService.verifyOtp | PdirectPaymentService.verifyOtp |
POST /payments/resend-otp | PdirectPaymentService.resendOtp | PdirectPaymentService.resendOtp |
GET /payments/transaction/{id} | PdirectPaymentService.getTransactionDetails | PdirectPaymentService.getTransactionDetails |
GET /payments/get-config-bank | PdirectCommonService.fetchAvailableBanks | (call directly via HttpClient) |
Server-side endpoints (/internal/sessions/create, /payments/send,
/payments/collect-redirect, etc.) are not called from either SDK
— integrate them on your backend using HTTP.
Where to next
Section titled “Where to next” Flutter — installation Install pdirect_pay from pub.dev and configure native platforms.
Angular — installation Install @mms/pdirect-pay from npm.