Skip to main content

waffy_sdk_flutter 0.6.0 copy "waffy_sdk_flutter: ^0.6.0" to clipboard
waffy_sdk_flutter: ^0.6.0 copied to clipboard

Official Waffy payments SDK for Flutter. Embed the Waffy checkout in your app and get success or failure callbacks.

example/example.dart

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

void main() => runApp(const MaterialApp(home: CheckoutPage()));

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

  // Get these from your backend after creating a Waffy payment.
  // The ticket expires after 5 minutes, so request it right before opening
  // this page.
  static const paymentUrl = 'https://example.com/checkout';
  static const ticket = 'PAYMENT_TICKET';

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Waffy Checkout')),
      body: WaffyPaymentWebView.ticket(
        paymentUrl: paymentUrl,
        ticket: ticket,
        onPaymentComplete: (status, message) {
          final text = status == WaffyPaymentStatus.success
              ? 'Payment succeeded'
              : 'Payment failed: $message';
          ScaffoldMessenger.of(context)
              .showSnackBar(SnackBar(content: Text(text)));
        },
      ),
    );
  }
}
0
likes
160
points
91
downloads

Documentation

API reference

Publisher

verified publisherwaffyapp.com

Weekly Downloads

Official Waffy payments SDK for Flutter. Embed the Waffy checkout in your app and get success or failure callbacks.

Homepage

Topics

#payments #checkout #webview

License

MIT (license)

Dependencies

flutter, webview_flutter

More

Packages that depend on waffy_sdk_flutter