lpe 0.0.4 copy "lpe: ^0.0.4" to clipboard
lpe: ^0.0.4 copied to clipboard

Learmond Pay Element - Paysheet built in flutter. Transposable to any app framework.

LPE (Learmond Pay Element) #

A reusable Flutter package for Stripe payment sheets, providing a simple modal interface for card, bank, Apple Pay, and Google Pay payments.

Features #

  • Modal bottom sheet UI
  • Card, US bank, EU bank, Apple Pay, Google Pay support
  • Built on stripe.
  • Easy API for payment confirmation and result handling context: context,

Quick usage #

You can either present the paysheet programmatically via LearmondPaySheet.show(...) or embed the single-line widget LearmondPayButtons into your UI. The widget renders Card / Bank buttons on the first row and Apple/Google Pay on the second row and centrally handles the pay flows.

Example (recommended):

import 'package:lpe/lpe.dart';

LearmondPayButtons(
  publishableKey: 'pk_test_...'
  clientSecret: 'pi_test_client_secret',
  merchantId: 'merchant.com.yourdomain',
  amount: '10.00',
  onResult: (r) { /* handle */ },
),

Where to put the widget #

Place LearmondPayButtons in your checkout screen or checkout form where your user can see common payment options—typically beneath the order-total and above the confirm button. Example:

Column(
  children: [
    // ... cart/summary widgets ...
    LearmondPayButtons(...),
    ElevatedButton(onPressed: _placeOrder, child: Text('Place Order')),
  ],
)

The widget wires the pay buttons to both the Stripe paysheet and the native Apple/Google pay flows and returns the result via onResult for unified handling.

Programmatic / custom buttons #

If you want to use custom-styled buttons instead of LearmondPayButtons, call the paysheet or native bridge directly. Typical steps:

  1. For card/bank flows, create a PaymentIntent on your server and get the client_secret.
  2. Call LearmondPaySheet.show(...) with the clientSecret.
  3. For Apple/Google Pay, call LearmondNativePay.showNativePay(...) and send the returned token to your server for finalization.

See lpe/INSTRUCTIONS.md for complete examples and server integration guidance.


## Installation
Add to your `pubspec.yaml`:
```yaml
dependencies:
  lpe:
    path: ../LPE
  flutter_inappwebview: ^6.0.0

import 'package:lpe/learmond_pay_element.dart';

final result = await LearmondPaySheet.show( context: context, publishableKey: 'pk_test_...', clientSecret: 'pi_...secret...', method: 'card', // or 'us_bank', 'apple_pay', 'google_pay' title: 'Pay $10.00', ); if (result.success) { // Payment succeeded }


## API
- `LearmondPaySheet.show(...)` — Shows the payment sheet and returns a `PaymentResult`.
- Supports custom titles, amounts, and button labels.

## Example
See `example/` for a full integration example.

## License
MIT

## Author
The Learmond Corporation
0
likes
0
points
541
downloads

Publisher

verified publisherthelearmondcorporation.com

Weekly Downloads

Learmond Pay Element - Paysheet built in flutter. Transposable to any app framework.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_inappwebview, flutter_test

More

Packages that depend on lpe

Packages that implement lpe