paypal-sdk-permissions 1.96.3 → 1.96.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NDBlOGRlNmEyZmJkNTU3MTRkMDVhZWZlOGQ4Mjg3MjMyZjFhOWRhOQ==
5
- data.tar.gz: !binary |-
6
- NzdkMjMzMGZhOTY0NGFiNjk0MjI2ZjQ5MmUwYzVkNGM2ODNlN2Y2Nw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NjQwZjBlOTE4NWI4YWU2Y2NiNDQ1NTJiMmI0ZTlkYmM3NWZjMTA4ZDk4Zjk5
10
- YTc5YzYxNDYzOTg0YzY2MzI4YWNlMDYyNTRlZTE3NjA1ODRiNmE5ZDE4MDE1
11
- MDk0YzMzNjU1YjA5NTI2ZDJiNzg5N2UyMTg1ZDViMzgxOTY1ZTg=
12
- data.tar.gz: !binary |-
13
- MGMxYWY3Y2I5Zjc0ODQ1NzgzNzgyODVjNmI5MjFkNDcyYzM0NjZlZmE3ODRk
14
- MWNhN2I0MWRjMGIyZmRjOWE1NTFmYTA3ZWNiYWVhMWI3NTQ0Mzk2MDIxODcz
15
- M2FlMzIyZDk3MDM3NmE4NmQ3MWZjZTNiZjU5Mzg2NTk3NTY2YjI=
2
+ SHA256:
3
+ metadata.gz: 6e7e4c00c8be70891dcd61d753f9a68bf56eeb124ea2d46a78c7f3a6b67a6c1c
4
+ data.tar.gz: '06979fd6d62ad5cc20872d301f2f97544757b4dbae377379486aa0e8ace4591f'
5
+ SHA512:
6
+ metadata.gz: 6bb7f3dedd25f036868c264001212c10a16c1eafc5eb5cc9df4abbd14a54870981972337e4601678f3fae4b3e6c2b8215dc40b2cf4866df1520bd576af8922b2
7
+ data.tar.gz: 68955fc0dcc082cd193294a00afb78fd93eab669b8fe408529223fdae2e3dcccef904d0274a854b6ef6590e6b37094291ff56e607543ef48a1d23cbe92a8455a
data/Gemfile CHANGED
@@ -4,14 +4,8 @@ gemspec
4
4
 
5
5
  gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
6
6
 
7
- if File.exist? File.expand_path('../samples/permissions_samples.gemspec', __FILE__)
8
- gem 'permissions_samples', :path => 'samples', :require => false
9
- group :test do
10
- gem 'rspec-rails', :require => false
11
- gem 'capybara', '~> 2.0.3', :require => false
12
- end
13
- end
14
-
15
7
  group :test do
16
8
  gem 'rspec'
17
9
  end
10
+
11
+ gem 'nokogiri', '~> 1.8.1', :platform => :mri_18
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  The PayPal Permission SDK provides Ruby APIs for developers to request and obtain permissions from merchants and consumers, to execute APIs on behalf of them. The permissions include variety of operations from processing payments to accessing account transaction history.
4
4
 
