paypal_sdk 0.2.1 copy "paypal_sdk: ^0.2.1" to clipboard
paypal_sdk: ^0.2.1 copied to clipboard

outdated

PayPal SDK for simplifying integration with PayPal REST APIs

Unofficial Paypal SDK https://developer.paypal.com/docs/api/overview/

Features #

APIs implemented:

  • Catalog Products

In progress:

  • Subscriptions
  • Webhooks

TODO:

  • Add Tracking
  • Billing Agreements
  • Billing Plans
  • Disputes
  • Identity
  • Invoicing
  • Orders
  • Partner Referrals
  • Payment Experience
  • Payments
  • Payouts
  • Referenced Payouts
  • Transaction Search

Getting started #

Follow the instructions here to get Sandbox account credentials

Usage #

Products API

var paypalEnvironment = PayPalEnvironment.sandbox(
    clientId: YOUR_CLIENT_ID, clientSecret: YOUR_CLIENT_SECRET);
var payPalHttpClient = PayPalHttpClient(paypalEnvironment);
var productsApi = CatalogProductsApi(payPalHttpClient);

// Get product details
try {
  var product = await productsApi.showProductDetails('product_id');
  print(product);
} catch (e) {
  print(e);
}

// List products
try {
  var productsCollection = await productsApi.listProducts();
  for (var product in productsCollection.products) {
    print(product);
  }
} catch (e) {
  print(e);
}

// Create product
try {
  var product = await productsApi.createProduct(
    name: 'Product name',
    type: Product.typeDigital,
    category: 'ONLINE_GAMING',
    description: 'Product description',
  );

  print(product);
} catch (e) {
  print(e);
}

// Update product
try {
  await productsApi.updateProduct('product_id', [
  Patch(
    op: Patch.operationReplace,
    path: '/description',
    value: 'Updated description')
  ]);
} catch (e) {
  print(e);
}

Additional information #

I will implement further APIs as time permits. Pull requests always welcome :)

19
likes
0
pub points
83%
popularity

Publisher

verified publisheromnimind.tech

PayPal SDK for simplifying integration with PayPal REST APIs

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http, json_annotation, logging

More

Packages that depend on paypal_sdk