曾子銘
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 綠界金流Api串接(前端) 🐑 🐑 🐑 ------------ ## 流程說明 ![](https://i.imgur.com/ZlgRD20.jpg) ### 建立訂單 1. 跟後端建立後端訂單資料 2. 建立成功後用訂單編號當url跳轉至ECpay ### 建立ECpay 1. 用router取的編號後跟後端取的訂單資料 2. 判斷訂單資料的狀態 ``` json paymentStatus: { 1: 未付款 2: 付款中 3: 完成付款 } ecpayStatus: { 1: 第一次建立訂單 2: 重建訂單 3: 完成訂單 } ``` **如果ecpayStatus === 3 前往/{payment}/{no} 結果頁面** 4. 顯示資料跟開始付款按鈕 5. 按下開始付款後 跟後端取得表單資料放上v-html後submit跳窗前往綠界站外付 ### ECpay #### 付款完成 會有返回商店按鈕 點選後會根據付款類型前往不同的地方 - 前往/{payment}/{no} 結果頁面 - 前往/{no} 重新判定訂單狀態 #### 付款失敗或訂單建立失敗 1. 綠界通知後端付款失敗 後端重新建立綠界訂單 狀態改為重建訂單(2) 2. 使用者點選返回按鈕前往/{no} 重新判定訂單狀態 ![](https://i.imgur.com/fnD9jzP.jpg) ## 檔案分層 ### page ``` |-Money |-_id.vue |-index.vue |-_payment/_no/index.vue ``` ### component ``` |-Money |-Ecpay.vue |-Info |-ATM.vue |-Barcode.vue |-CREDIT.vue |-CVS.vue |-WebATM.vue |-CREDIT |-Installment.vue |-Payoff.vue |-Period.vue ``` ## 新增的套件 - 一維條碼(jsBarcode) > https://github.com/lindell/JsBarcode - 二維條碼 qrcode > https://www.npmjs.com/package/qrcode.vue ### JsbarCode使用範例 裝進去 ```npm npm i jsbarcode ``` ![](https://i.imgur.com/31AoKC7.png) 載入 template ![](https://i.imgur.com/6sxMdU3.png) barcode可為svg、img、canvas ![](https://i.imgur.com/aittdJu.png) ```javascript= jsbarcode("htmlid",String); ``` ### qrcode.vue使用範例 ```npm npm install --save qrcode.vue # yarn add qrcode.vue ``` 於component中引入 ```javascript import QrcodeVue from 'qrcode.vue' ``` templete ```html <qrcode-vue :value="value" :size="size" level="H"></qrcode-vue> ``` ## 銀行與付款方式對照表 ![](https://i.imgur.com/h4cGYBR.png) 用於CVS Barcode ATM 返回付款中Info data.PaymentType ![](https://i.imgur.com/hj5K0Wb.png) ## 付款方式 - ATM 一般atm匯款 - CVS 超商號碼 and 條碼 - WebATM 網路銀行(需讀卡機 - Barcode 一般條碼 - Credit 信用卡 - payoff 一次付清 - installment 分期付款 - period 定期定額 ## 遇到問題Vue ### 資料尚未拿到時資料呈現 template 取得data 為 order[] ![](https://i.imgur.com/uxpUMhT.png) ![](https://i.imgur.com/393671I.png) order透過api取回 如果預設data不為 ```javascript= order:{ buyer: {} } ``` 則結果會為顯示為undefind需要向下訂到第二層 ### Props問題 由於htmltag props採駝峰命名導致props失敗 htmltag 由於都會轉成小寫不建議採大寫命名 props則無所謂 大駝峰小駝峰都可以 ```vue <div id="vm"> <!--post-title 跟 post-content 都是props --> <blog-post post-title="Blog1" post-content="I\'m content1"></blog-post> </div> <script> Vue.component("blog-post", { props: ["PostTitle", "postContent"], template: `<div> <h3>{{ PostTitle }}</h3> <div>{{ postContent }}</div> </div>` }); </script> ``` ### HotReLoad-Boom! ```npm npm run dev ``` 模式中開啟過多分頁會導致nuxt啟的node server crash ```npm npm run build npm run start ``` 則不會 ## 電子發票細項 - 回應代碼: rtnCode - 特店編號: IISMerID - 發票號碼: IISNumber - 特店自訂編號: IISRelateNumber - 客戶編號: IISCustomerID - 買方統編: IISIdentifier - 客戶名稱: IISCustomerName - 客戶地址: IISCustomerAddr - 客戶手機號碼: IISCustomerPhone - 客戶電子信箱: IISCustomerEmail - 通關方式: IISClearanceMark - 發票種類: IISType - 發票類別: IISCategory - 課稅別: IISTaxType - 特種稅額類別: specialTaxType - 稅率: IISTaxRate - 稅金: IISTaxAmount - 發票金額: IISSalesAmount - 發票檢查碼: IISCheckNumber - 載具類別: IISCarrierType - 載具編號: IISCarrierNum - 捐款單位捐贈碼: IISLoveCode - 發票開立IP: IISIP - 發票開立時間: IISCreateDate - 發票開立狀態: IISIssueStatus - 發票作廢狀態: IISInvalidStatus - 發票上傳狀態: IISUploadStatus - 發票上傳時間: IISUploadDate - 發票上傳後接收狀態: IISTurnkeyStatus - 折讓剩餘金額: IISRemainAllowanceAmt - 列印旗標: IISPrintFlag - 中獎期標: IISAwardFlag - 中獎種類: IISAwardType - 隨機碼: IISRandomNumber - 發票備註: invoiceRemark - 顯示電子發票BARCODE用: posBarCode - 顯示電子發票QRCODE左邊用: QRCodeLeft - 顯示電子發票QRCODE右邊用: QRCodeRight

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully