📜 ⬆️ ⬇️

stripe - pay online for programmers

I tried a very interesting start - up service for receiving payments by stripe plastic cards, based in San Francisco.

stripe blueprints

Judging by their blog, they opened recently, according to information on the Internet, in December 2011. It is noteworthy that among the investors of this service are the three most influential venture capital funds of the Silicon Valley (Sequoia Capital, Y Combinator and Andreessen Horowitz), as well as Peter Thiel and Elon Musk, who are the founders of PayPal. Such a company of investors immediately draws attention to the project.

')

Ideology


They argue that the complexity of payments on the Internet lies not in finance, but in code, that their service is simple and created by programmers for programmers, and that they will not need to use payment aggregators. They solve all the problems of card payments, including storing card data, recurring payments and withdrawals to your bank account. They say that they cooperate with several of the best financial institutions in the world.

stripe api cloud

I created an account there and decided to try to screw the payment through this service.
For the impatient: you can try it here , the sources of what works there can be viewed here: index.php , pay.php and stripe 's php- lib.

Impressions


I must admit that, as a developer, I was very pleased with their service. I will try to describe why:

Security


I noticed that they had a very interesting security solution; it concerns the painful topic of storing and transferring plastic card data (cvc, etc.). They offer to take the buyer's card data on the store's page, but the store does not send them anywhere, but calls the method of creating a token based on the card data and the public key of the account that actually calls java-script from their server. As a result, the store receives a token that can be sent and saved, it can only be decrypted on stripe servers (and in the event of a leak, the token can only be paid to the specified store). I think this is an interesting and secure solution: the transfer of open private data does not occur, all encryption occurs on the client (in the browser), and the script that lies on the stripe servers (see index.php for more details).

Code example


I will give an example of code that implements a payment of $ 10 in my test account:

<?php require_once("stripe-php/lib/Stripe.php"); Stripe::setApiKey("YOUR_API_SECRET_KEY"); // get the credit card details submitted by the form $token = $_POST['stripeToken']; // create the charge on Stripe's servers - this will charge the user's card $charge = Stripe_Charge::create(array( "amount" => 1000, // amount in cents, again "currency" => "usd", "card" => $token, "description" => "your_email@domain.com") ); ?> 

Conclusion


If I were a store and wanted to connect credit card payments, I would love to try them. But not without a spoon of tar, but rather a bucket or barrel. At the moment, they only work with US resident legal entities. True, they argue that geography will soon expand.

Who knows something interesting about them or digs them out of the documentation - add me in the comments.

Source: https://habr.com/ru/post/138869/


All Articles