paypal-sdk-permissions 1.96.4 → 1.96.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +1 -9
  3. data/README.md +42 -27
  4. metadata +11 -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: 6e7e4c00c8be70891dcd61d753f9a68bf56eeb124ea2d46a78c7f3a6b67a6c1c
4
+ data.tar.gz: '06979fd6d62ad5cc20872d301f2f97544757b4dbae377379486aa0e8ace4591f'
5
5
  SHA512:
6
- metadata.gz: df0c490701951125e0ee5ae40f16b54b4e6410158ac60842eeba575e24ecacb800e9d83f70631872dd62e17f084766e4b8a0ab911afbd5e66f7e2c0dd974b378
7
- data.tar.gz: 56e44efee026ffc3ef647f7dbb5fe491ab0c4dbf86f506f3a875da0ccd9a65e5f1c3cf8907498b26aab9700d131103205340dac28e599ed81558e9c9da65ecab
6
+ metadata.gz: 6bb7f3dedd25f036868c264001212c10a16c1eafc5eb5cc9df4abbd14a54870981972337e4601678f3fae4b3e6c2b8215dc40b2cf4866df1520bd576af8922b2
7
+ data.tar.gz: 68955fc0dcc082cd193294a00afb78fd93eab669b8fe408529223fdae2e3dcccef904d0274a854b6ef6590e6b37094291ff56e607543ef48a1d23cbe92a8455a
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.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: 2015-02-03 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
@@ -24,10 +24,10 @@ 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] 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: []
@@ -51,7 +51,7 @@ files:
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
@@ -66,11 +66,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  requirements: []
69
- rubyforge_project:
70
- rubygems_version: 2.4.1
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:
75
74
  - spec/config/cert_key.pem
76
75
  - spec/config/paypal.yml