Тёмный

Introduction to the Stripe CLI 

Stripe Developers
Подписаться 29 тыс.
Просмотров 57 тыс.
50% 1

In this edition of Stripe Developer Office Hours, follow along as CJ Avilla walks through the fundamentals of using the Stripe Command Line Interface, or simply “the CLI”. We cover getting started, using multiple API commands, how to test webhooks, and more.
Resources
- Full Reference: stripe.com/docs/cli
- Download the Stripe CLI: github.com/stripe/stripe-cli
- Using the Stripe CLI: stripe.com/docs/stripe-cli
- jq: stedolan.github.io/jq/
Table of contents
01:35 - Installation
02:32 - Getting started
02:34 - `stripe`
03:00 - `stripe -v`
03:21 - `stripe status`
03:34 - Connecting to your Stripe account
04:42 - `stripe plans list`
04:54 - `stripe config`
05:26 - Connecting a second Stripe account
07:00 - API Resource Commands
07:15 - Create a Customer and subscribe them to a Plan
15:07 - Pairing Stripe CLI with jq
17:28 - Webhook Commands
18:13 - `stripe listen`
21:00 - `stripe trigger`
25:36 - Forwarding events to local webhook handler
27:40 - Resending events
28:36 - `stripe serve`
29:23 - `stripe samples`
32:07 - Quick Wins ⚡️
Presenter
CJ Avilla, Developer Advocate @ Stripe - / cjav_dev
Support
If you have a question, please feel free to reach out to our support team at support.stripe.com/ or on Discord at stripe.com/go/developer-chat.
Updates
Sign up to stay updated with developer news: go.stripe.global/dev-digest
Feedback
If you have any feedback about this or other episodes, let us know: forms.gle/VjNqzRhotM2snYo88.
#Stripe #Payments

Наука

Опубликовано:

 

