A production-ready ECPay AIO SDK for Node.js

Overview

node-ecpay-aio

A production-ready 綠界全方位金流(ECPay All-In-One, AIO) SDK for Node.js with TypeScript Support

build Coverage Badge npm npm node version TypeScript


Documentation

本模組詳細使用說明請見 User Guide


Overview

本模組是根據綠界官方 AIO 規格的全新實作,並非官方維護的 SDK 或是 fork 改寫版本。此模組的設計初衷是為了與官方最新的 API 規格一致、更貼近 JS 開發風格、提供 TypeScript 支援、盡可能完善的自動化測試以及更完善的文件說明。


對應官方版本


Installation

npm install --save node-ecpay-aio

Features

  • 內建 TypeScript 支援
  • 按職責區分 Merchant (特店)、Payment (付款方式)、Query (查詢)、Action (操作)等類別
  • ATM、超商代碼與超商條碼可於後端建立訂單時一併獲得取號結果
  • 結構化的錯誤訊息,更易於程式流程控制
  • 使用 yup 對 API 要求參數與相依條件進行防衛驗證
  • 自動為 REQ/RSP 產生與驗證 CheckMacValue,若驗證到接收響應之校驗碼不符會自動拋錯
  • 遠端查詢或操作作業失敗,會自動拋錯並附帶綠界傳回的錯誤碼、錯誤訊息與原始響應資料
  • 自動設定 derivable 的參數,如 ChoosePayment, InvoiceMark
  • 支援 Node.js v10.x 以上 (自動測試環境包含 v10.x, v12.x, v14.x 與 v16.x)
  • Serverless (Lambda) friendly

Notes

  • 使用前建議先讀過官方文件與本模組 User Guide
  • 歡迎發 Issue,但我不一定有時間修
  • 更歡迎發 PR(帶測試佳)或共同維護
  • 本模組基本穩定,但有些功能綠界沒有提供 Testing stage,自動化測試跑不到那些 cases。

License

Licensed under MIT.




You might also like...

Portfolio for Intro to Photography/Digital Media Production

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

May 26, 2022

next-graphql-server is a library for building production-grade GraphQL servers using Next.js with API Routes

next-graphql-server next-graphql-server is an easy to use Next.js library for creating performant GraphQL endpoints on top of Next.js API Routes. Star

Nov 21, 2022

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and a CLI tool.

Dec 24, 2022

A tool for managing production-grade cloud clusters, infrastructure as code

Cloudy Description Cloudy is an "infrastructure as code" tool for managing production-grade cloud clusters. It's based on Pulumi that mostly using Ter

Jan 1, 2023

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.

Install | Documentation | Releases | Contributing Foundation is the most advanced responsive front-end framework in the world. Quickly go from prototy

Jan 4, 2023

Groth16 proofs are very popular and are used by many protocols in production.

Groth16 proofs are very popular and are used by many protocols in production.

Geometry presents: the Groth16 Malleability Challenge Preamble Groth16 proofs are very popular and are used by many protocols in production. Libraries

Dec 14, 2022

This blog is still under development! I present a project scope for science articles, it can now be used in production! But there are some details that need to be put up front.

Science-Blog 🛑 Attention! This blog is still under development! I present a project scope for science articles, it can now be used in production! But

Sep 19, 2022

Node.js implementation of the Socket SDK client

SYNOPSIS A Node.js adapter for the Socket SDK DESCRIPTION Socket SDK uses a simple uri-based protocol for brokering messages between the render proces

Dec 28, 2022

ZITADEL SDK for Node.js

ZITADEL Node.js This is the ZITADEL Node.js SDK. This library contains the compiled and generated gRPC service clients for the ZITADEL API. Also it co

Dec 18, 2022
Comments
  • 測試時使用本地網址ReturnURL錯誤

    測試時使用本地網址ReturnURL錯誤

    ReturnURL使用本地網址 "http://localhost:3000/" 會產生錯誤訊息。 使用NextJS 後端用tRPC 和 RESTAPI 都出現一樣問題。 換回用官方的是ok可以用, 我嘗試以下方法:

    const newM = new Merchant("Test", options);
    
    const options = {
    ....
     ReturnURL:`${process.env.API_URL}paySuccess`, //API_URL=http://localhost:3000,
    OR...
     ReturnURL:`http://localhost:3000/paySuccess`,
    }
    

    catch出來的錯誤:

     value: {
        ...,
        ReturnURL: 'http://localhost:3000/paySuccess',
    
      },
      path: 'ReturnURL',
      type: 'url',
      errors: [ 'ReturnURL must be a valid URL' ],
      params: {
        value: 'http://localhost:3000/paySuccess',
        originalValue: 'http://localhost:3000/paySuccess',
        label: undefined,
        path: 'ReturnURL',
        regex: /^((https?|ftp):)?\/\/.......?)*)?$/i
      },
      inner: [],
      page: '/api/PaymentDoneServer'
    }
    

    版本:0.2.2

    opened by Jimmy1186 3
Releases(v0.2.0)
Owner
simen
Code with Love
simen
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
The high efficent browser driver on top of puppeteer, ready for production scenarios.

browserless is an efficient driver for controlling headless browsers built on top of puppeteer developed for scenarios where performance matters. High

microlink.io 1.2k Jan 6, 2023
Prototype of real-time comments and a proposal of how to make it "production-ready".

Real-time comments prototype Simple demonstration of real-time commenting. Installation After forking it, run npm install, then you need two environme

Tiger Abrodi 3 Jan 16, 2022
A highly opinionated and complete starter for Next.js projects ready to production

The aim for this starter is to give you a starting point with everything ready to work and launch to production. Web Vitals with 100% by default. Folder structure ready. Tooling ready. SEO ready. SSR ready.

Fukuro Studio 28 Nov 27, 2022
MUI Core is a collection of React UI libraries for shipping new features faster. Start with Material UI, our fully-loaded component library, or bring your own design system to our production-ready components.

MUI Core MUI Core contains foundational React UI component libraries for shipping new features faster. Material UI is a comprehensive library of compo

MUI 83.6k Dec 30, 2022
A secure MERN Stack boilerplate ready for Production that uses Docker & Nginx.

A production ready & secure boilerplate for the MERN Stack that uses Docker & Nginx. Focus on the product and not the setup. You can directly start wo

Karan Jagtiani 34 Dec 23, 2022
The iofod SDK provides developers with the ability to interact with the main iofod interface within the Web worker, enabling rapid development of iofod extensions through the SDK.

iofod-sdk English | 简体中文 The iofod SDK provides developers with the ability to interact with the main iofod interface within the Web worker, enabling

iofod, Inc. 47 Oct 17, 2022
Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's `move-ts`.

Movehat Movehat is a TypeScript SDK for Move on Sui built on top of Sui's TypeScript SDK and our fork of Ian Macalinao's move-ts. Movehat aspires to b

Pentagon 10 Sep 30, 2022
NoExGen is a node.js express application generator with modern folder structure, namespace/project mapping and much more! It contains preconfigured Settings and Routing files, ready to be used in any project.

Installation $ npm install -g noexgen Quick Start You can use Node Package Execution to create your node-express application as shown below: Create th

Souvik Sen 7 Oct 8, 2022