paypal-sdk-invoice 1.96.1 → 1.96.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MTQ3N2NiYTNkZmVkMWE3MWMxNDE1MmU0MjQxNDkxZDQxMTFjYjE2YQ==
5
+ data.tar.gz: !binary |-
6
+ YWNjNjUxZWY5Nzg5MjBlMTYxOTM5MWU3ZjA4N2M4NmZjN2JmODZjZQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MjFiYzQ3NjdhMGJhOTIyZjY0OTQzMDNjMDc4MDdmMmNjNzVmZmM0NTA3NzU4
10
+ NzQzM2FmZjczNzg3MzUzMzdjZTkxYWVjNDM4ZDNhNzVlNGI5YjExNWIyOWM2
11
+ MjZkZjUzZThmZDAzZjY3ZjBhMjNhYjY0N2ZjOTNlY2M5MWQ4ZGQ=
12
+ data.tar.gz: !binary |-
13
+ MmVlZDY4N2Q2ZTg2ODVhZWE0YTRkZTk0MTRlYzM1Yzc2NjhlMWQzNzgyMWEz
14
+ YzI3YTE2NGFjYjM2MWM5MzA2ZjFkODE3OGMxZGU1ZjkyZTFkZTQ1Mjg5MjVm
15
+ NTkyZGYxZjE3NGY0OTA5MmI1YWVlZjc5ZjRkNjJjZGMxNTY3YjQ=
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ gemspec
4
4
 
5
5
  gem 'paypal-sdk-core', :git => "https://github.com/paypal/sdk-core-ruby.git"
6
6
 
7
- if Dir.exist? File.expand_path('../samples', __FILE__)
7
+ if File.exist? File.expand_path('../samples/invoice_samples.gemspec', __FILE__)
8
8
  gem 'invoice_samples', :path => 'samples', :require => false
9
9
  group :test do
10
10
  gem 'rspec-rails', :require => false
data/README.md CHANGED
@@ -6,136 +6,179 @@ The PayPal Invoice SDK provides Ruby APIs to create and manage Invoices using th
6
6
 
7
7
  Add this line to your application's Gemfile:
8
8
 
9
- gem 'paypal-sdk-invoice'
9
+ ```ruby
10
+ gem 'paypal-sdk-invoice'
11
+ ```
10
12
 
11
13
  And then execute:
12
14
 
13
- $ bundle
15
+ ```bash
16
+ $ bundle
17
+ ```
14
18
 
15
19
  Or install it yourself as:
16
20
 
17
- $ gem install paypal-sdk-invoice
21
+ ```bash
22
+ $ gem install paypal-sdk-invoice
23
+ ```
18
24
 
19
25
  ## Configuration
20
26
 
21
27
  For Rails application:
22
28
 
23
- rails g paypal:sdk:install
29
+ ```bash
30
+ $ rails g paypal:sdk:install
31
+ ```
24
32
 
25
33
  For other ruby application, create a configuration file(`config/paypal.yml`):
26
34
 
27
- development: &default
28
- username: jb-us-seller_api1.paypal.com
29
- password: WX4WTU3S8MY44S7F
30
- signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
31
- app_id: APP-80W284485P519543T
32
- http_timeout: 30
33
- mode: sandbox
34
- # # with certificate
35
- # cert_path: "config/cert_key.pem"
36
- # # with token authentication
37
- # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
38
- # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
39
- # # with Proxy
40
- # http_proxy: http://proxy-ipaddress:3129/
41
- # # with device ip address
42
- # device_ipaddress: "127.0.0.1"
43
- test:
44
- <<: *default
45
- production:
46
- <<: *default
47
- mode: live
48
-
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
+
49
59
  Load Configurations from specified file:
50
60
 
51
- PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
61
+ ```ruby
62
+ PayPal::SDK::Core::Config.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
63
+ ```
52
64
 
53
65
  ## Create API object
54
66
 
55
67
  Create API object:
56
68
 
57
- api = PayPal::SDK::Invoice::API.new
69
+ ```ruby
70
+ api = PayPal::SDK::Invoice::API.new
71
+ ```
58
72
 
59
73
  Override configuration while creating a object:
60
74
 
61
- api = PayPal::SDK::Invoice::API.new(:development)
62
- api = PayPal::SDK::Invoice::API.new(:development, :app_id => "XYZ")
63
- api = PayPal::SDK::Invoice::API.new(:app_id => "XYZ") # Take default environment.
75
+ ```ruby
76
+ api = PayPal::SDK::Invoice::API.new(:development)
77
+ api = PayPal::SDK::Invoice::API.new(:development, :app_id => "XYZ")
78
+ api = PayPal::SDK::Invoice::API.new(:app_id => "XYZ") # Take default environment.
79
+ ```
64
80
 
