paypal-sdk-buttonmanager 1.106.0 → 1.106.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 02a1c802d78a6ef6b36c62a1029e27c9323e8a5cb03ce3e5bb58db35272a9ef1
4
+ data.tar.gz: c6a6d8f32caa6cead401cc6fe6a87bbd51034d22d5ec0c2773d8aaa31f2e4d56
5
+ SHA512:
6
+ metadata.gz: e45fecc871cf6e8816a1a919026dae84e50326f8614c54c81e04bc75a74bc000b13b52903d0b208c9e485c7ce8c9264a24e3054fb95a041690058a32f0978969
7
+ data.tar.gz: 37eeb97f2f65c82b14cea0b8666cc1a1a5c39f14b8921e3efc0ba7b5f4cb05a6f7528d957f081baa85c2d6458fdd708e9a1e91a6ad43b3566985b40586d9e662
data/Gemfile CHANGED
@@ -1,19 +1,11 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
6
-
7
- if File.exist? File.expand_path('../samples/button_manager_samples.gemspec', __FILE__)
8
- gem 'button_manager_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
- group :test do
16
- gem 'rspec'
17
- end
18
-
19
- gem 'nokogiri', '~> 1.5.9', :platform => :mri_18
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
6
+
7
+ group :test do
8
+ gem 'rspec'
9
+ end
10
+
11
+ gem 'nokogiri', '~> 1.8.1', :platform => :mri_18
data/README.md CHANGED
@@ -1,120 +1,98 @@
1
- # Button Manager SDK
2
-
3
- The PayPal Button Manager SDK provides Ruby APIs to create, and manage PayPal Payments Standard buttons programmatically.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'paypal-sdk-buttonmanager'
11
- ```
12
-
13
- And then execute:
14
-
15
- ```sh
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
-
21
- ```sh
22
- $ gem install paypal-sdk-buttonmanager
23
- ```
24
-
25
- ## Configuration
26
-
27
- For Rails application:
28
-
29
- ```sh
30
- rails g paypal:sdk:install
31
- ```
32
-
33
- For other ruby application, create a configuration file(`config/paypal.yml`):
34
-
35
- ```yaml
36
- development: &default
37
- username: jb-us-seller_api1.paypal.com
38
- password: WX4WTU3S8MY44S7F
39
- signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
40
- app_id: APP-80W284485P519543T
41
- http_timeout: 30
42
- mode: sandbox
43
- sandbox_email_address: Platform.sdk.seller@gmail.com
44
- # # with certificate
45
- # cert_path: "config/cert_key.pem"
46
- # # with token authentication
47
- # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
48
- # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
49
- # # with Proxy
50
- # http_proxy: http://proxy-ipaddress:3129/
51
- # # with device ip address
52
- # device_ipaddress: "127.0.0.1"
53
- test:
54
- <<: *default
55
- production:
56
- <<: *default
57
- mode: live
58
- ```
59
-
60
- Load Configurations from specified file:
61
-
62
- ```ruby
63
- PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
64
- ```
65
-
66
- ## Example
67
-
68
- ```ruby
69
- require 'paypal-sdk-buttonmanager'
70
- @api = PayPal::SDK::ButtonManager::API.new(
71
- :mode => "sandbox", # Set "live" for production
72
- :app_id => "APP-80W284485P519543T",
73
- :username => "jb-us-seller_api1.paypal.com",
74
- :password => "WX4WTU3S8MY44S7F",
75
- :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
76
-
77
- # Build request object
78
- @bm_create_button = @api.build_bm_create_button({
79
- :ButtonType => "BUYNOW",
80
- :ButtonCode => "HOSTED",
81
- :ButtonVar => ["item_name=Testing","amount=5","return=http://localhost:3000/samples/button_manager/bm_create_button","notify_url=http://localhost:3000/samples/button_manager/ipn_notify"] })
82
-
83
- # Make API call & get response
84
- @bm_create_button_response = @api.bm_create_button(@bm_create_button)
85
-
86
- # Access Response
87
- if @bm_create_button_response.success?
88
- @bm_create_button_response.Website
89
- @bm_create_button_response.Email
90
- @bm_create_button_response.HostedButtonID
91
- else
92
- @bm_create_button_response.Errors
93
- end
94
- ```
95
-
96
- For more samples [paypal-sdk-samples.herokuapp.com/button_manager/](https://paypal-sdk-samples.herokuapp.com/button_manager/)
97
-
98
- ## Samples App
99
-
100
- Add following line in rails `Gemfile`:
101
-
102
- ```ruby
103
- gem 'paypal-sdk-buttonmanager'
104
- gem 'button_manager_samples', :git => "https://github.com/paypal/buttonmanager-sdk-ruby.git", :group => :development
105
- ```
106
-
107
- Configure routes(`config/routes.rb`):
108
-
109
- ```ruby
110
- mount ButtonManagerSamples::Engine => "/samples" if Rails.env.development?
111
- ```
112
-
113
- To get default paypal configuration execute:
114
-
115
- ```sh
116
- rails g paypal:sdk:install
117
- ```
118
-
119
- Run `rails server` and check the samples.
120
-
1
+ # Button Manager SDK
2
+
3
+ The PayPal Button Manager SDK provides Ruby APIs to create, and manage PayPal Payments Standard buttons programmatically.
4
+
5
+ ## Support
6
+
7
+ > Please contact [PayPal Technical Support](https://developer.paypal.com/support/) for any live or account issues.
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'paypal-sdk-buttonmanager'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ ```sh
20
+ $ bundle
21
+ ```
22
+
23
+ Or install it yourself as:
24
+
25
+ ```sh
26
+ $ gem install paypal-sdk-buttonmanager
27
+ ```
28
+
29
+ ## Configuration
30
+
31
+ For Rails application:
32
+
33
+ ```sh
34
+ rails g paypal:sdk:install
35
+ ```
36
+
37
+ For other ruby application, create a configuration file(`config/paypal.yml`):
38
+
39
+ ```yaml
40
+ development: &default
41
+ username: jb-us-seller_api1.paypal.com
42
+ password: WX4WTU3S8MY44S7F
43
+ signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
44
+ app_id: APP-80W284485P519543T
45
+ http_timeout: 30
46
+ mode: sandbox
47
+ sandbox_email_address: Platform.sdk.seller@gmail.com
48
+ # # with certificate
49
+ # cert_path: "config/cert_key.pem"
50
+ # # with token authentication
51
+ # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
52
+ # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
53
+ # # with Proxy
54
+ # http_proxy: http://proxy-ipaddress:3129/
55
+ # # with device ip address
56
+ # device_ipaddress: "127.0.0.1"
57
+ test:
58
+ <<: *default
59
+ production:
60
+ <<: *default
61
+ mode: live
62
+ ```
63
+
64
+ Load Configurations from specified file:
65
+
66
+ ```ruby
67
+ PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
68
+ ```
69
+
70
+ ## Example
71
+
72
+ ```ruby
73
+ require 'paypal-sdk-buttonmanager'
74
+ @api = PayPal::SDK::ButtonManager::API.new(
75
+ :mode => "sandbox", # Set "live" for production
76
+ :app_id => "APP-80W284485P519543T",
77
+ :username => "jb-us-seller_api1.paypal.com",
78
+ :password => "WX4WTU3S8MY44S7F",
79
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
80
+
81
+ # Build request object
82
+ @bm_create_button = @api.build_bm_create_button({
83
+ :ButtonType => "BUYNOW",
84
+ :ButtonCode => "HOSTED",
85
+ :ButtonVar => ["item_name=Testing","amount=5","return=http://localhost:3000/samples/button_manager/bm_create_button","notify_url=http://localhost:3000/samples/button_manager/ipn_notify"] })
86
+
87
+ # Make API call & get response
88
+ @bm_create_button_response = @api.bm_create_button(@bm_create_button)
89
+
90
+ # Access Response
91
+ if @bm_create_button_response.success?
92
+ @bm_create_button_response.Website
93
+ @bm_create_button_response.Email
94
+ @bm_create_button_response.HostedButtonID
95
+ else
96
+ @bm_create_button_response.Errors
97
+ end
98
+ ```
data/Rakefile CHANGED
@@ -2,13 +2,8 @@ require "bundler/gem_tasks"
2
2
 
3
3
  desc "Run tests"
4
4
  task :rspec do
5
- cmd = "bundle exec rspec && cd samples && bundle exec rspec"
5
+ cmd = "bundle exec rspec"
6
6
  system(cmd) || raise("#{cmd} failed")
7
7
  end
8
8
 
9
- desc "View samples"
10
- task :samples do
11
- system("cd samples/spec/dummy && bundle exec rails server")
12
- end
13
-
14
9
  task :default => :rspec
@@ -1,26 +1,26 @@
1
- require 'paypal-sdk-core'
2
-
3
- module PayPal
4
- module SDK
5
- module ButtonManager
6
- class API < Core::API::Merchant
7
- include Services
8
-
9
- def initialize(environment = nil, options = {})
10
- super("", environment, options)
11
- end
12
-
13
- ADAPTIVE_PAYMENTS_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "buttonmanager-ruby-sdk-#{VERSION}" }
14
- def default_http_header
15
- super.merge(ADAPTIVE_PAYMENTS_HTTP_HEADER)
16
- end
17
-
18
- # Validate IPN message
19
- def ipn_valid?(raw_post_data)
20
- Core::API::IPN.valid?(raw_post_data, config)
21
- end
22
- end
23
- end
24
- end
25
- end
26
-
1
+ require 'paypal-sdk-core'
2
+
3
+ module PayPal
4
+ module SDK
5
+ module ButtonManager
6
+ class API < Core::API::Merchant
7
+ include Services
8
+
9
+ def initialize(environment = nil, options = {})
10
+ super("", environment, options)
11
+ end
12
+
13
+ ADAPTIVE_PAYMENTS_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "buttonmanager-ruby-sdk-#{VERSION}" }
14
+ def default_http_header
15
+ super.merge(ADAPTIVE_PAYMENTS_HTTP_HEADER)
16
+ end
17
+
18
+ # Validate IPN message
19
+ def ipn_valid?(raw_post_data)
20
+ Core::API::IPN.valid?(raw_post_data, config)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+