Giter Club home page Giter Club logo

line-pay-in-bot's Introduction

Overview

A sample code to use LINE Pay in your bot.

Demo

line-pay-in-bot-demo

Getting started

Create sandbox of LINE Pay

Go to LINE Pay Developers and create your sandbox. You can retrieve Channel Id and Channel Secret Key after successful login to LINE Pay Console. You also need to configure white lists of server ip addresses which access to LINE Pay API.

Create a channel of LINE Messaging API

Go to LINE developers console and create your channel for LINE Messaging API.

Installation

$ git clone https://github.com/nkjm/line-pay-in-bot.git
$ cd line-pay-in-bot/
$ npm install

Configuration

Create .env file and write following replacing YOUR_VALUE to your value of each parameters.

LINE_BOT_CHANNEL_SECRET=YOUR_VALUE
LINE_BOT_ACCESS_TOKEN=YOUR_VALUE
LINE_PAY_CHANNEL_ID=YOUR_VALUE
LINE_PAY_CHANNEL_SECRET=YOUR_VALUE
LINE_PAY_CONFIRM_URL=YOUR_VALUE

As for LINE_PAY_CONFIRM_URL, it will be https://YOUR_HOSTNAME/pay/confirm.

You can use free services like ngrok or serveo to launch your server. Please be noted that you need to register your global ip address as white list of LINE Pay sandbox. Also need to register https://YOUR_HOSTNAME/webhook as webook URL in LINE Messaging API channel configuration.

*Please keep in mind that these hostname and ip address may change every time you restart the server.

Launch server

If you like to try the server with middleware of the SDK, run follwoing command. This is much simpler but not so flexible.

$ node with_middleare.js

If you like to try the server without using middleware of the SDK, run following command. You can control the behavior more in detail in this configuration.

$ node without_middleware.js

Reference

For more methods of LINE Pay API SDK, refer to API reference.

License

MIT

line-pay-in-bot's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.