Skip to main content

checkout_flutter 1.0.5 copy "checkout_flutter: ^1.0.5" to clipboard
checkout_flutter: ^1.0.5 copied to clipboard

Accept a payment with one or multiple payment methods securely. Powered by Tap Payments.

example/README.md

checkout_flutter examples #

Two example apps that run the same Dart code and differ only in how iOS pulls in Checkout-IOS:

App iOS integration
spm_example Swift Package Manager
cocoapods_example CocoaPods

The screens, settings and unit tests live in shared (package:checkout_example); each app's lib/main.dart only starts it.

Add your Tap sandbox key first (Add your keys), then:

cd spm_example
FLUTTER_SWIFT_PACKAGE_MANAGER=true flutter run --dart-define=TAP_PUBLIC_KEY=pk_test_...
cd cocoapods_example
flutter run --dart-define=TAP_PUBLIC_KEY=pk_test_...

See Run the SPM example, Run the CocoaPods example and Tests in the plugin README for the details.

Add your keys #

The apps need a Tap sandbox public key (pk_test_...). Keys are never committed. Give the apps a key in one of these ways:

  1. On the command line (nothing to edit). Add TAP_MERCHANT_ID only if you need a specific merchant:

    flutter run --dart-define=TAP_PUBLIC_KEY=pk_test_... --dart-define=TAP_MERCHANT_ID=...
    
  2. In code. Replace the placeholder YOUR_TAP_PUBLIC_KEY in shared/lib/src/keys.dart. Both apps read it from there; don't commit the change.

  3. Several saved keys to switch between in the app. From example/, copy the example file and fill it in:

    cp shared/assets/keys.local.example.json shared/assets/keys.local.json
    
    [
      { "name": "My sandbox key", "publicKey": "pk_test_...", "merchantId": "" },
      { "name": "Another merchant", "publicKey": "pk_test_...", "merchantId": "" }
    ]
    

    keys.local.json is gitignored. Debug builds then show Settings > Saved Keys; pick one and it fills in Public Key and Merchant Id. Rebuild (or hot restart) after editing the file.

  4. In the app, under Settings > SDK Configuration > Public Key. Settings are saved on the device.

The key must be registered with Tap for the app's bundle id / package name. Both example apps use the bundle id com.example.checkoutFlutterExample (iOS) and the package name com.example.checkout_flutter_example (Android); register them for your key, or change them to ones your key is registered for.

0
likes
160
points
974
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Accept a payment with one or multiple payment methods securely. Powered by Tap Payments.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on checkout_flutter

Packages that implement checkout_flutter