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. @seike 460 - - @seike 46 0
 - Fusic -

    / - / / 
 - - JAWS Days - AWS Dev Day - PHPConference 2
  2. 01

  3. 02

  4. 10

  5. 03

  6. Web Amazon S 3 15 
 OrderID UUID 
 -

    API OrderID - OrderID 
 - OrderID 
 OrderID Key 
 築
  7. http 17 Amazon S 3 
 Stripe Payment Links Payment

    Link 
 OrderID -> client_reference_id Email -> prefilled_email Email OrderID
  8. Stripe Webhook 
 
 
 
 Webhook SDK 
 20

    <?php 
 \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(); }