juicyway_flutter 1.3.0 copy "juicyway_flutter: ^1.3.0" to clipboard
juicyway_flutter: ^1.3.0 copied to clipboard

Official Juicyway Flutter SDK

img

Official Juicyway Flutter SDK

style: flutterlints License: MIT

Introduction #

JuicywayCheckoutView integrates Juicyway checkout into Flutter apps via a modal WebView wrapper around the Juicyway checkout URL.

Screen Shots #

Installation #

Add the dependency:

dependencies:
  juicyway_flutter: ^1.3.0 # or the latest compatible version from pub.dev

Then run:

flutter pub get

Usage #

Import the package:

import 'package:juicyway_flutter/juicyway_flutter.dart';

Example #

const options = JuicyWayChekoutOptions(
  amount: 6000,
  currency: JuicyWayCurrency.USD,
  environment: JuicyWayEnvironment.production,
  accountId: 'YOUR_ACCOUNT_ID',
  key: 'YOUR_KEY',
  customer: JuicywayCustomer(
    billingAddress: JuicywayBillingAddress(
      city: 'Ikeja',
      countryCode: 'NG',
      line1: 'Sample Address here...',
      state: 'Lagos',
      zipCode: '101251',
    ),
    email: 'test@example.com',
    firstName: 'John',
    lastName: 'Doe',
    phoneNumber: '+234...........',
  ),
  paymentMethod: PaymentMethod.card,
);

await JuicywayCheckoutView(
  options: options,
  showLogs: true,
  onClosed: () {
    print('closed');
    Navigator.pop(context);
  },
  onSuccess: (data) {
    print(data.toString());
    Navigator.pop(context);
  },
  onError: print,
).show(context);

Checkout options (JuicyWayChekoutOptions) #

Set environment to JuicyWayEnvironment.sandbox, JuicyWayEnvironment.staging, or JuicyWayEnvironment.production for the Juicyway environment you are targeting.

Required fields typically include amount, key, paymentMethod, and customer / account identifiers as required by your integration.

Widget parameters (JuicywayCheckoutView) #

  • options: JuicyWayChekoutOptions for the checkout session.

  • showLogs (optional): Log WebView/checkout activity. Defaults to false.

  • onClosed (optional): Called when the checkout UI is dismissed.

  • onSuccess (optional): Called on a successful payment; receives the payload from the checkout flow.

  • onError (optional): Called when an error is reported during checkout.

Additional resources #

See Juicyway documentation and this package’s API docs on pub.dev for the latest types and callbacks.

0
likes
150
points
139
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Official Juicyway Flutter SDK

Homepage
Repository (GitLab)
View/report issues

License

MIT (license)

Dependencies

connectivity_plus, equatable, flutter, url_launcher, uuid, webview_flutter

More

Packages that depend on juicyway_flutter