uplinespay 0.0.9 copy "uplinespay: ^0.0.9" to clipboard
uplinespay: ^0.0.9 copied to clipboard

Accept payments in your Flutter app with ease by using UplinesPay. With this SDK, you can quickly and safely accept payments through Apple Pay and Credit Card (with managed 3DS step).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:uplinespay/src/widgets/payment_methods.dart';
import 'package:uplinespay/uplinespay.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: FastFoodRestaurant(),
    );
  }
}

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

  @override
  State<FastFoodRestaurant> createState() => _FastFoodRestaurantState();
}

class _FastFoodRestaurantState extends State<FastFoodRestaurant> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        resizeToAvoidBottomInset: true,
        body: Center(
          child: SizedBox(
            width: MediaQuery.of(context).size.width * 0.9,
            child: ListView(
              children: [
                const Padding(
                  padding:
                      EdgeInsets.only(left: 20, bottom: 20, right: 20, top: 20),
                  child: Text(
                    "Checkout",
                    style: TextStyle(fontSize: 22),
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.only(bottom: 8.0),
                  child: ClipRRect(
                    borderRadius: BorderRadius.circular(8),
                    child: Image.asset(
                      'assets/shawarma.jpg',
                      fit: BoxFit.cover,
                      width: MediaQuery.of(context).size.width,
                    ),
                  ),
                ),
                UplinesPayButton(
                  paymentConfig: PaymentConfig(
                    // TODO get it from vendor app at Uplines platform
                    publishableApiKey: 'TODO',
                    // pass the amount (e.g. 10 SAR)
                    amount: 100 * 10,
                    // pass the description
                    description: 'order #1324 (Big Shawarma Sandwich)',
                  ),
                  onPaymentResult: (paymentResult) {
                    // Do something with paymentResult
                  },
                ),
              ],
            ),
          ),
        ));
  }
}
1
likes
130
points
59
downloads

Publisher

unverified uploader

Weekly Downloads

Accept payments in your Flutter app with ease by using UplinesPay. With this SDK, you can quickly and safely accept payments through Apple Pay and Credit Card (with managed 3DS step).

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, http, pay, plugin_platform_interface, web, webview_flutter

More

Packages that depend on uplinespay