xero-ruby 2.7.0 → 2.7.1

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: 30a7bb87ce9cfceb77f481f5cdc6359b767aa5fec1f4026bd21fb79b8de303f3
4
- data.tar.gz: 60992fcee98c7e596922ef53b5a7f8f4e10cacc690306c35155d8139d602eeaa
3
+ metadata.gz: 03abd466e114decb262bf28248c8d7b28d41ca70fbf094e47e1fb60c03200fb1
4
+ data.tar.gz: acbcb6c935d37121c80ad71ceeed1c1df5aaf4c6be86454db356f34792558aac
5
5
  SHA512:
6
- metadata.gz: 4cc57b00a6dd63d307bc2073270bf41f96135a7e866c2815c2fd802e5ecfb87d1f2187e83fb9001ad66c880c0c49f16a821e2e09fd20d7cf35b84a606357d909
7
- data.tar.gz: 2568596be9f223d4baac9d48d2b83a4df3eae8bacacc62b1f7fdc12a94a89ee79bf388607fe77ac55e5e5e85dddace40144e37eb5064801f0ef9a241ccb0aaae
6
+ metadata.gz: 577ffd5fb0b0fdc652ad12167826b03110e65298870a2a35bd0b128c4ad8714316c37a3c7cfa748ef6a6235ec71a25cb2653d6e5f299e6f45fb4b494ecd5dd15
7
+ data.tar.gz: 78ec12b893964c7c0b523e3e4b3e42ce2987ef0fea6bb9c524aa1ac732a2d987551bd252b78f06c0eb99774e8af9385194e17ddee2c19475aa1501a52b3389f2
data/README.md CHANGED
@@ -138,6 +138,11 @@ connections = xero_client.connections
138
138
  "updatedDateUtc" => "2020-04-15T22:37:10.4943410"
139
139
  }]
140
140
 
141
+ # To completely Revoke a user's access token and all their connections
142
+ # pass in the users token set to the #revoke_token api_client method
143
+
144
+ xero_client.revoke_token(user.token_set)
145
+
141
146
  # disconnect an org from a user's connections. Pass the connection ['id'] not ['tenantId'].
142
147
  # Useful if you want to enforce only a single org connection per token.
143
148
  remaining_connections = xero_client.disconnect(connections[0]['id'])
@@ -155,7 +160,7 @@ require 'jwt'
155
160
 
156
161
  def token_expired?
157
162
  token_expiry = Time.at(decoded_access_token['exp'])
158
- token_expiry > Time.now
163
+ token_expiry < Time.now
159
164
  end
160
165
 
161
166
  def decoded_access_token
@@ -15,6 +15,7 @@ require 'logger'
15
15
  require 'tempfile'
16
16
  require 'find'
17
17
  require 'faraday'
18
+ require 'base64'
18
19
 
19
20
  module XeroRuby
20
21
  class ApiClient
@@ -136,7 +137,7 @@ module XeroRuby
136
137
  req.body = URI.encode_www_form(data)
137
138
  end
138
139
  return_error(response) unless response.success?
139
- if !response.body.blank?
140
+ if !response.body.nil? && !response.body.empty?
140
141
  body = JSON.parse(response.body)
141
142
  set_token_set(body)
142
143
  else
@@ -33,10 +33,17 @@ module XeroRuby::PayrollUk
33
33
  OVERTIME_EARNINGS = "OvertimeEarnings".freeze
34
34
  REGULAR_EARNINGS = "RegularEarnings".freeze
35
35
  STATUTORY_ADOPTION_PAY = "StatutoryAdoptionPay".freeze
36
+ STATUTORY_ADOPTION_PAY_NON_PENSIONABLE = "StatutoryAdoptionPayNonPensionable".freeze
37
+ STATUTORY_BEREAVEMENT_PAY = "StatutoryBereavementPay".freeze
36
38
  STATUTORY_MATERNITY_PAY = "StatutoryMaternityPay".freeze
39
+ STATUTORY_MATERNITY_PAY_NON_PENSIONABLE = "StatutoryMaternityPayNonPensionable".freeze
37
40
  STATUTORY_PATERNITY_PAY = "StatutoryPaternityPay".freeze
41
+ STATUTORY_PATERNITY_PAY_NON_PENSIONABLE = "StatutoryPaternityPayNonPensionable".freeze
42
+ STATUTORY_PARENTAL_BEREAVEMENT_PAY_NON_PENSIONABLE = "StatutoryParentalBereavementPayNonPensionable".freeze
38
43
  STATUTORY_SHARED_PARENTAL_PAY = "StatutorySharedParentalPay".freeze
44
+ STATUTORY_SHARED_PARENTAL_PAY_NON_PENSIONABLE = "StatutorySharedParentalPayNonPensionable".freeze
39
45
  STATUTORY_SICK_PAY = "StatutorySickPay".freeze
46
+ STATUTORY_SICK_PAY_NON_PENSIONABLE = "StatutorySickPayNonPensionable".freeze
40
47
  TIPS_DIRECT = "Tips(Direct)".freeze
41
48
  TIPS_NON_DIRECT = "Tips(Non-Direct)".freeze
42
49
 
@@ -206,7 +213,7 @@ module XeroRuby::PayrollUk
206
213
  def valid?
207
214
  return false if @name.nil?
208
215
  return false if @earnings_type.nil?
209
- earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
216
+ earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
210
217
  return false unless earnings_type_validator.valid?(@earnings_type)
211
218
  return false if @rate_type.nil?
212
219
  rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"])
@@ -219,7 +226,7 @@ module XeroRuby::PayrollUk
219
226
  # Custom attribute writer method checking allowed values (enum).
220
227
  # @param [Object] earnings_type Object to be assigned
221
228
  def earnings_type=(earnings_type)
222
- validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryMaternityPay", "StatutoryPaternityPay", "StatutorySharedParentalPay", "StatutorySickPay", "Tips(Direct)", "Tips(Non-Direct)"])
229
+ validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "Tips(Direct)", "Tips(Non-Direct)"])
223
230
  unless validator.valid?(earnings_type)
224
231
  fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}."
225
232
  end
@@ -7,9 +7,9 @@ Contact: api@xero.com
7
7
  Generated by: https://openapi-generator.tech
8
8
  OpenAPI Generator version: 4.3.1
9
9
 
10
- The version of the XeroOpenAPI document: 2.9.3
10
+ The version of the XeroOpenAPI document: 2.9.4
11
11
  =end
12
12
 
13
13
  module XeroRuby
14
- VERSION = '2.7.0'
14
+ VERSION = '2.7.1'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xero-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xero API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-18 00:00:00.000000000 Z
11
+ date: 2021-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday