基于B/S的扫码支付平台的设计
2018-11-13汪天星程耕国
汪天星 程耕国
摘 要: 针对单一的支付方式不能满足用户多元化的支付需求,设计一个基于B/S的扫码支付平台。该平台通过采用扫码支付模式,实现对支付宝和微信支付服务的整合。平台由服务器选型、支付订单生成和异步回调处理三个模块组成。服务器选型模块用于从集群服务器中选择性能相对最佳的服务器处理整个扫码支付流程。支付订单生成模块调用第三方支付下单API生成预支付订单。异步回调处理模块的功能是接收支付通知和更新数据库表的数据。平台采用四项措施降低了支付风险,为用户提供了既安全又快捷的支付服务。
关键词: 支付方式; 支付服务整合; 服务器选型; 异步回调处理; 扫码支付; 支付平台
中图分类号: TN820.2?34; TP311 文献标识码: A 文章编号: 1004?373X(2018)22?0049?04
Abstract: As the single payment mode cannot meet users′ diversified payment needs, a scanning?code payment platform based on B/S is designed. On the platform, the integration of Alipay and WeChat payment services is realized by adopting the scanning?code payment mode. The platform is composed of three modules of server model selection, payment order generation, and asynchronous callback processing. The server model selection module is used to select the relatively high?performance server from cluster servers to handle the whole scanning?code payment process. The payment order generation module is used to invoke the third?party payment order API to generate the prepayment order. The functions of the asynchronous callback processing module is to receive payment notifications and update the data in database tables. Four measures are taken for the platform to reduce payment risks, which can provide users with secure, rapid and convenient payment services.
Keywords: payment mode; payment service integration; server model selection; asynchronous callback processing; scanning?code payment; payment platform
0 引 言
随着互联网技术的飞速发展,以支付宝为代表的第三方支付方式迅速在中国普及。第三方支付逐渐取代现金和信用卡支付,成为当前中国最受欢迎的支付方式。然而,中国消费者广泛分布在线下、PC端和移动端,消费者的支付需求趋于多元化,支付场景过于碎片化。任意一种支付方式不足以应付所有支付场景和满足所有支付需求。本平台为了满足消费者多元化的支付需求,基于扫码支付模式整合支付宝和微信支付服务,为消费者提供灵活方便、多渠道的支付服务[1]。
1 扫码支付
1.1 支付原理
首先,平台服务器按照第三方支付平台(指支付宝和微信)制定的规则生成二维码,并将它展示在PC网页上。……
