fiuu_mobile_xdk_flutter 3.34.6 copy "fiuu_mobile_xdk_flutter: ^3.34.6" to clipboard
fiuu_mobile_xdk_flutter: ^3.34.6 copied to clipboard

Fiuu Mobile Payment for Flutter

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pay/pay.dart';
import 'package:fiuu_mobile_xdk_flutter/fiuu_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_bill_description": "",
                    "mp_bill_name": "",
                    "mp_verification_key": "",
                    "mp_username": "",
                    "mp_merchant_ID": "",
                    "mp_app_name": "",
                    "mp_bill_email": "",
                    "mp_country": "MY",
                    "mp_amount": "1.01",
                    "mp_bill_mobile": "",
                    "mp_order_ID": "", //HB23111517727
                    "mp_channel": "multi",
                    "mp_currency": "MYR",
                    "mp_password": "",

                    '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_allowed_channels': ['ApplePay, credit23'],
                    'mp_mc2p_key': [],
                  };

                  String? result = await MobileXDK.start(paymentDetails);
                  print("Result" + result!);
                },
              ),
              // TODO: Choose your preferred Google Pay button : https://developers.google.com/pay/api/android/guides/brand-guidelines
              new GestureDetector(
                onTap: () async {
                  print("logGooglePay googlePay Button Tapped!");

                  var paymentDetails = {

                    /*
                     TODO: Follow Google’s instructions to request production access for your app: https://developers.google.com/pay/api/android/guides/test-and-deploy/request-prod-access
                    *
                     Choose the integration type Gateway when prompted, and provide screenshots of your app for review.
                     After your app has been approved, test your integration in production by set mp_sandbox_mode = false & use production mp_verification_key & mp_merchant_ID.
                     Then launching Google Pay from a signed, release build of your app.
                     */
                    'mp_sandbox_mode': true,

                    // TODO : Enter your credentials
                    'mp_merchant_ID': '',
                    'mp_verification_key': '',

                    'mp_order_ID': 'order202404221201',
                    'mp_currency': 'MYR',
                    'mp_country': 'MY',

                    'mp_amount': '1.23',
                    'mp_bill_description': 'Test App to App',
                    'mp_bill_name': 'Testing',
                    'mp_bill_email': 'testing@gmail.com',
                    'mp_bill_mobile': '123456789',
                  };

                  String? result = await MobileXDK.googlePay(paymentDetails);
                  print("logGooglePay Result" + result!);
                },
                child: Image.asset(
                  'assets/gpay.png',
                  width: 99,
                  height: 99,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
6
likes
0
pub points
74%
popularity

Publisher

unverified uploader

Fiuu Mobile Payment for Flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, pay

More

Packages that depend on fiuu_mobile_xdk_flutter