Simple Paypal SDK for Flutter.
Usage
This package provides three main Features. In order to handle payment you must need to have webview_flutter.
You can check in the /example
folder.
import 'package:flutter_paypal_sdk/flutter_paypal_sdk.dart';
Features
Initiate FlutterPaypalSDK
FlutterPaypalSDK sdk = FlutterPaypalSDK(
clientId:'yourClientId',
clientSecret: 'yourSecretId',
mode: Mode.sandbox, // this will use sandbox environment
);
Authentication
AccessToken accessToken = await sdk.getAccessToken();
Create Payment
Payment payment = await sdk.createPayment(
transactions,
accessToken.token!,
);
Please refer to PayPal Payment API for more detail on required params and payment response.
Execute Payment
Payment payment = await sdk.executePayment(
executeUrl,
payerId,
accessToken,
);