fadada 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d693c4effe4af6f44bb7df2f1f571a8e8604c0129c9b0697d84840ede076a03e
4
- data.tar.gz: 9389e7b9d00b8f2d3dc56cd004f480b8039a34340f2e4d7a37b682f567611d71
3
+ metadata.gz: 95de2a3553910d76031328a11efccbed5076c86effae254bf1e240f131a575e1
4
+ data.tar.gz: 37dbcf429b10db85932a46a5e1932887ad47ec042f71aa4de8d7eba9a0545a25
5
5
  SHA512:
6
- metadata.gz: dcbbf3370e99c03a78b5f34b83156303d0ae2d138b9736a99eaee2c9b56436d32cd0f7ec082c78ecc0d613d1f6df638592aa9ffcd0e551c09d3e5956cbb2bd7e
7
- data.tar.gz: d4debaa915256d876f965e4ec5c7be5ed694978ebdea785658453df998d4df7036bd41b1c51881184e4188ae6207f88ba566eefcbf918c0efca3f84638079fcc
6
+ metadata.gz: 757908f854b73543ea2052d27fe782ce33d37cbf1504d2e3f71445b0bba529f9eb6ecf7a8a01450e1d03ef1b4e66d0195440f7db5c992e1cd5cb80c923e57bc6
7
+ data.tar.gz: 4637d1427438de6d72af21e4be0b3ab965b097b19ec1e012ccddfadb658faf1ff11bdc104ed2872f148c25dfba23a0b47cb5ba76973426bb5bd687a6a4664ffb
@@ -1,6 +1,6 @@
1
1
  # 法大大实名认证接口调用顺序(五)
2
2
 
3
- contract_id = "39273648172364987169"
3
+ contract_id = DateTime.now.to_i
4
4
  doc_title = "这是一个测试合同"
5
5
  contract_file = File.open('xxx')
6
6
 
@@ -12,58 +12,68 @@ options = {
12
12
  }
13
13
  Fadada::Contract.upload_doc(options)
14
14
 
15
+ template_id = DateTime.now.to_i
16
+
15
17
  # 上传合同模板
16
18
  options = {
17
- template_id: '9769867876876876',
19
+ template_id: template_id,
18
20
  file: contract_file
19
21
  }
20
22
  Fadada::Contract.upload_template(options)
21
23
 
24
+ json_obj = {}
25
+ (1..29).each do |item|
26
+ json_obj[item.to_s] = "this is #{item} test"
27
+ end
22
28
  # 模板填充
23
29
  options = {
24
-
30
+ doc_title: "据说这是一个测试合同",
31
+ template_id: template_id,
32
+ contract_id: contract_id,
33
+ parameter_map: json_obj.to_json
25
34
  }
26
35
  Fadada::Contract.generate(options)
27
36
 
28
37
  # 自动签署合同
29
38
  options = {
30
- transaction_id: 'A1028374019287342342',
39
+ transaction_id: DateTime.now.to_i,
31
40
  contract_id: contract_id,
32
41
  doc_title: doc_title,
42
+ sign_keyword: '杨米尔斯'
33
43
  }
34
44
  Fadada::Contract.auto_sign(options)
35
45
 
36
46
  # 手动签署合同
37
47
  options = {
38
- transaction_id: 'B1028374019287341114',
48
+ transaction_id: DateTime.now.to_i,
39
49
  contract_id: contract_id,
40
50
  customer_id: '926064BA49FB4EAA0F1323A0B000DA22',
41
51
  doc_title: doc_title,
42
- sign_keyword: '甲方(盖章):',
52
+ sign_keyword: '杨米尔斯',
43
53
  keyword_strategy: '2',
44
- customer_name: 'xx',
45
- customer_ident_no: 'xx',
54
+ customer_name: '张三',
55
+ customer_ident_no: 'xxx',
46
56
  return_url: 'http://baidu.com'
47
57
  }
48
58
  Fadada::Contract.sign(options)
49
59
 
50
60
  # 批量手动签署合同
51
61
  sign_data = [{
52
- contractId: '29273648172364987169',
53
- signKeyword: '甲方(盖章):',
54
- transactionId: '4523454452',
55
- # keyword_strategy: '2'
62
+ contractId: '123',
63
+ signKeyword: '甲方',
64
+ transactionId: DateTime.now.to_i,
65
+ keywordStrategy: '2'
56
66
  },{
57
- contractId: '39273648172364987169',
58
- signKeyword: '甲方(盖章):',
59
- transactionId: '23452345234',
60
- # keyword_strategy: '2'
67
+ contractId: '456',
68
+ signKeyword: '甲方',
69
+ transactionId: DateTime.now.to_i,
70
+ keywordStrategy: '2'
61
71
  }].to_json
62
72
 
63
73
  options = {
64
74
  customer_id: '926064BA49FB4EAA0F1323A0B000DA22',
65
75
  # outh_customer_id: '',
66
- batch_id: '23452345345345234',
76
+ batch_id: DateTime.now.to_i,
67
77
  batch_title: '批量合同签署',
68
78
  mobile_sign_type: '1',
69
79
  return_url: 'http://baidu.com',
@@ -12,8 +12,8 @@ module Fadada
12
12
  # 返回 法大大的账号
13
13
  def self.person_register(open_id)
14
14
  options = {
15
- open_id: open_id,
16
- account_type: 1 # 账户类型,1 个人;2 企业,默认 1
15
+ account_type: 1, # 账户类型,1 个人;2 企业,默认 1
16
+ open_id: open_id
17
17
  }
18
18
  response = Fadada::HttpClient.request(:post, 'account_register.api', options)
19
19
  response['data']
@@ -29,8 +29,8 @@ module Fadada
29
29
  # 返回 法大大的账号
30
30
  def self.company_register(open_id)
31
31
  options = {
32
- open_id: open_id,
33
- account_type: 2 # 账户类型,1 个人;2 企业,默认 1
32
+ account_type: 2, # 账户类型,1 个人;2 企业,默认 1
33
+ open_id: open_id
34
34
  }
35
35
  response = Fadada::HttpClient.request(:post, 'account_register.api', options)
36
36
  response['data']
@@ -34,7 +34,7 @@ module Fadada
34
34
  # 需要排序后使用
35
35
  def self.params_transform(options)
36
36
  _options = options || {}
37
- _options.delete_if { |key, value| value.blank? }.sort.map { |k,v| v }.join
37
+ _options.delete_if { |key, value| value.blank? }.map { |k,v| v }.join
38
38
  end
39
39
  end
40
40
  end
@@ -26,8 +26,8 @@ module Fadada
26
26
  # content => 印章展示的内容,可以是企业名称或者客户名称
27
27
  def self.custom(customer_id:, content:)
28
28
  options = {
29
- customer_id: customer_id,
30
- content: content
29
+ content: content,
30
+ customer_id: customer_id
31
31
  }
32
32
  response = Fadada::HttpClient.request(:post, 'custom_signature.api', options)
33
33
  response['data']['signature_img_base64']
@@ -1,3 +1,3 @@
1
1
  module Fadada
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fadada
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - wangrui
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-25 00:00:00.000000000 Z
11
+ date: 2019-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler