Stripe has a cornucopia of APIs that deal with payments. You can do everything from simple charges to order management. You can even use it as a marketplace, where you connect payments from one source to another, making you the middleman for such transactions.
On top of this, Stripe’s APIs are fairly spread out, each endpoint following the REST principles where applicable. Reading through all that can be daunting at times, so we have attempted to boil it down to some simple steps
Doing a one-off charge
This way you can make simple transaction without remembering any details of your customer.
-
Get the customer’s card details TOKENised first. Tokenisation means you get an ID which can be used to reference the card in use. Using the token means you won’t be subject to rigorous PCI complience reviews (you aren’t fully off the hook though!). At this point the only thing that happened is that the card details have been registered with Stripe.
-
With the token, you can create a CHARGE. Charging the card will actually take money off the account - whether it’s through a one-step auth+capture or 2 separate calls that’s up to you. You will receive back a CHARGE object on this call, which includes important information about the transaction: The result from Stripe, the issuer (the institution that gave the card to the customer, i.e. the issuing bank, or the card schemes themselves) and acquirer (the institution that takes the money off the card). Each of these parties have a say in the outcome of a transaction, and all three’s `OK` is needed to get a successful charge completed.
Saving and reusing the customer details
Use this flow to remember customer details (including card / bank account details).
-
Now, before the CHARGE you can create a CUSTOMER object in stripe. This customer object can be used in any later action on the Stripe APIs, making it easier to reference the person’s details (billing, delivery, email, etc.) and payment options. You can add and store multiple cards & bank accounts on a customer object!
-
In your CHARGE request now you will use the TOKEN as the source and the CUSTOMER ID as well. This way you can later review all transactions in your dashboard (or by listing all CHARGES using the REST API)