Giter Site home page Giter Site logo

tappay-nodejs's People

Contributors

cherri-tech avatar yu-jack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tappay-nodejs's Issues

tappay-nodejs 不支援 LinePay ?

呼叫下面的 /linepay router後express log 一直出現

payment-web:server Listening on port 3000 +0ms
POST /linepay 200 16.901 ms - 2
2019-02-15T02:31:21+0800 <warn> app.js:122 (TapPay.payByPrime.then.result) { status: 627, msg: 'Invalid arguments : backend_notify_url' }
2019-02-15T02:31:21+0800 <warn> app.js:116 (TapPay.payByPrime) null { status: 627, msg: 'Invalid arguments : backend_notify_url' }

想說是不是這個nodejs SDK只支援 DirectPay而已?

app.post('/linepay', urlencodedParser, function(req, res) {
  TapPay.initialize({
    partner_key:
      'partner_0MF44WsoEhgw6ksLALjoia8GamlIGvaMhQRg2myKXqv0ih4UcpEW1MKb',
    env: 'sandbox',
  });

  const payment_info = {
    prime: req.body.prime,
    merchant_id: req.body.merchant_id,
    amount: req.body.amount,
    currency: req.body.currency,
    details: req.body.details,
    cardholder: {
      phone_number: req.body.phone_number || '',
      name: req.body.name || '',
      email: req.body.email || '',
    },
    //prettier-ignore
    result_url: { backend_notify_url: 'https://localhost', frontend_redirect_url: 'https://localhost'}
  };

  // Promise Style
  TapPay.payByPrime(payment_info)
    .then(result => {
      tlogger.warn(result);
    })
    .catch(error => {
      tlogger.error(error);
    });

  res.send('ok');
});

Angular 7 service支援?

請問我該怎麼使用 angular 7 framework 做 TPDirect.card.setup 與後續的TPDirect.card.getPrime 呼叫呢?我看到 tappay-nodejs 裡面有 TapPayServices.d.ts 定義檔案,但確定怎麼整合到 angular 裡面,請問有範例程式嗎?

感謝

Include type declarations in the npm packge

Since this package is written in TypeScript, it will be nice if you can provide .d.ts files in the published npm package to allow other projects to reuse your type declarations. It should be as simple as adding a single line to tsconfig.json:

diff a/tsconfig.json b/tsconfig.json
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -7,6 +7,7 @@
         "target": "es6",
         "module": "commonjs",
         "noImplicitAny": true,
+        "declaration": true,
         "moduleResolution": "node",
         "baseUrl": "./",
         "paths": {

This package does not build on my machine, and I cannot test if the patch works for you.

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.