core_pro.rb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/core_pro/version.rb +1 -1
- data/lib/core_pro.rb +2 -2
- data/spec/core_pro_spec.rb +47 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd341d82e042f3fe4520d76418d70b183a15f680642789f974f518eaf2237502
|
4
|
+
data.tar.gz: f1ead372dbb9278aecc3e6c925f46ad0bee55ee283b8090f153443e055f9303c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 622037865ff00661fb309237b4509b88d0285e9913852895f4c21fda7dc86e738497b3eb58061322afbeef8df7c3cf7c90d1b33215cebc4bedcb17e1ea696b16
|
7
|
+
data.tar.gz: 2f50f4a8b623f5546f8c167fb7936d7338bd58e6f28ddc2545395ea9f1ef717e8cb755b5c39c99e8acc255dc578ca9c7a2ac80a97709ba74231b32b1e075a32c
|
data/lib/core_pro/version.rb
CHANGED
data/lib/core_pro.rb
CHANGED
@@ -43,8 +43,8 @@ module CorePro
|
|
43
43
|
# @param id [String] resource indentifier
|
44
44
|
# @param params [Hash] request parameters to pass to the endpoint as JSON.
|
45
45
|
# @return [Object] instance
|
46
|
-
def self.update(
|
47
|
-
objectify(request(:
|
46
|
+
def self.update(params = {})
|
47
|
+
objectify(request(:post, uri(:update), json: params))
|
48
48
|
end
|
49
49
|
|
50
50
|
# Resource constructor wrapper
|
data/spec/core_pro_spec.rb
CHANGED
@@ -75,6 +75,53 @@ RSpec.describe CorePro::Resource do
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
+
describe '#update for customer', vcr: 'core_pro' do
|
79
|
+
it do
|
80
|
+
customer = CorePro::Customer.update(
|
81
|
+
customerId: 12_345,
|
82
|
+
firstName: 'James',
|
83
|
+
lastName: 'Bond',
|
84
|
+
isSubjectToBackupWithholding: false,
|
85
|
+
isOptedInToBankCommunication: false,
|
86
|
+
birthDate: '1987-07-27',
|
87
|
+
taxId: '498931947',
|
88
|
+
emailAddress: 'stas@startuplandia.io',
|
89
|
+
phones: [
|
90
|
+
{
|
91
|
+
number: '+16502530000',
|
92
|
+
phoneType: 'Mobile'
|
93
|
+
}
|
94
|
+
],
|
95
|
+
addresses: [
|
96
|
+
addressLine1: '4017 Buffalo Ave',
|
97
|
+
addressType: 'Residence',
|
98
|
+
city: 'Buffalo',
|
99
|
+
country: 'US',
|
100
|
+
postalCode: '94043',
|
101
|
+
state: 'NY'
|
102
|
+
]
|
103
|
+
)
|
104
|
+
|
105
|
+
expect(customer.firstName).to eq('James')
|
106
|
+
expect(customer.lastName).to eq('Bond')
|
107
|
+
expect(customer.customerId).to eq(12_345)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
describe '#update with errors for customer', vcr: 'core_pro_errors' do
|
112
|
+
it do
|
113
|
+
expect do
|
114
|
+
CorePro::Customer.update(
|
115
|
+
customerId: 12_345,
|
116
|
+
firstName: 'James'
|
117
|
+
)
|
118
|
+
end.to raise_error(
|
119
|
+
HTTP::RestClient::ResponseError,
|
120
|
+
/used during the ID Verification process is not allowed/
|
121
|
+
)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
78
125
|
describe '#create with errors', vcr: 'core_pro_errors' do
|
79
126
|
let(:new_customer) do
|
80
127
|
CorePro::Customer.create(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core_pro.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stas SUȘCOV
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http-rest_client
|