img Official Juicyway Flutter SDK

style: flutterlints License: MIT

Introduction

JuicywayCheckoutView is a Flutter widget designed to facilitate the integration of Juicyway payment services into your mobile applications. This widget streamlines the checkout process by providing a pre-built UI for payment transactions.

Screen Shots

Installation

To use JuicywayCheckoutView in your Flutter project, add the following dependency to your pubspec.yaml file:

dependencies:
  juicyway_flutter: ^1.0.0 # Replace with the latest version

Then run:

flutter pub get

Usage

Import the package in your Dart file:

import 'package:juicyway_flutter/juicyway_flutter.dart';

Example


    const options = JuicyWayChekoutOptions(
        amount: 6000,
        currency: JuicyWayCurrency.USD,
        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);

Parameters

  • config (options): An instance of JuicyWayChekoutOptions containing the necessary information for the payment transaction.

  • showLogs (optional): A boolean flag indicating whether to show logs during the checkout process. Default is false.

  • onClosed (optional): A callback function that gets triggered when the checkout view is closed.

  • onSuccess (optional): A callback function that gets triggered when the payment transaction is successful. It receives a dynamic parameter representing the success response.

  • onError (optional): A callback function that gets triggered when an error occurs during the checkout process. It receives an error message as a parameter.

Conclusion

With JuicywayCheckoutView, you can easily integrate Juicyway payments into your Flutter application, providing a seamless and secure payment experience for your users.

Make sure to replace the version number in the installation section with the latest version available. Additionally, always refer to the official documentation of the juicyway_flutter package for any updates or changes.

Feel free to modify the formatting or content according to your specific needs.

Libraries

juicyway_flutter
Official Juicyway Flutter SDK