Skip to content

Commit

Permalink
Updates Demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Benny Powers committed Jan 17, 2018
1 parent e90a86e commit 126e25e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
25 changes: 8 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,19 @@ You should make sure to load stripe.js on your app's index.html, as per Stripe's
```
-->
```html
<custom-style>
<style>
html {
--stripe-elements-base-color: var(--paper-grey-700);
--stripe-elements-base-text-transform: uppercase;
--stripe-elements-base-font-family: 'Georgia';
--stripe-elements-base-font-style: italic;
--stripe-elements-element: {
padding: 14px;
background-color: #c0fefe;
}
}
</style>
</custom-style>
<p>Insert a test key to create the element, then use a <a href="https://stripe.com/docs/testing#cards">test card</a> to generate a token.</p>

<paper-input label="Stripe Publishable Key" value="{{key}}"></paper-input>

<stripe-elements id="stripe" publishable-key="[[key]]" token="{{token}}"></stripe-elements>
<div style="display:flex;">

<paper-button onclick="stripe.submit();"></paper-button>
<stripe-elements id="stripe" stripe-ready="{{ready}}" publishable-key="[[key]]" token="{{token}}"></stripe-elements>

<show-json hide-copy-button json="[[token]]"></show-json>
<paper-button disabled="[[!ready]]" onclick="stripe.submit();">Get Token</paper-button>

</div>

<paper-toast opened="[[token]]" text="Token received for 💳 [[token.card.last4]]! 🤑"></paper-toast>
```

## Styling
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"web-component-tester": "^6.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
"paper-input": "PolymerElements/paper-input#^2.0.0",
"show-json": "ryanburns23/show-json#^2"
"show-json": "ryanburns23/show-json#^2",
"paper-button": "PolymerElements/paper-button#^2.0.0"
}
}
14 changes: 12 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,24 @@ <h3>Basic stripe-elements demo</h3>
background-color: #c0fefe;
}
}
.form {
display: flex;
}
</style>
</custom-style>

<p>Insert a test key to create the element, then use a <a href="https://stripe.com/docs/testing#cards">test card</a> to generate a token.</p>

<paper-input label="Stripe Publishable Key" value="{{key}}"></paper-input>

<stripe-elements id="stripe" publishable-key="[[key]]" token="{{token}}"></stripe-elements>
<div class="form">

<stripe-elements id="stripe" stripe-ready="{{ready}}" publishable-key="[[key]]" token="{{token}}"></stripe-elements>

<paper-button disabled="[[!ready]]" onclick="stripe.submit();">Get Token</paper-button>

</div>

<paper-button onclick="stripe.submit();"></paper-button>

<show-json hide-copy-button json="[[token]]"></show-json>
</template>
Expand Down

0 comments on commit 126e25e

Please sign in to comment.