Stripe: A Fully Integrated Suite of Payments Products
Agenda
- What actually Stripe is?
- Creating Stripe Account & Getting API Key
- Authentication
- How to install the client library?
- How to install stripe using compose?
- Core Resources
- Tokens
- Customers
- Charges
- Error Handling
What Actually Stripe Is?
Stripe is a platform that creates products for online payment.
Stripe’s products power payments for online and in-person retailers, subscriptions, businesses, software platforms, and marketplaces.
Stripe provides APIs which facilitate online payment to web applications and mobile applications.
Creating an Account and Getting an API key
To start with Stripe, a Stripe account is needed. After Signing up or signing in, Stripe provides a dashboard where all the transaction details, supports, Test API key, Live API Key, etc. available.
- API key: API Key is the way which is used to authenticate the request to make payment.
- There are two types of API keys.
Test API Key Test API Key is used for testing purposes. It won’t communicate with your bank networks. | Live API Key Live API Key is used on the production level where payments are actually made. |
- Both API Keys are available on the dashboard where the stripe login page redirects after a successful login or sign-up.
- The test key is easily available on the dashboard, just copy the test key and set it in the application and enjoy the online payment feature at the testing level.
- To implement Live API Key in the product Stripe accounts need to be activated. To activate an account, Stripe needs some valid information about the product or services that stripe is implementing.
Authentication
- Each request to make a payment using Stripe is Authenticated by API Key. This key does so many things like-
- It differentiates payment requests. In simple words, the API key is unique to every stripe customer. It tells the stripe server that the current coming payment request belongs to which stripe customer otherwise someone else payment will go to someone’s account.
- Stripe server uses API to recognize the request that is coming from the Stripe client (Web application), validate that, and do further processes to make a payment request successful.
- Test API Key has the prefix “sk_test _“
Whereas the Live API key has the prefix “sk_live_”.
Creating a Stripe Client Object which takes API Key as an argument whether it is a Test API key or Live API Key.
$stripeClient = new \Stripe\StripeClient("sk_test_51I1UreFwExyTgnhXgeQQXaKHHHemLhl6HKM2JeSyV9pyF7P4B1Dleo3WGKWYSbN3RACaY5C8AoHypxrkPtYtJwRf002LHooBSF");
Core Resources
- Tokens
o Tokenization is the process Stripe uses to collect sensitive card or bank account details, or personally identifiable information, directly from customers in a secure manner. A token representing this information is returned to your server to use.
$stripeClient = new \Stripe\StripeClient( 'sk_test_51I1UreFwExyTgnhXgeQQXaKHHHemLhl6HKM2JeSyV9pyF7P4B1Dleo3WGKWYSbN3RACaY5C8AoHypxrkPtYtJwRf002LHooBSF');$stripeClient ->tokens->create([ 'card' => [ 'number' => '4242424242424242', 'exp_month' => 12, 'exp_year' => 2021, 'cvc' => '314', ],]);
Customer
o Customer Objects allow you to perform recurring charges, and to track multiple charges, that are associated with the same customer. The API allows you to create, delete, and update your customers.
$stripeClient = new \Stripe\StripeClient( 'sk_test_51I1UreFwExyTgnhXgeQQXaKHHHemLhl6HKM2JeSyV9pyF7P4B1Dleo3WGKWYSbN3RACaY5C8AoHypxrkPtYtJwRf002LHooBSF');$stripeClient ->customers->create([ “description”=>”First time payment”,“email”=>”[email protected]”,“name”=>”Anuj Pathak”,“phone”=>”987643211”,“payment_method”=>”card”]]);
Contact Us for Custom Software Platforms and Marketplaces Development