npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

paypal-invoices

v1.5.0

Published

Library for Paypal Invoice API

Downloads

29

Readme

paypal-invoices

An api wrapper for paypal 2.0 invoices.

Installing

npm i paypal-invoices

Getting Started

const { Invoices } = require('paypal-invoices')

const invoice = {...}

const main = async () => {
  // Create a new API instance
  const api = new Invoices(CLIENT_ID, CLIENT_SECRET)
  // Or a sandbox api
  // const api = new Invoices(CLIENT_ID, CLIENT_SECRET, true)

  // Initialize the API
  try {
    await api.initialize();
  } catch (e) {
    console.log("Could not initialize");
    return;
  }

  // Get the next Invoice number
  const invoiceNum = await api.generateInvoiceNumber();

  // Create a new Invoice draft
  const link = await api.createDraftInvoice(/* Invoice Object*/);

  // Get the created invoice
  const invoiceDraft = await api.getInvoiceByLink(link);

  // Send the new Invoice to the recipient
  await api.sendInvoice(invoiceDraft.id);
};

main();

Logging

To enabled request logging, add the following environment variable.

PP_INVOICER:LOG=true

PayPal official docs

Roadmap

  • ~~OAuth token~~
    • ~~holding~~
    • ~~refreshing~~
      • ~~Refresh on near expire~~
  • ~~Generate invoice number~~
  • ~~Create draft invoice~~
  • ~~List invoices~~
  • ~~Delete invoice~~
  • ~~Fully update invoice~~
  • ~~Show invoice details~~
  • ~~Cancel sent invoice~~
  • ~~Generate QR code~~
  • ~~Record payment for invoice~~
  • ~~Delete external payment~~
  • ~~Record refund for invoice~~
  • ~~Delete external refund~~
  • ~~Send invoice reminder~~
  • ~~Send invoice~~
  • ~~Search invoices~~
    • ~~Search for invoices~~
  • Templates
    • Create template
    • List templates
    • Delete template
    • Fully update template
    • Show template details
  • Common Object Definitions
    • 202_response
    • ~~address_details~~
    • address_portable
    • address_portable_postal_code_validation
    • aggregated_discount
    • ~~amount_range~~
    • amount_summary_detail
    • ~~amount_with_breakdown~~
    • ~~billing_info~~
    • business_name
    • business_name_validation
    • configuration
    • contact_information
    • country_code
    • currency_code
    • custom_amount
    • date_no_time
    • ~~date_range~~
    • date_time
    • ~~date_time_range~~
    • ~~detail~~
    • ~~discount~~
    • email_address
    • error
    • error_details
    • field
    • file_reference
    • ~~invoice~~
    • invoice_creation_flow
    • ~~invoice_detail~~
    • invoice_number
    • ~~invoice_payment_term~~
    • ~~invoice_status~~
    • invoicer_info
    • invoices
    • item
    • language
    • ~~link_description~~
    • metadata
    • money
    • ~~name~~
    • name_validation
    • notification
    • partial_payment
    • payment_detail
    • payment_method
    • payment_reference
    • payment_term
    • payment_term_type
    • payment_type
    • payments
    • percentage
    • ~~phone~~
    • phone_detail
    • phone_type
    • qr_config
    • recipient_info
    • refund_detail
    • refund_reference
    • refunds
    • search_data
    • shipping_cost
    • tax
    • template
    • template_configuration
    • template_detail
    • template_display_preference
    • template_info
    • template_item_field
    • template_item_setting
    • template_metadata
    • template_settings
    • template_subtotal_field
    • template_subtotal_setting
    • templates
    • unit_of_measure

Post-Complete Roadmap

  • Data Validation

Dependencies