codeforwuhan / unionpei Goto Github PK
View Code? Open in Web Editor NEWUnionPay for Ruby 银联非官方包 rubygems.org/gems/unionpei
UnionPay for Ruby 银联非官方包 rubygems.org/gems/unionpei
UnionPei - 非官方银联支付(UnionPay)SDK 1. 安装 gem 'unionpei' 2. 快速开始(rails) 2.1 指定读取设定的配置文件 # config/initializers/unionpei.rb UnionPei.configure do |config| if Rails.env.production? config.acp_sdk_config_path = Rails.root.join('safe/unionpay/acp_production_sdk.ini') end end 2.2 生成支付的页面 参数可参考相关文档,或者源码中payment.rb class PaymentsController < ApplicationController # B2C 支付 def union_b2c_pay UnionPei::Payment.b2c({}) render html: UnionPei::Payment.b2c.html_safe end # B2B 支付 def union_b2b_pay UnionPei::Payment.b2b({}) render html: UnionPei::Payment.b2b.html_safe end # 查询订单详情 def query_trans UnionPei::Payment.query_trans({}) end end 3. 参考文档 - 银联测试参数:https://open.unionpay.com/tjweb/user/mchTest/param - 测试说明:https://open.unionpay.com/tjweb/support/faq/mchlist?id=516 - 证书说明:https://open.unionpay.com/tjweb/support/faq/mchlist?id=21 - API文档:https://open.unionpay.com/tjweb/acproduct/APIList?apiservId=448&acpAPIId=754&bussType=0 - SDK下载:https://open.unionpay.com/tjweb/support/faq/mchlist?id=38 - 测试卡信息:https://open.unionpay.com/tjweb/support/faq/mchlist?id=4 - B2B:https://open.unionpay.com/tjweb/acproduct/list?apiSvcId=452&index=999 4. 免责声明 本Gem对以下非官方代码进行封装和改造: https://open.unionpay.com/tjweb/support/faq/mchlist?id=38 代码仅供参考学习,生产环境请自行封装代码。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.