Sha256: 6117cca85ba6fab6db1066956602b5bf4ac20548f67d8659228e2745a55f187e
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 KB
Contents
# 银联账单接口Ruby SDK 提供此版SDK,方便用户调用银联账单服务接口 ## 安装 Add this line to your application's Gemfile: gem 'unp_smart' And then execute: $ bundle Or install it yourself as: $ gem install unp_smart ## 配置 在项目下增加config/unp_smart.yml文件 ``` development: account: '000000' secret_key: '' server: 'https://data.unionpaysmart.com' debug: true verbose: false raw_response: true ``` * account 账单服务账号 * secret_key 私钥 * server 账单服务地址 * debug 是否开始debug模式 * verbose 是否开始verbose模式 * raw_response 是否解析返回结果 ## 使用 ``` UnpSmart.get path,params,&block UnpSmart.post path,params,&block ``` 支持 post or get,根据官方文档选择即可,接受两个参数 * 请求的接口 此接口可以从官方文档中得到 * 业务参数 如: ``` UnpSmart.get '/merchant/queryName',{mName: '巴黎春天'} ``` 如果只关心返回成功结果,可以将配置参数raw_response设置为false,那么将返回两个值 * 第一个为接口是否请求成功,true or false * 第二个为请求的内容,如果失败为失败信息 ## Contributing 1. Fork it ( https://github.com/unpsmart/unp_smart/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
unp_smart-0.1.0 | README.md |