Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevRel_Meetup_Tokyo_20170905_Stripe

 DevRel_Meetup_Tokyo_20170905_Stripe

Stripe におけるドキュメント周りのナレッジを Tips という形でご紹介させていただきました。

Yasuhiko Tokunaga

September 05, 2017
Tweet

More Decks by Yasuhiko Tokunaga

Other Decks in Technology

Transcript

  1. HTTP R. F!e"d!ng UC Irv!ne J. Gettys Compaq/W3C J. Mogu"

    Compaq H. Frystyk W3C/MIT L. Mas!nter Xerox P. Leach M!crosoft T. Berners-Lee W3C/MIT June 1999 Network Work!ng Group Request for Comments: 2616 Obso"etes: 2068 Category: Standards Track Hypertext Transfer Protoco! -- HTTP/1.1 Status of th!s Memo Th!s document spec!f!es an Internet standards track protoco" for the Internet commun!ty, and requests d!scuss!on and suggest!ons for !mprovements. P"ease refer to the current ed!t!on of the "Internet Off!c!a" Protoco" Standards" (STD 1) for the standard!zat!on state and status of th!s protoco". D!str!but!on of th!s memo !s un"!m!ted. Copyr!ght Not!ce Copyr!ght (C) The Internet Soc!ety (1999). A"" R!ghts Reserved.
  2. HTTP The requested resource could not be found but may

    be available again in the future. 403 Forbidden
  3. const stripe = require('stripe') ('sk_test_BQokikJOvBiI2HlWgH4olfQ2'); const charge = await stripe.charges.create({

    amount: 1980, currency: 'jpy', source: 'tok_visa', description: 'Payment', statement_descriptor: 'Rocket Rides', destination: { amount: 800, account: 'driver_account_id' } }); 1 2 3 4 5 6 7 8 9 10 11 12 13 14
  4. ͦΕͧΕͷݴޠͰ εχϖοτΛ༻ҙ <p> On your server, grab the Stripe token

    in
 the POST parameters submitted by your form. From there, it’s one simple API call to charge the card: </p> <% code_tutorial :tutorial_charge_create %>
  5. J A M E S Y U , C O

    - F O U N D E R O F PA R S E The way to a developer’s heart is great documentation.” “
  6. ιʔείʔυ͔Β API ϦϑΝϨϯεΛੜ੒ class ChargeAPIResource < AbstractAPIResource required :amount, Integer

    required :currency, String … document :amount, 'A positive integer in the…' document :currency, 'Three-letter ISO currency…' … end
  7. ߴ౓ͳΤϥʔϝοηʔδ >> Stripe::Customer.create Stripe::AuthenticationError: No API key provided. Set your

    API key using "Stripe.api_key = <API-KEY>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email [email protected] if you have any questions.
  8. ߴ౓ͳΤϥʔϝοηʔδ >> Stripe.api_key = "BQokikJOvBiI2HlWgH4olfQ2"
 >> Stripe::Charge.retrieve("ch_17SOe5QQ2exd2S") Stripe::InvalidRequestError: (Status 404)


    No such charge: ch_17SOe5QQ2exd2S; a similar object exists in live mode, but a test mode key was used to make this request.
  9. API Ξοϓσʔτ࣌ͷ Gate ͷ׆༻ :versions: - :version: 2016-07-06 :new_gates: -

    :gate: hide_canceled_subscriptions :description: >- You can now view canceled subscriptions
 by specifying `status=canceled` or `status=all` when listing subscriptions. In addition, you can now retrieve a canceled subscription by its ID.