Skip to content

Commit

Permalink
Fix examples (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-stripe authored Apr 20, 2020
1 parent 685d92f commit 80f3800
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 933 deletions.
3 changes: 3 additions & 0 deletions examples/parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
"@babel/preset-env": "^7.7.7",
"@babel/runtime": "^7.7.7",
"parcel-bundler": "^1.12.4"
},
"dependencies": {
"@stripe/stripe-js": "^1.4.0"
}
}
8 changes: 4 additions & 4 deletions examples/parcel/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {loadStripe} from '@stripe/stripe-js';

import './styles.css';
import {loadStripe} from '../../../src';

(async () => {
// setup DOM
Expand All @@ -13,11 +14,10 @@ import {loadStripe} from '../../../src';
rootNode.appendChild(form);

// setup Stripe.js and Elements
const Stripe = await loadStripe();
const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const elements = stripe.elements();

// setup Card Element
// setup card Element
const cardElement = elements.create('card', {});
cardElement.mount(cardWrapper);

Expand Down
5 changes: 5 additions & 0 deletions examples/parcel/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,11 @@
"@parcel/utils" "^1.11.0"
physical-cpu-count "^2.0.0"

"@stripe/stripe-js@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.4.0.tgz#287b0fb653d9a34321dfa8b52f8c99b7983f2eda"
integrity sha512-ZvrD4s0T2VcZLXIll0eO9YO/Gnr2sgHgycqvSVN5A3ok/USesD9SL6j1vX9wTy7DVbm0vvQQE01Jap6PjP1IVw==

"@types/q@^1.5.1":
version "1.5.2"
resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.2.tgz#690a1475b84f2a884fd07cd797c00f5f31356ea8"
Expand Down
1 change: 1 addition & 0 deletions examples/rollup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
]
},
"dependencies": {
"@stripe/stripe-js": "^1.4.0",
"express": "^4.17.1"
},
"devDependencies": {
Expand Down
7 changes: 3 additions & 4 deletions examples/rollup/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {loadStripe} from '../../../src';
import {loadStripe} from '@stripe/stripe-js';

(async () => {
// setup DOM
Expand All @@ -12,11 +12,10 @@ import {loadStripe} from '../../../src';
rootNode.appendChild(form);

// setup Stripe.js and Elements
const Stripe = await loadStripe();
const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const elements = stripe.elements();

// setup Card Element
// setup card Element
const cardElement = elements.create('card', {});
cardElement.mount(cardWrapper);

Expand Down
5 changes: 5 additions & 0 deletions examples/rollup/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@
dependencies:
estree-walker "^0.6.1"

"@stripe/stripe-js@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.4.0.tgz#287b0fb653d9a34321dfa8b52f8c99b7983f2eda"
integrity sha512-ZvrD4s0T2VcZLXIll0eO9YO/Gnr2sgHgycqvSVN5A3ok/USesD9SL6j1vX9wTy7DVbm0vvQQE01Jap6PjP1IVw==

"@types/estree@*":
version "0.0.41"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.41.tgz#fd90754150b57432b72bf560530500597ff04421"
Expand Down
3 changes: 3 additions & 0 deletions examples/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.1"
},
"dependencies": {
"@stripe/stripe-js": "^1.4.0"
}
}
8 changes: 4 additions & 4 deletions examples/webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {loadStripe} from '@stripe/stripe-js';

import './styles.css';
import {loadStripe} from '../../../src';

(async () => {
// setup DOM
Expand All @@ -13,11 +14,10 @@ import {loadStripe} from '../../../src';
rootNode.appendChild(form);

// setup Stripe.js and Elements
const Stripe = await loadStripe();
const stripe = Stripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx');
const elements = stripe.elements();

// setup Card Element
// setup card Element
const cardElement = elements.create('card', {});
cardElement.mount(cardWrapper);

Expand Down
Loading

0 comments on commit 80f3800

Please sign in to comment.