lanmao 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +59 -0
  3. data/.travis.yml +21 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +8 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +47 -0
  8. data/Rakefile +12 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +8 -0
  11. data/lanmao.gemspec +45 -0
  12. data/lib/lanmao/api/account/.gitkeep +0 -0
  13. data/lib/lanmao/api/api_helper.rb +57 -0
  14. data/lib/lanmao/api/money/.gitkeep +0 -0
  15. data/lib/lanmao/api/money/auto_withdraw.rb +37 -0
  16. data/lib/lanmao/api/query/.gitkeep +0 -0
  17. data/lib/lanmao/api/query/query_authorization_entrust_pay_record.rb +32 -0
  18. data/lib/lanmao/api/query/query_project_information.rb +32 -0
  19. data/lib/lanmao/api/query/query_transaction.rb +34 -0
  20. data/lib/lanmao/api/query/query_user_information.rb +33 -0
  21. data/lib/lanmao/api/trade/.gitkeep +0 -0
  22. data/lib/lanmao/api/trade/async_transaction.rb +49 -0
  23. data/lib/lanmao/api/trade/establish_project.rb +45 -0
  24. data/lib/lanmao/api/trade/modify_project.rb +34 -0
  25. data/lib/lanmao/client.rb +45 -0
  26. data/lib/lanmao/extensions.rb +7 -0
  27. data/lib/lanmao/form/account/.gitkeep +0 -0
  28. data/lib/lanmao/form/account/activate_stocked_user_form.rb +36 -0
  29. data/lib/lanmao/form/account/check_password_form.rb +35 -0
  30. data/lib/lanmao/form/account/enterprise_register_form.rb +52 -0
  31. data/lib/lanmao/form/account/personal_register_expand_form.rb +44 -0
  32. data/lib/lanmao/form/account/reset_password_form.rb +35 -0
  33. data/lib/lanmao/form/account/user_authorization_form.rb +35 -0
  34. data/lib/lanmao/form/account/user_pre_transaction_form.rb +43 -0
  35. data/lib/lanmao/form/form_helper.rb +34 -0
  36. data/lib/lanmao/form/money/.gitkeep +0 -0
  37. data/lib/lanmao/form/money/recharge_form.rb +65 -0
  38. data/lib/lanmao/form/query/.gitkeep +0 -0
  39. data/lib/lanmao/form/trade/.gitkeep +0 -0
  40. data/lib/lanmao/http/error_code/account.rb +61 -0
  41. data/lib/lanmao/http/error_code/asset.rb +20 -0
  42. data/lib/lanmao/http/error_code/batch.rb +28 -0
  43. data/lib/lanmao/http/error_code/enterprise.rb +12 -0
  44. data/lib/lanmao/http/error_code/form.rb +15 -0
  45. data/lib/lanmao/http/error_code/money.rb +48 -0
  46. data/lib/lanmao/http/error_code/platform.rb +15 -0
  47. data/lib/lanmao/http/error_code/query.rb +48 -0
  48. data/lib/lanmao/http/error_code/trade.rb +52 -0
  49. data/lib/lanmao/http/request.rb +82 -0
  50. data/lib/lanmao/http/response.rb +55 -0
  51. data/lib/lanmao/railtie.rb +7 -0
  52. data/lib/lanmao/sign/rsa.rb +14 -0
  53. data/lib/lanmao/utils.rb +76 -0
  54. data/lib/lanmao/version.rb +3 -0
  55. data/lib/lanmao.rb +55 -0
  56. data/tmp/.gitkeep +0 -0
  57. metadata +270 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1526c8fe1fc83ea13b164a209a635800ead4e17a
