corepro 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corepro.rb +1 -0
- data/lib/corepro/card.rb +1 -2
- data/lib/corepro/external_account_document.rb +1 -1
- data/lib/corepro/version.rb +1 -1
- data/q2labs_public.pem +9 -0
- data/test/aa_customer_test.rb +4 -0
- data/test/al_card_test.rb +51 -0
- data/test/core_pro_test_base.rb +2 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c86fed36877aafd5889fb59562ec0ae6dc0fbb0
|
4
|
+
data.tar.gz: eaf8c5f7a2ae399ceb5c44c2cc0b405a97ea32d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03d257cc930426e238d7aa6306a675453f5dd4cfebb08882de36a2ab6340c78ef9ec8dccb6e6f2a14f16a7d4d52b5b62f616957f6347c32066498cc974e233d1
|
7
|
+
data.tar.gz: 2f9d37d9b1c9cb04ec8208a6780594aa63d8438e404f98cb5a3174f13dfa791e4e1c9b3e0428d7da4621fe675672c74733bf70674744dd1d05a4405692c89608
|
data/lib/corepro.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'corepro/connection'
|
2
2
|
require_relative 'corepro/account'
|
3
3
|
require_relative 'corepro/account_close'
|
4
|
+
require_relative 'corepro/card'
|
4
5
|
require_relative 'corepro/core_pro_api_exception'
|
5
6
|
require_relative 'corepro/customer'
|
6
7
|
require_relative 'corepro/customer_beneficiary'
|
data/lib/corepro/card.rb
CHANGED
@@ -29,7 +29,7 @@ module CorePro
|
|
29
29
|
attr_accessor :archivedDate
|
30
30
|
attr_accessor :lastModifiedDate
|
31
31
|
attr_accessor :accounts
|
32
|
-
|
32
|
+
attr_accessor :newPin
|
33
33
|
|
34
34
|
def self.get(customerId, cardId, connection = nil, loggingObject = nil)
|
35
35
|
CorePro::Utils::Requestor.get("/card/get/#{customerId}/#{cardId}", Card, connection, loggingObject)
|
@@ -43,7 +43,6 @@ module CorePro
|
|
43
43
|
CorePro::Utils::Requestor.get("/card/list/#{customerId}", Card, connection, loggingObject)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
46
|
def initiate(connection = nil, loggingObject = nil)
|
48
47
|
CorePro::Utils::Requestor.post('/card/initiate', Card, self, connection, loggingObject)
|
49
48
|
end
|
data/lib/corepro/version.rb
CHANGED
data/q2labs_public.pem
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
2
|
+
MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEAvWp5DhHGFUQnMl7elQ2T
|
3
|
+
TQ+grCpsmo+ZsKE7K+FDqaCs0dxge0Sepju5wbusXCgPv1c0297foYLqfF7zHxIY
|
4
|
+
k5T/O8jsgt26iHAjUIOJx+qsMnWUR3/RUMscH4Ft8GVCWrJL+dRUM6rUFPDDwmbp
|
5
|
+
aQuVgvm/a0igDFZLykuBDTDaSTul35dPrRWsi+f8bQ3g+VdDQqB0A/eup2UxByts
|
6
|
+
zDf65xDIG8oC6C2Mf2Ws6i6zb69Su24a6jxwKDvglIlCDFxgGNDvZ2pyv8ifIgds
|
7
|
+
YPKw4UYnffRTJlRphrv/KiUIp8TluB0NPYQfJnGAcsheGjYuHCHkig0WEQ69GBRx
|
8
|
+
0QIBJQ==
|
9
|
+
-----END PUBLIC KEY-----
|
data/test/aa_customer_test.rb
CHANGED
@@ -18,6 +18,10 @@ class AaCustomerTest < CoreProTestBase
|
|
18
18
|
c.isOptedInToBankCommunication = false
|
19
19
|
c.tag = "jfm#{@@timestamp}"
|
20
20
|
c.taxId = '012341234'
|
21
|
+
p = CorePro::Models::CustomerPhone.new
|
22
|
+
p.phoneType = 'mobile'
|
23
|
+
p.number = '515-555-1234'
|
24
|
+
c.phones.push(p)
|
21
25
|
|
22
26
|
ra = CorePro::Models::CustomerAddress.new
|
23
27
|
ra.addressLine1 = '123 Main Street'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative '../test/core_pro_test_base'
|
2
|
+
require_relative '../lib/corepro/card'
|
3
|
+
|
4
|
+
require 'openssl'
|
5
|
+
require 'base64'
|
6
|
+
|
7
|
+
class AlCardTest < CoreProTestBase
|
8
|
+
|
9
|
+
def test_create
|
10
|
+
c = CorePro::Card.new
|
11
|
+
c.customerId = @@exampleCustomerId
|
12
|
+
c.primaryAccountId = @@exampleAccountId
|
13
|
+
c.tag = "card ruby #{@@timestamp}"
|
14
|
+
c.nickName = "Card #{@@timestamp}"
|
15
|
+
c.firstName = 'Frank'
|
16
|
+
c.lastName = 'Drummond'
|
17
|
+
c.vendorTypeCode = 'VS'
|
18
|
+
|
19
|
+
rawPin = '1234'
|
20
|
+
publicKey = OpenSSL::PKey::RSA.new(File.read('q2labs_public.pem'))
|
21
|
+
c.newPin = encrypted_string = Base64.encode64(publicKey.public_encrypt(rawPin, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING))
|
22
|
+
puts "#{rawPin}, #{c.newPin}"
|
23
|
+
newCard = c.initiate @@exampleConn, nil
|
24
|
+
@@exampleCardId = newCard.cardId
|
25
|
+
puts "cardId=#{@@exampleCardId}"
|
26
|
+
assert @@exampleCardId > 0
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_list
|
31
|
+
accounts = CorePro::Account.list(@@exampleCustomerId, @@exampleConn, nil)
|
32
|
+
assert_equal 1, accounts.length, "Listed #{accounts.length} accounts for customerId=#{@@exampleCustomerId}"
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_get
|
36
|
+
puts "getting #{@@exampleAccountId}..."
|
37
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
38
|
+
assert_equal 'CategoryB', a.subCategory
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_update
|
42
|
+
a = CorePro::Account.get(@@exampleCustomerId, @@exampleAccountId, @@exampleConn, nil)
|
43
|
+
a = CorePro::Account.new
|
44
|
+
a.accountId = @@exampleAccountId
|
45
|
+
a.customerId = @@exampleCustomerId
|
46
|
+
a.name = "Updated account #{@@timestamp}"
|
47
|
+
accountId = a.update @@exampleConn, nil
|
48
|
+
assert accountId == @@exampleAccountId
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
data/test/core_pro_test_base.rb
CHANGED
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: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- devsupport
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/corepro/utils/logger.rb
|
121
121
|
- lib/corepro/utils/requestor.rb
|
122
122
|
- lib/corepro/version.rb
|
123
|
+
- q2labs_public.pem
|
123
124
|
- test.pdf
|
124
125
|
- test/a_program_test.rb
|
125
126
|
- test/aa_customer_test.rb
|
@@ -132,6 +133,7 @@ files:
|
|
132
133
|
- test/ai_statement_test.rb
|
133
134
|
- test/aj_transfer_test.rb
|
134
135
|
- test/ak_transaction_test.rb
|
136
|
+
- test/al_card_test.rb
|
135
137
|
- test/core_pro_test_base.rb
|
136
138
|
homepage: https://github.com/socialmoney/corepro-sdk-ruby
|
137
139
|
licenses:
|
@@ -169,4 +171,5 @@ test_files:
|
|
169
171
|
- test/ai_statement_test.rb
|
170
172
|
- test/aj_transfer_test.rb
|
171
173
|
- test/ak_transaction_test.rb
|
174
|
+
- test/al_card_test.rb
|
172
175
|
- test/core_pro_test_base.rb
|