paypal-sdk-invoice 1.106.0 → 1.117.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d054f84affa8f23f69af43c452ce8b937858541d
4
+ data.tar.gz: 9e2f1364e07b8493302d6f11aeaf25b9d3fe0883
5
+ SHA512:
6
+ metadata.gz: 5ef48a855da426f8640c0f9e62c833420622533144d98e3c35e955063de0c45f05dca20f0d3b2fe5a45e1aa52d5d098c52abe1de57683f534dc22e5c61538803
7
+ data.tar.gz: d28427c33084ee178e4e17f9b668ef7d910b00dff8dca0cbf26368f13f97ab5168b80c718d7e5f7b19b99edfb000d03a4ba69f8bed931a6ae90299c4bb913cb5
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,125 @@
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
+ ## 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.
data/Rakefile CHANGED
@@ -1,14 +1,14 @@
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 && 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,2 +1,2 @@
1
- require "paypal-sdk/invoice"
2
-
1
+ require "paypal-sdk/invoice"
2
+
@@ -1,16 +1,16 @@
1
- require 'paypal-sdk-core'
2
-
3
- module PayPal
4
- module SDK
5
- module Invoice
6
- autoload :VERSION, "paypal-sdk/invoice/version"
7
- autoload :Services, "paypal-sdk/invoice/services"
8
- autoload :DataTypes, "paypal-sdk/invoice/data_types"
9
- autoload :API, "paypal-sdk/invoice/api"
10
-
11
- def self.new(*args)
12
- API.new(*args)
13
- end
14
- end
15
- end
16
- end
1
+ require 'paypal-sdk-core'
2
+
3
+ module PayPal
4
+ module SDK
5
+ module Invoice
6
+ autoload :VERSION, "paypal-sdk/invoice/version"
7
+ autoload :Services, "paypal-sdk/invoice/services"
8
+ autoload :DataTypes, "paypal-sdk/invoice/data_types"
9
+ autoload :API, "paypal-sdk/invoice/api"
10
+
11
+ def self.new(*args)
12
+ API.new(*args)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -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
+
@@ -1,871 +1,988 @@
1
- # Stub objects for Invoice
2
- # Auto generated code
3
-
4
- require 'paypal-sdk-core'
5
-
6
- module PayPal::SDK
7
- module Invoice
8
- module DataTypes
9
-
10
- class DataType < Core::API::DataTypes::Base
11
- def self.load_members
12
- add_attribute :xmlns
13
- add_attribute :type, :namespace => :xsi
14
- end
15
- end
16
-
17
- module ResponseStatus
18
- Status = { :success => ["Success", "SuccessWithWarning"],
19
- :warning => ["Warning", "SuccessWithWarning", "FailureWithWarning"],
20
- :failure => ["Failure", "FailureWithWarning"] }
21
-
22
- def response_status
23
- self.responseEnvelope && self.responseEnvelope.ack
24
- end
25
-
26
- Status.keys.each do |status|
27
- define_method("#{status}?") do
28
- Status[status].include?(self.response_status)
29
- end
30
- end
31
- end
32
-
33
- class EnumType < Core::API::DataTypes::Enum
34
- end
35
-
36
- class BaseAddress < DataType
37
- def self.load_members
38
- object_of :line1, String, :required => true
39
- object_of :line2, String
40
- object_of :city, String, :required => true
41
- object_of :state, String
42
- object_of :postalCode, String
43
- object_of :countryCode, String, :required => true
44
- object_of :type, String
45
- end
46
- end
47
-
48
-
49
-
50
- # This type contains the detailed error information resulting from the service operation.
51
- class ErrorData < DataType
52
- def self.load_members
53
- object_of :errorId, Integer
54
- object_of :domain, String
55
- object_of :subdomain, String
56
- object_of :severity, ErrorSeverity
57
- object_of :category, ErrorCategory
58
- object_of :message, String
59
- object_of :exceptionId, String
60
- array_of :parameter, ErrorParameter
61
- end
62
- end
63
-
64
-
65
-
66
- class ErrorParameter < DataType
67
- def self.load_members
68
- add_attribute :name, :required => true
69
- object_of :value, String, :required => true
70
- end
71
- end
72
-
73
-
74
-
75
- # This specifies a fault, encapsulating error data, with specific error codes.
76
- class FaultMessage < DataType
77
- def self.load_members
78
- include ResponseStatus
79
- object_of :responseEnvelope, ResponseEnvelope, :required => true
80
- array_of :error, ErrorData
81
- end
82
- end
83
-
84
-
85
-
86
- # This specifies the list of parameters with every request to the service.
87
- class RequestEnvelope < DataType
88
- def self.load_members
89
- # This specifies the required detail level that is needed by a client application pertaining to a particular data component (e.g., Item, Transaction, etc.). The detail level is specified in the DetailLevelCodeType which has all the enumerated values of the detail level for each component.
90
- object_of :detailLevel, DetailLevelCode
91
- # This should be the standard RFC 3066 language identification tag, e.g., en_US.
92
- object_of :errorLanguage, String
93
- end
94
- end
95
-
96
-
97
-
98
- # This specifies a list of parameters with every response from a service.
99
- class ResponseEnvelope < DataType
100
- def self.load_members
101
- object_of :timestamp, DateTime, :required => true
102
- # Application level acknowledgment code.
103
- object_of :ack, AckCode, :required => true
104
- object_of :correlationId, String, :required => true
105
- object_of :build, String, :required => true
106
- end
107
- end
108
-
109
-
110
-
111
- # AckCodeType This code identifies the acknowledgment code types that could be used to communicate the status of processing a (request) message to an application. This code would be used as part of a response message that contains an application level acknowledgment element.
112
- class AckCode < EnumType
113
- self.options = { 'SUCCESS' => 'Success', 'FAILURE' => 'Failure', 'WARNING' => 'Warning', 'SUCCESSWITHWARNING' => 'SuccessWithWarning', 'FAILUREWITHWARNING' => 'FailureWithWarning' }
114
- end
115
-
116
-
117
-
118
- # DetailLevelCodeType
119
- class DetailLevelCode < EnumType
120
- self.options = { 'RETURNALL' => 'ReturnAll' }
121
- end
122
-
123
-
124
-
125
- class ErrorCategory < EnumType
126
- self.options = { 'SYSTEM' => 'System', 'APPLICATION' => 'Application', 'REQUEST' => 'Request' }
127
- end
128
-
129
-
130
-
131
- class ErrorSeverity < EnumType
132
- self.options = { 'ERROR' => 'Error', 'WARNING' => 'Warning' }
133
- end
134
-
135
-
136
-
137
- # Specifies the payment terms for this invoice.
138
- class PaymentTermsType < EnumType
139
- self.options = { 'NODUEDATE' => 'NoDueDate', 'DUEONRECEIPT' => 'DueOnReceipt', 'DUEONDATESPECIFIED' => 'DueOnDateSpecified', 'NET1' => 'Net10', 'NET2' => 'Net15', 'NET3' => 'Net30', 'NET4' => 'Net45' }
140
- end
141
-
142
-
143
-
144
- # Specifies the payment methods that can be used to mark an invoice as paid.
145
- class PaymentMethodsType < EnumType
146
- self.options = { 'BANKTRANSFER' => 'BankTransfer', 'CASH' => 'Cash', 'CHECK' => 'Check', 'CREDITCARD' => 'CreditCard', 'DEBITCARD' => 'DebitCard', 'OTHER' => 'Other', 'PAYPAL' => 'PayPal', 'WIRETRANSFER' => 'WireTransfer' }
147
- end
148
-
149
-
150
-
151
- # Specifies the invoice status.
152
- class StatusType < EnumType
153
- self.options = { 'DRAFT' => 'Draft', 'SENT' => 'Sent', 'PAID' => 'Paid', 'MARKEDASPAID' => 'MarkedAsPaid', 'CANCELED' => 'Canceled', 'REFUNDED' => 'Refunded', 'PARTIALLYREFUNDED' => 'PartiallyRefunded', 'MARKEDASREFUNDED' => 'MarkedAsRefunded' }
154
- end
155
-
156
-
157
-
158
- # Specifies the merchant or payer.
159
- class OriginType < EnumType
160
- self.options = { 'WEB' => 'Web', 'API' => 'API' }
161
- end
162
-
163
-
164
-
165
- # Specifies the merchant or payer.
166
- class ActorType < EnumType
167
- self.options = { 'MERCHANT' => 'Merchant', 'PAYER' => 'Payer' }
168
- end
169
-
170
-
171
-
172
- # Contact information for a company participating in the invoicing system.
173
- class BusinessInfoType < DataType
174
- def self.load_members
175
- # First name of the company contact.
176
- object_of :firstName, String
177
- # Last name of the company contact.
178
- object_of :lastName, String
179
- # Business name of the company.
180
- object_of :businessName, String
181
- # Phone number for contacting the company.
182
- object_of :phone, String
183
- # Fax number used by the company.
184
- object_of :fax, String
185
- # Website used by the company.
186
- object_of :website, String
187
- # Tax ID of the merchant.
188
- object_of :taxId, String
189
- # Custom value to be displayed in the contact information details.
190
- object_of :customValue, String
191
- # Street address of the company.
192
- object_of :address, BaseAddress
193
- end
194
- end
195
-
196
-
197
-
198
- # Item information about a service or product listed in the invoice.
199
- class InvoiceItemType < DataType
200
- def self.load_members
201
- # SKU or item name.
202
- object_of :name, String, :required => true
203
- # Description of the item.
204
- object_of :description, String
205
- # Date on which the product or service was provided.
206
- object_of :date, DateTime
207
- # Item count.
208
- object_of :quantity, Float, :required => true
209
- # Price of the item, in the currency specified by the invoice.
210
- object_of :unitPrice, Float, :required => true
211
- # Name of an applicable tax, if any.
212
- object_of :taxName, String
213
- # Rate of an applicable tax, if any.
214
- object_of :taxRate, Float
215
- end
216
- end
217
-
218
-
219
-
220
- # A list of invoice items.
221
- class InvoiceItemListType < DataType
222
- def self.load_members
223
- array_of :item, InvoiceItemType, :required => true
224
- end
225
- end
226
-
227
-
228
-
229
- # Invoice details about the merchant, payer, totals and terms.
230
- class InvoiceType < DataType
231
- def self.load_members
232
- # Merchant's email.
233
- object_of :merchantEmail, String, :required => true
234
- # Email to which the invoice will be sent.
235
- object_of :payerEmail, String, :required => true
236
- # Unique identifier for the invoice.
237
- object_of :number, String
238
- # Company contact information of the merchant company sending the invoice.
239
- object_of :merchantInfo, BusinessInfoType
240
- # List of items included in this invoice.
241
- object_of :itemList, InvoiceItemListType, :required => true
242
- # If True, indicates tax calculated after discount. Default is False.
243
- object_of :taxCalculatedAfterDiscount, Boolean
244
- # Currency used for all invoice item amounts and totals.
245
- object_of :currencyCode, String, :required => true
246
- # Date on which the invoice will be enabled.
247
- object_of :invoiceDate, DateTime
248
- # Date on which the invoice payment is due.
249
- object_of :dueDate, DateTime
250
- # Terms by which the invoice payment is due.
251
- object_of :paymentTerms, PaymentTermsType
252
- # A discount percent applied to the invoice, if any.
253
- object_of :discountPercent, Float
254
- # A discount amount applied to the invoice, if any. If DiscountPercent is provided, DiscountAmount is ignored.
255
- object_of :discountAmount, Float
256
- # If true, indicates tax included in item amount. If present, this setting will supersede the merchant’s default setting.
257
- object_of :taxInclusive, Boolean
258
- # General terms for the invoice.
259
- object_of :terms, String
260
- # Note to the payer company.
261
- object_of :note, String
262
- # Memo for book keeping that is private to the Merchant.
263
- object_of :merchantMemo, String
264
- # Details of the receipt. Applicable only when invoice is a receipt.
265
- object_of :receiptDetails, String
266
- # Billing information for the payer.
267
- object_of :billingInfo, BusinessInfoType
268
- # Shipping information for the payer.
269
- object_of :shippingInfo, BusinessInfoType
270
- # Cost of shipping.
271
- object_of :shippingAmount, Float
272
- # Name of the applicable tax on shipping cost, if any.
273
- object_of :shippingTaxName, String
274
- # Rate of the applicable tax on shipping cost, if any.
275
- object_of :shippingTaxRate, Float
276
- # The external image URL of the invoice's logo, if any
277
- object_of :logoUrl, String
278
- # BN code for tracking transactions with a particular partner.
279
- object_of :referrerCode, String
280
- # Label used to display custom amount value. If a value is entered for customAmountLabel, then customAmountValue cannot be empty.
281
- object_of :customAmountLabel, String
282
- # Value of custom amount. If a value is entered for customAmountValue, then customAmountLabel cannot be empty.
283
- object_of :customAmountValue, Float
284
- end
285
- end
286
-
287
-
288
-
289
- # Invoice details about the invoice status and state change dates.
290
- class InvoiceDetailsType < DataType
291
- def self.load_members
292
- # Status of the invoice.
293
- object_of :status, StatusType, :required => true
294
- # The total amount of the invoice (cost of items, shipping and tax, less any discount). This field is set by the invoicing system and will ignore any changes made by API callers.
295
- object_of :totalAmount, Float
296
- # Whether the invoice was created via the website or via an API call.
297
- object_of :origin, OriginType, :required => true
298
- # Date when the invoice was created.
299
- object_of :createdDate, DateTime, :required => true
300
- # Account that created the invoice.
301
- object_of :createdBy, String
302
- # If canceled, date when the invoice was canceled.
303
- object_of :canceledDate, DateTime
304
- # Actor who canceled the invoice.
305
- object_of :canceledByActor, ActorType
306
- # Account that canceled the invoice.
307
- object_of :canceledBy, String
308
- # Date when the invoice was last edited.
309
- object_of :lastUpdatedDate, DateTime
310
- # Account that last edited the invoice.
311
- object_of :lastUpdatedBy, String
312
- # Date when the invoice was first sent.
313
- object_of :firstSentDate, DateTime
314
- # Date when the invoice was last sent.
315
- object_of :lastSentDate, DateTime
316
- # Account that last sent the invoice.
317
- object_of :lastSentBy, String
318
- # If the invoice was paid, date when the invoice was paid.
319
- object_of :paidDate, DateTime
320
- end
321
- end
322
-
323
-
324
-
325
- # Details of the refund made against this invoice.
326
- class OtherPaymentRefundDetailsType < DataType
327
- def self.load_members
328
- # Optional note associated with the refund.
329
- object_of :note, String
330
- # Date when the invoice was marked as refunded. If the date is not specified, the current date and time is used as a default. In addition, the date must be after the payment date of the invoice.
331
- object_of :date, DateTime
332
- end
333
- end
334
-
335
-
336
-
337
- # Details of the paypal refund made against this invoice.
338
- class PayPalPaymentRefundDetailsType < DataType
339
- def self.load_members
340
- # Date when the invoice was marked as refunded by PayPal.
341
- object_of :date, DateTime
342
- end
343
- end
344
-
345
-
346
-
347
- # PayPal payment details about the invoice.
348
- class PayPalPaymentDetailsType < DataType
349
- def self.load_members
350
- # Transaction ID of the PayPal payment.
351
- object_of :transactionID, String, :required => true
352
- # Date when the invoice was paid.
353
- object_of :date, DateTime
354
- end
355
- end
356
-
357
-
358
-
359
- # Offline payment details about the invoice.
360
- class OtherPaymentDetailsType < DataType
361
- def self.load_members
362
- # Method used for the offline payment.
363
- object_of :method, PaymentMethodsType
364
- # Optional note associated with the payment.
365
- object_of :note, String
366
- # Date when the invoice was paid.
367
- object_of :date, DateTime
368
- end
369
- end
370
-
371
-
372
-
373
- # Payment details about the invoice.
374
- class PaymentDetailsType < DataType
375
- def self.load_members
376
- # True if the invoice was paid using PayPal.
377
- object_of :viaPayPal, Boolean, :required => true
378
- # PayPal payment details.
379
- object_of :paypalPayment, PayPalPaymentDetailsType
380
- # Other payment details.
381
- object_of :otherPayment, OtherPaymentDetailsType
382
- end
383
- end
384
-
385
-
386
-
387
- # Determines an inclusive date range.
388
- class DateRangeType < DataType
389
- def self.load_members
390
- # Start of the date range.
391
- object_of :startDate, DateTime
392
- # End of the date range.
393
- object_of :endDate, DateTime
394
- end
395
- end
396
-
397
-
398
-
399
- # Search parameters criteria.
400
- class SearchParametersType < DataType
401
- def self.load_members
402
- # Email search string.
403
- object_of :email, String
404
- # Recipient search string.
405
- object_of :recipientName, String
406
- # Company search string.
407
- object_of :businessName, String
408
- # Invoice number search string.
409
- object_of :invoiceNumber, String
410
- # Invoice status search.
411
- array_of :status, StatusType
412
- # Invoice amount search. Specifies the smallest amount to be returned.
413
- object_of :lowerAmount, Float
414
- # Invoice amount search. Specifies the largest amount to be returned.
415
- object_of :upperAmount, Float
416
- # Currency used for lower and upper amounts. Required when lowerAmount or upperAmount is specified.
417
- object_of :currencyCode, String
418
- # Invoice memo search string.
419
- object_of :memo, String
420
- # Whether the invoice was created via the website or via an API call.
421
- object_of :origin, OriginType
422
- # Invoice date range filter.
423
- object_of :invoiceDate, DateRangeType
424
- # Invoice due date range filter.
425
- object_of :dueDate, DateRangeType
426
- # Invoice payment date range filter.
427
- object_of :paymentDate, DateRangeType
428
- # Invoice creation date range filter.
429
- object_of :creationDate, DateRangeType
430
- end
431
- end
432
-
433
-
434
-
435
- # Summary of invoice information.
436
- class InvoiceSummaryType < DataType
437
- def self.load_members
438
- # The created invoice's ID.
439
- object_of :invoiceID, String, :required => true
440
- # Invoice creator's email.
441
- object_of :merchantEmail, String, :required => true
442
- # Email to which the invoice will be sent.
443
- object_of :payerEmail, String, :required => true
444
- # Unique identifier for the invoice.
445
- object_of :number, String, :required => true
446
- # Business name of the billing info.
447
- object_of :billingBusinessName, String
448
- # First name of the billing info.
449
- object_of :billingFirstName, String
450
- # Last name of the billing info.
451
- object_of :billingLastName, String
452
- # Business name of the shipping info.
453
- object_of :shippingBusinessName, String
454
- # First name of the shipping info.
455
- object_of :shippingFirstName, String
456
- # Last name of the shipping info.
457
- object_of :shippingLastName, String
458
- # Total amount of the invoice.
459
- object_of :totalAmount, Float, :required => true
460
- # Currency used for all invoice item amounts and totals.
461
- object_of :currencyCode, String, :required => true
462
- # Date on which the invoice will be enabled.
463
- object_of :invoiceDate, DateTime, :required => true
464
- # Date on which the invoice payment is due.
465
- object_of :dueDate, DateTime, :required => true
466
- # Status of the invoice.
467
- object_of :status, StatusType, :required => true
468
- # Whether the invoice was created via the website or via an API call.
469
- object_of :origin, OriginType, :required => true
470
- # BN code for tracking transactions with a particular partner.
471
- object_of :referrerCode, String
472
- end
473
- end
474
-
475
-
476
-
477
- # A list of invoice summaries.
478
- class InvoiceSummaryListType < DataType
479
- def self.load_members
480
- array_of :invoice, InvoiceSummaryType
481
- end
482
- end
483
-
484
-
485
-
486
- # The request object for CreateInvoice.
487
- class CreateInvoiceRequest < DataType
488
- def self.load_members
489
- object_of :requestEnvelope, RequestEnvelope, :required => true
490
- # Data to populate the newly created invoice.
491
- object_of :invoice, InvoiceType, :required => true
492
- end
493
- end
494
-
495
-
496
-
497
- # The response object for CreateInvoice.
498
- class CreateInvoiceResponse < DataType
499
- def self.load_members
500
- include ResponseStatus
501
- object_of :responseEnvelope, ResponseEnvelope, :required => true
502
- # The created invoice's ID.
503
- object_of :invoiceID, String, :required => true
504
- # The created invoice's number.
505
- object_of :invoiceNumber, String, :required => true
506
- # The URL which lead merchant to view the invoice details on web.
507
- object_of :invoiceURL, String, :required => true
508
- # The total amount of the invoice (cost of items, shipping and tax, less any discount).
509
- object_of :totalAmount, Integer, :required => true
510
- array_of :error, ErrorData
511
- end
512
- end
513
-
514
-
515
-
516
- # The request object for SendInvoice.
517
- class SendInvoiceRequest < DataType
518
- def self.load_members
519
- object_of :requestEnvelope, RequestEnvelope, :required => true
520
- # ID of the invoice to send.
521
- object_of :invoiceID, String, :required => true
522
- end
523
- end
524
-
525
-
526
-
527
- # The response object for SendInvoice.
528
- class SendInvoiceResponse < DataType
529
- def self.load_members
530
- include ResponseStatus
531
- object_of :responseEnvelope, ResponseEnvelope, :required => true
532
- # The sent invoice's ID.
533
- object_of :invoiceID, String, :required => true
534
- # The URL which lead merchant to view the invoice details on web.
535
- object_of :invoiceURL, String, :required => true
536
- array_of :error, ErrorData
537
- end
538
- end
539
-
540
-
541
-
542
- # The request object for RemindInvoice.
543
- class RemindInvoiceRequest < DataType
544
- def self.load_members
545
- object_of :requestEnvelope, RequestEnvelope, :required => true
546
- # ID of the invoice to remind.
547
- object_of :invoiceID, String, :required => true
548
- # Subject of the Reminder notification
549
- object_of :subject, String
550
- # Note to send payer within the reminder notification
551
- object_of :noteForPayer, String
552
- end
553
- end
554
-
555
-
556
-
557
- # The response object for RemindInvoice.
558
- class RemindInvoiceResponse < DataType
559
- def self.load_members
560
- include ResponseStatus
561
- object_of :responseEnvelope, ResponseEnvelope, :required => true
562
- # The sent invoice's ID.
563
- object_of :invoiceID, String, :required => true
564
- # The URL which lead merchant to view the invoice details on web.
565
- object_of :invoiceURL, String, :required => true
566
- array_of :error, ErrorData
567
- end
568
- end
569
-
570
-
571
-
572
- # The request object for CreateAndSendInvoice.
573
- class CreateAndSendInvoiceRequest < DataType
574
- def self.load_members
575
- object_of :requestEnvelope, RequestEnvelope, :required => true
576
- # Data to populate the newly created invoice.
577
- object_of :invoice, InvoiceType, :required => true
578
- end
579
- end
580
-
581
-
582
-
583
- # The response object for CreateAndSendInvoice.
584
- class CreateAndSendInvoiceResponse < DataType
585
- def self.load_members
586
- include ResponseStatus
587
- object_of :responseEnvelope, ResponseEnvelope, :required => true
588
- # The created invoice's ID.
589
- object_of :invoiceID, String, :required => true
590
- # The created invoice's number.
591
- object_of :invoiceNumber, String, :required => true
592
- # The URL which lead merchant to view the invoice details on web.
593
- object_of :invoiceURL, String, :required => true
594
- # The total amount of the invoice (cost of items, shipping and tax, less any discount).
595
- object_of :totalAmount, Integer, :required => true
596
- array_of :error, ErrorData
597
- end
598
- end
599
-
600
-
601
-
602
- # The request object for UpdateInvoice.
603
- class UpdateInvoiceRequest < DataType
604
- def self.load_members
605
- object_of :requestEnvelope, RequestEnvelope, :required => true
606
- # invoice's ID
607
- object_of :invoiceID, String, :required => true
608
- # Data to populate the newly created invoice.
609
- object_of :invoice, InvoiceType, :required => true
610
- end
611
- end
612
-
613
-
614
-
615
- # The response object for UpdateInvoice.
616
- class UpdateInvoiceResponse < DataType
617
- def self.load_members
618
- include ResponseStatus
619
- object_of :responseEnvelope, ResponseEnvelope, :required => true
620
- # The invoice's ID.
621
- object_of :invoiceID, String, :required => true
622
- # The updated invoice's number.
623
- object_of :invoiceNumber, String, :required => true
624
- # The URL which lead merchant to view the invoice details on web.
625
- object_of :invoiceURL, String, :required => true
626
- # The total amount of the invoice (cost of items, shipping and tax, less any discount).
627
- object_of :totalAmount, Integer, :required => true
628
- array_of :error, ErrorData
629
- end
630
- end
631
-
632
-
633
-
634
- # The request object for GetInvoiceDetails.
635
- class GetInvoiceDetailsRequest < DataType
636
- def self.load_members
637
- object_of :requestEnvelope, RequestEnvelope, :required => true
638
- # ID of the invoice to retrieve.
639
- object_of :invoiceID, String, :required => true
640
- end
641
- end
642
-
643
-
644
-
645
- # The response object for CreateInvoice.
646
- class GetInvoiceDetailsResponse < DataType
647
- def self.load_members
648
- include ResponseStatus
649
- object_of :responseEnvelope, ResponseEnvelope, :required => true
650
- # The requested invoice.
651
- object_of :invoice, InvoiceType, :required => true
652
- # The requested invoice details.
653
- object_of :invoiceDetails, InvoiceDetailsType, :required => true
654
- # The requested invoice payment details.
655
- object_of :paymentDetails, PaymentDetailsType
656
- # The requested invoice refund details.
657
- object_of :refundDetails, PaymentRefundDetailsType
658
- # The URL which lead merchant to view the invoice details on web.
659
- object_of :invoiceURL, String, :required => true
660
- array_of :error, ErrorData
661
- end
662
- end
663
-
664
-
665
-
666
- # The request object for CancelInvoice.
667
- class CancelInvoiceRequest < DataType
668
- def self.load_members
669
- object_of :requestEnvelope, RequestEnvelope, :required => true
670
- # invoice's ID
671
- object_of :invoiceID, String
672
- # Subject of the cancellation notification
673
- object_of :subject, String
674
- # Note to send payer within the cancellation notification
675
- object_of :noteForPayer, String
676
- # send a copy of cancellation notification to merchant
677
- object_of :sendCopyToMerchant, Boolean
678
- end
679
- end
680
-
681
-
682
-
683
- # The response object for CancelInvoice.
684
- class CancelInvoiceResponse < DataType
685
- def self.load_members
686
- include ResponseStatus
687
- object_of :responseEnvelope, ResponseEnvelope, :required => true
688
- # The canceled invoice's ID.
689
- object_of :invoiceID, String, :required => true
690
- # The canceled invoice's number.
691
- object_of :invoiceNumber, String, :required => true
692
- # The URL which lead merchant to view the invoice details on web.
693
- object_of :invoiceURL, String, :required => true
694
- array_of :error, ErrorData
695
- end
696
- end
697
-
698
-
699
-
700
- # The request object for SearchInvoices.
701
- class SearchInvoicesRequest < DataType
702
- def self.load_members
703
- object_of :requestEnvelope, RequestEnvelope, :required => true
704
- # Invoice creator's email.
705
- object_of :merchantEmail, String, :required => true
706
- # Parameters constraining the search.
707
- object_of :parameters, SearchParametersType, :required => true
708
- # Page number of result set, starting with 1.
709
- object_of :page, Integer, :required => true
710
- # Number of results per page, between 1 and 100.
711
- object_of :pageSize, Integer, :required => true
712
- end
713
- end
714
-
715
-
716
-
717
- # The response object for SearchInvoices.
718
- class SearchInvoicesResponse < DataType
719
- def self.load_members
720
- include ResponseStatus
721
- object_of :responseEnvelope, ResponseEnvelope, :required => true
722
- # Number of invoices that matched the search.
723
- object_of :count, Integer, :required => true
724
- # Page of invoice summaries that matched the search.
725
- object_of :invoiceList, InvoiceSummaryListType
726
- # Page number of result set.
727
- object_of :page, Integer, :required => true
728
- # True if another page of invoice summary results exists.
729
- object_of :hasNextPage, Boolean, :required => true
730
- # True if a previous page of invoice summary results exists.
731
- object_of :hasPreviousPage, Boolean, :required => true
732
- array_of :error, ErrorData
733
- end
734
- end
735
-
736
-
737
-
738
- # The request object for MarkInvoiceAsPaid.
739
- class MarkInvoiceAsPaidRequest < DataType
740
- def self.load_members
741
- object_of :requestEnvelope, RequestEnvelope, :required => true
742
- # ID of the invoice to mark as paid.
743
- object_of :invoiceID, String, :required => true
744
- # Details of the payment made against this invoice.
745
- object_of :payment, OtherPaymentDetailsType, :required => true
746
- end
747
- end
748
-
749
-
750
-
751
- # The response object for MarkInvoiceAsPaid.
752
- class MarkInvoiceAsPaidResponse < DataType
753
- def self.load_members
754
- include ResponseStatus
755
- object_of :responseEnvelope, ResponseEnvelope, :required => true
756
- # The paid invoice ID.
757
- object_of :invoiceID, String, :required => true
758
- # The paid invoice number.
759
- object_of :invoiceNumber, String, :required => true
760
- # The URL which lead merchant to view the invoice details on web.
761
- object_of :invoiceURL, String, :required => true
762
- array_of :error, ErrorData
763
- end
764
- end
765
-
766
-
767
-
768
- # The request object for MarkInvoiceAsRefunded.
769
- class MarkInvoiceAsRefundedRequest < DataType
770
- def self.load_members
771
- object_of :requestEnvelope, RequestEnvelope, :required => true
772
- # ID of the invoice to mark as refunded.
773
- object_of :invoiceID, String, :required => true
774
- # Details of the refund made against this invoice.
775
- object_of :refundDetail, OtherPaymentRefundDetailsType, :required => true
776
- end
777
- end
778
-
779
-
780
-
781
- # The response object for MarkInvoiceAsRefunded.
782
- class MarkInvoiceAsRefundedResponse < DataType
783
- def self.load_members
784
- include ResponseStatus
785
- object_of :responseEnvelope, ResponseEnvelope, :required => true
786
- # The invoice ID of the invoice that was marked as refunded.
787
- object_of :invoiceID, String, :required => true
788
- # The invoice number of the invoice that was marked as refunded.
789
- object_of :invoiceNumber, String, :required => true
790
- # The URL of the details page of the invoice that was marked as refunded.
791
- object_of :invoiceURL, String, :required => true
792
- array_of :error, ErrorData
793
- end
794
- end
795
-
796
-
797
-
798
- # The request object for MarkInvoiceAsUnpaid.
799
- class MarkInvoiceAsUnpaidRequest < DataType
800
- def self.load_members
801
- object_of :requestEnvelope, RequestEnvelope, :required => true
802
- # ID of the invoice to mark as unpaid.
803
- object_of :invoiceID, String, :required => true
804
- end
805
- end
806
-
807
-
808
-
809
- # The response object for MarkInvoiceAsUnpaid.
810
- class MarkInvoiceAsUnpaidResponse < DataType
811
- def self.load_members
812
- include ResponseStatus
813
- object_of :responseEnvelope, ResponseEnvelope, :required => true
814
- # The invoice ID of the invoice that was marked as unpaid.
815
- object_of :invoiceID, String, :required => true
816
- # The invoice number of the invoice that was marked as unpaid.
817
- object_of :invoiceNumber, String, :required => true
818
- # The URL of the details page of the invoice that was marked as unpaid.
819
- object_of :invoiceURL, String, :required => true
820
- array_of :error, ErrorData
821
- end
822
- end
823
-
824
-
825
-
826
- # Payment refund details about the invoice.
827
- class PaymentRefundDetailsType < DataType
828
- def self.load_members
829
- # True if the invoice was refunded using PayPal.
830
- object_of :viaPayPal, Boolean, :required => true
831
- # Other payment refund details.
832
- object_of :paypalPayment, PayPalPaymentRefundDetailsType
833
- # details.
834
- object_of :otherPayment, OtherPaymentRefundDetailsType
835
- end
836
- end
837
-
838
-
839
-
840
- # The request object for DeleteInvoice.
841
- class DeleteInvoiceRequest < DataType
842
- def self.load_members
843
- object_of :requestEnvelope, RequestEnvelope, :required => true
844
- # ID of the invoice to be deleted.
845
- object_of :invoiceID, String, :required => true
846
- end
847
- end
848
-
849
-
850
-
851
- # The response object for DeleteInvoice.
852
- class DeleteInvoiceResponse < DataType
853
- def self.load_members
854
- include ResponseStatus
855
- object_of :responseEnvelope, ResponseEnvelope, :required => true
856
- array_of :error, ErrorData
857
- end
858
- end
859
-
860
-
861
-
862
-
863
-
864
- constants.each do |data_type_klass|
865
- data_type_klass = const_get(data_type_klass)
866
- data_type_klass.load_members if defined? data_type_klass.load_members
867
- end
868
-
869
- end
870
- end
871
- end
1
+ # Stub objects for Invoice
2
+ # Auto generated code
3
+
4
+ require 'paypal-sdk-core'
5
+
6
+ module PayPal::SDK
7
+ module Invoice
8
+ module DataTypes
9
+
10
+ class DataType < Core::API::DataTypes::Base
11
+ def self.load_members
12
+ add_attribute :xmlns
13
+ add_attribute :type, :namespace => :xsi
14
+ end
15
+ end
16
+
17
+ module ResponseStatus
18
+ Status = { :success => ["Success", "SuccessWithWarning"],
19
+ :warning => ["Warning", "SuccessWithWarning", "FailureWithWarning"],
20
+ :failure => ["Failure", "FailureWithWarning"] }
21
+
22
+ def response_status
23
+ self.responseEnvelope && self.responseEnvelope.ack
24
+ end
25
+
26
+ Status.keys.each do |status|
27
+ define_method("#{status}?") do
28
+ Status[status].include?(self.response_status)
29
+ end
30
+ end
31
+ end
32
+
33
+ class EnumType < Core::API::DataTypes::Enum
34
+ end
35
+
36
+ class BaseAddress < DataType
37
+ def self.load_members
38
+ object_of :line1, String, :required => true
39
+ object_of :line2, String
40
+ object_of :city, String, :required => true
41
+ object_of :state, String
42
+ object_of :postalCode, String
43
+ object_of :countryCode, String, :required => true
44
+ object_of :type, String
45
+ end
46
+ end
47
+
48
+
49
+
50
+ # This type contains the detailed error information resulting from the service operation.
51
+ class ErrorData < DataType
52
+ def self.load_members
53
+ object_of :errorId, Integer
54
+ object_of :domain, String
55
+ object_of :subdomain, String
56
+ object_of :severity, ErrorSeverity
57
+ object_of :category, ErrorCategory
58
+ object_of :message, String
59
+ object_of :exceptionId, String
60
+ array_of :parameter, ErrorParameter
61
+ end
62
+ end
63
+
64
+
65
+
66
+ class ErrorParameter < DataType
67
+ def self.load_members
68
+ add_attribute :name, :required => true
69
+ object_of :value, String, :required => true
70
+ end
71
+ end
72
+
73
+
74
+
75
+ # This specifies a fault, encapsulating error data, with specific error codes.
76
+ class FaultMessage < DataType
77
+ def self.load_members
78
+ include ResponseStatus
79
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
80
+ array_of :error, ErrorData
81
+ end
82
+ end
83
+
84
+
85
+
86
+ # This specifies the list of parameters with every request to the service.
87
+ class RequestEnvelope < DataType
88
+ def self.load_members
89
+ # This specifies the required detail level that is needed by a client application pertaining to a particular data component (e.g., Item, Transaction, etc.). The detail level is specified in the DetailLevelCodeType which has all the enumerated values of the detail level for each component.
90
+ object_of :detailLevel, DetailLevelCode
91
+ # This should be the standard RFC 3066 language identification tag, e.g., en_US.
92
+ object_of :errorLanguage, String
93
+ end
94
+ end
95
+
96
+
97
+
98
+ # This specifies a list of parameters with every response from a service.
99
+ class ResponseEnvelope < DataType
100
+ def self.load_members
101
+ object_of :timestamp, DateTime, :required => true
102
+ # Application level acknowledgment code.
103
+ object_of :ack, AckCode, :required => true
104
+ object_of :correlationId, String, :required => true
105
+ object_of :build, String, :required => true
106
+ end
107
+ end
108
+
109
+
110
+
111
+ # AckCodeType This code identifies the acknowledgment code types that could be used to communicate the status of processing a (request) message to an application. This code would be used as part of a response message that contains an application level acknowledgment element.
112
+ class AckCode < EnumType
113
+ self.options = { 'SUCCESS' => 'Success', 'FAILURE' => 'Failure', 'WARNING' => 'Warning', 'SUCCESSWITHWARNING' => 'SuccessWithWarning', 'FAILUREWITHWARNING' => 'FailureWithWarning' }
114
+ end
115
+
116
+
117
+
118
+ # DetailLevelCodeType
119
+ class DetailLevelCode < EnumType
120
+ self.options = { 'RETURNALL' => 'ReturnAll' }
121
+ end
122
+
123
+
124
+
125
+ class ErrorCategory < EnumType
126
+ self.options = { 'SYSTEM' => 'System', 'APPLICATION' => 'Application', 'REQUEST' => 'Request' }
127
+ end
128
+
129
+
130
+
131
+ class ErrorSeverity < EnumType
132
+ self.options = { 'ERROR' => 'Error', 'WARNING' => 'Warning' }
133
+ end
134
+
135
+
136
+
137
+ # Specifies the payment terms for this invoice.
138
+ class PaymentTermsType < EnumType
139
+ self.options = { 'NODUEDATE' => 'NoDueDate', 'DUEONRECEIPT' => 'DueOnReceipt', 'DUEONDATESPECIFIED' => 'DueOnDateSpecified', 'NET1' => 'Net10', 'NET2' => 'Net15', 'NET3' => 'Net30', 'NET4' => 'Net45' }
140
+ end
141
+
142
+
143
+
144
+ # Specifies the payment methods that can be used to mark an invoice as paid.
145
+ class PaymentMethodsType < EnumType
146
+ self.options = { 'BANKTRANSFER' => 'BankTransfer', 'CASH' => 'Cash', 'CHECK' => 'Check', 'CREDITCARD' => 'CreditCard', 'DEBITCARD' => 'DebitCard', 'OTHER' => 'Other', 'PAYPAL' => 'PayPal', 'WIRETRANSFER' => 'WireTransfer' }
147
+ end
148
+
149
+
150
+
151
+ # Specifies the payment transaction type.
152
+ class PaymentTransactionType < EnumType
153
+ self.options = { 'AUTHORIZATION' => 'Authorization', 'CAPTURE' => 'Capture', 'SALE' => 'Sale' }
154
+ end
155
+
156
+
157
+
158
+ # Specifies the invoice status.
159
+ class StatusType < EnumType
160
+ self.options = { 'DRAFT' => 'Draft', 'SENT' => 'Sent', 'PAID' => 'Paid', 'MARKEDASPAID' => 'MarkedAsPaid', 'CANCELED' => 'Canceled', 'REFUNDED' => 'Refunded', 'PARTIALLYREFUNDED' => 'PartiallyRefunded', 'MARKEDASREFUNDED' => 'MarkedAsRefunded', 'PAYMENTPENDING' => 'PaymentPending', 'PARTIALLYPAID' => 'PartiallyPaid' }
161
+ end
162
+
163
+
164
+
165
+ # Specifies the merchant or payer.
166
+ class OriginType < EnumType
167
+ self.options = { 'WEB' => 'Web', 'API' => 'API' }
168
+ end
169
+
170
+
171
+
172
+ # Specifies the merchant or payer.
173
+ class ActorType < EnumType
174
+ self.options = { 'MERCHANT' => 'Merchant', 'PAYER' => 'Payer' }
175
+ end
176
+
177
+
178
+
179
+ # Contact information for a company participating in the invoicing system.
180
+ class BusinessInfoType < DataType
181
+ def self.load_members
182
+ # First name of the company contact.
183
+ object_of :firstName, String
184
+ # Last name of the company contact.
185
+ object_of :lastName, String
186
+ # Business name of the company.
187
+ object_of :businessName, String
188
+ # Phone number for contacting the company.
189
+ object_of :phone, String
190
+ # Fax number used by the company.
191
+ object_of :fax, String
192
+ # Website used by the company.
193
+ object_of :website, String
194
+ # Language of the participant.
195
+ object_of :language, String
196
+ # Tax ID of the merchant.
197
+ object_of :taxId, String
198
+ # Custom value to be displayed in the contact information details.
199
+ object_of :customValue, String
200
+ # Street address of the company.
201
+ object_of :address, BaseAddress
202
+ end
203
+ end
204
+
205
+
206
+
207
+ # Item information about a service or product listed in the invoice.
208
+ class InvoiceItemType < DataType
209
+ def self.load_members
210
+ # SKU or item name.
211
+ object_of :name, String, :required => true
212
+ # Description of the item.
213
+ object_of :description, String
214
+ # Date on which the product or service was provided.
215
+ object_of :date, DateTime
216
+ # Item count.
217
+ object_of :quantity, Float, :required => true
218
+ # Price of the item, in the currency specified by the invoice.
219
+ object_of :unitPrice, Float, :required => true
220
+ # A discount percent applied to the item, if any.
221
+ object_of :discountPercent, Float
222
+ # A discount amount applied to the item, if any. If DiscountPercent is provided, DiscountAmount is ignored.
223
+ object_of :discountAmount, Float
224
+ # Name of an applicable tax, if any.
225
+ object_of :taxName, String
226
+ # Rate of an applicable tax, if any.
227
+ object_of :taxRate, Float
228
+ # The tax amount on the item, either included or on top of it.
229
+ object_of :taxAmount, Float
230
+ # Image URL of the item, if any.
231
+ object_of :imageUrl, String
232
+ end
233
+ end
234
+
235
+
236
+
237
+ # A list of invoice items.
238
+ class InvoiceItemListType < DataType
239
+ def self.load_members
240
+ array_of :item, InvoiceItemType, :required => true
241
+ end
242
+ end
243
+
244
+
245
+
246
+ # Invoice details about the merchant, payer, totals and terms.
247
+ class InvoiceType < DataType
248
+ def self.load_members
249
+ # Merchant's email.
250
+ object_of :merchantEmail, String, :required => true
251
+ # Email to which the invoice will be sent.
252
+ object_of :payerEmail, String, :required => true
253
+ # Unique identifier for the invoice.
254
+ object_of :number, String
255
+ # Company contact information of the merchant company sending the invoice.
256
+ object_of :merchantInfo, BusinessInfoType
257
+ # List of items included in this invoice.
258
+ object_of :itemList, InvoiceItemListType, :required => true
259
+ # If True, indicates tax calculated after discount. Default is False.
260
+ object_of :taxCalculatedAfterDiscount, Boolean
261
+ # Currency used for all invoice item amounts and totals.
262
+ object_of :currencyCode, String, :required => true
263
+ # Date on which the invoice will be enabled.
264
+ object_of :invoiceDate, DateTime
265
+ # Date on which the invoice payment is due.
266
+ object_of :dueDate, DateTime
267
+ # Terms by which the invoice payment is due.
268
+ object_of :paymentTerms, PaymentTermsType
269
+ # A discount percent applied to the invoice, if any.
270
+ object_of :discountPercent, Float
271
+ # A Invoice level discount amount applied on the invoice, if any. If DiscountPercent is provided, DiscountAmount is ignored.
272
+ object_of :discountAmount, Float
273
+ # Total Items Discount applied to the invoice, if any.
274
+ object_of :totalItemDiscountAmount, Float
275
+ # If true, indicates tax included in item amount. If present, this setting will supersede the merchant’s default setting.
276
+ object_of :taxInclusive, Boolean
277
+ # General terms for the invoice.
278
+ object_of :terms, String
279
+ # Note to the payer company.
280
+ object_of :note, String
281
+ # Memo for book keeping that is private to the Merchant.
282
+ object_of :merchantMemo, String
283
+ # Details of the receipt. Applicable only when invoice is a receipt.
284
+ object_of :receiptDetails, String
285
+ # Billing information for the payer.
286
+ object_of :billingInfo, BusinessInfoType
287
+ # Shipping information for the payer.
288
+ object_of :shippingInfo, BusinessInfoType
289
+ # Cost of shipping.
290
+ object_of :shippingAmount, Float
291
+ # Name of the applicable tax on shipping cost, if any.
292
+ object_of :shippingTaxName, String
293
+ # Rate of the applicable tax on shipping cost, if any.
294
+ object_of :shippingTaxRate, Float
295
+ # The tax on shipping amount, either included or on top of it.
296
+ object_of :shippingTaxAmount, Float
297
+ # The external image URL of the invoice's logo, if any
298
+ object_of :logoUrl, String
299
+ # BN code for tracking transactions with a particular partner.
300
+ object_of :referrerCode, String
301
+ # Label used to display custom amount value. If a value is entered for customAmountLabel, then customAmountValue cannot be empty.
302
+ object_of :customAmountLabel, String
303
+ # Value of custom amount. If a value is entered for customAmountValue, then customAmountLabel cannot be empty.
304
+ object_of :customAmountValue, Float
305
+ # False, if the payment cannot be paid using both external and PayPal payment. True, if the payment can be paid using both external and PayPal payment.
306
+ object_of :allowPartialPayments, Boolean
307
+ end
308
+ end
309
+
310
+
311
+
312
+ # Invoice details about the invoice status and state change dates.
313
+ class InvoiceDetailsType < DataType
314
+ def self.load_members
315
+ # Status of the invoice.
316
+ object_of :status, StatusType, :required => true
317
+ # The total discount amount on the invoice. This field is set by the invoicing system and will ignore any changes made by API callers.
318
+ object_of :totalDiscountAmount, Float
319
+ # The total amount of the invoice (cost of items, shipping and tax, less any discount). This field is set by the invoicing system and will ignore any changes made by API callers.
320
+ object_of :totalAmount, Float
321
+ # Whether the invoice was created via the website or via an API call.
322
+ object_of :origin, OriginType, :required => true
323
+ # Date when the invoice was created.
324
+ object_of :createdDate, DateTime, :required => true
325
+ # Account that created the invoice.
326
+ object_of :createdBy, String
327
+ # If canceled, date when the invoice was canceled.
328
+ object_of :canceledDate, DateTime
329
+ # Actor who canceled the invoice.
330
+ object_of :canceledByActor, ActorType
331
+ # Account that canceled the invoice.
332
+ object_of :canceledBy, String
333
+ # Date when the invoice was last edited.
334
+ object_of :lastUpdatedDate, DateTime
335
+ # Account that last edited the invoice.
336
+ object_of :lastUpdatedBy, String
337
+ # Date when the invoice was first sent.
338
+ object_of :firstSentDate, DateTime
339
+ # Date when the invoice was last sent.
340
+ object_of :lastSentDate, DateTime
341
+ # Account that last sent the invoice.
342
+ object_of :lastSentBy, String
343
+ # If the invoice was paid, date when the invoice was paid.
344
+ object_of :paidDate, DateTime
345
+ # The adjustment amount of the invoice (total invoice amount less all payments). This field is set by the invoicing system and will ignore any changes made by API callers.
346
+ object_of :adjustmentAmount, Float
347
+ end
348
+ end
349
+
350
+
351
+
352
+ # A list of paypal paymentss.
353
+ class PayPalPaymentDetailsListType < DataType
354
+ def self.load_members
355
+ array_of :payment, PayPalPaymentDetailsType, :required => true
356
+ end
357
+ end
358
+
359
+
360
+
361
+ # Details of the refund made against this invoice.
362
+ class OtherPaymentRefundDetailsType < DataType
363
+ def self.load_members
364
+ # Optional note associated with the refund.
365
+ object_of :note, String
366
+ # Date when the invoice was marked as refunded. If the date is not specified, the current date and time is used as a default. In addition, the date must be after the payment date of the invoice.
367
+ object_of :date, DateTime
368
+ # Refunded amount. If empty then it is assumed to be a full refund.
369
+ object_of :amount, Float
370
+ end
371
+ end
372
+
373
+
374
+
375
+ # A list of other paymentss.
376
+ class OtherPaymentRefundDetailsListType < DataType
377
+ def self.load_members
378
+ array_of :payment, OtherPaymentRefundDetailsType, :required => true
379
+ end
380
+ end
381
+
382
+
383
+
384
+ # Details of the paypal refund made against this invoice.
385
+ class PayPalPaymentRefundDetailsType < DataType
386
+ def self.load_members
387
+ # Transaction ID of the PayPal refund.
388
+ object_of :transactionID, String, :required => true
389
+ # Date when the invoice was marked as refunded by PayPal.
390
+ object_of :date, DateTime
391
+ # Refund amount, if empty, it means a full refund.
392
+ object_of :amount, Float
393
+ end
394
+ end
395
+
396
+
397
+
398
+ # A list of other paymentss.
399
+ class PayPalPaymentRefundDetailsListType < DataType
400
+ def self.load_members
401
+ array_of :payment, PayPalPaymentRefundDetailsType, :required => true
402
+ end
403
+ end
404
+
405
+
406
+
407
+ # PayPal payment details about the invoice.
408
+ class PayPalPaymentDetailsType < DataType
409
+ def self.load_members
410
+ # Transaction ID of the PayPal payment.
411
+ object_of :transactionID, String, :required => true
412
+ # Date when the invoice was paid.
413
+ object_of :date, DateTime
414
+ # Payment amount. If empty, it means a full payment.
415
+ object_of :amount, Float
416
+ # Payment Transaction Type.
417
+ object_of :transactionType, PaymentTransactionType, :required => true
418
+ end
419
+ end
420
+
421
+
422
+
423
+ # Offline payment details about the invoice.
424
+ class OtherPaymentDetailsType < DataType
425
+ def self.load_members
426
+ # Method used for the offline payment.
427
+ object_of :method, PaymentMethodsType
428
+ # Optional note associated with the payment.
429
+ object_of :note, String
430
+ # Date when the invoice was paid.
431
+ object_of :date, DateTime
432
+ # Payment amount. If empty, it means a full payment.
433
+ object_of :amount, Float
434
+ end
435
+ end
436
+
437
+
438
+
439
+ # A list of other paymentss.
440
+ class OtherPaymentDetailsListType < DataType
441
+ def self.load_members
442
+ array_of :payment, OtherPaymentDetailsType, :required => true
443
+ end
444
+ end
445
+
446
+
447
+
448
+ # Payment details about the invoice.
449
+ class PaymentDetailsType < DataType
450
+ def self.load_members
451
+ # True if the invoice was paid using PayPal.
452
+ object_of :viaPayPal, Boolean, :required => true
453
+ # PayPal payment details.
454
+ object_of :paypalPayment, PayPalPaymentDetailsType
455
+ # List of paypal payments.
456
+ object_of :paypalPayments, PayPalPaymentDetailsListType
457
+ # Other payment details.
458
+ object_of :otherPayment, OtherPaymentDetailsType
459
+ # Other payment details.
460
+ object_of :otherPayments, OtherPaymentDetailsListType
461
+ end
462
+ end
463
+
464
+
465
+
466
+ # Determines an inclusive date range.
467
+ class DateRangeType < DataType
468
+ def self.load_members
469
+ # Start of the date range.
470
+ object_of :startDate, DateTime
471
+ # End of the date range.
472
+ object_of :endDate, DateTime
473
+ end
474
+ end
475
+
476
+
477
+
478
+ # Search parameters criteria.
479
+ class SearchParametersType < DataType
480
+ def self.load_members
481
+ # Email search string.
482
+ object_of :email, String
483
+ # Recipient search string.
484
+ object_of :recipientName, String
485
+ # Company search string.
486
+ object_of :businessName, String
487
+ # Invoice number search string.
488
+ object_of :invoiceNumber, String
489
+ # Invoice status search.
490
+ array_of :status, StatusType
491
+ # Invoice amount search. Specifies the smallest amount to be returned.
492
+ object_of :lowerAmount, Float
493
+ # Invoice amount search. Specifies the largest amount to be returned.
494
+ object_of :upperAmount, Float
495
+ # Currency used for lower and upper amounts. Required when lowerAmount or upperAmount is specified.
496
+ object_of :currencyCode, String
497
+ # Invoice memo search string.
498
+ object_of :memo, String
499
+ # Whether the invoice was created via the website or via an API call.
500
+ object_of :origin, OriginType
501
+ # Invoice date range filter.
502
+ object_of :invoiceDate, DateRangeType
503
+ # Invoice due date range filter.
504
+ object_of :dueDate, DateRangeType
505
+ # Invoice payment date range filter.
506
+ object_of :paymentDate, DateRangeType
507
+ # Invoice creation date range filter.
508
+ object_of :creationDate, DateRangeType
509
+ end
510
+ end
511
+
512
+
513
+
514
+ # Summary of invoice information.
515
+ class InvoiceSummaryType < DataType
516
+ def self.load_members
517
+ # The created invoice's ID.
518
+ object_of :invoiceID, String, :required => true
519
+ # Invoice creator's email.
520
+ object_of :merchantEmail, String, :required => true
521
+ # Email to which the invoice will be sent.
522
+ object_of :payerEmail, String, :required => true
523
+ # Unique identifier for the invoice.
524
+ object_of :number, String, :required => true
525
+ # Business name of the billing info.
526
+ object_of :billingBusinessName, String
527
+ # First name of the billing info.
528
+ object_of :billingFirstName, String
529
+ # Last name of the billing info.
530
+ object_of :billingLastName, String
531
+ # Business name of the shipping info.
532
+ object_of :shippingBusinessName, String
533
+ # First name of the shipping info.
534
+ object_of :shippingFirstName, String
535
+ # Last name of the shipping info.
536
+ object_of :shippingLastName, String
537
+ # Total amount of the invoice.
538
+ object_of :totalAmount, Float, :required => true
539
+ # Currency used for all invoice item amounts and totals.
540
+ object_of :currencyCode, String, :required => true
541
+ # Date on which the invoice will be enabled.
542
+ object_of :invoiceDate, DateTime, :required => true
543
+ # Date on which the invoice payment is due.
544
+ object_of :dueDate, DateTime, :required => true
545
+ # Status of the invoice.
546
+ object_of :status, StatusType, :required => true
547
+ # Whether the invoice was created via the website or via an API call.
548
+ object_of :origin, OriginType, :required => true
549
+ # BN code for tracking transactions with a particular partner.
550
+ object_of :referrerCode, String
551
+ end
552
+ end
553
+
554
+
555
+
556
+ # A list of invoice summaries.
557
+ class InvoiceSummaryListType < DataType
558
+ def self.load_members
559
+ array_of :invoice, InvoiceSummaryType
560
+ end
561
+ end
562
+
563
+
564
+
565
+ # The request object for CreateInvoice.
566
+ class CreateInvoiceRequest < DataType
567
+ def self.load_members
568
+ object_of :requestEnvelope, RequestEnvelope, :required => true
569
+ # Data to populate the newly created invoice.
570
+ object_of :invoice, InvoiceType, :required => true
571
+ end
572
+ end
573
+
574
+
575
+
576
+ # The response object for CreateInvoice.
577
+ class CreateInvoiceResponse < DataType
578
+ def self.load_members
579
+ include ResponseStatus
580
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
581
+ # The created invoice's ID.
582
+ object_of :invoiceID, String, :required => true
583
+ # The created invoice's number.
584
+ object_of :invoiceNumber, String, :required => true
585
+ # The URL which lead merchant to view the invoice details on web.
586
+ object_of :invoiceURL, String, :required => true
587
+ # The URL which lead merchant to view the invoice as the payer would see it.
588
+ object_of :payerViewURL, String, :required => true
589
+ # The total amount of the invoice (cost of items, shipping and tax, less any discount).
590
+ object_of :totalAmount, Integer, :required => true
591
+ array_of :error, ErrorData
592
+ end
593
+ end
594
+
595
+
596
+
597
+ # The request object for SendInvoice.
598
+ class SendInvoiceRequest < DataType
599
+ def self.load_members
600
+ object_of :requestEnvelope, RequestEnvelope, :required => true
601
+ # ID of the invoice to send.
602
+ object_of :invoiceID, String, :required => true
603
+ end
604
+ end
605
+
606
+
607
+
608
+ # The response object for SendInvoice.
609
+ class SendInvoiceResponse < DataType
610
+ def self.load_members
611
+ include ResponseStatus
612
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
613
+ # The sent invoice's ID.
614
+ object_of :invoiceID, String, :required => true
615
+ # The URL which lead merchant to view the invoice details on web.
616
+ object_of :invoiceURL, String, :required => true
617
+ # The URL which lead merchant to view the invoice as the payer would see it.
618
+ object_of :payerViewURL, String, :required => true
619
+ array_of :error, ErrorData
620
+ end
621
+ end
622
+
623
+
624
+
625
+ # The request object for RemindInvoice.
626
+ class RemindInvoiceRequest < DataType
627
+ def self.load_members
628
+ object_of :requestEnvelope, RequestEnvelope, :required => true
629
+ # ID of the invoice to remind.
630
+ object_of :invoiceID, String, :required => true
631
+ # Subject of the Reminder notification
632
+ object_of :subject, String
633
+ # Note to send payer within the reminder notification
634
+ object_of :noteForPayer, String
635
+ end
636
+ end
637
+
638
+
639
+
640
+ # The response object for RemindInvoice.
641
+ class RemindInvoiceResponse < DataType
642
+ def self.load_members
643
+ include ResponseStatus
644
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
645
+ # The sent invoice's ID.
646
+ object_of :invoiceID, String, :required => true
647
+ # The URL which lead merchant to view the invoice details on web.
648
+ object_of :invoiceURL, String, :required => true
649
+ array_of :error, ErrorData
650
+ end
651
+ end
652
+
653
+
654
+
655
+ # The request object for GenerateInvoiceNumber.
656
+ class GenerateInvoiceNumberRequest < DataType
657
+ def self.load_members
658
+ object_of :requestEnvelope, RequestEnvelope, :required => true
659
+ end
660
+ end
661
+
662
+
663
+
664
+ # The response object for GenerateInvoiceNumber.
665
+ class GenerateInvoiceNumberResponse < DataType
666
+ def self.load_members
667
+ include ResponseStatus
668
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
669
+ # Next Invoice NUmber for the Merchant.
670
+ object_of :invoiceNumber, String, :required => true
671
+ array_of :error, ErrorData
672
+ end
673
+ end
674
+
675
+
676
+
677
+ # The request object for CreateAndSendInvoice.
678
+ class CreateAndSendInvoiceRequest < DataType
679
+ def self.load_members
680
+ object_of :requestEnvelope, RequestEnvelope, :required => true
681
+ # Data to populate the newly created invoice.
682
+ object_of :invoice, InvoiceType, :required => true
683
+ end
684
+ end
685
+
686
+
687
+
688
+ # The response object for CreateAndSendInvoice.
689
+ class CreateAndSendInvoiceResponse < DataType
690
+ def self.load_members
691
+ include ResponseStatus
692
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
693
+ # The created invoice's ID.
694
+ object_of :invoiceID, String, :required => true
695
+ # The created invoice's number.
696
+ object_of :invoiceNumber, String, :required => true
697
+ # The URL which lead merchant to view the invoice details on web.
698
+ object_of :invoiceURL, String, :required => true
699
+ # The URL which lead merchant to view the invoice as the payer would see it.
700
+ object_of :payerViewURL, String, :required => true
701
+ # The total amount of the invoice (cost of items, shipping and tax, less any discount).
702
+ object_of :totalAmount, Integer, :required => true
703
+ array_of :error, ErrorData
704
+ end
705
+ end
706
+
707
+
708
+
709
+ # The request object for UpdateInvoice.
710
+ class UpdateInvoiceRequest < DataType
711
+ def self.load_members
712
+ object_of :requestEnvelope, RequestEnvelope, :required => true
713
+ # invoice's ID
714
+ object_of :invoiceID, String, :required => true
715
+ # Data to populate the newly created invoice.
716
+ object_of :invoice, InvoiceType, :required => true
717
+ end
718
+ end
719
+
720
+
721
+
722
+ # The response object for UpdateInvoice.
723
+ class UpdateInvoiceResponse < DataType
724
+ def self.load_members
725
+ include ResponseStatus
726
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
727
+ # The invoice's ID.
728
+ object_of :invoiceID, String, :required => true
729
+ # The updated invoice's number.
730
+ object_of :invoiceNumber, String, :required => true
731
+ # The URL which lead merchant to view the invoice details on web.
732
+ object_of :invoiceURL, String, :required => true
733
+ # The total amount of the invoice (cost of items, shipping and tax, less any discount).
734
+ object_of :totalAmount, Integer, :required => true
735
+ array_of :error, ErrorData
736
+ end
737
+ end
738
+
739
+
740
+
741
+ # The request object for GetInvoiceDetails.
742
+ class GetInvoiceDetailsRequest < DataType
743
+ def self.load_members
744
+ object_of :requestEnvelope, RequestEnvelope, :required => true
745
+ # ID of the invoice to retrieve.
746
+ object_of :invoiceID, String
747
+ # Invoice number of the invoice to retrieve.
748
+ object_of :invoiceNumber, String
749
+ end
750
+ end
751
+
752
+
753
+
754
+ # The response object for CreateInvoice.
755
+ class GetInvoiceDetailsResponse < DataType
756
+ def self.load_members
757
+ include ResponseStatus
758
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
759
+ # The requested invoice.
760
+ object_of :invoice, InvoiceType, :required => true
761
+ # The requested invoice details.
762
+ object_of :invoiceDetails, InvoiceDetailsType, :required => true
763
+ # The requested invoice payment details.
764
+ object_of :paymentDetails, PaymentDetailsType
765
+ # The requested invoice refund details.
766
+ object_of :refundDetails, PaymentRefundDetailsType
767
+ # The URL which lead merchant to view the invoice details on web.
768
+ object_of :invoiceURL, String, :required => true
769
+ # The URL which lead merchant to view the invoice as the payer would see it.
770
+ object_of :payerViewURL, String, :required => true
771
+ array_of :error, ErrorData
772
+ end
773
+ end
774
+
775
+
776
+
777
+ # The request object for CancelInvoice.
778
+ class CancelInvoiceRequest < DataType
779
+ def self.load_members
780
+ object_of :requestEnvelope, RequestEnvelope, :required => true
781
+ # invoice's ID
782
+ object_of :invoiceID, String
783
+ # Subject of the cancellation notification
784
+ object_of :subject, String
785
+ # Note to send payer within the cancellation notification
786
+ object_of :noteForPayer, String
787
+ # send a copy of cancellation notification to merchant
788
+ object_of :sendCopyToMerchant, Boolean
789
+ # send cancel notification to payer
790
+ object_of :sendPayerNotification, Boolean
791
+ end
792
+ end
793
+
794
+
795
+
796
+ # The response object for CancelInvoice.
797
+ class CancelInvoiceResponse < DataType
798
+ def self.load_members
799
+ include ResponseStatus
800
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
801
+ # The canceled invoice's ID.
802
+ object_of :invoiceID, String, :required => true
803
+ # The canceled invoice's number.
804
+ object_of :invoiceNumber, String, :required => true
805
+ # The URL which lead merchant to view the invoice details on web.
806
+ object_of :invoiceURL, String, :required => true
807
+ array_of :error, ErrorData
808
+ end
809
+ end
810
+
811
+
812
+
813
+ # The request object for SearchInvoices.
814
+ class SearchInvoicesRequest < DataType
815
+ def self.load_members
816
+ object_of :requestEnvelope, RequestEnvelope, :required => true
817
+ # Invoice creator's email.
818
+ object_of :merchantEmail, String, :required => true
819
+ # Parameters constraining the search.
820
+ object_of :parameters, SearchParametersType, :required => true
821
+ # Page number of result set, starting with 1.
822
+ object_of :page, Integer, :required => true
823
+ # Number of results per page, between 1 and 100.
824
+ object_of :pageSize, Integer, :required => true
825
+ end
826
+ end
827
+
828
+
829
+
830
+ # The response object for SearchInvoices.
831
+ class SearchInvoicesResponse < DataType
832
+ def self.load_members
833
+ include ResponseStatus
834
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
835
+ # Number of invoices that matched the search.
836
+ object_of :count, Integer, :required => true
837
+ # Page of invoice summaries that matched the search.
838
+ object_of :invoiceList, InvoiceSummaryListType
839
+ # Page number of result set.
840
+ object_of :page, Integer, :required => true
841
+ # True if another page of invoice summary results exists.
842
+ object_of :hasNextPage, Boolean, :required => true
843
+ # True if a previous page of invoice summary results exists.
844
+ object_of :hasPreviousPage, Boolean, :required => true
845
+ array_of :error, ErrorData
846
+ end
847
+ end
848
+
849
+
850
+
851
+ # The request object for MarkInvoiceAsPaid.
852
+ class MarkInvoiceAsPaidRequest < DataType
853
+ def self.load_members
854
+ object_of :requestEnvelope, RequestEnvelope, :required => true
855
+ # ID of the invoice to mark as paid.
856
+ object_of :invoiceID, String, :required => true
857
+ # Details of the payment made against this invoice.
858
+ object_of :payment, OtherPaymentDetailsType, :required => true
859
+ end
860
+ end
861
+
862
+
863
+
864
+ # The response object for MarkInvoiceAsPaid.
865
+ class MarkInvoiceAsPaidResponse < DataType
866
+ def self.load_members
867
+ include ResponseStatus
868
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
869
+ # The paid invoice ID.
870
+ object_of :invoiceID, String, :required => true
871
+ # The paid invoice number.
872
+ object_of :invoiceNumber, String, :required => true
873
+ # The URL which lead merchant to view the invoice details on web.
874
+ object_of :invoiceURL, String, :required => true
875
+ array_of :error, ErrorData
876
+ end
877
+ end
878
+
879
+
880
+
881
+ # The request object for MarkInvoiceAsRefunded.
882
+ class MarkInvoiceAsRefundedRequest < DataType
883
+ def self.load_members
884
+ object_of :requestEnvelope, RequestEnvelope, :required => true
885
+ # ID of the invoice to mark as refunded.
886
+ object_of :invoiceID, String, :required => true
887
+ # Details of the refund made against this invoice.
888
+ object_of :refundDetail, OtherPaymentRefundDetailsType, :required => true
889
+ end
890
+ end
891
+
892
+
893
+
894
+ # The response object for MarkInvoiceAsRefunded.
895
+ class MarkInvoiceAsRefundedResponse < DataType
896
+ def self.load_members
897
+ include ResponseStatus
898
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
899
+ # The invoice ID of the invoice that was marked as refunded.
900
+ object_of :invoiceID, String, :required => true
901
+ # The invoice number of the invoice that was marked as refunded.
902
+ object_of :invoiceNumber, String, :required => true
903
+ # The URL of the details page of the invoice that was marked as refunded.
904
+ object_of :invoiceURL, String, :required => true
905
+ array_of :error, ErrorData
906
+ end
907
+ end
908
+
909
+
910
+
911
+ # The request object for MarkInvoiceAsUnpaid.
912
+ class MarkInvoiceAsUnpaidRequest < DataType
913
+ def self.load_members
914
+ object_of :requestEnvelope, RequestEnvelope, :required => true
915
+ # ID of the invoice to mark as unpaid.
916
+ object_of :invoiceID, String, :required => true
917
+ end
918
+ end
919
+
920
+
921
+
922
+ # The response object for MarkInvoiceAsUnpaid.
923
+ class MarkInvoiceAsUnpaidResponse < DataType
924
+ def self.load_members
925
+ include ResponseStatus
926
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
927
+ # The invoice ID of the invoice that was marked as unpaid.
928
+ object_of :invoiceID, String, :required => true
929
+ # The invoice number of the invoice that was marked as unpaid.
930
+ object_of :invoiceNumber, String, :required => true
931
+ # The URL of the details page of the invoice that was marked as unpaid.
932
+ object_of :invoiceURL, String, :required => true
933
+ array_of :error, ErrorData
934
+ end
935
+ end
936
+
937
+
938
+
939
+ # Payment refund details about the invoice.
940
+ class PaymentRefundDetailsType < DataType
941
+ def self.load_members
942
+ # True if the invoice was refunded using PayPal.
943
+ object_of :viaPayPal, Boolean, :required => true
944
+ # Other payment refund details.
945
+ object_of :paypalPayment, PayPalPaymentRefundDetailsType
946
+ # Other payment refund details.
947
+ object_of :paypalPayments, PayPalPaymentRefundDetailsListType
948
+ # details.
949
+ object_of :otherPayment, OtherPaymentRefundDetailsType
950
+ # details.
951
+ object_of :otherPayments, OtherPaymentRefundDetailsListType
952
+ end
953
+ end
954
+
955
+
956
+
957
+ # The request object for DeleteInvoice.
958
+ class DeleteInvoiceRequest < DataType
959
+ def self.load_members
960
+ object_of :requestEnvelope, RequestEnvelope, :required => true
961
+ # ID of the invoice to be deleted.
962
+ object_of :invoiceID, String, :required => true
963
+ end
964
+ end
965
+
966
+
967
+
968
+ # The response object for DeleteInvoice.
969
+ class DeleteInvoiceResponse < DataType
970
+ def self.load_members
971
+ include ResponseStatus
972
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
973
+ array_of :error, ErrorData
974
+ end
975
+ end
976
+
977
+
978
+
979
+
980
+
981
+ constants.each do |data_type_klass|
982
+ data_type_klass = const_get(data_type_klass)
983
+ data_type_klass.load_members if defined? data_type_klass.load_members
984
+ end
985
+
986
+ end
987
+ end
988
+ end