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.
- checksums.yaml +7 -0
- data/Gemfile +17 -17
- data/README.md +125 -125
- data/Rakefile +14 -14
- data/lib/paypal-sdk-invoice.rb +2 -2
- data/lib/paypal-sdk/invoice.rb +16 -16
- data/lib/paypal-sdk/invoice/api.rb +21 -21
- data/lib/paypal-sdk/invoice/data_types.rb +988 -871
- data/lib/paypal-sdk/invoice/services.rb +267 -248
- data/lib/paypal-sdk/invoice/version.rb +7 -7
- data/spec/config/paypal.yml +24 -24
- data/spec/invoice_spec.rb +18 -18
- data/spec/spec_helper.rb +6 -6
- metadata +20 -24
checksums.yaml
ADDED
@@ -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
|
data/lib/paypal-sdk-invoice.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require "paypal-sdk/invoice"
|
2
|
-
|
1
|
+
require "paypal-sdk/invoice"
|
2
|
+
|
data/lib/paypal-sdk/invoice.rb
CHANGED
@@ -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
|
152
|
-
class
|
153
|
-
self.options = { '
|
154
|
-
end
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
# Specifies the
|
159
|
-
class
|
160
|
-
self.options = { '
|
161
|
-
end
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
# Specifies the merchant or payer.
|
166
|
-
class
|
167
|
-
self.options = { '
|
168
|
-
end
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
#
|
173
|
-
class
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
# Optional note associated with the
|
365
|
-
object_of :note, String
|
366
|
-
# Date when the invoice was
|
367
|
-
object_of :date, DateTime
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
#
|
411
|
-
|
412
|
-
#
|
413
|
-
object_of :
|
414
|
-
#
|
415
|
-
object_of :
|
416
|
-
#
|
417
|
-
object_of :
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
#
|
427
|
-
object_of :
|
428
|
-
#
|
429
|
-
object_of :
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
object_of :
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
end
|
847
|
-
end
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
# The
|
852
|
-
class
|
853
|
-
def self.load_members
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
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
|