Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥

決済のその先へ、顧客DBとして考えるStripe / Beyond payments, Str...

決済のその先へ、顧客DBとして考えるStripe / Beyond payments, Stripe as a customer DB

JP_Stripes 大阪 Vol.7 - 新サービス開発・収益化を加速するStripe活用法
https://jpstripes.connpass.com/event/294284/

shiro seike

October 17, 2023
Tweet

More Decks by shiro seike

Other Decks in Programming

Transcript

  1. 自己 @seike 46 0 - - @seike 46 0 -

    AWS Community Builder Serverless - Fusic - / 門 - / - - PHP Japan - JAWS Days AWS Dev Day - Serverless Days Tokyo - - JP_Stripes - PHP 2023 行 長 - JAWS Festa 行 - Cloudflare Meet-up Fukuoka Serverless Meetup Fukuoka Fukuoka.php Fukuoka.go 2
  2. 01

  3. 02

  4. - Windows 人 手 自 行 - 用 行 Linux

    - - - 用 用 - Stripe 用 入 8
  5. 10

  6. 03

  7. Web Amazon S 3 13 入力 OrderID 自 UUID 生

    - API OrderID 生 - OrderID - OrderID JSON - OrderID.kaiseki OrderID.json OrderID Key 築 Amazon S 3 … Cloudfront … CDN AWS Lambda … FaaS
  8. Event( ) -> Amazon S 3 14 行 JSON OrderID.json

    -> OrderID OrderID -> OrderID.kaiseki 入 力 用 行 AWS Fargate … Amazon EventBridge …
  9. http 15 Amazon S 3 入力 Email Stripe Payment Links

    Payment Link 入 OrderID -> client_reference_id Email -> prefilled_email Email 人 OrderID Amazon SES … Email
  10. Payment Links 16 Stripe 行 Payment Links 築 client_reference_id =

    OrderID prefilled_email = Email 行 Webhook 築
  11. Stripe 用 Webhook Webhook 言 SDK 非 18 <?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(); }
  12. Stripe 22 AWS Amplify 用 Stripe DB 用 - Payment

    Links 文 - Email AWS Amplify …