cyberpaysdkflutter 1.0.0+28 copy "cyberpaysdkflutter: ^1.0.0+28" to clipboard
cyberpaysdkflutter: ^1.0.0+28 copied to clipboard

discontinued

The Android SDK to integrate to the cyberpay payment gateway The Cyberpay SDK makes it quick and easy to build seamless payment into your android app.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:cyberpaysdkflutter/cyberpaysdkflutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  static const platform = const MethodChannel('cyberpayflutter_plugin');

  @override
  void initState() {
    super.initState();
    initCyberPayState();

    platform.setMethodCallHandler((call) {
      final String argument = call.arguments;
      switch (call.method) {
        case "onSuccess":
          print("SUCCESS $argument");
          break;
      }
      return;
    });
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initCyberPayState() async {
    try {
      await CyberpayflutterPlugin.makePaymentWithReference(
          integrationKey: "d5355204f9cf495f853c8f8d26ada19b",
          reference: "shaba@gmail.com",
          liveMode: false);
    } on PlatformException {}
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: \n'),
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

The Android SDK to integrate to the cyberpay payment gateway The Cyberpay SDK makes it quick and easy to build seamless payment into your android app.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on cyberpaysdkflutter