Git Product home page Git Product logo

flutter_paypal_checkout's Introduction

πŸŽ₯ Flutter PayPal Checkout

⚑ Best and easy way to INTEGRATE PayPal checkout in Flutter application ⚑

Main features of flutter_paypal_checkout :

  1. Simple and easy to Connect Flutter with PayPal
  2. Plug and PlayπŸš€
  3. Event HandlersπŸš€
  4. Easy to follow guide

πŸŽ– Installing

dependencies:
  flutter_paypal_checkout: ^<latest_version>

Android

in app\build.gradle

defaultConfig {
    minSdkVersion 17
    compileSdkVersion 33    
}

iOS

No extra setup is needed

Usage

⚑ Setup:

Navigator.of(context).push(MaterialPageRoute(
    builder: (BuildContext context) => 
    
    PaypalCheckout(
        sandboxMode: true,
        clientId: "CLIENT_ID",
        secretKey: "SECRET_KEY",
        returnURL: "RETURN_URL",
        cancelURL: "CANCEL_URL",
        transactions: const [
            {
                "amount": {
                    "total": '70',
                    "currency": "USD",
                    "details": {
                        "subtotal": '70',
                        "shipping": '0',
                        "shipping_discount": 0
                    }
                },
                "description": "The payment transaction description.",
                "item_list": {
                    "items": [
                        {
                            "name": "Apple",
                            "quantity": 4,
                            "price": '5',
                            "currency": "USD"
                        },
                        {
                            "name": "Pineapple",
                            "quantity": 5,
                            "price": '10',
                            "currency": "USD"
                        }
                    ],
                    // shipping address is Optional
                    "shipping_address": {
                        "recipient_name": "Raman Singh",
                        "line1": "Delhi",
                        "line2": "",
                        "city": "Delhi",
                        "country_code": "IN",
                        "postal_code": "11001",
                        "phone": "+00000000",
                        "state": "Texas"
                    },
                }
            }
        ],
        note: "PAYMENT_NOTE",
        onSuccess: (Map params) async {
            print("onSuccess: $params");
        },
        onError: (error) {
            print("onError: $error");
            Navigator.pop(context);
        },
        onCancel: () {
            print('cancelled:');
        },
    ),

));

⚑ Events

onSuccess: (Map params) async {
    print("onSuccess: $params");
},

onError: (error) {
    print("onError: $error");
}

onCancel: () {
    print('cancelled:');
}

⚑ Constructors Parameters

Parameter Type Optional Description
sandboxMode bool YES To use PayPal in Sandbox Mode. Default value = false
clientId String NO Pass the PayPal Client Id.
secretKey String NO Pass the PayPal Secret Key.
returnURL String NO Return URL on Payment Success.
cancelURL String NO Cancel URL on Payment Failed.
transactions List<dynamic> NO Transaction parameters for making payment
note String YES PayPal payment note if any.
onSuccess Function(Dynamic) YES Event will be called on Successful payment.
onError Function(Dynamic) YES Event will be called on Error/Failed payment.
onCancel Function(Dynamic) YES Event will be called on Cancelled payment.

⚑ Donate

If you like my work, you can support me buying a cup of β˜•

Copyright & License

Code and documentation Copyright 2023 SnippetCoder. Code released under the Apache License. Docs released under Creative Commons.

flutter_paypal_checkout's People

Contributors

jorbope09 avatar

Watchers

Jorbel Borrero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.