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

StripeとAWSで作るフルサーバレスな解析サービス構築

 StripeとAWSで作るフルサーバレスな解析サービス構築

shiro seike

January 26, 2023
Tweet

More Decks by shiro seike

Other Decks in Technology

Transcript

  1. Stripe AWS

    JP_Stripes !!
    2
    0
    23
    .
    1
    .
    26



    @seike
    4
    60
    1

    View full-size slide

  2. @seike
    460
    -


    - @seike
    46
    0

    - Fusic


    - /


    - / /

    -


    - JAWS Days


    - AWS Dev Day


    - PHPConference
    2

    View full-size slide

  3. Agenda
    1
    .


    2
    .


    3
    .


    4
    . x Stripe
    3

    View full-size slide


  4. https://fusic.co.jp/works/
    4 7





    x SaaS
    5

    View full-size slide

  5. - Windows

    -

    -
    7
    + Stripe

    View full-size slide

  6. - Windows


    - Linux


    -


    -


    -


    - Stripe
    8

    View full-size slide






  7. Email

    Stripe Payment Links






    9

    View full-size slide

  8. 12






    Amazon S
    3 

    Stripe Payment Links




    Stripe




    Web hook



    View full-size slide

  9. Web Amazon S
    3
    15


    OrderID UUID

    - API OrderID


    - OrderID


    - OrderID


    OrderID Key


    View full-size slide

  10. Event( ) -> Amazon S
    3
    16

    OrderID



    = OrderID



    View full-size slide

  11. http
    17
    Amazon S
    3 

    Stripe Payment Links


    Payment Link


    OrderID -> client_reference_id


    Email -> prefilled_email


    Email OrderID

    View full-size slide

  12. Payment Links
    18
    Stripe


    Payment Links 築


    client_reference_id = OrderID


    prefilled_email = Email



    Webhook 築

    View full-size slide

  13. 19
    Web hook





    Payload OrderID Email

    OrderID 築


    View full-size slide

  14. Stripe
    Webhook


    
 

    Webhook


    SDK

    20

    \Stripe\Stripe::setApiKey( sk_test_hoge

    hoge');


    $endpoint_secret = whsec_hoge

    hoge ;



    $payload = @file_get_contents('php://input');


    $sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];


    $event = null;


    try {


    $event = \Stripe\Webhook::constructEvent(


    $payload, $sig_header, $endpoint_secret


    );


    } catch(\UnexpectedValueException $e) {


    // Invalid payload


    http_response_code(
    400
    );


    exit();


    } catch(\Stripe\Exception\SignatureVerificationException $e) {


    // Invalid signature


    http_response_code(
    400
    );


    exit();


    }

    View full-size slide





  15. Web


    Stripe SaaS

    22
    300 $1

    View full-size slide

  16. DB
    Stripe DB




    API


    AWS

    DB

    25
    Stripe

    View full-size slide

  17. Thank You
    We are Hiring !


    https://recruit.fusic.co.jp/

    View full-size slide

  18. 28




    Amazon S
    3 

    Linux


    View full-size slide

  19. Payment Links
    29






    Amazon S
    3 

    Stripe Payment Links


    Linux

    API

    View full-size slide

  20. Stripe
    30






    Amazon S
    3 

    Stripe Payment Links




    Stripe


    Payment Links

    築 築

    View full-size slide

  21. 31






    Amazon S
    3 

    Stripe Payment Links




    Stripe




    Web hook





    Stripe Payload ( )

    View full-size slide

  22. 32






    Amazon S
    3 

    Stripe Payment Links




    Stripe




    Web hook



    View full-size slide