5
+ ## Support
6
+
7
+ > Please contact [PayPal Technical Support](https://developer.paypal.com/support/) for any live or account issues.
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -64,53 +68,82 @@ PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'develop
64
68
 
65
69
  ## Example
66
70
 
71
+ Request permission:
72
+
67
73
  ```ruby
68
74
  require 'paypal-sdk-permissions'
69
- @api = PayPal::SDK::Permissions::API.new(
75
+
76
+ PayPal::SDK.configure({
70
77
  :mode => "sandbox", # Set "live" for production
71
78
  :app_id => "APP-80W284485P519543T",
72
79
  :username => "jb-us-seller_api1.paypal.com",
73
80
  :password => "WX4WTU3S8MY44S7F",
74
- :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
81
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" })
82
+
83
+ @api = PayPal::SDK::Permissions::API.new
75
84
 
76
85
  # Build request object
77
86
  @request_permissions = @api.build_request_permissions({
78
- :scope => ["EXPRESS_CHECKOUT","INVOICING"],
87
+ :scope => ["ACCESS_BASIC_PERSONAL_DATA","ACCESS_ADVANCED_PERSONAL_DATA"],
79
88
  :callback => "http://localhost:3000/samples/permissions/get_access_token" })
80
89
 
81
90
  # Make API call & get response
82
- @request_permissions_response = @api.request_permissions(@request_permissions)
91
+ @response = @api.request_permissions(@request_permissions)
83
92
 
84
93
  # Access Response
85
- if @request_permissions_response.success?
86
- @request_permissions_response.token
87
- @api.grant_permission_url(@request_permissions_response) # Redirect url to grant permissions
94
+ if @response.success?
95
+ @response.token
96
+ # Redirect url to grant permissions
97
+ redirect_to @api.grant_permission_url(@response)
98
+ # When the user then logs into PayPal and grants the requested permissions, the user will get redirected to the
99
+ # callback url defined when building the permissions-request.
88
100
  else
89
- @request_permissions_response.error
101
+ @response.error
90
102
  end
91
- ```
92
-
93
- For more samples [https://paypal-sdk-samples.herokuapp.com/permissions/](https://paypal-sdk-samples.herokuapp.com/permissions/)
94
-
95
- ## Samples App
96
103
 
97
- Add following line in rails `Gemfile`:
104
+ # In the controller handling the callback:
105
+ # http://localhost:3000/samples/permissions/get_access_token
106
+
107
+ class PermissionsController < ApplicationController
108
+ include PayPal::SDK::Permissions
109
+
110
+ def get_access_token
111
+ api = PayPal::SDK::Permissions::API.new
112
+
113
+ # Build request to exchange tokens
114
+ request_access_token = api.build_get_access_token(
115
+ # As an additional security measure, you should verify that the below "params['request_token']" is the
116
+ # same token as the "@response.token" above for the current user. For instance, you could store the
117
+ # "@response.token" in the user's session before the redirect and verify in this method.
118
+ :token => params['request_token'],
119
+ :verifier => params['verification_code']
120
+ )
121
+
122
+ # Make API call & get response
123
+ access_token_response = api.get_access_token(request_access_token)
124
+
125
+ # Access Token Response
126
+ if access_token_response.success?
127
+ token = access_token_response.token
128
+ token_secret = access_token_response.token_secret
129
+ # Now you have a token and token_secret you can use to make requests.
130
+ else
131
+ @error = access_token_response.error
132
+ # Handle the error here
133
+ end
134
+ end
135
+ end
98
136
 
99
- ```ruby
100
- gem 'paypal-sdk-permissions'
101
- gem 'permissions_samples', :git => "https://github.com/paypal/permissions-sdk-ruby.git", :group => :development
102
137
  ```
103
138
 
104
- Configure routes(`config/routes.rb`):
139
+ Make API call with `token` and `token_secret`:
105
140
 
106
141
  ```ruby
107
- mount PermissionsSamples::Engine => "/samples" if Rails.env.development?
108
- ```
142
+ @api = PayPal::SDK::Permissions::API.new({
143
+ :token => "3rMSi3kCmK1Q3.BKxkH29I53R0TRLrSuCO..l8AMOAFM6cQhPTTrfQ",
144
+ :token_secret => "RuE1j8RNRlSuL5T-PSSpVWLvOlI" })
109
145
 
110
- To get default paypal configuration execute:
111
-
112
- ```sh
113
- rails g paypal:sdk:install
146
+ @response = @api.get_basic_personal_data({
147
+ :attributeList => {
148
+ :attribute => [ "http://axschema.org/namePerson/first" ] } })
114
149
  ```
115
-
116
- Run `rails server` and check the samples.
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module Permissions
4
- VERSION = "1.96.3"
4
+ VERSION = "1.96.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,78 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-sdk-permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.3
4
+ version: 1.96.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-26 00:00:00.000000000 Z
11
+ date: 2023-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paypal-sdk-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.3
19
+ version: 0.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.3
27
- description: The PayPal Permission SDK provides Ruby APIs for developers to request
28
- and obtain permissions from merchants and consumers, to execute APIs on behalf of
29
- them. The permissions include variety of operations from processing payments to
30
- accessing account transaction history
26
+ version: 0.3.0
27
+ description: "[Deprecated] The PayPal Permission SDK provides Ruby APIs for developers
28
+ to request and obtain permissions from merchants and consumers, to execute APIs
29
+ on behalf of them. The permissions include variety of operations from processing
30
+ payments to accessing account transaction history"
31
31
  email:
32
32
  - DL-PP-Platform-Ruby-SDK@ebay.com
33
33
  executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - spec/permissions_spec.rb
38
- - spec/spec_helper.rb
39
- - spec/config/paypal.yml
40
- - spec/config/cert_key.pem
37
+ - Gemfile
38
+ - README.md
39
+ - Rakefile
41
40
  - lib/paypal-sdk-permissions.rb
42
41
  - lib/paypal-sdk/permissions.rb
42
+ - lib/paypal-sdk/permissions/api.rb
43
+ - lib/paypal-sdk/permissions/data_types.rb
43
44
  - lib/paypal-sdk/permissions/services.rb
44
45
  - lib/paypal-sdk/permissions/urls.rb
45
- - lib/paypal-sdk/permissions/api.rb
46
46
  - lib/paypal-sdk/permissions/version.rb
47
- - lib/paypal-sdk/permissions/data_types.rb
48
- - Rakefile
49
- - README.md
50
- - Gemfile
47
+ - spec/config/cert_key.pem
48
+ - spec/config/paypal.yml
49
+ - spec/permissions_spec.rb
50
+ - spec/spec_helper.rb
51
51
  homepage: https://developer.paypal.com
52
52
  licenses: []
53
53
  metadata: {}
54
- post_install_message:
54
+ post_install_message:
55
55
  rdoc_options: []
56
56
  require_paths:
57
57
  - lib
58
58
  required_ruby_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ! '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubyforge_project:
70
- rubygems_version: 2.0.0
71
- signing_key:
69
+ rubygems_version: 3.4.10
70
+ signing_key:
72
71
  specification_version: 4
73
- summary: PayPal Permissions SDK
72
+ summary: Deprecated.
74
73
  test_files:
74
+ - spec/config/cert_key.pem
75
+ - spec/config/paypal.yml
75
76
  - spec/permissions_spec.rb
76
77
  - spec/spec_helper.rb
77
- - spec/config/paypal.yml
78
- - spec/config/cert_key.pem