lpe_sdk 4.1.0+8 copy "lpe_sdk: ^4.1.0+8" to clipboard
lpe_sdk: ^4.1.0+8 copied to clipboard

Learmond Pay Element (LPE) SDK – A reusable Flutter package supporting card, bank, Apple Pay, and Google Pay in a single API.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:lpe_sdk/lpe_sdk.dart';
// Removed unused imports: dart:convert and http; add them when implementing server calls

void main() {
  // Initialize default merchant identifiers for the example app so the
  // `LearmondPayButtons` and native pay flows have default values if not
  // provided explicitly by the caller.
  LpeSDKConfig.init(
    appleMerchantId: 'merchant.com.example',
    googleMerchantId: 'yourGatewayMerchantId',
  );
  runApp(const ExampleApp());
}

// Note: You may call `LpeSDKConfig.init(...)` at app startup to set defaults
// for Apple/Google merchant ids. Example usage is shown above in `main()`.

class ExampleApp extends StatelessWidget {
  const ExampleApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'LPE SDK Example',
      theme: ThemeData(primarySwatch: Colors.deepPurple),
      home: const ExampleHome(),
    );
  }
}

class ExampleHome extends StatelessWidget {
  const ExampleHome({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final args = buildMerchantArgs(
      merchantName: 'Example Merchant',
      merchantInfo: 'Example Transaction',
    );

    return Scaffold(
      appBar: AppBar(title: const Text('LPE SDK Example')),
      body: Center(
        child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            LearmondApplePayButton(
              appleMerchantId:
                  LpeSDKConfig.appleMerchantId ?? 'merchant.com.example',
              merchantArgs: args,
              amount: '10.00',
              currency: 'USD',
              onResult: null,
            ),
            const SizedBox(width: 12),
            LearmondGooglePayButton(
              googleMerchantId:
                  LpeSDKConfig.googleMerchantId ?? 'yourGatewayMerchantId',
              merchantArgs: args,
              amount: '10.00',
              currency: 'USD',
              onResult: null,
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
462
downloads

Publisher

verified publisherthelearmondcorporation.com

Weekly Downloads

Learmond Pay Element (LPE) SDK – A reusable Flutter package supporting card, bank, Apple Pay, and Google Pay in a single API.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

flutter, flutter_stripe, flutter_test, flutter_web_plugins, lpe, paysheet, webview_flutter

More

Packages that depend on lpe_sdk

Packages that implement lpe_sdk