porto-sap / stripe
Porto-SAP Container for Hello-API.
Installs: 257
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/porto-sap/stripe
Requires
- cartalyst/stripe-laravel: 5.0.*
- composer/installers: ~1.0
This package is not auto-updated.
Last update: 2016-11-29 20:10:15 UTC
README
How it works:
- the front-end app shows the stripe form (can use "Stripe Checkout" or "Stripe.js").
- the user fill the form (enter his credit card details..).
- the front-end app send a request to the stripe api to create a user with credit card.
- the stripe api returns data including (customer_id, card_id, card_funding, card_last_digits, card_fingerprint) to the front-end app.
- the front-end app send the stripe api response data to the back-end (POST https://api.hello.com/stripes) to be stored.
- the user select an item to buy.
- the front-end sends the item ID "item_id" to the back-end (POST https://api.hello.com/items/purchase).
- the back-end finds the logged in user and gets his stripe customer_id, and finds the item price by its ID, for the next step.
- the back-end send a request to the stripe api to charge the user (using the customer id and the item amount).
- the back-end api returns OK response informing the front-end app that the user was charged.