Click on Pay
StripeCheckout opens modal dialog.
You input in modal dialog the CC number, address if any, etc.
StripeCheckout sends from the modal dialog the information
to Stripe. Stripe checks your credit card, does whatever it wants,
and gives your site a "token" back.
Then, StripeCheckout calls the token method that you specified in the
stipe_instance.
That method is in charge of telling the server:
- what you bought
- how much it costed
- the all-important token, which authorizes the purchase.
We get above call from browser with:
- token
- cart, and total to be paid.
So, we need to verify that the token is legitimate.
We send it to Stripe, along with our private (server) key, and
along with the total to be charged to the card.
Stripe will tell us whether the transaction is ok or not.