1.1.6 • Published 3 years ago

gatsby-plugin-paypal v1.1.6

Weekly downloads
23
License
ISC
Repository
github
Last release
3 years ago

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

NameTypeDescriptionDefault
amountstringThe amount value of the transaction.
currencystringThe 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 optionsUSD
createOrder(data, actions) => anySee createOrder
onApprove(data, actions) => anySee onApprove
onError(error) => anySee onError
onCancel(data) => anySee onCancel
onInit(data, actions) => anySee onInit
onClick() => anySee onClick
shippingPreferencestringThe 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) => anySee createSubscription
styleobjectSee Customize the PayPal Buttons{}

Contribution

Pull requests

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

4 years ago

1.0.32

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.19

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.10

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago