flutter_paypal_checkout
1.0.1, released 4 years ago by snippetcoder.com
Flutter widget that launches a PayPal checkout flow via an in‑app webview.
$ flutter pub add flutter_paypal_checkoutWhat it does
The package opens a PayPal payment page inside a WebView, lets the user complete the transaction, and returns success, error, or cancel events through callbacks. It handles sandbox and live modes and requires only client‑id and secret key configuration.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to accept PayPal payments in a Flutter app without native SDKs
- You prefer a simple plug‑and‑play widget with callback handling
Skip it when
- You require native PayPal SDK features like Apple Pay or advanced fraud protection
- You cannot expose client secret in the app for security reasons
- You need extensive UI customization beyond the provided WebView
Strengths
- Very easy to add – just a widget and callbacks
- Works on both Android and iOS out of the box
- Supports sandbox mode for testing
Weaknesses
- Relies on a WebView, which may be less performant than native SDKs
- Client secret is stored in the app, posing security concerns
- Limited customization and feature set compared to official PayPal SDKs
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Add flutter_inappwebview and http dependencies; ensure Android minSdkVersion >=17; no extra iOS configuration required
Navigator.of(context).push(MaterialPageRoute(builder: (_) => PaypalCheckout(
sandboxMode:true,
clientId:"YOUR_CLIENT_ID",
secretKey:"YOUR_SECRET_KEY",
returnURL:"YOUR_RETURN_URL",
cancelURL:"YOUR_CANCEL_URL",
transactions:[{
"amount":{"total":"70","currency":"USD","details":{"subtotal":"70","shipping":"0","shipping_discount":0}},
"description":"The payment transaction description."
}],
onSuccess:(params)=>print(params),
onError:(e)=>print(e),
onCancel:()=>print('cancelled'),
)))Alternatives
Packages that do the same job and could replace flutter_paypal_checkout.
Works with
Packages commonly used together with flutter_paypal_checkout: ones it builds on, ones built on it, and its own family.