4
+ data.tar.gz: 5a316c6a08982b2257b284f64adb60b38a2ec414
5
+ SHA512:
6
+ metadata.gz: 262d2cde5d79fe287c9ae207b34c778a0003c5551a3813f3bc572667e8c677e6b8e0367271d61cc79d13f33ca94f8d9f1e69e947be31fdd1f6149f3fe1a112fd
7
+ data.tar.gz: 64d79a02268f353941177ddb5a134763a638522d8a311fce20f9a154aae6e4bf505fa680cbee4d3855ef95b92876248425cfa871bf8ad9d47743b5a99cf56e3b
data/.gitignore ADDED
@@ -0,0 +1,59 @@
1
+ .rspec_status
2
+ *.gem
3
+ *.rbc
4
+ /.config
5
+ /coverage/
6
+ /InstalledFiles
7
+ /pkg/
8
+ /spec/reports/
9
+ /spec/examples.txt
10
+ /test/tmp/
11
+ /test/version_tmp/
12
+ /tmp/
13
+ /spec/support/config/config.yml
14
+
15
+ .byebug_history
16
+ Gemfile.lock
17
+
18
+ # Used by dotenv library to load environment variables.
19
+ # .env
20
+
21
+ ## Specific to RubyMotion:
22
+ .dat*
23
+ .repl_history
24
+ build/
25
+ *.bridgesupport
26
+ build-iPhoneOS/
27
+ build-iPhoneSimulator/
28
+
29
+ ## Specific to RubyMotion (use of CocoaPods):
30
+ #
31
+ # We recommend against adding the Pods directory to your .gitignore. However
32
+ # you should judge for yourself, the pros and cons are mentioned at:
33
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
34
+ #
35
+ # vendor/Pods/
36
+
37
+ ## Documentation cache and generated files:
38
+ /.yardoc/
39
+ /_yardoc/
40
+ /doc/
41
+ /rdoc/
42
+
43
+ ## Environment normalization:
44
+ /.bundle/
45
+ /vendor/bundle
46
+ /lib/bundler/man/
47
+
48
+ # for a library or gem, you might want to ignore these files since the code is
49
+ # intended to run in multiple environments; otherwise, check them in:
50
+ # Gemfile.lock
51
+ # .ruby-version
52
+ # .ruby-gemset
53
+
54
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
55
+ .rvmrc
56
+ spec/tmp_spec.rb
57
+
58
+ *#*
59
+ *~*
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.5
4
+ before_install:
5
+ - cp spec/support/config/config.uat.yml spec/support/config/config.yml
6
+ notifications:
7
+ email:
8
+ on_success: always
9
+ on_failure: always
10
+ sudo: false
11
+ cache: bundler
12
+ deploy:
13
+ script: echo "正在部署到 rubygems.org"
14
+ provider: rubygems
15
+ skip_cleanup: true
16
+ gem:
17
+ lanmao
18
+ on:
19
+ tags: true
20
+ api_key:
21
+ secure: ddd
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at chpy15@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ gem 'codecov', :require => false, :group => :test
6
+
7
+ # Specify your gem's dependencies in lanmao.gemspec
8
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 chenpengyu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ [![Gem](https://img.shields.io/gem/v/lanmao.svg?style=flat)](https://rubygems.org/gems/lanmao)
2
+ [![Build Status](https://travis-ci.org/omniaccountcorp/lanmao.svg?branch=master)](https://travis-ci.org/omniaccountcorp/lanmao)
3
+ [![codecov](https://codecov.io/gh/omniaccountcorp/lanmao/branch/master/graph/badge.svg)](https://codecov.io/gh/omniaccountcorp/lanmao)
4
+
5
+ # Lanmo
6
+
7
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lanmao`. To experiment with that code, run `bin/console` for an interactive prompt.
8
+
9
+ TODO: Delete this and the text above, and describe your gem
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'lanmao'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install lanmao
26
+
27
+ ## Usage
28
+
29
+ TODO: Write usage instructions here
30
+
31
+ ## Development
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lanmao. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
40
+
41
+ ## License
42
+
43
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
44
+
45
+ ## Code of Conduct
46
+
47
+ Everyone interacting in the Lanmao’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lanmao/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+
8
+ task :push do
9
+ puts `gem push pkg/lanmao-#{Lanmao::VERSION}.gem`
10
+ end
11
+
12
+ task :publish => [:build, :push]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "lanmao"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lanmao.gemspec ADDED
@@ -0,0 +1,45 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path("../lib", __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require "lanmao/version"
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "lanmao"
9
+ spec.version = Lanmao::VERSION
10
+ spec.authors = ["tony"]
11
+ spec.email = ["gandalf@omniaccount.com"]
12
+
13
+ spec.summary = %q{懒猫存管系统 SDK}
14
+ spec.description = %q{新网银行的存管实现}
15
+ spec.homepage = "https://github.com/omniaccountcorp/lanmao"
16
+ spec.license = "MIT"
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ if spec.respond_to?(:metadata)
21
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
22
+ else
23
+ raise "RubyGems 2.0 or newer is required to protect against " \
24
+ "public gem pushes."
25
+ end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
28
+ f.match(%r{^(test|spec|features)/})
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ spec.add_development_dependency "bundler", "~> 1.16"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency 'macaddr', '~> 1.7', '>= 1.7.1'
37
+ spec.add_development_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
38
+ spec.add_development_dependency "rspec", "~> 3.0"
39
+ spec.add_development_dependency 'faker', '~> 1.8', '>= 1.8.4'
40
+ spec.add_development_dependency 'byebug', '~> 9.1'
41
+ spec.add_development_dependency 'awesome_print', '~> 1.8'
42
+
43
+ spec.add_runtime_dependency 'macaddr', '~> 1.7', '>= 1.7.1'
44
+ spec.add_runtime_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
45
+ end
File without changes
@@ -0,0 +1,57 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module CommunicateResultHelper
5
+
6
+ # 操作类的 api,统一返回处理
7
+ #
8
+ # @param request_type [Symbole] 操作类(:operate)/查询类(:query)
9
+ # @param service [ String ] 上饶的服务
10
+ # @param params [ Hash ] 参数
11
+ # @param type [ Symbol ] gateway => 网关模式, service => 直连模式
12
+ # @param fail_codes [ Array ] 错误返回码
13
+ # @param success_codes [ String ] 【业务】【明确的】正确返回码(而不是申请成功这类)
14
+ #
15
+ # @return [ Hash ] 结果集(见通用返回)
16
+ #
17
+ def operate_post(request_type, service, params, type)
18
+ request = Http::Request.new(params, @config, service, type)
19
+ response = request.post
20
+
21
+ res = Lanmao::Utils.api_result(params, response)
22
+
23
+ # 向服务器发送操作,超时类的都应该当 pending 处理
24
+ if :operate == request_type
25
+ if response.http_pending?
26
+ Lanmao.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
27
+ return res
28
+ end
29
+
30
+ # 确定的错误
31
+ # 调用状态(0为调用成功、1为失败,返回1时请看【error_code】及【error_msg】描述)
32
+ if '1' == response.data[:code].to_s
33
+ res[:result] = 'F'
34
+ Lanmao.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
35
+ return res
36
+ end
37
+
38
+ # 查询类 api,http 没成功都返回 pending
39
+ elsif :query == request_type
40
+ unless response.http_success?
41
+ Lanmao.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
42
+ return res
43
+ end
44
+
45
+ else
46
+ raise '未知的请求类型,请选择设置:操作类(:operate)/查询类(:query)'
47
+ end
48
+
49
+ res[:result] = 'S' if 'SUCCESS' == response.data[:status] && '0' == response.data[:code].to_s # 业务是否成功标记位
50
+
51
+ Lanmao.logger.info "#{request.identifier} 最终返回的数据为:\n#{res}\n"
52
+ res
53
+ end
54
+
55
+ end # CommunicateResultHelper
56
+ end
57
+ end
File without changes
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Money
5
+ module Withdraw
6
+
7
+ #
8
+ # @return [ Hash ] 结果集
9
+ # * :result [String] "S"/"F"/"P"
10
+ # * :request_params [Hash] 请求参数
11
+ # * :response [Object] 请求返回对象
12
+ # * :code [String] 结果代码
13
+ # * :msg [String] 结果信息
14
+ # * :data: 具体业务返回信息
15
+ #
16
+ def auto_withdraw(user_no, flow_id, withdraw_type,
17
+ amount, commission=nil)
18
+
19
+ service = 'AUTO_WITHDRAW'
20
+
21
+ params = {
22
+ platformUserNo: user_no,
23
+ requestNo: flow_id,
24
+ withdrawType: withdraw_type,
25
+ amount: amount,
26
+ commission: commission
27
+ }
28
+
29
+ res = operate_post(:operate, service, params, :service)
30
+
31
+ res
32
+ end
33
+
34
+ end
35
+ end
36
+ end
37
+ end
File without changes
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Query
5
+ module QueryAuthorizationEntrustPayRecord
6
+
7
+ # 5.2 单笔交易查询
8
+ #
9
+ # @return [ Hash ] 结果集
10
+ # * :result [String] "S"/"F"/"P"
11
+ # * :request_params [Hash] 请求参数
12
+ # * :response [Object] 请求返回对象
13
+ # * :code [String] 结果代码
14
+ # * :msg [String] 结果信息
15
+ # * :data: 具体业务返回信息
16
+ #
17
+ def query_authorization_entrust_pay_record(flow_id)
18
+ service = 'QUERY_AUTHORIZATION_ENTRUST_PAY_RECORD'
19
+
20
+ params = {
21
+ requestNo: flow_id,
22
+ }
23
+
24
+ res = operate_post(:query, service, params, :service)
25
+
26
+ res
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Query
5
+ module QueryProjectInformation
6
+
7
+ # 5.2 标的信息查询
8
+ #
9
+ # @return [ Hash ] 结果集
10
+ # * :result [String] "S"/"F"/"P"
11
+ # * :request_params [Hash] 请求参数
12
+ # * :response [Object] 请求返回对象
13
+ # * :code [String] 结果代码
14
+ # * :msg [String] 结果信息
15
+ # * :data: 具体业务返回信息
16
+ #
17
+ def query_project_information(project_no)
18
+ service = 'QUERY_PROJECT_INFORMATION'
19
+
20
+ params = {
21
+ projectNo: project_no,
22
+ }
23
+
24
+ res = operate_post(:query, service, params, :service)
25
+
26
+ res
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Query
5
+ module QueryTransaction
6
+
7
+ # 5.2 单笔交易查询
8
+ #
9
+ # @return [ Hash ] 结果集
10
+ # * :result [String] "S"/"F"/"P"
11
+ # * :request_params [Hash] 请求参数
12
+ # * :response [Object] 请求返回对象
13
+ # * :code [String] 结果代码
14
+ # * :msg [String] 结果信息
15
+ # * :data: 具体业务返回信息
16
+ #
17
+ def query_transaction(flow_id, transaction_type, user_no)
18
+ service = 'QUERY_TRANSACTION'
19
+
20
+ params = {
21
+ requestNo: flow_id,
22
+ transactionType: transaction_type,
23
+ platformUserNo: user_no,
24
+ }
25
+
26
+ res = operate_post(:query, service, params, :service)
27
+
28
+ res
29
+ end
30
+
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Query
5
+ module QueryUserInfomation
6
+
7
+ # 5.1. 用户信息查询
8
+ #
9
+ # @return [ Hash ] 结果集
10
+ # * :result [String] "S"/"F"/"P"
11
+ # * :request_params [Hash] 请求参数
12
+ # * :response [Object] 请求返回对象
13
+ # * :code [String] 结果代码
14
+ # * :msg [String] 结果信息
15
+ # * :data: 具体业务返回信息
16
+ #
17
+ def query_user_information(user_no)
18
+
19
+ service = 'QUERY_USER_INFORMATION'
20
+
21
+ params = {
22
+ platformUserNo: user_no,
23
+ }
24
+
25
+ res = operate_post(:query, service, params, :service)
26
+
27
+ res
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
File without changes
@@ -0,0 +1,49 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Trade
5
+ module AsyncTransaction
6
+
7
+ #
8
+ # @param biz_details [ Array ] 交易明细
9
+ # * :request_no 交易明细订单号
10
+ # * :trade_type 交易类型
11
+ # * :project_no 标的编号
12
+ # * :sale_request_no 债权出让请求流水号
13
+ # * :details [Array] 业务明细
14
+ # * :biz_type 业务类型
15
+ # * :freeze_request_no 预处理请求流水号
16
+ # * :source_platform_user_no 出款方用户编号
17
+ # * :target_platform_user_no 收款方用户编号
18
+ # * :amount 交易金额
19
+ # * :income 利息
20
+ # * :share 债权份额 (债权认购且需校验债权关系的必传)
21
+ # * :custom_define 平台商户自定义参数,平台交易时传入的自定义参数
22
+ # * :remark 备注
23
+ #
24
+ # @return [ Hash ] 结果集
25
+ # * :result [String] "S"/"F"/"P"
26
+ # * :request_params [Hash] 请求参数
27
+ # * :response [Object] 请求返回对象
28
+ # * :code [String] 结果代码
29
+ # * :msg [String] 结果信息
30
+ # * :data: 具体业务返回信息
31
+ #
32
+ def async_transaction(batch_no, biz_details)
33
+
34
+ service = 'ASYNC_TRANSACTION'
35
+
36
+ params = {
37
+ batchNo: batch_no,
38
+ bizDetails: biz_details,
39
+ }
40
+
41
+ res = operate_post(:operate, service, params, :service)
42
+
43
+ res
44
+ end
45
+
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,45 @@
1
+ # coding: utf-8
2
+ module Lanmao
3
+ module Api
4
+ module Trade
5
+ module EstablishProject
6
+
7
+ #
8
+ # @return [ Hash ] 结果集
9
+ # * :result [String] "S"/"F"/"P"
10
+ # * :request_params [Hash] 请求参数
11
+ # * :response [Object] 请求返回对象
12
+ # * :code [String] 结果代码
13
+ # * :msg [String] 结果信息
14
+ # * :data: 具体业务返回信息
15
+ #
16
+ def establish_project(request_no, user_no, project_no,
17
+ project_amount, project_name,
18
+ project_type, annnual_interest_rate,
19
+ repayment_way, project_period, project_description=nil, extend_info=nil)
20
+
21
+ service = 'ESTABLISH_PROJECT'
22
+
23
+ params = {
24
+ platformUserNo: user_no,
25
+ requestNo: request_no,
26
+ projectNo: project_no,
27
+ projectAmount: project_amount,
28
+ projectName: project_name,
29
+ projectDescription: project_description,
30
+ projectType: project_type,
31
+ projectPeriod: project_period,
32
+ annnualInterestRate: annnual_interest_rate,
33
+ repaymentWay: repayment_way,
34
+ extend: extend_info,
35
+ }
36
+
37
+ res = operate_post(:operate, service, params, :service)
38
+
39
+ res
40
+ end
41
+
42
+ end
43
+ end
44
+ end
45
+ end