corepro 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzFkZjk4Mzk2YmI1N2JlN2U0OWI3ODg1YjUzNTIzNjk4YTRmNTk4Mw==
4
+ NzdmMjMyY2M3MzI3ODE5N2Q2YmI5ZWNkMzA3OGNkMzhjMTI3YTI4Zg==
5
5
  data.tar.gz: !binary |-
6
- OWYzMmNkZTM0YWY4ZTJkYTBmMGVhOGQwYzFhNGVjNzZmYjEzMWY4Zg==
6
+ OTgxZTAxNmY3YTQwYTFiN2NlOTljODIwZjEyN2E4ODgwMWVjYjk0OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODRlNzZlMzE5NWY3ZmRmZjM4ZGQ0Y2NiYTAwYTI4Y2M4NGMwMGEzYzY5NjZk
10
- MWVmMzM0ODI2OWJjZjY4NjM4MjVjOWU5OTVhN2I4OWY5MmQ0YmY2Yzc5MjYw
11
- NDZhNTU2YmU3NDQxNGM0YTQ0YTUyYWNhYjYyMTZjMTUxMDhlMTE=
9
+ MmRhMzg4MjVkMzQ2Mzg4ZDAwYTM3NmQ1YTk4MzYxYjEyODlhMTBiMDY3ZGJi
10
+ ZjVhMGMyODIxNmYzOWFjNDc5NWQ5NzQyYzhlMjg3MzU2NjNjMWYzOTAwMjVl
11
+ MTkxMTc0NzkwZDY5NGIxMmZmZWM3ZDI0MmZkZmE1ZGI0MWE4ZmU=
12
12
  data.tar.gz: !binary |-
13
- Y2VlZjQ2MGJmY2UzZmU5NDIwMjA3ODc0ODhhNjBiNmJlOWNmYjAzZDRiMWQw
14
- M2E5MDM2MmI2ZTJkZTM4ZmFlYmI1ZGI0N2NlODkzYmY3MWJhNmE0YjhjNjA5
15
- MTM3ZmY3OTZmMWRmZTJlYmRiYjdkNmE3ZTJkYjU5ZjMwMmZiOGQ=
13
+ YmJlNDk4NThkZjhiMTg0MDNlMzY0ODRjMjA5NmVmOGIxMTcxZTNmMGI1MjZl
14
+ NzRiMWZkYWNhNzk4YWFkZmEwMDJjNDdmNDU4YzRmOTMzYzdiNWM0MzFlNThl
15
+ ZjBkOTE5ZTRhZjRhMTMzYjM4YWZlZTg2ODA0NWZjYTEyZGMzYjM=
@@ -1,7 +1,6 @@
1
1
  require_relative 'models/model_base'
2
2
  require_relative 'utils/requestor'
3
3
  require_relative 'models/account_id_only'
4
- require_relative 'connection'
5
4
 
6
5
  module CorePro
7
6
  class Account < Models::ModelBase
@@ -37,28 +36,23 @@ module CorePro
37
36
  end
38
37
 
39
38
  def self.list(customerId, connection = nil, loggingObject = nil)
40
- connection ||= Connection.createFromConfig()
41
39
  CorePro::Utils::Requestor.get("/account/list/#{customerId}", Account, connection, loggingObject)
42
40
  end
43
41
 
44
42
  def self.get(customerId, accountId, connection = nil, loggingObject = nil)
45
- connection ||= Connection.createFromConfig()
46
43
  CorePro::Utils::Requestor.get("/account/get/#{customerId}/#{accountId}", Account, connection, loggingObject)
47
44
  end
48
45
 
49
46
  def self.getByTag(customerId, tag, connection = nil, loggingObject = nil)
50
- connection ||= Connection.createFromConfig()
51
47
  CorePro::Utils::Requestor.get("/account/getByTag/#{customerId}/#{escape(tag)}", Account, connection, loggingObject)
52
48
  end
53
49
 
54
50
  def create(connection = nil, loggingObject = nil)
