Skip to content

This is a wrapper around native Android and IOS PayPal SDK.

License

Notifications You must be signed in to change notification settings

Blasanka/paypal_flutter_sdk

Repository files navigation

paypal_sdk_flutter

pub package

Please note that this is not official PayPal's plugin. But this uses Android and IOS native official libraries (so, nothing to worry).

try {
  PaypalSdkFlutter sdk = PaypalSdkFlutter(
    environment: Environment.sandbox,
    merchantName: "ecommerce",
    clientId: "AQlOU6B3g4hj23g4hg32jhjh5du2OEJlb7p3-2HMffsdQH49p_uw1-fw6P96BsdfdfdsZSz9bg4d6ko-hVfet6zvE",
  );
  var result = await sdk.payWithPayPal(amount: amount, description: description);
  print(result);
} on PlatformException {
  result = 'Failed to get payPal result.';
}

See example page for more info.

Implementation and available parameters for now:

  /// [environment] can be Environment.noNetwork, Environment.sandbox, and Environment.production
  final Environment environment;
  final String merchantName;
  /// [urlForPrivacyWebPage] is required if you have privacy, policy to provide
  final String urlForPrivacyWebPage;
  /// [urlForLegalWebPage] is required if you have privacy, policy to provide
  final String urlForLegalWebPage;
  final String clientId;
  /// For to buy something, secret is not must
  final String secret;

  //...

  /// [currency] default to USD
  /// [description] default to empty string ""
  Future<String> payWithPayPal({@required double amount, @required String description, String currency}) async {//..

You can get the client id from your paypal developer account dashboard.

About

This is a wrapper around native Android and IOS PayPal SDK.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published