paypal-sdk-invoice 1.106.0 → 1.117.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: 6cc36afb984070bcf832f2fba6acf962becda1ff611b8ec59d2d1910f649f886
4
+ data.tar.gz: 5d0d800685c54d1d8fe962cc41132581285ebf68489cbf2679621c7e8b0e5ba8
5
+ SHA512:
6
+ metadata.gz: 98bc45df0faf6da59baa83d09b2756cb285cdfebb727261a8177f098029c80f9561b9ec79f5f94fb6b3f8d41b7c56d114e1a33ae60ad3bb1c5fe8a6de21a7f49
7
+ data.tar.gz: fe3b2011a5e9e9fb96ed1feb6aa0eeeae3f6013d0de7be58866c42bb94c866a6f8b92f151063d1499c12bc98ba23cc8b0a4c826258aa1814a1c50007aded396e
data/Gemfile CHANGED
@@ -1,17 +1,17 @@
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/invoice_samples.gemspec', __FILE__)
8
- gem 'invoice_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
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/invoice_samples.gemspec', __FILE__)
8
+ gem 'invoice_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
data/README.md CHANGED
@@ -1,125 +1,104 @@
1
- # Invoice SDK
2
-
3
- The PayPal Invoice SDK provides Ruby APIs to create and manage Invoices using the PayPal's Invoicing Service API.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'paypal-sdk-invoice'
11
- ```
12
-
13
- And then execute:
14
-
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
-
21
- ```bash
22
- $ gem install paypal-sdk-invoice
23
- ```
24
-
25
- ## Configuration
26
-
27
- For Rails application:
28
-
29
- ```bash
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
- # # with certificate
44
- # cert_path: "config/cert_key.pem"
45
- # # with token authentication
46
- # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
47
- # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
48
- # # with Proxy
49
- # http_proxy: http://proxy-ipaddress:3129/
50
- # # with device ip address
51
- # device_ipaddress: "127.0.0.1"
52
- test:
53
- <<: *default
54
- production:
55
- <<: *default
56
- mode: live
57
- ```
58
-
59
- Load Configurations from specified file:
60
-
61
- ```ruby
62
- PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
63
- ```
64
-
65
- ## Example
66
-
67
- ```ruby
68
- require 'paypal-sdk-invoice'
69
- @api = PayPal::SDK::Invoice::API.new(
70
- :mode => "sandbox", # Set "live" for production
71
- :app_id => "APP-80W284485P519543T",
72
- :username => "jb-us-seller_api1.paypal.com",
73
- :password => "WX4WTU3S8MY44S7F",
74
- :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
75
-
76
- # Build request object
77
- @create_invoice = @api.build_create_invoice({
78
- :invoice => {
79
- :merchantEmail => "jb-us-seller@paypal.com",
80
- :payerEmail => "sender@yahoo.com",
81
- :itemList => {
82
- :item => [{
83
- :name => "item1",
84
- :quantity => 2.0,
85
- :unitPrice => 5.0 }] },
86
- :currencyCode => "USD",
87
- :paymentTerms => "DueOnReceipt" } })
88
-
89
- # Make API call & get response
90
- @create_invoice_response = @api.create_invoice(@create_invoice)
91
-
92
- # Access Response
93
- if @create_invoice_response.success?
94
- @create_invoice_response.invoiceID
95
- @create_invoice_response.invoiceNumber
96
- @create_invoice_response.invoiceURL
97
- else
98
- @create_invoice_response.error
99
- end
100
- ```
101
-
102
- For more samples [paypal-sdk-samples.herokuapp.com/invoice/](https://paypal-sdk-samples.herokuapp.com/invoice/)
103
-
104
- ## Samples App
105
-
106
- Add following line in rails `Gemfile`:
107
-
108
- ```ruby
109
- gem 'paypal-sdk-invoice'
110
- gem 'invoice_samples', :git => "https://github.com/paypal/invoice-sdk-ruby.git", :group => :development
111
- ```
112
-
113
- Configure routes(`config/routes.rb`):
114
-
115
- ```ruby
116
- mount InvoiceSamples::Engine => "/samples" if Rails.env.development?
117
- ```
118
-
119
- To get default paypal configuration execute:
120
-
121
- ```bash
122
- $ rails g paypal:sdk:install
123
- ```
124
-
125
- Run `rails server` and check the samples.
1
+ # Invoice SDK
2
+
3
+ The PayPal Invoice SDK provides Ruby APIs to create and manage Invoices using the PayPal's Invoicing Service API.
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-invoice'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ ```bash
20
+ $ bundle
21
+ ```
22
+
23
+ Or install it yourself as:
24
+
25
+ ```bash
26
+ $ gem install paypal-sdk-invoice
27
+ ```
28
+
29
+ ## Configuration
30
+
31
+ For Rails application:
32
+
33
+ ```bash
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
+ # # with certificate
48
+ # cert_path: "config/cert_key.pem"
49
+ # # with token authentication
50
+ # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
51
+ # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
52
+ # # with Proxy
53
+ # http_proxy: http://proxy-ipaddress:3129/
54
+ # # with device ip address
55
+ # device_ipaddress: "127.0.0.1"
56
+ test:
57
+ <<: *default
58
+ production:
59
+ <<: *default
60
+ mode: live
61
+ ```
62
+
63
+ Load Configurations from specified file:
64
+
65
+ ```ruby
66
+ PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
67
+ ```
68
+
69
+ ## Example
70
+
71
+ ```ruby
72
+ require 'paypal-sdk-invoice'
73
+ @api = PayPal::SDK::Invoice::API.new(
74
+ :mode => "sandbox", # Set "live" for production
75
+ :app_id => "APP-80W284485P519543T",
76
+ :username => "jb-us-seller_api1.paypal.com",
77
+ :password => "WX4WTU3S8MY44S7F",
78
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
79
+
80
+ # Build request object
81
+ @create_invoice = @api.build_create_invoice({
82
+ :invoice => {
83
+ :merchantEmail => "jb-us-seller@paypal.com",
84
+ :payerEmail => "sender@yahoo.com",
85
+ :itemList => {
86
+ :item => [{
87
+ :name => "item1",
88
+ :quantity => 2.0,
89
+ :unitPrice => 5.0 }] },
90
+ :currencyCode => "USD",
91
+ :paymentTerms => "DueOnReceipt" } })
92
+
93
+ # Make API call & get response
94
+ @create_invoice_response = @api.create_invoice(@create_invoice)
95
+
96
+ # Access Response
97
+ if @create_invoice_response.success?
98
+ @create_invoice_response.invoiceID
99
+ @create_invoice_response.invoiceNumber
100
+ @create_invoice_response.invoiceURL
101
+ else
102
+ @create_invoice_response.error
103
+ end
104
+ ```
data/Rakefile CHANGED
@@ -1,14 +1,9 @@
1
- require "bundler/gem_tasks"
2
-
3
- desc "Run tests"
4
- task :rspec do
5
- cmd = "bundle exec rspec && cd samples && bundle exec rspec"
6
- system(cmd) || raise("#{cmd} failed")
7
- end
8
-
9
- desc "View samples"
10
- task :samples do
11
- system("cd samples/spec/dummy && bundle exec rails server")
12
- end
13
-
14
- task :default => :rspec
1
+ require "bundler/gem_tasks"
2
+
3
+ desc "Run tests"
4
+ task :rspec do
5
+ cmd = "bundle exec rspec"
6
+ system(cmd) || raise("#{cmd} failed")
7
+ end
8
+
9
+ task :default => :rspec
@@ -1,21 +1,21 @@
1
- require 'paypal-sdk-core'
2
-
3
- module PayPal
4
- module SDK
5
- module Invoice
6
- class API < Core::API::Platform
7
- include Services
8
-
9
- def initialize(environment = nil, options = {})
10
- super(SERVICE_NAME, environment, options)
11
- end
12
-
13
- INVOICE_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "invoice-ruby-sdk-#{VERSION}" }
14
- def default_http_header
15
- super.merge(INVOICE_HTTP_HEADER)
16
- end
17
- end
18
- end
19
- end
20
- end
21
-
1
+ require 'paypal-sdk-core'
2
+
3
+ module PayPal
4
+ module SDK
5
+ module Invoice
6
+ class API < Core::API::Platform
7
+ include Services
8
+
9
+ def initialize(environment = nil, options = {})
10
+ super(SERVICE_NAME, environment, options)
11
+ end
12
+
13
+ INVOICE_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "invoice-ruby-sdk-#{VERSION}" }
14
+ def default_http_header
15
+ super.merge(INVOICE_HTTP_HEADER)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+