Note
This KHQR SDK plugin is not officially release from NBC.
This is a simple interface layer that connects your Dart code directly to the original native platform-specific SDK, bridging Flutter and native functionality seamlessly.
The standardization of KHQR code specifications will help promote wider use of mobile retail payments in Cambodia and provide consistent user experience for merchants and consumers. It can enable interoperability in the payment industry. A common QR code would facilitate payments among different schemes, e-wallets and banks and would encourage small merchants to adopt KHQR code as payment method. KHQR is created for retail or remittance in Cambodia and Cross-Border. It only requires a single QR for receiving transactions from any payment provider through Bakong including Bakong App.
- iOS
- Android
- iOS using
BakongKHQR
(v1.0.0.15) - Android using
kh.gov.nbc.bakong_khqr:sdk-java:1.0.0.13
See the example app for detailed implementation information.
Features | Android | iOS |
---|---|---|
Generate Individual | ✔ | ✔ |
Generate Merchant | ✔ | ✔ |
Generate Deeplink | ✔ | ✔ |
Verify | ✔ | ✔ |
Decode | ✔ | ✔ |
KHQR Card Widget | ✔ | ✔ |
- Add source to Podfile (ios/Podfile)
source "https://sambo:[email protected]/khqr/khqr-ios-pod.git"
- Run pod install (make sure your terminal is in ios folder)
pod install
- No need to do anything it's working out of the box.
import 'package:khqr_sdk/khqr_sdk.dart';
final _khqrSdk = KhqrSdk();
final info = IndividualInfo(
bakongAccountId: 'kimhak@dev',
merchantName: 'Kimhak',
accountInformation: '123456789',
);
final khqrData = await _khqrSdk.generateIndividual(info);
final info = MerchantInfo(
bakongAccountId: 'kimhak@dev',
acquiringBank: 'Dev Bank',
merchantId: '123456',
merchantName: 'Kimhak',
);
final khqrData = await _khqrSdk.generateMerchant(info);
const qrCode = '00020101021129270010kimhak@dev01091234567895204599953031165802KH5906Kimhak6010Phnom Penh9917001317324625358296304B59E';
final isValid = await _khqrSdk.verify(qrCode);
const qrCode = '00020101021129270010kimhak@dev01091234567895204599953031165802KH5906Kimhak6010Phnom Penh9917001317324625358296304B59E';
final khqrDecodeData = await _khqrSdk.decode(qrCode);
const qrCode = '00020101021129270010kimhak@dev01091234567895204599953031165802KH5906Kimhak6010Phnom Penh9917001317324625358296304B59E';
final sourceInfo = SourceInfo(
appName: 'Example App',
appIconUrl: 'http://cdn.example.com/icons.logo.png',
appDeepLinkCallBack: 'http://app.example.com/callback',
);
final deeplinkInfo = DeeplinkInfo(
qr: qrCode,
url: 'http://api.example.com/v1/generate_deeplink_by_qr',
sourceInfo: sourceInfo,
);
final deeplinkData = await _khqrSdk.generateDeepLink(deeplinkInfo);
KhqrCardWidget(
width: 300.0,
receiverName: 'Kimhak',
amount: 0,
currency: KhqrCurrency.khr,
qr: khqrContent,
),
See the example for runnable examples of various usages.
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.
See Contributing.md.
Don't forget to give it a like 👍 or a star ⭐