65
81
  Change configuration:
66
82
 
67
- api.set_config :testing
68
- api.set_config :testing, app_id => "XYZ"
83
+ ```ruby
84
+ api.set_config :testing
85
+ api.set_config :testing, app_id => "XYZ"
86
+ ```
69
87
 
70
88
 
71
89
  ## Build Request Object
72
90
 
73
91
  To make api request, we need to build a request object.
74
92
 
75
- # To build a empty request object
76
- create_invoice_request = api.build_create_invoice()
93
+ ```ruby
94
+ # To build a empty request object
95
+ create_invoice_request = api.build_create_invoice()
96
+
97
+ # To build a request object with default data
98
+ create_invoice_request = api.build_create_invoice( :invoice => { :merchantEmail => "jb-us-seller@paypal.com" })
99
+ ```
77
100
 
78
- # To build a request object with default data
79
- create_invoice_request = api.build_create_invoice( :invoice => { :merchantEmail => "jb-us-seller@paypal.com" })
80
101
 
81
102
  The Build method can be access with camelcase or underscore:
82
103
 
83
- api = api.build_create_invoice()
84
- # (or)
85
- api = api.BuildCreateInvoice()
104
+ ```ruby
105
+ api = api.build_create_invoice()
106
+ # (or)
107
+ api = api.BuildCreateInvoice()
108
+ ```
86
109
 
87
110
  ## Assign value to members
88
111
 
89
112
  Members can be access with camelcase or underscore format.
90
113
 
91
- create_invoice_request.invoice.itemList.item[0].name = "item1"
92
- # With underscore
93
- create_invoice_request.invoice.item_list.item[0].name = "item1"
114
+ ```ruby
115
+ create_invoice_request.invoice.itemList.item[0].name = "item1"
116
+ # With underscore
117
+ create_invoice_request.invoice.item_list.item[0].name = "item1"
118
+ ```
94
119
 
95
120
  To Assign multiple values:
96
121
 
97
- create_invoice_request.invoice.itemList.item[0] = { :name => "item1", :quantity => 2.0, :unitPrice => 5.0 }
122
+ ```ruby
123
+ create_invoice_request.invoice.itemList.item[0] = { :name => "item1", :quantity => 2.0, :unitPrice => 5.0 }
124
+ ```
98
125
 
99
126
  To Get members list for the given object( For Reference ):
100
127
 
101
- create_invoice_request.members
102
- create_invoice_request.baseAmountList.members
128
+ ```ruby
129
+ create_invoice_request.members
130
+ create_invoice_request.baseAmountList.members
131
+ ```
103
132
 
104
133
  ## Make API Request
105
134
 
106
135
  Make api call with request object:
107
136
 
108
- create_invoice_response = api.create_invoice(create_invoice_request)
137
+ ```ruby
138
+ create_invoice_response = api.create_invoice(create_invoice_request)
139
+ ```
109
140
 
110
141
  Make api call with hash:
111
142
 
112
- create_invoice_response = api.create_invoice( :invoice => { :merchantEmail => "jb-us-seller@paypal.com", :payerEmail => "sender@yahoo.com" } )
143
+ ```ruby
144
+ create_invoice_response = api.create_invoice( :invoice => { :merchantEmail => "jb-us-seller@paypal.com", :payerEmail => "sender@yahoo.com" } )
145
+ ```
113
146
 
114
147
  ## Access values from response object
115
148
 
116
149
  To get response status:
117
150
 
118
- create_invoice_response.responseEnvelope.ack
151
+ ```ruby
152
+ create_invoice_response.responseEnvelope.ack
153
+ ```
119
154
 
120
155
 
121
156
  ## Example
122
157
 
