Mobile SDKs
WayaQuick — Flutter SDK
One Dart SDK for payments and payouts on Android and iOS.
- Flutter 3 · Dart 3
Install
dependencies:
wayapay:
path: ./wayapayThe official Flutter SDK for WayaQuick. Accept payments, send payouts and verify accounts — written in Dart for Flutter apps on Android and iOS.
#Requirements
- Flutter 3.0+
- Dart 3.0+
- Android and iOS
#Installation
Add the package to the dependencies in pubspec.yaml:
dependencies:
wayapay:
path: ./wayapay#Setup
import 'package:wayapay/wayapay.dart';
final client = WayaPayClient(
merchantId: 'YOUR_MERCHANT_ID',
publicKey: 'YOUR_API_SECRET_KEY',
environment: WayaPayEnvironment.development,
);You can also pass the environment as a string:
final client = WayaPayClient.fromStrings(
merchantId: 'YOUR_MERCHANT_ID',
publicKey: 'YOUR_API_SECRET_KEY',
environment: 'production', // 'prod' | 'production' | 'dev' | 'development'
);#Initialize payment
Starts a payment and returns a transaction ID and payment link.
final res = await client.initializePayment(
InitializePaymentPayload(
currency: 'NGN',
amount: 5000,
callBackUrl: 'https://yourapp.com/callback',
idempotencyKey: 'unique-key-123',
paymentRef: 'order-001',
metadata: PaymentMetadata(
firstName: 'Ada',
lastName: 'Lovelace',
phoneNumber: '08000000000',
emailAddress: 'ada@example.ng',
cancelUrl: 'https://yourapp.com/cancel',
),
),
);
if (res.isSuccess) {
final txnId = (res.data as Map)['transactionId'];
final link = client.paymentLinkFor(txnId);
}#Verify account & initiate payout
Always verify the destination account before sending a payout.
final verify = await client.verifyAccount(
VerifyAccountPayload(
accountNumber: '0123456789',
bankCode: '058',
),
);
if (verify.isSuccess) {
final payout = await client.initiatePayout(
InitiatePayoutPayload(
currency: 'NGN',
amount: 2500,
idempotencyKey: 'payout-key-456',
bankCode: '058',
accountNumber: '0123456789',
),
);
}#Verify transaction
Gets the current status of a transaction by its reference.
await client.verifyTransaction('TXN_REF');#Fetch bank list
Returns every supported bank and its code.
await client.fetchBankList();#Handling responses
Every method returns a WayaPayResult with the status, data, message, code and raw response.
final result = await client.verifyTransaction('TXN_REF');
if (result.isSuccess) {
print(result.data);
} else {
print(result.message);
}#Environments
| Value | Description |
|---|---|
development | Test environment |
dev | Test environment |
production | Live environment |
prod | Live environment |
#Package structure
wayapay/
├── lib/
│ ├── wayapay.dart
│ └── src/
│ ├── wayapay_client.dart
│ ├── wayapay_environment.dart
│ └── wayapay_models.dart
├── test/
│ └── wayapay_client_test.dart
├── pubspec.yaml
└── README.md#Cleanup
Call close() when you're done with the SDK to release its HTTP client.
await client.close();