Giter Site home page Giter Site logo

zitong / alipayorderssupervisor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thundernet8/alipayorderssupervisor

0.0 1.0 0.0 75 KB

:sparkles: 使用Node监视支付宝订单,即时通知服务器以实现免签约支付接口

License: MIT License

JavaScript 51.03% TypeScript 48.97%

alipayorderssupervisor's Introduction

Alipay Orders Supervisor

支付宝免签约支付接口实现脚本 - NodeJS 版本 .

GitHub issues GitHub forks GitHub stars dependency status Build Status GitHub license code style: prettier


Update 2018.2

目前支付宝已经加强了登录的校验,极大影响工具便利性,现在推出了另一种解决方案,见利用有赞云和有赞微小店实现个人收款解决方案提供一种思路参考,可以直接按此仓库使用的方法应用到自己的系统中,或使用该仓库作为一个独立的服务.

GUI 版 (Update 2017-08-17)

现已推出 GUI 版客户端,由 Java+Swing 编写,项目地址AlipayOrdersSupervisor-GUI

功能介绍

通过 NodeJS 爬取个人支付宝交易订单列表,分析订单中的备注,然后将订单数据推送至指定服务器,实现支付宝交易接口

自带了简单的日志和邮件通知功能,对系统异常及时报告以及记录

如何使用

    1. 请配置lib/config.js中的参数,如邮件 SMTP,推送服务器地址,以及pushStateSecretalipayCookies等。

pushStateSecret用于数据的加盐保证安全以及验证推送来源的合法性

pushAppIdpushAppKey暂时无用

alipayCookies必须填写,这是为了爬取订单时保证登录状态

    1. 安装必要的 npm 包
npm install
    1. 使用forever循环运行脚本
forever start index.js

或者使用 script

npm start

脚本会每分钟爬取一次订单列表

    1. 服务端处理

请参考脚本中利用pushStateSecret生成签名的方法,验证数据合法性后进行业务处理

注 : 服务端返回success文本后会将对应记录标记为已处理,后续不会再次推送

使用 Tips

目前该脚本已在我的个人网站 webapproach.net/shop 上稳定生产运行,对于 cookies 过期问题,从上一次 2017 年 2 月 25 日更换 cookies 起至今 (2017 年 6 月 13 日 ),已持续 3 个半月未遭遇 cookies 过期问题。因此可能建议:

  • 没事不要去登录访问网页版的订单界面,当你关闭网页或网页上直接退出或者在网页停留过久无操作可能会触发服务端 session 更新 cookies 内容失效

License

AlipayOrdersSupervisor is freely distributable under the terms of the MIT license.

FOSSA Status

alipayorderssupervisor's People

Contributors

thundernet8 avatar

Watchers

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