123
158
  ```ruby
124
159
  require 'paypal-sdk-invoice'
125
- @api = PayPal::SDK::Invoice::API.new
160
+ @api = PayPal::SDK::Invoice::API.new(
161
+ :mode => "sandbox", # Set "live" for production
162
+ :app_id => "APP-80W284485P519543T",
163
+ :username => "jb-us-seller_api1.paypal.com",
164
+ :password => "WX4WTU3S8MY44S7F",
165
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
126
166
 
127
167
  # Build request object
128
- @create_invoice_request = @api.build_create_invoice()
129
- @create_invoice_request.invoice.merchantEmail = "jb-us-seller@paypal.com"
130
- @create_invoice_request.invoice.payerEmail = "sender@yahoo.com"
131
- @create_invoice_request.invoice.itemList.item[0].name = "item1"
132
- @create_invoice_request.invoice.itemList.item[0].quantity = 2.0
133
- @create_invoice_request.invoice.itemList.item[0].unitPrice = 5.0
134
- @create_invoice_request.invoice.currencyCode = "USD"
135
- @create_invoice_request.invoice.paymentTerms = "DueOnReceipt"
168
+ @create_invoice = @api.build_create_invoice({
169
+ :invoice => {
170
+ :merchantEmail => "jb-us-seller@paypal.com",
171
+ :payerEmail => "sender@yahoo.com",
172
+ :itemList => {
173
+ :item => [{
174
+ :name => "item1",
175
+ :quantity => 2.0,
176
+ :unitPrice => 5.0 }] },
177
+ :currencyCode => "USD",
178
+ :paymentTerms => "DueOnReceipt" } })
136
179
 
137
180
  # Make API call & get response
138
- @create_invoice_response = @api.create_invoice(@create_invoice_request)
181
+ @create_invoice_response = @api.create_invoice(@create_invoice)
139
182
 
140
183
  # Access Response
141
184
  @create_invoice_response.responseEnvelope
@@ -149,15 +192,21 @@ require 'paypal-sdk-invoice'
149
192
 
150
193
  Add following line in rails `Gemfile`:
151
194
 
152
- gem 'paypal-sdk-invoice'
153
- gem 'invoice_samples', :git => "https://github.com/paypal/invoice-sdk-ruby.git", :group => :development
195
+ ```ruby
196
+ gem 'paypal-sdk-invoice'
197
+ gem 'invoice_samples', :git => "https://github.com/paypal/invoice-sdk-ruby.git", :group => :development
198
+ ```
154
199
 
155
200
  Configure routes(`config/routes.rb`):
156
201
 
157
- mount InvoiceSamples::Engine => "/samples" if Rails.env.development?
202
+ ```ruby
203
+ mount InvoiceSamples::Engine => "/samples" if Rails.env.development?
204
+ ```
158
205
 
159
206
  To get default paypal configuration execute:
160
207
 
161
- rails g paypal:sdk:install
208
+ ```bash
209
+ $ rails g paypal:sdk:install
210
+ ```
162
211
 
163
212
  Run `rails server` and check the samples.
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  module PayPal
2
2
  module SDK
3
3
  module Invoice
4
- VERSION = "1.96.1"
4
+ VERSION = "1.96.2"
5
5
  end
6
6
  end
7
7
  end
File without changes
@@ -1,25 +1,24 @@
1
- test: &default
2
- username: jb-us-seller_api1.paypal.com
3
- password: WX4WTU3S8MY44S7F
4
- signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
5
- app_id: APP-80W284485P519543T
6
- http_timeout: 30
7
- mode: sandbox
8
- redirect_url: "https://www.sandbox.paypal.com/webscr&cmd="
9
- dev_central_url: "https://developer.paypal.com"
10
- development:
11
- <<: *default
12
-
13
- with_certificate:
14
- <<: *default
15
- username: platfo_1255170694_biz_api1.gmail.com
16
- password: 2DPPKUPKB7DQLXNR
17
- signature:
18
- cert_path: "spec/config/cert_key.pem"
19
- app_id: APP-80W284485P519543T
20
- soap_end_point: "https://api.sandbox.paypal.com/2.0/"
21
-
22
- with_oauth_token:
23
- <<: *default
24
- token: H2kLxjm9lCxQdnOYxkH29I53TpZyIXez4GtHhAVGpiU3DiVTz5eNPQ
25
- token_secret: MnZ-iPdDqGLEfQIuTIfUN4uK9lU
1
+ test: &default
2
+ username: jb-us-seller_api1.paypal.com
3
+ password: WX4WTU3S8MY44S7F
4
+ signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
5
+ app_id: APP-80W284485P519543T
6
+ http_timeout: 30
7
+ mode: sandbox
8
+
9
+ development:
10
+ <<: *default
11
+
12
+ with_certificate:
13
+ <<: *default
14
+ username: platfo_1255170694_biz_api1.gmail.com
15
+ password: 2DPPKUPKB7DQLXNR
16
+ signature:
17
+ cert_path: "spec/config/cert_key.pem"
18
+ app_id: APP-80W284485P519543T
19
+ soap_end_point: "https://api.sandbox.paypal.com/2.0/"
20
+
21
+ with_oauth_token:
22
+ <<: *default
23
+ token: H2kLxjm9lCxQdnOYxkH29I53TpZyIXez4GtHhAVGpiU3DiVTz5eNPQ
24
+ token_secret: MnZ-iPdDqGLEfQIuTIfUN4uK9lU
@@ -1,27 +1,27 @@
1
- require 'spec_helper'
2
-
3
- describe "Invoice" do
4
-
5
- before :all do
6
- @client = PayPal::SDK::Invoice::API.new
7
- end
8
-
9
- describe "Services" do
10
- PayPal::SDK::Invoice::Services.instance_methods.select{|s| s =~ /^[A-Z]/ and s !~ /^Build/ }.each do |service_method|
11
- it "make empty request to #{service_method}" do
12
- response = @client.send(service_method, {})
13
- response.response_envelope.ack.should_not be_nil
14
- end
15
- end
16
- end
17
-
18
- describe "DataTypes" do
19
- PayPal::SDK::Invoice::DataTypes.constants.each do |const_name|
20
- it "create object for #{const_name}" do
21
- klass = PayPal::SDK::Invoice::DataTypes.const_get(const_name)
22
- klass.new.should be_a klass
23
- end
24
- end
25
- end
26
-
27
- end
1
+ require 'spec_helper'
2
+
3
+ describe "Invoice" do
4
+
5
+ before :all do
6
+ @client = PayPal::SDK::Invoice::API.new
7
+ end
8
+
9
+ describe "Services" do
10
+ PayPal::SDK::Invoice::Services.instance_methods.select{|s| s =~ /^[A-Z]/ and s !~ /^Build/ }.each do |service_method|
11
+ it "make empty request to #{service_method}" do
12
+ response = @client.send(service_method, {})
13
+ response.response_envelope.ack.should_not be_nil
14
+ end
15
+ end
16
+ end
17
+
18
+ describe "DataTypes" do
19
+ PayPal::SDK::Invoice::DataTypes.constants.each do |const_name|
20
+ it "create object for #{const_name}" do
21
+ klass = PayPal::SDK::Invoice::DataTypes.const_get(const_name)
22
+ klass.new.should be_a klass
23
+ end
24
+ end
25
+ end
26
+
27
+ end
@@ -1,6 +1,6 @@
1
- require 'bundler/setup'
2
-
3
- Bundler.require :default, :test
4
- PayPal::SDK::Core::Config.load('spec/config/paypal.yml', 'test')
5
-
6
- require 'paypal-sdk-invoice'
1
+ require 'bundler/setup'
2
+
3
+ Bundler.require :default, :test
4
+ PayPal::SDK::Core::Config.load('spec/config/paypal.yml', 'test')
5
+
6
+ require 'paypal-sdk-invoice'
metadata CHANGED
@@ -1,32 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-sdk-invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.1
5
- prerelease:
4
+ version: 1.96.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - PayPal
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-20 00:00:00.000000000 Z
11
+ date: 2013-03-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: paypal-sdk-core
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 0.1.2
19
+ version: 0.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 0.1.2
26
+ version: 0.2.0
30
27
  description: The PayPal Invoice SDK provides Ruby APIs to create and manage Invoices
31
28
  using the PayPal's Invoicing Service API.
32
29
  email:
@@ -48,35 +45,28 @@ files:
48
45
  - Rakefile
49
46
  - README.md
50
47
  - Gemfile
51
- homepage: https://www.x.com/
48
+ homepage: https://developer.paypal.com
52
49
  licenses: []
50
+ metadata: {}
53
51
  post_install_message:
54
52
  rdoc_options: []
55
53
  require_paths:
56
54
  - lib
57
55
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
56
  requirements:
60
57
  - - ! '>='
61
58
  - !ruby/object:Gem::Version
62
59
  version: '0'
63
- segments:
64
- - 0
65
- hash: 569728605
66
60
  required_rubygems_version: !ruby/object:Gem::Requirement
67
- none: false
68
61
  requirements:
69
62
  - - ! '>='
70
63
  - !ruby/object:Gem::Version
71
64
  version: '0'
72
- segments:
73
- - 0
74
- hash: 569728605
75
65
  requirements: []
76
66
  rubyforge_project:
77
- rubygems_version: 1.8.24
67
+ rubygems_version: 2.0.0
78
68
  signing_key:
79
- specification_version: 3
69
+ specification_version: 4
80
70
  summary: PayPal Invoice SDK
81
71
  test_files:
82
72
  - spec/invoice_spec.rb