16 мар 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 90   
@JakeJJKs
@JakeJJKs 3 года назад
I'm a software engineer putting my entrepreneurial spirit to the test, and I have honestly no clue how I would go about it without stripe.
@LazyDali
@LazyDali 2 года назад
That CLI is so useful. Awesome! And clearly explained. Thanks!
@oasis142
@oasis142 Год назад
Excellent, simple, to the point. Thanks stripe devs!
@StripeDev
@StripeDev Год назад
Thanks for watching, we really appreciate your feedback!
@futuregootecks
@futuregootecks Год назад
Holy smokes this was super helpful!!! Fledgling dev here, but there was so much useful insight in here that I would have missed if I was only reading the docs. Totally building my first stripe app with the cli now!
@StripeDev
@StripeDev Год назад
Thank you for the feedback, glad you found it helpful!
@petebytes5010
@petebytes5010 3 года назад
Wish all API's I work with had this capability - makes things so much easier!!!
@danielazori5455
@danielazori5455 2 года назад
Thank You!💞💖All the Best , Daniela Zori !💞💖
@jvcss
@jvcss Год назад
I just have to thank for this platform to exist
@mackymccormack8446
@mackymccormack8446 Год назад
Great tool, nicely explained, thank you
@Neonb88
@Neonb88 Год назад
RU-vid should recommend this to me in the future; it will help with future TraderEx work
@Fh_Ndiritu
@Fh_Ndiritu Год назад
Awesome intro. Thank you!
@kirikiki7100
@kirikiki7100 4 года назад
Very good, thanks!
@ChrisTian-ox5nr
@ChrisTian-ox5nr 2 года назад
This is great! THank you!
@francoisrafaralahy2786
@francoisrafaralahy2786 9 месяцев назад
Nice great explanation ! thanks for this job
@hbela1000
@hbela1000 Год назад
This tuto is an abs. must to have.thx.
@user-xs9si3qb2t
@user-xs9si3qb2t Месяц назад
27:50 特にここからとても参考になりました。これでピンポイントでデバッグできます!
@AlexGower
@AlexGower 5 месяцев назад
Thank you for doing the lords work
@mehedihasanmim529
@mehedihasanmim529 Год назад
Made my day!
@Neonb88
@Neonb88 Год назад
Best stuff (useful to actually processing a payment) is near the end of the video. You can always skip to "quick wins" and then go back through and actually memorize the commands Personal To-dos for future me: 1. Subscription / recurring payments 2. How much can I customize the Stripe UIs based on their given stuff? (vs. ReactJS, ) 3.
@logemann74
@logemann74 3 месяца назад
this resend feature on event level is awesome. Havent found that out so far....
@jaysee3611
@jaysee3611 4 года назад
Hey can you show us how we can change the statement descriptor using this with connected stripe accounts?
@anthonya9907
@anthonya9907 3 года назад
Complete novice here, but this is such a great guide for anyone getting involved with Stripe! I'm having difficulty with the building a csv list from stripe. Everything works well, until I try to do this. I'm using the following prompt: stripe customers list | jq '.data[] | [.id,.name,.email] | @csv' and I get an error stating that '[.id' is not recognized as an internal or external command, operable program or batch file. Am I doing something wrong?
@KeithBlack01
@KeithBlack01 2 года назад
Do you have to use this for adding lookup codes against live products? - I see you can add lookup codes when testing straight from stripe control panel but not for live products - am I missing something? Also can't seem to copy & paste into this CLI - that would be useful given the length of items names being generated. Thanks
@zenzen7091
@zenzen7091 2 года назад
Hey there :) Nice demo, everything is working as expected on my side. I do have a question though ^^ I'm trying to use CLI commands within my end-to-end tests, and would like to automatically create an account with details_submitted set to true, so that the user I'll link afterwards is all ready. Is there a way to do so ? Thanks a lot !
@StripeDev
@StripeDev 2 года назад
Hey there! For Connect account, we would recommend using "stripe accounts create" with parameters from this Doc: stripe.com/docs/connect/testing.
@carlweis
@carlweis Год назад
Great. Video! Thank you! What camera do you use to record these videos!
@StripeDev
@StripeDev Год назад
CJ uses a Sony a6400-here's a list of the gear and software he uses/recommends: www.cjav.dev/uses. Hope this helps!
@Cransridge2288
@Cransridge2288 Год назад
great video thanks, FYI the -j has now been replaced with: --format JSON
@bhagyathakur2016
@bhagyathakur2016 3 года назад
Hey Stripe ! How to pass discription of service in payment intent API
@user-ug1ci9le8m
@user-ug1ci9le8m 10 месяцев назад
Thanks for the video. How did you make the "movies" plan though?
@StripeDev
@StripeDev 10 месяцев назад
Hi Michael-you can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration: stripe.com/docs/api/prices. Here's more info about building a subscription integration: stripe.com/docs/billing/subscriptions/build-subscriptions. If you still need help, please post your question on the Stripe Developer Discord channel: stripe.com/go/developer-chat. Or send us an email, here: support.stripe.com/.
@thedigitalceo
@thedigitalceo 2 года назад
I haven’t seen any technology have such an in depth CLI it’s great but just wondering is there any other benefit to using the CLI besides for testing local environments?
@StripeDev
@StripeDev 2 года назад
Thanks a lot, we're glad you're enjoying it! Here are some benefits you can take note of. For local environment testings, you can: Make API requests [0][1]. Tail logs [2]. Listen and trigger webhook events [3], this is useful if you would like to get real time updates and trigger respective actions in your systems [4]. The Stripe CLI also allows you to: Check Stripe’s status [5]. Open the relative Stripe documentation or Dashboard in your browser [6]. Copy Stripe’s sample projects to your local environment [7]. Provide feedback for Stripe [8]. The Stripe CLI can also be run within a container with the use of Docker [9]. [0] stripe.com/docs/stripe-cli/test [1] stripe.com/docs/cli/resources [2] stripe.com/docs/cli/logs/tail [3] stripe.com/docs/stripe-cli/webhooks [4] stripe.com/docs/webhooks [5] stripe.com/docs/cli/status [6] stripe.com/docs/cli/open [7] stripe.com/docs/cli/samples/create [8] stripe.com/docs/cli/feedback [9] stripe.com/docs/cli/docker
@thedigitalceo
@thedigitalceo 2 года назад
@@StripeDev got it. That’s pretty amazing. I don’t think we’ve ever seen these use cases but I can see this as being helpful! It’s been instrumental for us for testing our apps locally. I’m glad to see Stripe extending all these resources for developers
@StripeDev
@StripeDev 2 года назад
That makes us happy to hear! Feel free to reach out if you have any other questions.
@jansgreen4650
@jansgreen4650 3 года назад
I have a problems with my app, the test returns
@Maxpl01t
@Maxpl01t Год назад
Hiya mate, I've been trying to configure stripe autocompletion on my zsh shell terminal on macOS with no luck, could you please provide instructions?
@i2mastering943
@i2mastering943 5 месяцев назад
Maybe it would be good to tell people they have to install homebrew for the brew command to actually work. It's actually funny how that important part is just simply skipped over.
@raygan3
@raygan3 2 года назад
If we toggle stripe test mode in the dashboard it turns off production mode? Or I can work with both production and test environments at same time?
@StripeDev
@StripeDev 2 года назад
Hey Szymon - you can only work in either live mode or test mode at one time. If you're having issues using Stripe CLI, please don't hesitate to ask us any questions. Thanks.
@jackhepple1049
@jackhepple1049 2 года назад
can a cardholder hold more than 1 virtual card, also is there any way to create a loop for example for 15 cards rather than having to type out the command each time? (not much cli experience)
@StripeDev
@StripeDev 2 года назад
Hey Jack-great questions! A cardholder can definitely be assigned more than one virtual card. What exactly do you mean about the loop though? Are you wanting to create one that would assign 15 cards to the same cardholder? If so, it should be possible to contain the card.create request inside a loop to do that.
@raygan3
@raygan3 2 года назад
is it ever possible to receive duplicate webhook requests from stripe for the same event? Should we save event id in the database and check if it was processed before?
@StripeDev
@StripeDev 2 года назад
Hi Szymon-you might want to check our our Best Practices documentation, it may help answer these questions for you: stripe.com/docs/webhooks/best-practices.
@Vincetroid
@Vincetroid 4 месяца назад
what do you do when you get 504 instead of 200?
@StripeDev
@StripeDev Год назад
Hello Ravindranath-can you tell us a bit more about what's happening? Are you referring to the part of the video starting at 03:21? We also encourage you to post your questions to our Stripe Developer Discord channel as well: discord.com/invite/RuJnSBXrQn.
@ravindranathmopparthy8116
@ravindranathmopparthy8116 Год назад
stripe status doesn't work for version 1.16.0. "Unknown command "status" for "stripe".
@user-cm2di5ce2e
@user-cm2di5ce2e 6 месяцев назад
Same here.
@midnightcoder2189
@midnightcoder2189 Год назад
Is there a way to quickly add new products and make them live using Stripe CLI? I can create new product but they end up in test mode and the only option I have in Dashboard is to "Copy to live mode". Would be nice if that is available in CLI too
@StripeDev
@StripeDev Год назад
Hi there! By default the CLI uses testmode, but there is a --live flag that they can use for livemode: stripe.com/docs/cli/post#post-live
@ronrivero1039
@ronrivero1039 Год назад
why do you use "payment-method" when in Stripe it is "payment_method"? I am confused which one to follow now?
@laygir
@laygir Год назад
Hey, got a question, when I trigger an event through cli I see failing events/requets on my Stripe dashboard for the registered webhook endpoint. Am I supposed to disable registered webhook endpoint everytime I want to test things locally? Or is there a configuration somewhere to prevent registered endpoint from receiving events when trigger is coming from cli?
@StripeDev
@StripeDev Год назад
Hey there-are you able to share the error messaging you're seeing?
@laygir
@laygir Год назад
@@StripeDev I posted a detailed reply here but now I do not see it, not sure what's wrong with RU-vid :/
@StripeDev
@StripeDev Год назад
We'd be happy to help-feel free to reach out to us at heretohelp@stripe.com with details!
@coachingreflexivo
@coachingreflexivo 4 года назад
Literally thought CLI was short for "client" as in server/client. Lol.
@shifrin7499
@shifrin7499 Год назад
Well - but HOW do you trigger event for specific customer id? otherwise you can't really test any of the webhook!
@StripeDev
@StripeDev Год назад
Hey Vlad-what type of Event are you trying to trigger exactly? Please feel free to check out the related documentation in the mean time: stripe.com/docs/cli/trigger.
@gerrigg
@gerrigg Год назад
hello. thanks for this. question: when triggering say an invoice.payment_failed event, how can I specify the customer? --help doesn't show flags to support this. thank you
@StripeDev
@StripeDev Год назад
Hey there! When using Stripe trigger, it uses a "fixture" which is a list of API requests we'll run to cause the events for you. This specific event is defined here: github.com/stripe/stripe-cli/blob/master/pkg/fixtures/triggers/invoice.payment_failed.json. In this case, it sounds like you want to override the customer, which the fixture is creating first. We suggest explicitly using a feature that lets you override this parameter with the one you want-this is documented here: stripe.com/docs/cli/fixtures#fixtures-override. What the fixture does is create an InvoiceItem and then creates an Invoice-you'll want to override the customer on both so the call would look like this: stripe trigger invoice.payment_failed --skip customer --override "invoiceitem:customer=cus_ABC" --override "invoice:customer=cus_ABC"
@gerrigg
@gerrigg Год назад
@@StripeDev Awesome! Thanks so much. I'll give that a try!
@gerrigg
@gerrigg Год назад
@@StripeDev Hmmm, running that fixture seems to simply create an invoice successfully, not a failed payment. ??? Thanks. Also, I thought a while back, in Test Mode, in our Stripe Dashboard/UI we could send events manually? That seemed much easier IMHO :)
@JeanAlesiagain3
@JeanAlesiagain3 3 года назад
Which video is the actual basic tutorial that teaches you what you don't even know you don't know?
@jarodmorris611
@jarodmorris611 3 года назад
Sorry, there's a conspiracy in the stripe world to never tell you. You have to magically pass the test to even begin to realize you don't know what you don't know. Until then you're SOL.
@almidoro
@almidoro 2 года назад
How can we test in CLI a especific object, for example, a update on subscription (sub...) that has been failed the payment? I triggered the event but CLI creates a new subscription for the test.
@StripeDev
@StripeDev 2 года назад
Hi André-can you explain a bit more about the issue you're running into with the failed payment and the subscription?
@almidoro
@almidoro 2 года назад
Hello. I have developed in my plataform some subscripitons plans and assigned then for the customers. Now I need to set the updates trough webhooks of thes subscripitions. For example, when a recurring payment failed for some problem with card. I’d like to test these situations but I didn’t undestand if is possible using the CLI
@StripeDev
@StripeDev 2 года назад
Got it, thanks for explaining, André! If you're looking to test a bit with subscriptions and learn to manage payment failures with the CLI, check out this doc: stripe.com/docs/billing/subscriptions/fixed-price#what-you%E2%80%99ll-build. We also have a bunch of resources around testing Billing: stripe.com/docs/billing/testing.
@almidoro
@almidoro 2 года назад
@@StripeDev thank you. I’ll study it.
@tddtv
@tddtv Год назад
Only problem with this is that if you don't know the object structure of the various params in your head, you have to go figure that out because this doesn't intellisense for you. All easy AFTER you get to know the objects you need to use and object structs
@jdotsystem
@jdotsystem Год назад
Actually, I became sleepy after started this movie viewing I would like to know overview about your product
@alpachino468
@alpachino468 8 месяцев назад
Can I create Stripe keys using Microsoft Paint?
@StripeDev
@StripeDev 8 месяцев назад
No. Stripe keys are generated through Stripe's website or API, and they require specific cryptographic algorithms to ensure their security.
@alpachino468
@alpachino468 8 месяцев назад
@@StripeDev Thanks but it was a very silly question, I must admit. Ok so I do need some real help though. On a charity website I maintain, I allow donations to be accepted, where donors can input an amount of their choice. All works fine and payment gets accepted. What I also try to do is append the ID of the donation campaign within the session's and price's metadata, with the intention of performing a lookup of all payments and then filtering by the campaign'd ID in order to collate all payments for a particular campaign so that I can present to users how much we have raised. Any way to do this? Am I even making sense?
@StripeDev
@StripeDev 8 месяцев назад
Yes, your ask does make sense. So, when a payment is made, you can include additional information such as the donation campaign ID in the metadata of the payment. Here's an example of how you can achieve this using Stripe's API: 1. When creating a payment, include the campaign ID in the metadata parameter: "import stripe stripe.api_key = 'YOUR_STRIPE_SECRET_KEY' payment_intent = stripe.PaymentIntent.create( amount=1000, currency='usd', metadata={ 'campaign_id': 'YOUR_CAMPAIGN_ID', }, )" 2. When retrieving payments, you can filter them based on the campaign ID: "import stripe stripe.api_key = 'YOUR_STRIPE_SECRET_KEY' # Retrieve all payments payments = stripe.PaymentIntent.list() # Filter payments based on campaign ID campaign_payments = [payment for payment in payments if payment.metadata.get('campaign_id') == 'YOUR_CAMPAIGN_ID']" You can then use the `campaign_payments´ list to perform any analysis or calculations to determine how much you have raised for a particular campaign. Note that you will need to replace `YOUR_STRIPE_SECRET_KEY´ with your actual Stripe secret key and `YOUR_CAMPAIGN_ID´ with the relevant IDs for each campaign on your website.
@thibao8726
@thibao8726 3 года назад
how to install tripe CLI ?
@cjav_dev
@cjav_dev 3 года назад
Hey Thi, there's a step by step guide for installing the Stripe CLI here: stripe.com/docs/stripe-cli.
@thibao8726
@thibao8726 3 года назад
@@cjav_dev i have install it, but i want ask you i want save to database card id and customer id , when i save 2 card and 1 customer, how do i do ?
@hemanth6951
@hemanth6951 3 года назад
8hrs I used stripe cli 25gb data gone 😁
@jarodmorris611
@jarodmorris611 3 года назад
I have CentOS 7 and a Virtual Private Server. I rarely find anyone that shows how to use one of those. It's always a local machine. I get it, that people's setup could be vastly different, but isn't that true about local machines too and yet people constantly show their local machine and installation, config, etc. I used wget to grab the repository for stripe-cli, unzipped it, then was instructed to run the executable. Only there IS NO EXECUTABLE. It's a file with title 'stripe'. NO EXTENSION AT ALL. It's horribly frustrating to have 99 options and videos act like there is only 1 possibility. It's like going into a bar and saying, "I'd like a beer." uh, which beer? There are only a few thousand in the world to choose from.
@jarodmorris611
@jarodmorris611 3 года назад
UPDATE: For anyone reading this that is also frustrated.... you have to run ./stripe login {secret_key_here} and then it should do what you want it to do
@jarodmorris611
@jarodmorris611 3 года назад
I've used the --interactive flag and been able to provide the secret key manually (don't get even a single digit wrong!) and then it asks me to provide a device-name and I do and then it says it's configured. Then if I go to ./stripe login, it does the "Waiting for confirmation" and hangs there. NO ONE has a tutorial for CentOS stripe-cli, etc. It should not be so hard to give Stripe money from my sales.
@sillypablo3495
@sillypablo3495 Год назад
This isnt working
@StripeDev
@StripeDev Год назад
Hi Pablo-sorry to hear you're having issues. If you get back to us with where you're seeing an error, we might be able to help further. Alternatively, you can find support through our developer discord community here: discord.com/invite/stripe
@gunrunjk
@gunrunjk Год назад
it gets error $_SERVER['HTTP_STRIPE_SIGNATURE']. how can I fix it ?, this is coming from stripe dashboard logs. Fatal error: Uncaught Error: Class "Stripe\Webhook" not found in C:\xampp\htdocs\index.php:16
@StripeDev
@StripeDev Год назад
Hi Junki. It looks like an SDK installation problem. Your code is unable to include Stripe SDK. We recommend going through the installation guide: github.com/stripe/stripe-php#requirements and using either Composer (recommended) or the manual installation.
@learninggcn1113
@learninggcn1113 5 месяцев назад
Wow,Now version 1.19.2 have canceled the status sub-command The result is : stripe status Unknown command "status" for "stripe". See "stripe --help" for a list of available commands.
Далее
.NET Core Starter
54:35
Просмотров 8 тыс.
How To Accept Payments With Stripe
23:05
Просмотров 266 тыс.
Спецэффекты в Симс 4
00:36
Просмотров 24 тыс.
ПАПА ГАМБУРГЕР
00:13
Просмотров 163 тыс.
Stripe Webhooks
1:00:16
Просмотров 41 тыс.
Accept a payment with the PaymentElement using Node.js
24:16
Accept a payment
24:09
Просмотров 9 тыс.
JAVA DTO Pattern Tutorial | Simplify Your Code
19:12
Просмотров 194 тыс.
Make Money from your API Tutorial
13:10
Просмотров 868 тыс.
Stripe Payments With Nextjs 14 - Full Guide
21:38
Просмотров 8 тыс.
Intel's CPUs Are Failing, ft. Wendell of Level1 Techs
23:59
Handling platform subscription related events
20:37
Просмотров 3,8 тыс.
Треш ПК за 420 000 рублей
0:59
Просмотров 209 тыс.
APPLE дают это нам БЕСПЛАТНО!
1:01
Просмотров 515 тыс.
Игровой Комп с Авито за 4500р
1:00