skip to Main Content

I just started on my Flutter journey and need to integrate Paypal payments into my app. However, there seems to be no standard Flutter API provided by Paypal and I couldn’t find an acceptable answer anywhere.

4

Answers


  1. You can achieve this using WebView.
    PayPal provides some APIs to do transaction. Using those APIs you can achieve this.

    Read this article

    Paypal Payment Gateway Integration in Flutter

    This article demonstrates the steps you need to follow.

    Login or Signup to reply.
  2. Braintree is the payment processor provided by Paypal to accept safe and secure payments with feature Drop-in UI and custom UI design.
    It also provides the Apple Pay, Google Pay feature to accept the payments.

    1. Open Braintree Sandbox Account

    2. Get the tokenization key from Braintree account

    3. Add the flutter_braintree dependencies in your pubspec.yaml file

      dependencies:
      flutter_braintree: ^0.5.3+1

    4. Create custom UI

    Paypal Credit card: accept the followings from user

    a. Card Number

    b. Expiration Month

    c. Expiration Year

    Create a Braintree Request

    final request = BraintreeCreditCardRequest(
    
      card number: '4115511771161116',
    
      expiration month: '02',
    
      expiration year: '2020',
    
    );
    

    Ask Braintree to tokenization it

    BraintreePaymentMethodNonce result = await Braintree.tokenizeCreditCard(
    
       '<Insert your tokenization key>',
    
       request,
    
    );
    

    For PayPal

    create Paypal request

    final request = BraintreePayPalRequest(amount: '50.00');
    

    then launch Paypal Request

    BraintreePaymentMethodNonce result = await Braintree.requestPaypalNonce(
    
       "Insert your tokenization key or client token here",
    
       request,
    
    );
    
    1. Get the NONCE from Braintree after successful payment and get the failure message on cancel the Paypal Payment by the user.

    2. Save this NONCE for future reference in your database

    Login or Signup to reply.
  3. you will find to do in this package
    flutter PayPal package

    Login or Signup to reply.
  4. There is a package in pub.dev called flutter_paypal https://pub.dev/packages/flutter_paypal
    You can also check this youtube video, he cleared up everything that how to use it or how it works
    https://youtu.be/QfLPdh771fA

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search