Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lilessam/stripecheckoutcustomform
Node Module to help you creating custom Stripe CheckOut Form Without Writing Any JS Code.
https://github.com/lilessam/stripecheckoutcustomform
Last synced: about 1 month ago
JSON representation
Node Module to help you creating custom Stripe CheckOut Form Without Writing Any JS Code.
- Host: GitHub
- URL: https://github.com/lilessam/stripecheckoutcustomform
- Owner: lilessam
- Created: 2017-08-16T14:26:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-21T09:04:08.000Z (over 7 years ago)
- Last Synced: 2024-11-11T15:33:08.848Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# StripeCheckoutCustomForm
Node Module to help you you creating custom Stripe CheckOut Form Without Writing Any JS Code.### How to install
##### Using NPM
`npm install stripe-checkout-custom-form`If you got any error using Laravel Mix delete `node_modules` folder and run `npm install` and everything should work just perfect.
##### using Yarn (Recommended)
`yarn add stripe-checkout-custom-form`### How does it work
Include Stripe JS First
```html```
Application JS File
```javascript
//The div id which the card element will be injected to
var cardElementID = 'card-element'
//The form id which will contain the stripe checkout form
var formElementID = 'payment-form'
//The name attribute of the card holder full name field
var fullNameInputName = 'card_holder_name'
//Your stripe public key
var stripeKey = 'pk_test_...'require('stripe-checkout-custom-form')(cardElementID, formElementID, fullNameInputName, stripeKey)
```
HTML File
```html
```
Then in your form post action in the backend you will get a `stripeToken` variable which you can use to create a customer or charge the card.##### Notice: All JS must be loaded before the form loading.
That's it !Please don't hesitate to create a pull request Or post an issue if found, Thanks.