55
- connection ||= Connection.createFromConfig()
56
51
  aid = CorePro::Utils::Requestor.post('/account/create', CorePro::Models::AccountIdOnly, self, connection, loggingObject)
57
52
  aid.accountId
58
53
  end
59
54
 
60
55
  def update(connection = nil, loggingObject = nil)
61
- connection ||= Connection.createFromConfig()
62
56
  aid = CorePro::Utils::Requestor.post('/account/update', CorePro::Models::AccountIdOnly, self, connection, loggingObject)
63
57
  aid.accountId
64
58
  end
@@ -15,7 +15,6 @@ module CorePro
15
15
  attr_accessor :isClosedToExternalAccount
16
16
 
17
17
  def close(connection = nil, loggingObject = nil)
18
- connection ||= Connection.createFromConfig()
19
18
  CorePro::Utils::Requestor.post('/account/close', AccountClose, self, connection, loggingObject)
20
19
  end
21
20
  end
@@ -24,7 +24,6 @@ module CorePro
24
24
  end
25
25
 
26
26
  def list(connection = nil, loggingObject = nil)
27
- connection ||= Connection.createFromConfig()
28
27
  CorePro::Utils::Requestor.get("/bankdocument/list/#{escape(self.culture)}/#{escape(self.documentType)}", BankDocument, connection, loggingObject)
29
28
  end
30
29
 
@@ -36,7 +35,6 @@ module CorePro
36
35
  end
37
36
 
38
37
  def download(connection = nil, loggingObject = nil)
39
- connection ||= Connection.createFromConfig()
40
38
  CorePro::Utils::Requestor.get("/bankdocument/download/#{escape(self.culture)}/#{self.documentId}", CorePro::Models::FileContent, connection, loggingObject)
41
39
  end
42
40
 
@@ -1,5 +1,4 @@
1
1
  require_relative 'models/model_base'
2
- require_relative 'connection'
3
2
  require_relative 'models/customer_verify_request'
4
3
  require_relative 'models/customer_response'
5
4
  require_relative 'models/customer_id_only'
@@ -63,7 +62,6 @@ module CorePro
63
62
  end
64
63
 
