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

gatsby-plugin-paypal

v1.1.6

Published

Add a paypal sell button to your Gatsby site.

Downloads

502

Readme

npm package npm downloads

gatsby-plugin-paypal

Add a PayPal Smart Payment Buttons to your Gatsby website easily.

Install

npm install --save gatsby-plugin-paypal

How to use Paypal plugin

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-paypal`,
      options: {
        clientId: `YOUR_CLIENT_ID`,
        currency: `EUR`, // Optional
        vault: true // Optional
      }
    }
  ]
};

Options

clientId

Your PayPal Client ID. You will find it on: https://developer.paypal.com/developer/applications/

currency

The currency of the transaction.

vault

The vault status of the transaction. If set to true:

  • Shows only funding sources that you can add to the vault
  • Set up a billing agreement, reference transaction, or subscription.

How to Use Paypal component

This is what a component using gatsby-plugin-paypal might look like:

import React from "react"
import Paypal from "gatsby-plugin-paypal"

const PaypalButton = () => (
    <Paypal 
      style={{
        shape: 'rect',
        color: 'blue',
        layout: 'horizontal',
        label: 'paypal',
      }}
      amount={10.1}
      currency="EUR"
    />
)

export default PaypalButton

Additional props of Paypal component

| Name | Type | Description | Default | | ------------------------- | ------------------------- | -------------------------------------------------------------------------------------------------- | -------------- | | amount | string | The amount value of the transaction. | | | currency | string | The currency of the transaction. The three-character ISO-4217 currency code. PayPal does not support all currencies. Warning: Uses the same value as declared in the plugin options | USD | | createOrder | (data, actions) => any | See createOrder | | | onApprove | (data, actions) => any | See onApprove | | | | onError | (error) => any | See onError | | | onCancel | (data) => any | See onCancel | | | onInit | (data, actions) => any | See onInit | | | onClick | () => any | See onClick | | | shippingPreference | string | The shipping preferences. The possible values are: -NO_SHIPPING: Redact shipping address fields from the PayPal pages. Recommended for digital goods. - GET_FROM_FILE : Use the buyer-selected shipping address. - SET_PROVIDED_ADDRESS : Use the merchant-provided address. Buyer cannot change the address on the PayPal pages. If the merchant does not pass an address, the buyer can choose the address on PayPal pages. | GET_FROM_FILE | | createSubscription | (data, actions) => any | See createSubscription | | style | object | See Customize the PayPal Buttons | {} |

Contribution

Pull requests