GithubHelp home page GithubHelp logo

vinniegarcia / paypal-incontext-browserify-example Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 24 KB

example of a PayPal incontext checkout integration using browserify and browserify-shim

License: MIT License

CSS 89.67% HTML 3.04% JavaScript 7.29%

paypal-incontext-browserify-example's Introduction

PayPal In-Context Browserify Example

An example of a PayPal In-Context checkout integration using browserify and browserify-shim

Getting started

  1. Install browserify and browserify-shim into your project:
npm install browserify browserify-shim --save-dev
  1. In your package.json, add a browserify key containing:
"browserify": {
  "transform": [
    "browserify-shim"
  ]
}

This tells browserify to use the browserify-shim. 3. Add a browserify-shim key to package.json so you can use PayPal In-Context from your bundle:

"browserify-shim": {
  "paypal-incontext": "global:paypal"
}
  1. In your HTML file, add references to PayPal's checkout.js and your bundle.
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script src="path/to/dist/js/bundle.js"></script>
  1. In your code, use the paypal-incontext module you defined previously:
var paypal = require('paypal-incontext');
paypal.checkout.setup('MERCHANT_ID' {
  options: {}
});
  1. Bundle your code:
browserify -d src/ -o dist/js/bundle.js
  1. Take orders and make money! ๐Ÿ’ฐ๐Ÿ’ณ๐Ÿ’ธ

paypal-incontext-browserify-example's People

Contributors

vinniegarcia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.