65
64
  def list(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
66
- connection ||= Connection.createFromConfig()
67
65
  CorePro::Utils::Requestor.get("/customer/list?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Customer, connection, loggingObject)
68
66
  end
69
67
 
@@ -74,7 +72,6 @@ module CorePro
74
72
  end
75
73
 
76
74
  def get(connection = nil, loggingObject = nil)
77
- connection ||= Connection.createFromConfig()
78
75
  CorePro::Utils::Requestor.get("/customer/get/#{self.customerId}", Customer, connection, loggingObject)
79
76
  end
80
77
 
@@ -85,7 +82,6 @@ module CorePro
85
82
  end
86
83
 
87
84
  def getByTag(connection = nil, loggingObject = nil)
88
- connection ||= Connection.createFromConfig()
89
85
  CorePro::Utils::Requestor.get("/customer/getByTag/#{escape(self.tag)}", Customer, connection, loggingObject)
90
86
  end
91
87
 
@@ -103,18 +99,15 @@ module CorePro
103
99
  end
104
100
 
105
101
  def search(pageNumber = 0, pageSize = 200, connection = nil, loggingObject = nil)
106
- connection ||= Connection.createFromConfig()
107
102
  CorePro::Utils::Requestor.post("/customer/search?pageNumber=#{pageNumber}&pageSize=#{pageSize}", Customer, self, connection, loggingObject)
108
103
  end
109
104
 
110
105
  def create(connection = nil, loggingObject = nil)
111
- connection ||= Connection.createFromConfig()
112
106
  cid = CorePro::Utils::Requestor.post('/customer/create', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
113
107
  cid.customerId
114
108
  end
115
109
 
116
110
  def update(connection = nil, loggingObject = nil)
117
- connection ||= Connection.createFromConfig()
118
111
  cid = CorePro::Utils::Requestor.post('/customer/update', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
119
112
  cid.customerId
120
113
  end
@@ -126,13 +119,11 @@ module CorePro
126
119
  end
127
120
 
128
121
  def deactivate(connection = nil, loggingObject = nil)
129
- connection ||= Connection.createFromConfig()
130
122
  cid = CorePro::Utils::Requestor.post('/customer/deactivate', CorePro::Models::CustomerIdOnly, self, connection, loggingObject)
131
123
  cid.customerId
132
124
  end
133
125
 
134
126
  def initiate(connection = nil, loggingObject = nil)
135
- connection ||= Connection.createFromConfig()
136
127
  CorePro::Utils::Requestor.post('/customer/initiate', CorePro::Models::CustomerResponse, self, connection, loggingObject)
137
128
  end
138
129
 
@@ -20,7 +20,6 @@ module CorePro
20
20
  end
21
21
 
22
22
  def list(connection = nil, loggingObject = nil)
23
- connection ||= Connection.createFromConfig()
24
23
  CorePro::Utils::Requestor.get("/customerbeneficiary/list/#{self.customerId}", CustomerBeneficiary, connection, loggingObject)
25
24
  end
26
25
 
@@ -32,24 +31,20 @@ module CorePro
32
31
  end
33
32
 
34
33
  def get(connection = nil, loggingObject = nil)
35
- connection ||= Connection.createFromConfig()
36
34
  CorePro::Utils::Requestor.get("/customerbeneficiary/get/#{self.customerId}/#{self.customerBeneficiaryId}", CustomerBeneficiary, connection, loggingObject)
37
35
  end
38
36
 
39
37
  def create(connection = nil, loggingObject = nil)
40
- connection ||= Connection.createFromConfig()
41
38
  cbid = CorePro::Utils::Requestor.post('/customerbeneficiary/create', CorePro::Models::CustomerBeneficiaryIdOnly, self, connection, loggingObject)
42
39
  cbid.customerBeneficiaryId
43
40
  end
44
41
 
45
42
  def update(connection = nil, loggingObject = nil)
46
- connection ||= Connection.createFromConfig()
47
43
  cbid = CorePro::Utils::Requestor.post('/customerbeneficiary/update', CorePro::Models::CustomerBeneficiaryIdOnly, self, connection, loggingObject)
48
44
  cbid.customerBeneficiaryId
49
45
  end
50
46
 
51
47
  def deactivate(connection = nil, loggingObject = nil)
52
- connection ||= Connection.createFromConfig()
53
48
  cbid = CorePro::Utils::Requestor.post('/customerbeneficiary/deactivate', CorePro::Models::CustomerBeneficiaryIdOnly, self, connection, loggingObject)
54
49
  cbid.customerBeneficiaryId
55
50
  end
@@ -24,10 +24,7 @@ module CorePro
24
24
  def upload(connection = nil, loggingObject = nil)
25
25
  # NOTE: documentContent is assumed to be raw content bytes.
26
26
  # corepro API expects base64 encoded string. so we convert that here.
27
- bytes = Base64.encode64(self.documentContent)
28
- self.documentContent = bytes
29
-
30
- connection ||= Connection.createFromConfig()
27
+ self.documentContent = Base64.encode64(self.documentContent)
31
28
  CorePro::Utils::Requestor.post('/customerdocument/upload', nil, self, connection, loggingObject)
32
29
  end
33
30
 
@@ -2,7 +2,6 @@ require_relative 'models/model_base'
2
2
  require_relative 'utils/requestor'
3
3
  require_relative 'models/external_account_id_only'
4
4
  require_relative 'models/external_account_verify'
5
- require_relative 'connection'
6
5
 
7
6
  module CorePro
8
7
  class ExternalAccount < Models::ModelBase
@@ -33,7 +32,6 @@ module CorePro
33
32
  end
34
33
 
35
34
  def list(connection = nil, loggingObject = nil)
36
- connection ||= Connection.createFromConfig()
37
35
  CorePro::Utils::Requestor.get("/externalaccount/list/#{customerId}", ExternalAccount, connection, loggingObject)
38
36
  end
39
37
 
@@ -45,7 +43,6 @@ module CorePro
45
43
  end
46
44
 
47
45
  def get(connection = nil, loggingObject = nil)
48
- connection ||= Connection.createFromConfig()
49
46
  CorePro::Utils::Requestor.get("/externalaccount/get/#{customerId}/#{externalAccountId}", ExternalAccount, connection, loggingObject)
50
47
  end
51
48
 
@@ -57,18 +54,15 @@ module CorePro
57
54
  end
58
55
 
59
56
  def getByTag(connection = nil, loggingObject = nil)
60
- connection ||= Connection.createFromConfig()
61
57
  CorePro::Utils::Requestor.get("/externalaccount/getByTag/#{customerId}/#{escape(tag)}", ExternalAccount, connection, loggingObject)
62
58
  end
63
59
 
64
60
  def create(connection = nil, loggingObject = nil)
65
- connection ||= Connection.createFromConfig()
66
61
  eaid = CorePro::Utils::Requestor.post('/externalaccount/create', CorePro::Models::ExternalAccountIdOnly, self, connection, loggingObject)
67
62
  eaid.externalAccountId
68
63
  end
69
64
 
70
65
  def initiate(connection = nil, loggingObject = nil)
71
- connection ||= Connection.createFromConfig()
72
66
  CorePro::Utils::Requestor.post('/externalaccount/initiate', CorePro::Models::ExternalAccountIdOnly, self, connection, loggingObject)
73
67
  end
74
68
 
@@ -80,7 +74,6 @@ module CorePro
80
74
  end
81
75
 
82
76
  def verify(amount1, amount2, connection = nil, loggingObject = nil)
83
- connection ||= Connection.createFromConfig()
84
77
  eav = CorePro::Models::ExternalAccountVerify.new
85
78
  eav.customerId = @customerId
86
79
  eav.externalAccountId = @externalAccountId
@@ -91,13 +84,11 @@ module CorePro
91
84
  end
92
85
 
93
86
  def update(connection = nil, loggingObject = nil)
94
- connection ||= Connection.createFromConfig()
95
87
  eaid = CorePro::Utils::Requestor.post('/externalaccount/update', CorePro::Models::ExternalAccountIdOnly, self, connection, loggingObject)
96
88
  eaid.externalAccountId
97
89
  end
98
90
 
99
91
  def deactivate(connection = nil, loggingObject = nil)
100
- connection ||= Connection.createFromConfig()
101
92
  eaid = CorePro::Utils::Requestor.post('/externalaccount/deactivate', CorePro::Models::ExternalAccountIdOnly, self, connection, loggingObject)
102
93
  eaid.externalAccountId
103
94
  end
@@ -27,8 +27,6 @@ module CorePro
27
27
  # NOTE: documentContent is assumed to be raw content bytes.
28
28
  # corepro API expects base64 encoded string. so we convert that here.
29
29
  self.documentContent = Base64.encode64(self.documentContent)
30
-
31
- connection ||= Connection.createFromConfig()
32
30
  CorePro::Utils::Requestor.post('/externalaccountdocument/upload', nil, self, connection, loggingObject)
33
31
  end
34
32
 
@@ -20,8 +20,7 @@ module CorePro
20
20
  @answers = []
21
21
  end
22
22
 
23
- def verify(connection = NIL, loggingObject = NIL)
24
- connection = connection || Connection.createFromConfig()
23
+ def verify(connection = nil, loggingObject = nil)
25
24
  CorePro::Utils::Requestor.post('/customer/verify', CustomerResponse, self, connection, loggingObject)
26
25
  end
27
26
  end
@@ -50,7 +50,6 @@ module CorePro
50
50
  end
51
51
 
52
52
  def self.get(connection = nil, loggingObject = nil)
53
- connection ||= Connection.createFromConfig()
54
53
  CorePro::Utils::Requestor.get("/program/get", Program, connection, loggingObject)
55
54
  end
56
55
 
@@ -11,17 +11,14 @@ module CorePro
11
11
  attr_accessor :year
12
12
 
13
13
  def self.list(customerId, connection = nil, loggingObject = nil)
14
- connection ||= Connection.createFromConfig()
15
14
  CorePro::Utils::Requestor.get("/statement/list/#{customerId}", Statement, connection, loggingObject)
16
15
  end
17
16
 
18
17
  def self.get(customerId, statementId, connection = nil, loggingObject = nil)
19
- connection ||= Connection.createFromConfig()
20
18
  CorePro::Utils::Requestor.get("/statement/get/#{customerId}/#{statementId}", Statement, connection, loggingObject)
21
19
  end
22
20
 
23
21
  def self.download(customerId, statementId, connection = nil, loggingObject = nil)
24
- connection ||= Connection.createFromConfig()
25
22
  CorePro::Utils::Requestor.get("/statement/download/#{customerId}/#{statementId}", CorePro::Models::FileContent, connection, loggingObject)
26
23
  end
27
24
  end
@@ -27,7 +27,6 @@ module CorePro
27
27
  end
28
28
 
29
29
  def list(accountId = nil, status = nil, beginDate = nil, endDate =nil, pageNumber =0, pageSize = 200, connection = nil, loggingObject = nil)
30
- connection ||= Connection.createFromConfig()
31
30
  start = beginDate.kind_of?(Date) ? beginDate.strftime('%Y-%m-%d') : (beginDate.kind_of?(String) ? beginDate[0..9] : nil)
32
31
  finish = endDate.kind_of?(Date) ? endDate.strftime('%Y-%m-%d') : (endDate.kind_of?(String) ? endDate[0..9] : nil)
33
32
 
@@ -22,7 +22,6 @@ module CorePro
22
22
  end
23
23
 
24
24
  def create(connection = nil, loggingObject = nil)
25
- connection ||= Connection.createFromConfig()
26
25
  CorePro::Utils::Requestor.post('/transfer/create', Transfer, self, connection, loggingObject)
27
26
  end
28
27
 
@@ -35,7 +34,6 @@ module CorePro
35
34
  end
36
35
 
37
36
  def void(connection = nil, loggingObject = nil)
38
- connection ||= Connection.createFromConfig()
39
37
  CorePro::Utils::Requestor.post('/transfer/void', Transfer, self, connection, loggingObject)
40
38
  end
41
39
  end
@@ -2,6 +2,7 @@ require_relative '../version'
2
2
  require_relative 'logger'
3
3
  require_relative '../models/envelope'
4
4
  require_relative '../core_pro_api_exception'
5
+ require_relative '../connection'
5
6
 
6
7
  require 'openssl'
7
8
  require 'base64'
@@ -27,6 +28,7 @@ module CorePro
27
28
 
28
29
 
29
30
  def self.get(relativeUrl, classDef, connection, loggingObject)
31
+ connection ||= Connection.createFromConfig()
30
32
  if connection.headerValue.to_s.empty? || connection.domainName.to_s.empty?
31
33
  raise ArgumentError, 'A valid connection with apiKey, apiSecret, and domainName must be specified.'
32
34
  end
@@ -54,6 +56,7 @@ module CorePro
54
56
  end
55
57
 
56
58
  def self.post(relativeUrl, classDef, toPost, connection, loggingObject)
59
+ connection ||= Connection.createFromConfig()
57
60
  if connection.headerValue.to_s.empty? || connection.domainName.to_s.empty?
58
61
  raise ArgumentError, 'A valid connection with apiKey, apiSecret, and domainName must be specified.'
59
62
  end
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/ruby -w
2
2
  module CorePro
3
- VERSION = '0.0.6'
3
+ VERSION = '0.0.7'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corepro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - devsupport
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-21 00:00:00.000000000 Z
11
+ date: 2014-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler