api_payment 0.0.2 copy "api_payment: ^0.0.2" to clipboard
api_payment: ^0.0.2 copied to clipboard

Easy payment api for online systems. It's available for any platform.

example/lib/main.dart

import 'package:api_payment/utils/enums/display_types.dart';
import 'package:flutter/material.dart';
import 'package:api_payment/yt_ypay.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  YtYpay ypay = YtYpay(
      clientId: "your client Id",
      title: "App Title",
      amount: 500.0,
      backendUrl: "backen url for test");
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      localizationsDelegates: const [
        DefaultMaterialLocalizations.delegate,
        DefaultWidgetsLocalizations.delegate,
      ],
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.only(top: 39.0),
          child: Builder(builder: (context) {
            return SingleChildScrollView(
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: [
                      ElevatedButton(
                        onPressed: () {
                          ypay.payment(
                                  displayType: DisplayTypes.MODAL,
                                  context: context) ??
                              Container();
                        },
                        child: const Text("Open dialog"),
                      ),
                    ],
                  ),
                  ypay.payment() ?? Container(),
                ],
              ),
            );
          }),
        ),
      ),
    );
  }
}
3
likes
120
points
167
downloads

Publisher

unverified uploader

Weekly Downloads

Easy payment api for online systems. It's available for any platform.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

clipboard, flutter, flutter_web_plugins, http, pinput, plugin_platform_interface, web

More

Packages that depend on api_payment