paypal-sdk-permissions 1.96.4 → 1.96.6

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.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +1 -9
  3. data/README.md +42 -27
  4. metadata +12 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 790bed37ca770bc5587542503a23c8f2cabb531d
4
- data.tar.gz: c878cbe3938e6e4bf40649cf680e10c16ed7aa54
2
+ SHA256:
3
+ metadata.gz: 9071919557d19e751a517b5b912e20563398f6de9d9cc2b0675f70a0bce268a4
4
+ data.tar.gz: 3edeb9fcb67894d157300d9cce626f992e456707bb7b764d09bcb9c285555207
5
5
  SHA512:
6
- metadata.gz: df0c490701951125e0ee5ae40f16b54b4e6410158ac60842eeba575e24ecacb800e9d83f70631872dd62e17f084766e4b8a0ab911afbd5e66f7e2c0dd974b378
7
- data.tar.gz: 56e44efee026ffc3ef647f7dbb5fe491ab0c4dbf86f506f3a875da0ccd9a65e5f1c3cf8907498b26aab9700d131103205340dac28e599ed81558e9c9da65ecab
6
+ metadata.gz: 1580a7864adeea5084b42fb5066c5ef5eb99776aa72c2f88d288cb1f0ad11cafbd964dfe411202f4cd5ac66e5e179c7d42f5abf7da414d0db0356e31070b0427
7
+ data.tar.gz: 6792aec8ca6d2782dc8ee7dab0dbd466f476a7d499f09aff90ccbfff622a0e84924aabdad2da70e4e5934fa3d248b4e19cc6ae6aa8a835bb170bbd7312f739cd
data/Gemfile CHANGED
@@ -4,16 +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
18
10
 
19
- gem 'nokogiri', '~> 1.5.9', :platform => :mri_18
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:
@@ -89,10 +93,47 @@ PayPal::SDK.configure({
89
93
  # Access Response
90
94
  if @response.success?
91
95
  @response.token
92
- @api.grant_permission_url(@response) # Redirect url to grant permissions
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.
93
100
  else
94
101
  @response.error
95
102
  end
103
+
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
136
+
96
137
  ```
97
138
 
98
139
  Make API call with `token` and `token_secret`:
@@ -106,29 +147,3 @@ Make API call with `token` and `token_secret`:
106
147
  :attributeList => {
107
148
  :attribute => [ "http://axschema.org/namePerson/first" ] } })
108
149
  ```
109
-
110
-
111
- For more samples [https://paypal-sdk-samples.herokuapp.com/permissions/](https://paypal-sdk-samples.herokuapp.com/permissions/)
112
-
113
- ## Samples App
114
-
115
- Add following line in rails `Gemfile`:
116
-
117
- ```ruby
118
- gem 'paypal-sdk-permissions'
119
- gem 'permissions_samples', :git => "https://github.com/paypal/permissions-sdk-ruby.git", :group => :development
120
- ```
121
-
122
- Configure routes(`config/routes.rb`):
123
-
124
- ```ruby
125
- mount PermissionsSamples::Engine => "/samples" if Rails.env.development?
126
- ```
127
-
128
- To get default paypal configuration execute:
129
-
130
- ```sh
131
- rails g paypal:sdk:install
132
- ```
133
-
134
- Run `rails server` and check the samples.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-sdk-permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.4
4
+ version: 1.96.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - PayPal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2024-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paypal-sdk-core
@@ -24,10 +24,11 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.0
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
27
+ description: "[Deprecated] It is recommended to use paypal-server-sdk instead. The
28
+ PayPal Permission SDK provides Ruby APIs for developers to request and obtain permissions
29
+ from merchants and consumers, to execute APIs on behalf of them. The permissions
30
+ include variety of operations from processing payments to accessing account transaction
31
+ history"
31
32
  email:
32
33
  - DL-PP-Platform-Ruby-SDK@ebay.com
33
34
  executables: []
@@ -51,7 +52,7 @@ files:
51
52
  homepage: https://developer.paypal.com
52
53
  licenses: []
53
54
  metadata: {}
54
- post_install_message:
55
+ post_install_message:
55
56
  rdoc_options: []
56
57
  require_paths:
57
58
  - lib
@@ -66,11 +67,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  - !ruby/object:Gem::Version
67
68
  version: '0'
68
69
  requirements: []
69
- rubyforge_project:
70
- rubygems_version: 2.4.1
71
- signing_key:
70
+ rubygems_version: 3.5.23
71
+ signing_key:
72
72
  specification_version: 4
73
- summary: PayPal Permissions SDK
73
+ summary: "[Deprecated] It is recommended to use paypal-server-sdk instead"
74
74
  test_files:
75
75
  - spec/config/cert_key.pem
76
76
  - spec/config/paypal.yml