Stripe: A Fully Integrated Suite of Payments Products | Devstringx Technologies

Devstringx Technologies
3 min readJan 5, 2021

--

Agenda

  • What actually Stripe is?
  • Creating Stripe Account & Getting API Key
  • Authentication
  • How to install client library?
  • How to install stripe using compose?
  • Core Resources

o Tokens

o Customers

o Charges

o Error Handling

What actually Stripe is?

Stripe is a platform used 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 Account and Getting API key

To start with Stripe, 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.

o API key: API Key is the way which is used to authenticate the request to make payment.

o There are two types of API Key.

Test API Key

Test API Key is used for testing purpose. It won’t communicate with your bank networks.

Live API Key

Live API Key is used on production level where payments are actually made.

o Both API Keys are available on the dashboard where stripe login page redirect after a successful log in or sign up.

o 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.

o To implement Live API Key in product Stripe accounts need to be activated. To activate an account, Stripe needs some valid information about the product or services for stripe is implementing.

Authentication

Each request to make payment using Stripe is Authenticated by API Key. This key does so many things like-

o It differentiates payment request. In simple words API key is unique to every stripe customer. It tells the stripe server that the currently coming payment request belongs to which stripe customer otherwise someone else payment will go to in someone’s account.

o Stripe server uses API to recognize the request that it is coming from Stripe client (Web application), validate that and do further process to make a payment request successful.

o Test API Key has the prefix “ sk_test _”.

o Whereas Live API key has the prefix “sk_live_”.

o 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

Token

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”=>”anujpathak@gamil.com”,

“name”=>”Anuj Pathak”,

“phone”=>”987643211”,

“payment_method”=>”card”

]

]);

Contact Us to Software Platforms and Marketplaces Development

Originally published at https://www.devstringx.com on January 5, 2021.

--

--

Devstringx Technologies
Devstringx Technologies

Written by Devstringx Technologies

Devstringx Technologies is highly recommended IT company for custom software development, mobile app development and automation testing services

No responses yet