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

SORACOMを利用した自社開発農業IoTデバイスの課金をStripeでやってみた

 SORACOMを利用した自社開発農業IoTデバイスの課金をStripeでやってみた

JP_Stripes (Stripe ユーザーグループ)in サッポロ キックオフで発表した資料です。
#JP_Stripes
http://eventregist.com/e/JP_Stripes_CTS

Takehito Tanabe

April 10, 2018
Tweet

More Decks by Takehito Tanabe

Other Decks in Technology

Transcript

  1. ɹSORACOMΛར༻ͨ͠
    ࣗࣾ։ൃ೶ۀIoTσόΠεͷ՝ۚΛ
    StripeͰ΍ͬͯΈͨ
    +1@4USJQFTJOαοϙϩΩοΫΦϑ
    ೶ۀ৘ใઃܭࣾɹా໊ล݈ਓ

    View full-size slide

  2. 8IPBN*
    ʢ͜ͷإʹϐϯͱ͖ͨΒʣ

    View full-size slide

  3. ా໊ล݈ਓʢͨͳ΂͚ͨͻͱʣ
    ൒೶൒*5ɾιϑτ΢ΣΞΤϯδχΞ
    ಓ࢈ࢠˠ౦ژʹ೥ˠ೥݄ʹΫϥ΢υҠॅ
    ೥݄ɾ౰ผொʹҠॅͨ͠͹͔Γ
    झຯɿόϯυ׆ಈʢ#BTTʣ%*:ʢେ޻ʣ
    ೶త׆ಈɿ
    ೥ʹࡳຈࢢͷ೶ۀݚमΛमྃɻ
    ೥͸BBͷാΛٽ͖ͳ͕ΒӦ೶ɻ
    ࠓγʔζϯ͔Β౰ผொʹͯ൒ࣗڅࣗ଍ɻ

    View full-size slide

  4. ೶ۀݚमͷશه࿥Λ
    ϒϩάʹॻ͖·ͨ͠ʢসʣ
    IUUQBTUCTUSPDLT

    View full-size slide

  5. ɹSORACOMΛར༻ͨ͠
    ࣗࣾ։ൃ೶ۀIoTσόΠεͷ՝ۚΛ
    StripeͰ΍ͬͯΈͨ
    ೶ۀ৘ใઃܭࣾɹా໊ล݈ਓ

    View full-size slide

  6. AgriBus-G+
    ͪΐͬͱΘ͔Γʹ͍͘ͷ
    Ͱɺॱ൪ʹઆ໌͠·͢X

    View full-size slide

  7. 35,(/44 (14
    *P5
    AgriBus-G+
    ʢ։ൃதʣ
    ߴਫ਼౓ͳ (14 ͱ೶ۀػցͱͷ௨৴ػೳΛ
    ซͤ࣋ͪɺ
    ҆ՁͰଟ໨తͳར༻͕Մೳ
    ɾ35,(/44 (14

    ɾ(*P5.PEVMF
    ɾ.BDIJOF$POUSPM *40#64"(1035

    ೶࡞ۀ৘ใϋϒαʔϏε
    AgriBus-Connect
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    طଘͷ֤छ೶ۀ
    *5γεςϜ
    ࣗಈૢ଩Φϓγϣϯ
    AgriBus-AutoSteer
    ʢ։ൃதʣ
    ϞʔλʔۦಈͰϢʔβʵ͕؆୯ʹ୤ணՄೳ
    ઃܭਤ͸Φʔ
    ϓϯιʔ
    εͰެ։
    ܗঢ়ʹ߹ΘͤͨΧελϚΠζ͕Մೳ
    "OESPJE04εϚϗ
    ɾ
    λϒϨο
    τ༻
    τϥΫλʔӡసࢧԉΞϓϦ˞
    AgriBus-NAVI
    ը໘දࣔΛݟͳ͕Β޿͍ะ৔಺Ͱ΋
    ·͙ͬ͢౳ִؒʹ࡞ۀՄೳ
    AgriBus-NAVI ぇத৺〝「〔
    ʢגʣ
    ೶ۀ৘ใઃܭࣾ〣औ〿૊〴
    ˞ AgriBus-NAVI͸ಠཱߦ੓๏ਓ೶ۀɾ৯඼࢈ۀٕज़૯߹ݚڀػߏ
    ʢ೶ݚػߏʣ
    ͷݚڀ։ൃ੒ՌͰ͋Διϑ
    τ
    ΢ΤΞ
    ʮ೶༻ं྆࡞ۀφϏήʔγ
    ϣ
    ϯιϑ
    τ
    ΢ΤΞʯ
    ٴͼಛڐ
    ʢಛڐୈ ߸ʣ
    Λج൫ͱ
    ͯ͠։ൃ͞Ε͍ͯ·͢ɻ
    ˞ (PPHMF1MBZ͓Αͼ(PPHMF1MBZϩΰ͸ɺ
    (PPHMF*ODͷ঎ඪͰ͢ɻ
    Φϓγϣϯͷ௥ՃͰϩϘο
    τԽ
    ɾ
    *P5ԽʹରԠ
    ͜Ε·Ͱะ৔ʹࣺ͖ͯͯͨܭଌ
    ੍ޚ৘ใΛ
    ʮऩ֭ʯ
    ͯ͠༗ޮར༻
    ʂ
    ৘ใఏڙɾ࿈ܞ
    ˟๺ւಓଳ޿ࢢ੢̔৚ೆ̐̌ஸ໨̍൪̒߸
    IUUQBHSJJOGPEFTJHODPNDPOUBDU!BHSJJOGPEFTJHODPN

    View full-size slide

  8. "OESPJE04εϚϗ
    ɾ
    λϒϨο
    τ༻
    τϥΫλʔӡసࢧԉΞϓϦ˞
    AgriBus-NAVI
    ը໘දࣔΛݟͳ͕Β޿͍ะ৔಺Ͱ΋
    ·͙ͬ͢౳ִؒʹ࡞ۀՄೳ
    AgriBus-NAVI ぇத৺〝「〔
    ʢגʣ
    ೶ۀ৘ใ
    ͜Ε·Ͱะ৔ʹࣺ
    ੍ޚ৘ใΛ
    ʮऩ֭

    View full-size slide

  9. 35,(/44 (14
    *P5
    AgriBus-G+
    ʢ։ൃதʣ
    ߴਫ਼౓ͳ (14 ͱ೶ۀػցͱͷ௨৴ػೳΛ
    ซͤ࣋ͪɺ
    ҆ՁͰଟ໨తͳར༻͕Մೳ
    ɾ35,(/44 (14

    ɾ(*P5.PEVMF
    ɾ.BDIJOF$POUSPM *40#64"(1035

    ೶࡞ۀ৘ใϋϒαʔϏε
    AgriBus-Connect
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    طଘͷ֤छ೶ۀ
    *5γεςϜ
    ࣗಈૢ଩Φϓγϣϯ
    AgriBus-AutoSteer
    ʢ։ൃதʣ
    ϞʔλʔۦಈͰϢʔβʵ͕؆୯ʹ୤ணՄೳ
    ઃܭਤ͸Φʔ
    ϓϯιʔ
    εͰެ։
    ܗঢ়ʹ߹ΘͤͨΧελϚΠζ͕Մೳ
    "OESPJE04εϚϗ
    ɾ
    λϒϨο
    τ༻
    τϥΫλʔӡసࢧԉΞϓϦ˞
    AgriBus-NAVI
    ը໘දࣔΛݟͳ͕Β޿͍ะ৔಺Ͱ΋
    ·͙ͬ͢౳ִؒʹ࡞ۀՄೳ
    AgriBus-NAVI ぇத৺〝「〔
    ʢגʣ
    ೶ۀ৘ใઃܭࣾ〣औ〿૊〴
    ˞ AgriBus-NAVI͸ಠཱߦ੓๏ਓ೶ۀɾ৯඼࢈ۀٕज़૯߹ݚڀػߏ
    ʢ೶ݚػߏʣ
    ͷݚڀ։ൃ੒ՌͰ͋Διϑ
    τ
    ΢ΤΞ
    ʮ೶༻ं྆࡞ۀφϏήʔγ
    ϣ
    ϯιϑ
    τ
    ΢ΤΞʯ
    ٴͼಛڐ
    ʢಛڐୈ ߸ʣ
    Λج൫ͱ
    ͯ͠։ൃ͞Ε͍ͯ·͢ɻ
    ˞ (PPHMF1MBZ͓Αͼ(PPHMF1MBZϩΰ͸ɺ
    (PPHMF*ODͷ঎ඪͰ͢ɻ
    Φϓγϣϯͷ௥ՃͰϩϘο
    τԽ
    ɾ
    *P5ԽʹରԠ
    ͜Ε·Ͱะ৔ʹࣺ͖ͯͯͨܭଌ
    ੍ޚ৘ใΛ
    ʮऩ֭ʯ
    ͯ͠༗ޮར༻
    ʂ
    ৘ใఏڙɾ࿈ܞ
    ˟๺ւಓଳ޿ࢢ੢̔৚ೆ̐̌ஸ໨̍൪̒߸
    IUUQBHSJJOGPEFTJHODPNDPOUBDU!BHSJJOGPEFTJHODPN

    View full-size slide

  10. ೶࡞ۀ৘ใϋϒαʔϏε
    AgriBus-Connect
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ

    ʢגʣ
    ೶ۀ৘ใઃܭࣾ〣औ〿૊〴
    ͜Ε·Ͱะ৔ʹࣺ͖ͯͯͨܭଌ

    View full-size slide

  11. AgriBus-Connect
    w AgriBus-NAVIͷσʔλΛ஝ੵ͢ΔΫϥ΢υ
    w ะ৔ɺ࡞ۀཤྺͳͲ

    View full-size slide

  12. ೶࡞ۀ৘ใϋϒαʔϏε
    "HSJ#VT$POOFDU
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    AgriBus-Connect

    View full-size slide

  13. ೶࡞ۀ৘ใϋϒαʔϏε
    "HSJ#VT$POOFDU
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    AgriBus-Connect
    ೶࡞ۀ৘ใϋϒαʔϏε
    "HSJ#VT$POOFDU
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    ಉظ

    View full-size slide

  14. ೶࡞ۀ৘ใϋϒαʔϏε
    "HSJ#VT$POOFDU
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    AgriBus-Connect
    ೶࡞ۀ৘ใϋϒαʔϏε
    "HSJ#VT$POOFDU
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ

    View full-size slide

  15. 35,(/44 (14
    *P5
    AgriBus-G+
    ʢ։ൃதʣ
    ߴਫ਼౓ͳ (14 ͱ೶ۀػցͱͷ௨৴ػೳΛ
    ซͤ࣋ͪɺ
    ҆ՁͰଟ໨తͳར༻͕Մೳ
    ɾ35,(/44 (14

    ɾ(*P5.PEVMF
    ɾ.BDIJOF$POUSPM *40#64"(1035

    ೶࡞ۀ৘ใϋϒαʔϏε
    AgriBus-Connect
    ะ৔৘ใɺ
    ࡞ۀཤྺɺ
    ػցͷௐࢠͳͲΛ
    ࣗಈه࿥͠Ϋϥ΢υ্ʹอଘ
    طଘͷ֤छ೶ۀ
    *5γεςϜ
    ࣗಈૢ଩Φϓγϣϯ
    AgriBus-AutoSteer
    ʢ։ൃதʣ
    ϞʔλʔۦಈͰϢʔβʵ͕؆୯ʹ୤ணՄೳ
    ઃܭਤ͸Φʔ
    ϓϯιʔ
    εͰެ։
    ܗঢ়ʹ߹ΘͤͨΧελϚΠζ͕Մೳ
    "OESPJE04εϚϗ
    ɾ
    λϒϨο
    τ༻
    τϥΫλʔӡసࢧԉΞϓϦ˞
    AgriBus-NAVI
    ը໘දࣔΛݟͳ͕Β޿͍ะ৔಺Ͱ΋
    ·͙ͬ͢౳ִؒʹ࡞ۀՄೳ
    AgriBus-NAVI ぇத৺〝「〔
    ʢגʣ
    ೶ۀ৘ใઃܭࣾ〣औ〿૊〴
    ˞ AgriBus-NAVI͸ಠཱߦ੓๏ਓ೶ۀɾ৯඼࢈ۀٕज़૯߹ݚڀػߏ
    ʢ೶ݚػߏʣ
    ͷݚڀ։ൃ੒ՌͰ͋Διϑ
    τ
    ΢ΤΞ
    ʮ೶༻ं྆࡞ۀφϏήʔγ
    ϣ
    ϯιϑ
    τ
    ΢ΤΞʯ
    ٴͼಛڐ
    ʢಛڐୈ ߸ʣ
    Λج൫ͱ
    ͯ͠։ൃ͞Ε͍ͯ·͢ɻ
    ˞ (PPHMF1MBZ͓Αͼ(PPHMF1MBZϩΰ͸ɺ
    (PPHMF*ODͷ঎ඪͰ͢ɻ
    Φϓγϣϯͷ௥ՃͰϩϘο
    τԽ
    ɾ
    *P5ԽʹରԠ
    ͜Ε·Ͱะ৔ʹࣺ͖ͯͯͨܭଌ
    ੍ޚ৘ใΛ
    ʮऩ֭ʯ
    ͯ͠༗ޮར༻
    ʂ
    ৘ใఏڙɾ࿈ܞ
    ˟๺ւಓଳ޿ࢢ੢̔৚ೆ̐̌ஸ໨̍൪̒߸
    IUUQBHSJJOGPEFTJHODPNDPOUBDU!BHSJJOGPEFTJHODPN

    View full-size slide

  16. 35,(/44 (14
    *P5
    AgriBus-G+
    ʢ։ൃதʣ
    ߴਫ਼౓ͳ (14 ͱ೶ۀػցͱͷ௨৴ػೳΛ
    ซͤ࣋ͪɺ
    ҆ՁͰଟ໨తͳར༻͕Մೳ
    ɾ35,(/44 (14

    ɾ(*P5.PEVMF
    ɾ.BDIJOF$POUSPM *40#64"(1035

    ʢ
    Φϓγϣϯͷ௥ՃͰϩϘο
    τԽ
    *P5ԽʹରԠ

    View full-size slide

  17. AgriBus-G+
    w ߴਫ਼౓ͳ GNSS(GPSɺGLONASSɺGalileo etc…ʣ
    w RTKରԠʢޡࠩ ਺cmʣ
    w ิਖ਼৘ใ͸3Gճઢ·ͨ͸LoRa
    w ࡞ۀػͱͷ࿈ಈػೳ
    w ं଎ύϧεग़ྗɺISOBUS / AG-PORT

    View full-size slide

  18. AgriBus-G+
    ܞଳి࿩໢ɾ
    (ճઢ

    View full-size slide

  19. ճઢར༻ྉΛϢʔβʔ͞Μ͔Β
    αϒεΫϦϓγϣϯܗࣜͰ௃ऩ͍ͨ͠

    View full-size slide

  20. ࡶײ
    w ΊͪΌΊͪΌDeveloper໨ઢ
    •๛෋ͳυΩϡϝϯτʢͨͩ͠ӳޠʣ
    •༷ʑͳݴޠͷαϙʔτ
    •͙͢ʹ࢖͑Δ෦඼ɾCheckout/Elements
    •ϩάɺΠϕϯτͷ৘ใ͕ࡉ͔͘ݟΔ͜ͱ͕Մೳ

    View full-size slide

  21. ࡶײ
    •ਐԽ͕ૣ͍
    •API͸ԼҐޓ׵͕͋Δʢݹ͍όʔδϣϯ͸ͦͷ
    ··࢖͑Δʣ
    •ߟ͑ͣʹΞοϓσʔτ͢Δͱɺ·ΕʹέΨ͢Δ
    ʢͪΌΜͱϦϦʔεϊʔτΛಡΊ͹໰୊ͳ͍͆ʣ

    View full-size slide

  22. ࡶײ
    •ίϯιʔϧ͕࢖͍қ͍
    •ςετϞʔυʹ؆୯ʹ੾Γସ͑Մೳ
    •ςετσʔλ͸όοαϦফڈՄೳ

    View full-size slide

  23. ࡶײ
    •ຊ൪؀ڥਃ੥͕ૣ͍
    •ձࣾͷۜߦޱ࠲΍ొه৘ใͳͲΛೖྗ
    •ࣗ෼ͨͪͷ৔߹͸ཌ೔ʹ࢖͑ΔΑ͏ʹͳΓ·ͨ͠

    View full-size slide

  24. AgriBus-G+ 3G՝ۚ
    ΫϨδοτΧʔυ৘ใͷೖྗ
    2. ر๬ͷࢧ෷͍ϓϥϯΛબ୒
    3. ՝͕ۚ੒ޭͨ͠ΒSORACOM։௨

    View full-size slide

  25. AgriBus-G+ 3G՝ۚ
    ΫϨδοτΧʔυ৘ใͷೖྗ
    2. ر๬ͷࢧ෷͍ϓϥϯΛબ୒
    3. ՝͕ۚ੒ޭͨ͠ΒSORACOM։௨

    View full-size slide

  26. 4USJQF&MFNFOUT

    View full-size slide

  27. 4USJQF&MFNFOUT
    w 4USJQFͰ༻ҙͯ͘͠Ε͍ͯΔ8FCϑϩϯτ༻ͷ෦඼
    w όϦσʔγϣϯɺϑΥʔϚοτɺϚεΩϯάɺΤ
    ϥʔॲཧͳͲɺࢸΕΓਚͤ͘Γ
    w ΫϨδοτΧʔυ৘ใ͸4USJQFʹͷΈૹ৴ɺࣗࣾ
    αʔόʔ͸௨Βͳ͍ʢ͜Εେมॏཁʣ

    View full-size slide

  28. Χʔυ৘ใ
    w Χʔυ൪߸ͷ୅ΘΓͷτʔΫϯͰ΍ΓͱΓɻ
    w ϒϥϯυɺ༗ޮظݶɺԼܻͷ൪߸ͳͲͷ࠷௿ݶͷ
    ৘ใ͸औಘͰ͖Δɻ
    w ͓٬༷ͷΧʔυ৘ใΛࣗ෼ͨͪͰ௚઀৮ΕΔ͜ͱ
    ͸ෆՄೳɻʢ͜Εେมॏཁʣ

    View full-size slide

  29. AgriBus-G+ 3G՝ۚ
    ΫϨδοτΧʔυ৘ใͷೖྗ
    2. ر๬ͷࢧ෷͍ϓϥϯΛબ୒
    3. ՝͕ۚ੒ޭͨ͠ΒSORACOM։௨

    View full-size slide

  30. 4VCTDSJQUJPO
    w 4VCTDSJQUJPOΛઃఆ͢Δʹ͸ɺॳΊʹ1SPEVDUͱ
    1MBOΛఆٛ͢Δඞཁ͕͋Δɻ
    w 4VCTDSJQUJPOΛ࡞੒͢Δʹ͸ɺ$VTUPNFSͱ1MBOΛ
    ඥ͚ͮͨ4VCTDSJQUJPOΛDSFBUF͢Δ

    View full-size slide

  31. 4VCTDSJQUJPODSFBUF

    require "stripe"
    Stripe.api_key = "sk_test_AABBCCDDEEFFGG"
    Stripe::Subscription.create(
    :customer => "cus_XYZ123ABC",
    :items => [
    {
    :plan => "silver-express-898",
    },
    ]
    )

    View full-size slide

  32. AgriBus-G+ 3G՝ۚ
    ΫϨδοτΧʔυ৘ใͷೖྗ
    2. ر๬ͷࢧ෷͍ϓϥϯΛબ୒
    3. ՝͕ۚ੒ޭͨ͠ΒSORACOM։௨

    View full-size slide

  33. -JGFDZDMFͱ8FCIPPL
    w 4VCTDSJQUJPOʹؔ࿈͢Δ"DUJWJUZ͕ൃੜͨ͠ࡍʹ
    &WFOU͕ൃߦ͞ΕΔɻ
    w &WFOU͸8FCIPPLͰҾֻ͚ͬΔ͜ͱ͕Ͱ͖Δɻ
    w -JGFDZDMFΛཧղ͍ͯ͠Δ͜ͱ͕ॏཁɻ
    •https://stripe.com/docs/billing/lifecycle

    View full-size slide

  34. 4VCTDSJQUJPO-JGFDZDMF pSTUUJNF

    1. customer.created
    2. customer.subscription.created
    3. invoice.created
    4. charge.succeeded
    5. invoice.payment_succeeded

    View full-size slide

  35. 4VCTDSJQUJPO-JGFDZDMF FWFSZCJMMJOHQFSJPE

    1. invoice.upcoming
    2. invoice.created
    3. charge.succeeded
    4. invoice.payment_succeeded

    View full-size slide

  36. ૹ৴͞Εͯ͘Δ+40/ʢসʣ
    {"id":"evt_1CEzuXLC79AVHbbSSM9FOEW0","object":"event","api_version":"2018-02-06","created":1523279993,"data":
    {"object":{"id":"in_1CEzuWLC79AVHbbSlqvJ7CQ5","object":"invoice","amount_due":2160,"amount_paid":
    2160,"amount_remaining":0,"application_fee":null,"attempt_count":
    0,"attempted":true,"billing":"charge_automatically","charge":"ch_1CEzuWLC79AVHbbSHUQueAhk","closed":true,"cur
    rency":"jpy","customer":"cus_CRNAwZ99jgut59","date":
    1523279992,"description":null,"discount":null,"due_date":null,"ending_balance":0,"forgiven":false,"lines":
    {"object":"list","data":[{"id":"sub_CeIVB5oPxpPWw1","object":"line_item","amount":
    2000,"currency":"jpy","description":"1×AgriBus-G+(at¥2,000/
    month)","discountable":true,"livemode":false,"metadata":
    {"aid_my_product_type":"GPlus","aid_username":"dev-0000000000000048","aid_my_product_number":"AGBGP-
    SN-1","aid_my_product_sim_imsi":"4401031451227xx"},"period":{"end":1525871992,"start":1523279992},"plan":
    {"id":"plan_gplus-cellular-monthly-jpy","object":"plan","amount":2000,"billing_scheme":"per_unit","created":
    1520220039,"currency":"jpy","interval":"month","interval_count":1,"livemode":false,"metadata":
    {},"nickname":"3G/LTE通信:月払
    い","product":"prod_gplus","tiers":null,"tiers_mode":null,"transform_usage":null,"trial_period_days":null,"us
    age_type":"licensed"},"proration":false,"quantity":
    1,"subscription":null,"subscription_item":"si_CeIVUuNNkIFvGi","type":"subscription"}],"has_more":false,"total
    _count":1,"url":"/v1/invoices/in_1CEzuWLC79AVHbbSlqvJ7CQ5/lines"},"livemode":false,"metadata":
    {},"next_payment_attempt":null,"number":"804791B-0004","paid":true,"period_end":1523279992,"period_start":
    1523279992,"receipt_number":null,"starting_balance":
    0,"statement_descriptor":null,"subscription":"sub_CeIVB5oPxpPWw1","subtotal":2000,"tax":160,"tax_percent":
    8,"total":2160,"webhooks_delivered_at":null}},"livemode":false,"pending_webhooks":1,"request":
    {"id":"req_puvLaeHmQT4OKC","idempotency_key":null},"type":"invoice.payment_succeeded"}

    View full-size slide

  37. "tax": 160,
    "tax_percent": 8,
    "total": 2160,
    "webhooks_delivered_at": null
    }
    },
    "livemode": false,
    "pending_webhooks": 1,
    "request": {
    "id": "req_puvLaeHmQT4OKC",
    "idempotency_key": null
    },
    "type": "invoice.payment_succeeded"
    }

    View full-size slide

  38. "aid_my_product_number": "AGBGP-SN-1",
    "aid_my_product_sim_imsi": "4401031451227xx"
    },
    "period": {
    "end": 1525871992,
    "start": 1523279992
    },
    "plan": {
    "id": "plan_gplus-cellular-monthly-jpy",
    "object": "plan",
    "amount": 2000,
    "billing_scheme": "per_unit",
    "created": 1520220039,
    "currency": "jpy",
    "interval": "month",
    "interval_count": 1,
    "livemode": false,
    "metadata": {},
    "nickname": "3G/LTE通信: 月払い",
    "product": "prod_gplus",
    "tiers": null,
    "tiers_mode": null,
    "transform_usage": null,
    "trial_period_days": null,
    "usage_type": "licensed"

    View full-size slide

  39. {
    "id": "sub_CeIVB5oPxpPWw1",
    "object": "line_item",
    "amount": 2000,
    "currency": "jpy",
    "description": "1 × AgriBus-G+ (at ¥2,000 / month)",
    "discountable": true,
    "livemode": false,
    "metadata": {
    "aid_my_product_type": "GPlus",
    "aid_username": "dev-0000000000000048",
    "aid_my_product_number": "AGBGP-SN-1",
    "aid_my_product_sim_imsi": "4401031451227xx"
    },
    "period": {
    "end": 1525871992,
    "start": 1523279992
    },
    "plan": {
    "id": "plan_gplus-cellular-monthly-jpy",
    "object": "plan",
    "amount": 2000,
    "billing_scheme": "per_unit",
    "created": 1520220039,
    "currency": "jpy",
    4*.Λࣝผ͢Δ
    ͨΊͷ৘ใ

    View full-size slide

  40. NFUBEBUB
    w 4USJQFͷ͋ΒΏΔ"1*ϦΫΤετʹ͸NFUBEBUBΛؚ
    ΊΔ͜ͱ͕Ͱ͖Δɻ
    w ޙॲཧͷͨΊͷ৘ใΛอଘʢࠓճͷέʔεʣ
    w ԣஅతͳݕࡧ΋Մೳ

    View full-size slide

  41. 403"$0."1*
    w ͦ͜·Ͱ࿩͕࣌ؒ͢ͳ͍ͷͰׂѪʢ͢·Μʣ

    View full-size slide

  42. θϩϕʔεͷௐ͔ࠪΒ࣮૷ɺςετɺຊ൪౤ೖ·ͰΘ͔ͣϲ݄൒ɻ
    ʢ͍Ζ͍Ζผ݅Λ๊͑ͳ͕ΒͳͷͰɺ࣮࣭͸΋ͬͱૣ͍͆ʣ

    View full-size slide