Giter Club home page Giter Club logo

3rd_payway_nodejs_demo's Introduction

3rd_payway_nodejs_demo

MVC 架構 -> M ; C -> controller ; V -> view

  • (m)business model : 商業邏輯
  • (m)data model :

Database

Product

  • id -primary key
  • name var(char255)
  • amount (integer unsigned == 100)
  • description (text)
  • per_order 作為預留金流交易物品 預繳扣費額度 transactions
  • price 價格 => 同一時間一堆人點擊 到真正付款時候才扣掉額度

訂單表

CREATE TABLE orders ( id varchar(20) not null primary key COMMENT "大部分API 給予亂數字串", total int unsigned not null default 0, created_at datetime not null default now(), updated_at datetime not null default now(), payment_provider enum("PAYPAL", "ECPAY"), payment_pay enum("CSV", "CC", "ATM", "PAYPAL"), status enum("WAITING", "SUCCESS", "FAILED", "CANCEL"), contents JSON default null COMMENT "這是商品內容[{商品id,商品數量,商品價格}]" );

=>enum = enumerate列舉 , enum("T", "E") => 輸入單字不是T或E的話他會直接跳錯誤

訂單 - 產品對應表

  1. 前端資料驗證 // 使用express-validator
  2. 將商品的數量寫入 (預扣) -----> id
  3. 利用 ID 去打 第三方金流的 API 來產生給第三方金流的訂單
  4. 當使用者付款之後,第三方金流在打我們提供的 update 資訊的 API

// 倉品id, 商品名稱, 商品數量, payment_provider, payment_pay // 使用

3rd_payway_nodejs_demo's People

Contributors

ian293382 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.