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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47e1af473fc3afb70990f259b46c112f2afd2a76b0eaee62ff6e23d6a3cc48ed
4
- data.tar.gz: cd00c1b26e77b9e65f5bb2622820622920c803c24ef11154212739df2e88d96e
3
+ metadata.gz: bd341d82e042f3fe4520d76418d70b183a15f680642789f974f518eaf2237502
4
+ data.tar.gz: f1ead372dbb9278aecc3e6c925f46ad0bee55ee283b8090f153443e055f9303c
5
5
  SHA512:
6
- metadata.gz: c839debe81fa0792059ff1a5ef41443f5d720cd4d31bec182cf700ec85f4c6a20931277d28942bb95578991aaea157a6141e50088e2d1edc71dfd3fdbb42c3dc
7
- data.tar.gz: 73e433fae0e4488ec487396df6de906807c2e5327d27bc727a61256d670efd609b9d663ba0f3bffa6adbf5d2bb8eb383085842f6ac8884689ae283c449750e06
6
+ metadata.gz: 622037865ff00661fb309237b4509b88d0285e9913852895f4c21fda7dc86e738497b3eb58061322afbeef8df7c3cf7c90d1b33215cebc4bedcb17e1ea696b16
7
+ data.tar.gz: 2f50f4a8b623f5546f8c167fb7936d7338bd58e6f28ddc2545395ea9f1ef717e8cb755b5c39c99e8acc255dc578ca9c7a2ac80a97709ba74231b32b1e075a32c
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CorePro
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
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(id, params = {})
47
- objectify(request(:patch, uri(:update, id), json: params))
46
+ def self.update(params = {})
47
+ objectify(request(:post, uri(:update), json: params))
48
48
  end
49
49
 
50
50
  # Resource constructor wrapper
@@ -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.1
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-10-22 00:00:00.000000000 Z
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