å¦çããã¼ ãã©ã³ã¶ã¯ã·ã§ã³éå§ productsãSELECTãã¦stockãããã確èªãã ããã§ååã確ä¿ããï¼productsã®è©²å½ã¬ã³ã¼ãã®ããã¯ï¼ãå¿ è¦ã¨ãªã ordersã«INSERT order_detailsã«ãªã¯ã¨ã¹ãã®ååé åã®ä»¶æ°åINSERT(order_id=ordersã¨ç´ä»ã, product_id=ãªã¯ã¨ã¹ããã) å¤é¨APIã«é£æºãã¦æ±ºæ¸ãã(total_priceãè¨ç®ãã¦ãcardã渡ã) 失æããã° ãã¼ã«ãã㯠決æ¸ãæåããã°productsãUPDATE(stockãæ¸ãã) paymentsã«INSERT(order_id=ordersã¨ç´ä»ã, amount= total_price, card=ãªã¯ã¨ã¹ããã) ã³ããã å¦çå ¨ä½ããã©ã³ã¶ã¯ã·ã§ã³å ã§å®è¡ãããããå¤é¨APIã§å¤±æããå ´åã«ãã¼ã«ããã¯ããã°ãªãã®åé¡ããªãããã«æãã
{{#tags}}- {{label}}
{{/tags}}