rms_mobile_xdk_flutter 3.33.0
rms_mobile_xdk_flutter: ^3.33.0 copied to clipboard
RMS Mobile Payment for Flutter
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:rms_mobile_xdk_flutter/rms_mobile_xdk_flutter.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return new MaterialApp(
home: new Scaffold(
appBar: new AppBar(
title: new Text('RMS XDK Example'),
),
body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new ElevatedButton(
child: const Text('Start XDK'),
onPressed: () async {
var paymentDetails = {
// Mandatory String. Values obtained from MOLPay
'mp_username': 'RMSxdk_2022',
'mp_password': 'RMSpwd@2022',
'mp_merchant_ID': 'rmsxdk_mobile_Dev',
'mp_app_name': 'mobile',
'mp_verification_key': 'ee738b541eff7b6b495e44771f71c0ec',
// Mandatory String. Payment values
'mp_order_ID': '60186547890',
// Mandatory String. A value more than '1.00'
'mp_amount': '1.01',
'mp_currency': 'MYR',
'mp_country': 'MY',
// Optional String.
'mp_channel': 'multi',
// Use 'multi' for all available channels option. For individual channel seletion, please refer to "Channel Parameter" in "Channel Lists" in the MOLPay API Spec for Merchant pdf.
'mp_bill_description': 'Reload Social Credit',
'mp_bill_name': 'Razer Merchant',
'mp_bill_email': '[email protected]',
'mp_bill_mobile': '+60102338716',
'mp_silent_error': false,
'mp_sandbox_mode': false,
'mp_dev_mode': false,
'mp_express_mode': false,
'mp_preferred_token': 'new',
'mp_ap_merchant_ID': '',
'mp_advanced_email_validation_enabled': false,
'mp_advanced_phone_validation_enabled': false,
'mp_bill_name_edit_disabled': false,
'mp_bill_email_edit_disabled': false,
'mp_bill_mobile_edit_disabled': false,
'mp_bill_description_edit_disabled': false,
'mp_editing_enabled': false,
'mp_disabled_channels': ['enetsD'],
'mp_dpa_id': '',
'mp_company': '',
'mp_mc2p_key': [],
};
String? result = await MobileXDK.start(paymentDetails);
print("Result" + result!);
},
),
],
),
),
),
);
}
}