omniauth-square-oauth2 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e3ce6302878b604dad6faa187f8c010076d71e20f3af41511da76f145475590
4
- data.tar.gz: de9b2e8a453015ab750becdb0c8bc82adc3f1c469fc6bfaf25bbe0ab180a23cf
3
+ metadata.gz: f19ab92a8efc93e052e61f76c30ae3aa747e5154e0c22ed05c1dd235a76d2999
4
+ data.tar.gz: 734bc25d8e398cc8d33b297b837dbafb7c1cffaa91254523cfed7525f89a2c45
5
5
  SHA512:
6
- metadata.gz: f258bdfe36130dc3b56d87c4fd952e71a1f72ca40c3573e520e7ba6ba808e54cfee9ece431f347a99a3f4c9708bf88efe35c3cf68b5f3bf42311726cefe77545
7
- data.tar.gz: a50c2e2d11fbeae5c8d3b553e60eb30734ff38973e12cbb1af12c618889f33091700dc00a96636ba11dc9cade30e388ac09faf38c728858c796bc6f7e45a03b7
6
+ metadata.gz: e5f1b4c48dd0764ff141ead54e59435c026131cd407d6f430e673cad26aa8edf3d2f314d95a8bf10cfa6e9bc4ea898a6de68775981292d414933dc6e818c93e8
7
+ data.tar.gz: 913af461084fd09051c011e10d62202eff7d74f6862e6d6e9a16525bb27c4a3568a109d9eef3714dd760e6c56cc94565e08f8c64ee4317b6e763093cf75c45e1
@@ -39,9 +39,10 @@ module OmniAuth
39
39
 
40
40
  def raw_info
41
41
  @raw_info ||= access_token.get('/v2/merchants').parsed
42
- main_location_id = @raw_info['merchant'][0]['main_location_id']
43
- location_data = access_token.get("/v2/locations/#{main_location_id}").parsed
44
- @raw_info.merge!({email: location_data['location']['business_email']})
42
+
43
+ # Get merchant email
44
+ team_members = access_token.post("/v2/team-members/search", {query: {filter: {is_owner: true}}})
45
+ @raw_info.merge!({email: team_members[0].email})
45
46
  end
46
47
 
47
48
  def prune!(hash)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module Square
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-square-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Robinson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-29 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2