paypal-sdk-adaptivepayments 1.103.0 → 1.105.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,17 +1,19 @@
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/adaptive_payments_samples.gemspec', __FILE__)
8
- gem 'adaptive_payments_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/adaptive_payments_samples.gemspec', __FILE__)
8
+ gem 'adaptive_payments_samples', :path => 'samples', :require => false
9
+ group :test do
10
+ gem 'rspec-rails', :require => false
11
+ gem 'capybara', '~> 2.0.3', :require => false
12
+ end
13
+ end
14
+
15
+ group :test do
16
+ gem 'rspec'
17
+ end
18
+
19
+ gem 'nokogiri', '~> 1.5.9', :platform => :mri_18
data/README.md CHANGED
@@ -1,141 +1,141 @@
1
- # Adaptive Payments SDK
2
-
3
- The PayPal Adaptive Payments SDK provides Ruby APIs to create, process and manage simple and complex (parallel and chained) payments, and pre-approvals using the Adaptive Payments API.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'paypal-sdk-adaptivepayments'
11
- ```
12
-
13
- And then execute:
14
-
15
- ```sh
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
-
21
- ```sh
22
- $ gem install paypal-sdk-adaptivepayments
23
- ```
24
-
25
- ## Configuration
26
-
27
- For Rails application:
28
-
29
- ```sh
30
- rails g paypal:sdk:install
31
- ```
32
-
33
- For other ruby application, create a configuration file(`config/paypal.yml`):
34
-
35
- ```yaml
36
- development: &default
37
- username: jb-us-seller_api1.paypal.com
38
- password: WX4WTU3S8MY44S7F
39
- signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
40
- app_id: APP-80W284485P519543T
41
- http_timeout: 30
42
- mode: sandbox
43
- sandbox_email_address: Platform.sdk.seller@gmail.com
44
- # # with certificate
45
- # cert_path: "config/cert_key.pem"
46
- # # with token authentication
47
- # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
48
- # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
49
- # # with Proxy
50
- # http_proxy: http://proxy-ipaddress:3129/
51
- # # with device ip address
52
- # device_ipaddress: "127.0.0.1"
53
- test:
54
- <<: *default
55
- production:
56
- mode: live
57
- username: USERNAME
58
- password: PASSWORD
59
- signature: SIGNATURE
60
- app_id: APP_ID
61
- ```
62
-
63
- Load Configurations from specified file:
64
-
65
- ```ruby
66
- PayPal::SDK.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
67
- ```
68
-
69
- Or without configuration file:
70
-
71
- ```ruby
72
- PayPal::SDK.configure(
73
- :mode => "sandbox", # Set "live" for production
74
- :app_id => "APP-80W284485P519543T",
75
- :username => "jb-us-seller_api1.paypal.com",
76
- :password => "WX4WTU3S8MY44S7F",
77
- :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
78
- ```
79
-
80
- ## Example
81
-
82
- ```ruby
83
- require 'paypal-sdk-adaptivepayments'
84
- PayPal::SDK.configure(
85
- :mode => "sandbox", # Set "live" for production
86
- :app_id => "APP-80W284485P519543T",
87
- :username => "jb-us-seller_api1.paypal.com",
88
- :password => "WX4WTU3S8MY44S7F",
89
- :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
90
-
91
- @api = PayPal::SDK::AdaptivePayments.new
92
-
93
- # Build request object
94
- @pay = @api.build_pay({
95
- :actionType => "PAY",
96
- :cancelUrl => "http://localhost:3000/samples/adaptive_payments/pay",
97
- :currencyCode => "USD",
98
- :feesPayer => "SENDER",
99
- :ipnNotificationUrl => "http://localhost:3000/samples/adaptive_payments/ipn_notify",
100
- :receiverList => {
101
- :receiver => [{
102
- :amount => 1.0,
103
- :email => "platfo_1255612361_per@gmail.com" }] },
104
- :returnUrl => "http://localhost:3000/samples/adaptive_payments/pay" })
105
-
106
- # Make API call & get response
107
- @response = @api.pay(@pay)
108
-
109
- # Access response
110
- if @response.success?
111
- @response.payKey
112
- @api.payment_url(@response) # Url to complete payment
113
- else
114
- @response.error[0].message
115
- end
116
- ```
117
-
118
- For more samples [https://paypal-sdk-samples.herokuapp.com/adaptive_payments/](https://paypal-sdk-samples.herokuapp.com/adaptive_payments/)
119
-
120
- ## Samples App
121
-
122
- Add following line in rails `Gemfile`:
123
-
124
- ```ruby
125
- gem 'paypal-sdk-adaptivepayments'
126
- gem 'adaptive_payments_samples', :git => "https://github.com/paypal/adaptivepayments-sdk-ruby.git", :group => :development
127
- ```
128
-
129
- Configure routes(`config/routes.rb`):
130
-
131
- ```ruby
132
- mount AdaptivePaymentsSamples::Engine => "/samples" if Rails.env.development?
133
- ```
134
-
135
- To get default paypal configuration execute:
136
-
137
- ```sh
138
- rails g paypal:sdk:install
139
- ```
140
-
141
- Run `rails server` and check the samples.
1
+ # Adaptive Payments SDK
2
+
3
+ The PayPal Adaptive Payments SDK provides Ruby APIs to create, process and manage simple and complex (parallel and chained) payments, and pre-approvals using the Adaptive Payments API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'paypal-sdk-adaptivepayments'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ ```sh
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+
21
+ ```sh
22
+ $ gem install paypal-sdk-adaptivepayments
23
+ ```
24
+
25
+ ## Configuration
26
+
27
+ For Rails application:
28
+
29
+ ```sh
30
+ rails g paypal:sdk:install
31
+ ```
32
+
33
+ For other ruby application, create a configuration file(`config/paypal.yml`):
34
+
35
+ ```yaml
36
+ development: &default
37
+ username: jb-us-seller_api1.paypal.com
38
+ password: WX4WTU3S8MY44S7F
39
+ signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
40
+ app_id: APP-80W284485P519543T
41
+ http_timeout: 30
42
+ mode: sandbox
43
+ sandbox_email_address: Platform.sdk.seller@gmail.com
44
+ # # with certificate
45
+ # cert_path: "config/cert_key.pem"
46
+ # # with token authentication
47
+ # token: ESTy2hio5WJQo1iixkH29I53RJxaS0Gvno1A6.YQXZgktxbY4I2Tdg
48
+ # token_secret: ZKPhUYuwJwYsfWdzorozWO2U9pI
49
+ # # with Proxy
50
+ # http_proxy: http://proxy-ipaddress:3129/
51
+ # # with device ip address
52
+ # device_ipaddress: "127.0.0.1"
53
+ test:
54
+ <<: *default
55
+ production:
56
+ mode: live
57
+ username: USERNAME
58
+ password: PASSWORD
59
+ signature: SIGNATURE
60
+ app_id: APP_ID
61
+ ```
62
+
63
+ Load Configurations from specified file:
64
+
65
+ ```ruby
66
+ PayPal::SDK.load('config/paypal.yml', ENV['RACK_ENV'] || 'development')
67
+ ```
68
+
69
+ Or without configuration file:
70
+
71
+ ```ruby
72
+ PayPal::SDK.configure(
73
+ :mode => "sandbox", # Set "live" for production
74
+ :app_id => "APP-80W284485P519543T",
75
+ :username => "jb-us-seller_api1.paypal.com",
76
+ :password => "WX4WTU3S8MY44S7F",
77
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
78
+ ```
79
+
80
+ ## Example
81
+
82
+ ```ruby
83
+ require 'paypal-sdk-adaptivepayments'
84
+ PayPal::SDK.configure(
85
+ :mode => "sandbox", # Set "live" for production
86
+ :app_id => "APP-80W284485P519543T",
87
+ :username => "jb-us-seller_api1.paypal.com",
88
+ :password => "WX4WTU3S8MY44S7F",
89
+ :signature => "AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy" )
90
+
91
+ @api = PayPal::SDK::AdaptivePayments.new
92
+
93
+ # Build request object
94
+ @pay = @api.build_pay({
95
+ :actionType => "PAY",
96
+ :cancelUrl => "http://localhost:3000/samples/adaptive_payments/pay",
97
+ :currencyCode => "USD",
98
+ :feesPayer => "SENDER",
99
+ :ipnNotificationUrl => "http://localhost:3000/samples/adaptive_payments/ipn_notify",
100
+ :receiverList => {
101
+ :receiver => [{
102
+ :amount => 1.0,
103
+ :email => "platfo_1255612361_per@gmail.com" }] },
104
+ :returnUrl => "http://localhost:3000/samples/adaptive_payments/pay" })
105
+
106
+ # Make API call & get response
107
+ @response = @api.pay(@pay)
108
+
109
+ # Access response
110
+ if @response.success?
111
+ @response.payKey
112
+ @api.payment_url(@response) # Url to complete payment
113
+ else
114
+ @response.error[0].message
115
+ end
116
+ ```
117
+
118
+ For more samples [https://paypal-sdk-samples.herokuapp.com/adaptive_payments/](https://paypal-sdk-samples.herokuapp.com/adaptive_payments/)
119
+
120
+ ## Samples App
121
+
122
+ Add following line in rails `Gemfile`:
123
+
124
+ ```ruby
125
+ gem 'paypal-sdk-adaptivepayments'
126
+ gem 'adaptive_payments_samples', :git => "https://github.com/paypal/adaptivepayments-sdk-ruby.git", :group => :development
127
+ ```
128
+
129
+ Configure routes(`config/routes.rb`):
130
+
131
+ ```ruby
132
+ mount AdaptivePaymentsSamples::Engine => "/samples" if Rails.env.development?
133
+ ```
134
+
135
+ To get default paypal configuration execute:
136
+
137
+ ```sh
138
+ rails g paypal:sdk:install
139
+ ```
140
+
141
+ Run `rails server` and check the samples.
@@ -1,17 +1,17 @@
1
- require 'paypal-sdk-core'
2
-
3
- module PayPal
4
- module SDK
5
- module AdaptivePayments
6
- autoload :VERSION, "paypal-sdk/adaptive_payments/version"
7
- autoload :Services, "paypal-sdk/adaptive_payments/services"
8
- autoload :DataTypes, "paypal-sdk/adaptive_payments/data_types"
9
- autoload :Urls, "paypal-sdk/adaptive_payments/urls"
10
- autoload :API, "paypal-sdk/adaptive_payments/api"
11
-
12
- def self.new(*args)
13
- API.new(*args)
14
- end
15
- end
16
- end
17
- end
1
+ require 'paypal-sdk-core'
2
+
3
+ module PayPal
4
+ module SDK
5
+ module AdaptivePayments
6
+ autoload :VERSION, "paypal-sdk/adaptive_payments/version"
7
+ autoload :Services, "paypal-sdk/adaptive_payments/services"
8
+ autoload :DataTypes, "paypal-sdk/adaptive_payments/data_types"
9
+ autoload :Urls, "paypal-sdk/adaptive_payments/urls"
10
+ autoload :API, "paypal-sdk/adaptive_payments/api"
11
+
12
+ def self.new(*args)
13
+ API.new(*args)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,27 +1,27 @@
1
- require 'paypal-sdk-core'
2
-
3
- module PayPal
4
- module SDK
5
- module AdaptivePayments
6
- class API < Core::API::Platform
7
- include Services
8
- include Urls
9
-
10
- def initialize(environment = nil, options = {})
11
- super(SERVICE_NAME, environment, options)
12
- end
13
-
14
- ADAPTIVE_PAYMENTS_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "adaptivepayments-ruby-sdk-#{VERSION}" }
15
- def default_http_header
16
- super.merge(ADAPTIVE_PAYMENTS_HTTP_HEADER)
17
- end
18
-
19
- # Validate IPN message
20
- def ipn_valid?(raw_post_data)
21
- Core::API::IPN.valid?(raw_post_data, config)
22
- end
23
- end
24
- end
25
- end
26
- end
27
-
1
+ require 'paypal-sdk-core'
2
+
3
+ module PayPal
4
+ module SDK
5
+ module AdaptivePayments
6
+ class API < Core::API::Platform
7
+ include Services
8
+ include Urls
9
+
10
+ def initialize(environment = nil, options = {})
11
+ super(SERVICE_NAME, environment, options)
12
+ end
13
+
14
+ ADAPTIVE_PAYMENTS_HTTP_HEADER = { "X-PAYPAL-REQUEST-SOURCE" => "adaptivepayments-ruby-sdk-#{VERSION}" }
15
+ def default_http_header
16
+ super.merge(ADAPTIVE_PAYMENTS_HTTP_HEADER)
17
+ end
18
+
19
+ # Validate IPN message
20
+ def ipn_valid?(raw_post_data)
21
+ Core::API::IPN.valid?(raw_post_data, config)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+
@@ -1,1168 +1,1214 @@
1
- # Stub objects for AdaptivePayments
2
- # Auto generated code
3
-
4
- require 'paypal-sdk-core'
5
-
6
- module PayPal::SDK
7
- module AdaptivePayments
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 AccountIdentifier < DataType
37
- def self.load_members
38
- object_of :email, String
39
- object_of :phone, PhoneNumberType
40
- object_of :accountId, String
41
- end
42
- end
43
-
44
-
45
-
46
- class BaseAddress < DataType
47
- def self.load_members
48
- object_of :line1, String, :required => true
49
- object_of :line2, String
50
- object_of :city, String, :required => true
51
- object_of :state, String
52
- object_of :postalCode, String
53
- object_of :countryCode, String, :required => true
54
- object_of :type, String
55
- end
56
- end
57
-
58
-
59
-
60
- # Details about the end user of the application invoking this service.
61
- class ClientDetailsType < DataType
62
- def self.load_members
63
- object_of :ipAddress, String
64
- object_of :deviceId, String
65
- object_of :applicationId, String
66
- object_of :model, String
67
- object_of :geoLocation, String
68
- object_of :customerType, String
69
- object_of :partnerName, String
70
- object_of :customerId, String
71
- end
72
- end
73
-
74
-
75
-
76
- class CurrencyType < DataType
77
- def self.load_members
78
- object_of :code, String, :required => true
79
- object_of :amount, Float, :required => true
80
- end
81
- end
82
-
83
-
84
-
85
- # This type contains the detailed error information resulting from the service operation.
86
- class ErrorData < DataType
87
- def self.load_members
88
- object_of :errorId, Integer
89
- object_of :domain, String
90
- object_of :subdomain, String
91
- object_of :severity, ErrorSeverity
92
- object_of :category, ErrorCategory
93
- object_of :message, String
94
- object_of :exceptionId, String
95
- array_of :parameter, ErrorParameter
96
- end
97
- end
98
-
99
-
100
-
101
- class ErrorParameter < DataType
102
- def self.load_members
103
- add_attribute :name, :required => true
104
- object_of :value, String, :required => true
105
- end
106
- end
107
-
108
-
109
-
110
- # This specifies a fault, encapsulating error data, with specific error codes.
111
- class FaultMessage < DataType
112
- def self.load_members
113
- include ResponseStatus
114
- object_of :responseEnvelope, ResponseEnvelope, :required => true
115
- array_of :error, ErrorData
116
- end
117
- end
118
-
119
-
120
-
121
- class PhoneNumberType < DataType
122
- def self.load_members
123
- object_of :countryCode, String, :required => true
124
- object_of :phoneNumber, String, :required => true
125
- object_of :extension, String
126
- end
127
- end
128
-
129
-
130
-
131
- # This specifies the list of parameters with every request to the service.
132
- class RequestEnvelope < DataType
133
- def self.load_members
134
- # 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.
135
- object_of :detailLevel, DetailLevelCode
136
- # This should be the standard RFC 3066 language identification tag, e.g., en_US.
137
- object_of :errorLanguage, String, :required => true
138
- end
139
- end
140
-
141
-
142
-
143
- # This specifies a list of parameters with every response from a service.
144
- class ResponseEnvelope < DataType
145
- def self.load_members
146
- object_of :timestamp, DateTime, :required => true
147
- # Application level acknowledgment code.
148
- object_of :ack, AckCode, :required => true
149
- object_of :correlationId, String, :required => true
150
- object_of :build, String, :required => true
151
- end
152
- end
153
-
154
-
155
-
156
- # 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.
157
- class AckCode < EnumType
158
- self.options = { 'SUCCESS' => 'Success', 'FAILURE' => 'Failure', 'WARNING' => 'Warning', 'SUCCESSWITHWARNING' => 'SuccessWithWarning', 'FAILUREWITHWARNING' => 'FailureWithWarning' }
159
- end
160
-
161
-
162
-
163
- class DayOfWeek < EnumType
164
- self.options = { 'NODAYSPECIFIED' => 'NO_DAY_SPECIFIED', 'SUNDAY' => 'SUNDAY', 'MONDAY' => 'MONDAY', 'TUESDAY' => 'TUESDAY', 'WEDNESDAY' => 'WEDNESDAY', 'THURSDAY' => 'THURSDAY', 'FRIDAY' => 'FRIDAY', 'SATURDAY' => 'SATURDAY' }
165
- end
166
-
167
-
168
-
169
- # DetailLevelCodeType
170
- class DetailLevelCode < EnumType
171
- self.options = { 'RETURNALL' => 'ReturnAll' }
172
- end
173
-
174
-
175
-
176
- class ErrorCategory < EnumType
177
- self.options = { 'SYSTEM' => 'System', 'APPLICATION' => 'Application', 'REQUEST' => 'Request' }
178
- end
179
-
180
-
181
-
182
- class ErrorSeverity < EnumType
183
- self.options = { 'ERROR' => 'Error', 'WARNING' => 'Warning' }
184
- end
185
-
186
-
187
-
188
- class Status < EnumType
189
- self.options = { 'RTR' => 'RTR', 'NONRTR' => 'NON_RTR', 'MISSINGRECEIVERCOUNTRYINFORMATION' => 'MISSING_RECEIVER_COUNTRY_INFORMATION' }
190
- end
191
-
192
-
193
-
194
- class Address < DataType
195
- def self.load_members
196
- object_of :addresseeName, String
197
- object_of :baseAddress, BaseAddress, :required => true
198
- object_of :addressId, String
199
- end
200
- end
201
-
202
-
203
-
204
- class AddressList < DataType
205
- def self.load_members
206
- array_of :address, Address, :required => true
207
- end
208
- end
209
-
210
-
211
-
212
- # A list of ISO currency codes.
213
- class CurrencyCodeList < DataType
214
- def self.load_members
215
- array_of :currencyCode, String, :required => true
216
- end
217
- end
218
-
219
-
220
-
221
- # A list of estimated currency conversions for a base currency.
222
- class CurrencyConversionList < DataType
223
- def self.load_members
224
- object_of :baseAmount, CurrencyType, :required => true
225
- object_of :currencyList, CurrencyList, :required => true
226
- end
227
- end
228
-
229
-
230
-
231
- # A table that contains a list of estimated currency conversions for a base currency in each row.
232
- class CurrencyConversionTable < DataType
233
- def self.load_members
234
- array_of :currencyConversionList, CurrencyConversionList, :required => true
235
- end
236
- end
237
-
238
-
239
-
240
- # A list of ISO currencies.
241
- class CurrencyList < DataType
242
- def self.load_members
243
- array_of :currency, CurrencyType, :required => true
244
- end
245
- end
246
-
247
-
248
-
249
- # Customizable options that a client application can specify for display purposes.
250
- class DisplayOptions < DataType
251
- def self.load_members
252
- object_of :emailHeaderImageUrl, String
253
- object_of :emailMarketingImageUrl, String
254
- object_of :headerImageUrl, String
255
- object_of :businessName, String
256
- end
257
- end
258
-
259
-
260
-
261
- class ErrorList < DataType
262
- def self.load_members
263
- array_of :error, ErrorData, :required => true
264
- end
265
- end
266
-
267
-
268
-
269
- class FundingConstraint < DataType
270
- def self.load_members
271
- object_of :allowedFundingType, FundingTypeList
272
- end
273
- end
274
-
275
-
276
-
277
- # FundingTypeInfo represents one allowed funding type.
278
- class FundingTypeInfo < DataType
279
- def self.load_members
280
- object_of :fundingType, String, :required => true
281
- end
282
- end
283
-
284
-
285
-
286
- class FundingTypeList < DataType
287
- def self.load_members
288
- array_of :fundingTypeInfo, FundingTypeInfo, :required => true
289
- end
290
- end
291
-
292
-
293
-
294
- # Describes the conversion between 2 currencies.
295
- class CurrencyConversion < DataType
296
- def self.load_members
297
- object_of :from, CurrencyType, :required => true
298
- object_of :to, CurrencyType, :required => true
299
- object_of :exchangeRate, Float, :required => true
300
- end
301
- end
302
-
303
-
304
-
305
- # Funding source information.
306
- class FundingSource < DataType
307
- def self.load_members
308
- object_of :lastFourOfAccountNumber, String
309
- object_of :type, String, :required => true
310
- object_of :displayName, String
311
- object_of :fundingSourceId, String
312
- object_of :allowed, Boolean
313
- end
314
- end
315
-
316
-
317
-
318
- # Amount to be charged to a particular funding source.
319
- class FundingPlanCharge < DataType
320
- def self.load_members
321
- object_of :charge, CurrencyType, :required => true
322
- object_of :fundingSource, FundingSource, :required => true
323
- end
324
- end
325
-
326
-
327
-
328
- # FundingPlan describes the funding sources to be used for a specific payment.
329
- class FundingPlan < DataType
330
- def self.load_members
331
- object_of :fundingPlanId, String, :required => true
332
- object_of :fundingAmount, CurrencyType, :required => true
333
- object_of :backupFundingSource, FundingSource
334
- object_of :senderFees, CurrencyType
335
- object_of :currencyConversion, CurrencyConversion
336
- array_of :charge, FundingPlanCharge, :required => true
337
- end
338
- end
339
-
340
-
341
-
342
- # Details about the party that initiated this payment. The API user is making this payment on behalf of the initiator. The initiator can simply be an institution or a customer of the institution.
343
- class InitiatingEntity < DataType
344
- def self.load_members
345
- object_of :institutionCustomer, InstitutionCustomer
346
- end
347
- end
348
-
349
-
350
-
351
- # The customer of the initiating institution
352
- class InstitutionCustomer < DataType
353
- def self.load_members
354
- # The unique identifier as assigned to the institution.
355
- object_of :institutionId, String, :required => true
356
- # The first (given) name of the end consumer as known by the institution.
357
- object_of :firstName, String, :required => true
358
- # The last (family) name of the end consumer as known by the institution.
359
- object_of :lastName, String, :required => true
360
- object_of :middleName, String
361
- # The full name of the end consumer as known by the institution.
362
- object_of :displayName, String, :required => true
363
- # The unique identifier as assigned to the end consumer by the institution.
364
- object_of :institutionCustomerId, String, :required => true
365
- # The two-character ISO country code of the home country of the end consumer
366
- object_of :countryCode, String, :required => true
367
- object_of :email, String
368
- object_of :dateOfBirth, Date
369
- object_of :address, BaseAddress
370
- end
371
- end
372
-
373
-
374
-
375
- # Describes an individual item for an invoice.
376
- class InvoiceItem < DataType
377
- def self.load_members
378
- object_of :name, String
379
- object_of :identifier, String
380
- object_of :price, Float
381
- object_of :itemPrice, Float
382
- object_of :itemCount, Integer
383
- end
384
- end
385
-
386
-
387
-
388
- # Describes a payment for a particular receiver (merchant), contains list of additional per item details.
389
- class InvoiceData < DataType
390
- def self.load_members
391
- array_of :item, InvoiceItem
392
- object_of :totalTax, Float
393
- object_of :totalShipping, Float
394
- end
395
- end
396
-
397
-
398
-
399
- # The error that resulted from an attempt to make a payment to a receiver.
400
- class PayError < DataType
401
- def self.load_members
402
- object_of :receiver, Receiver, :required => true
403
- object_of :error, ErrorData, :required => true
404
- end
405
- end
406
-
407
-
408
-
409
- class PayErrorList < DataType
410
- def self.load_members
411
- array_of :payError, PayError, :required => true
412
- end
413
- end
414
-
415
-
416
-
417
- # PaymentInfo represents the payment attempt made to a Receiver of a PayRequest. If the execution of the payment has not yet completed, there will not be any transaction details.
418
- class PaymentInfo < DataType
419
- def self.load_members
420
- object_of :transactionId, String
421
- object_of :transactionStatus, String
422
- object_of :receiver, Receiver, :required => true
423
- object_of :refundedAmount, Float
424
- object_of :pendingRefund, Boolean
425
- object_of :senderTransactionId, String
426
- object_of :senderTransactionStatus, String
427
- object_of :pendingReason, String
428
- end
429
- end
430
-
431
-
432
-
433
- class PaymentInfoList < DataType
434
- def self.load_members
435
- array_of :paymentInfo, PaymentInfo, :required => true
436
- end
437
- end
438
-
439
-
440
-
441
- # Receiver is the party where funds are transferred to. A primary receiver receives a payment directly from the sender in a chained split payment. A primary receiver should not be specified when making a single or parallel split payment.
442
- class Receiver < DataType
443
- def self.load_members
444
- object_of :amount, Float, :required => true
445
- object_of :email, String
446
- object_of :phone, PhoneNumberType
447
- object_of :primary, Boolean
448
- object_of :invoiceId, String
449
- object_of :paymentType, String
450
- object_of :paymentSubType, String
451
- object_of :accountId, String
452
- end
453
- end
454
-
455
-
456
-
457
- class ReceiverList < DataType
458
- def self.load_members
459
- array_of :receiver, Receiver, :required => true
460
- end
461
- end
462
-
463
-
464
-
465
- # The sender identifier type contains information to identify a PayPal account.
466
- class ReceiverIdentifier < AccountIdentifier
467
- def self.load_members
468
- end
469
- end
470
-
471
-
472
-
473
- # Options that apply to the receiver of a payment, allows setting additional details for payment using invoice.
474
- class ReceiverOptions < DataType
475
- def self.load_members
476
- object_of :description, String
477
- object_of :customId, String
478
- object_of :invoiceData, InvoiceData
479
- object_of :receiver, ReceiverIdentifier, :required => true
480
- object_of :referrerCode, String
481
- end
482
- end
483
-
484
-
485
-
486
- # RefundInfo represents the refund attempt made to a Receiver of a PayRequest.
487
- class RefundInfo < DataType
488
- def self.load_members
489
- object_of :receiver, Receiver, :required => true
490
- object_of :refundStatus, String
491
- object_of :refundNetAmount, Float
492
- object_of :refundFeeAmount, Float
493
- object_of :refundGrossAmount, Float
494
- object_of :totalOfAllRefunds, Float
495
- object_of :refundHasBecomeFull, Boolean
496
- object_of :encryptedRefundTransactionId, String
497
- object_of :refundTransactionStatus, String
498
- object_of :errorList, ErrorList
499
- end
500
- end
501
-
502
-
503
-
504
- class RefundInfoList < DataType
505
- def self.load_members
506
- array_of :refundInfo, RefundInfo, :required => true
507
- end
508
- end
509
-
510
-
511
-
512
- # Options that apply to the sender of a payment.
513
- class SenderOptions < DataType
514
- def self.load_members
515
- # Require the user to select a shipping address during the web flow.
516
- object_of :requireShippingAddressSelection, Boolean
517
- object_of :referrerCode, String
518
- end
519
- end
520
-
521
-
522
-
523
- # Details about the payer's tax info passed in by the merchant or partner.
524
- class TaxIdDetails < DataType
525
- def self.load_members
526
- # Tax id of the merchant/business.
527
- object_of :taxId, String
528
- # Tax type of the Tax Id.
529
- object_of :taxIdType, String
530
- end
531
- end
532
-
533
-
534
-
535
- # The sender identifier type contains information to identify a PayPal account.
536
- class SenderIdentifier < AccountIdentifier
537
- def self.load_members
538
- object_of :useCredentials, Boolean
539
- object_of :taxIdDetails, TaxIdDetails
540
- end
541
- end
542
-
543
-
544
-
545
- class UserLimit < DataType
546
- def self.load_members
547
- object_of :limitType, String, :required => true
548
- object_of :limitAmount, CurrencyType, :required => true
549
- end
550
- end
551
-
552
-
553
-
554
- # This type contains the detailed warning information resulting from the service operation.
555
- class WarningData < DataType
556
- def self.load_members
557
- object_of :warningId, Integer
558
- object_of :message, String
559
- end
560
- end
561
-
562
-
563
-
564
- class WarningDataList < DataType
565
- def self.load_members
566
- array_of :warningData, WarningData, :required => true
567
- end
568
- end
569
-
570
-
571
-
572
- # The request to cancel a Preapproval.
573
- class CancelPreapprovalRequest < DataType
574
- def self.load_members
575
- object_of :requestEnvelope, RequestEnvelope, :required => true
576
- object_of :preapprovalKey, String, :required => true
577
- end
578
- end
579
-
580
-
581
-
582
- # The result of the CancelPreapprovalRequest.
583
- class CancelPreapprovalResponse < DataType
584
- def self.load_members
585
- include ResponseStatus
586
- object_of :responseEnvelope, ResponseEnvelope, :required => true
587
- array_of :error, ErrorData
588
- end
589
- end
590
-
591
-
592
-
593
- # The request to confirm a Preapproval.
594
- class ConfirmPreapprovalRequest < DataType
595
- def self.load_members
596
- object_of :requestEnvelope, RequestEnvelope, :required => true
597
- object_of :preapprovalKey, String, :required => true
598
- object_of :fundingSourceId, String
599
- object_of :pin, String
600
- end
601
- end
602
-
603
-
604
-
605
- # The result of the ConfirmPreapprovalRequest.
606
- class ConfirmPreapprovalResponse < DataType
607
- def self.load_members
608
- include ResponseStatus
609
- object_of :responseEnvelope, ResponseEnvelope, :required => true
610
- array_of :error, ErrorData
611
- end
612
- end
613
-
614
-
615
-
616
- # A request to convert one or more currencies into their estimated values in other currencies.
617
- class ConvertCurrencyRequest < DataType
618
- def self.load_members
619
- object_of :requestEnvelope, RequestEnvelope, :required => true
620
- object_of :baseAmountList, CurrencyList, :required => true
621
- object_of :convertToCurrencyList, CurrencyCodeList, :required => true
622
- # The two-character ISO country code where fx suppposed to happen
623
- object_of :countryCode, String
624
- object_of :conversionType, String
625
- end
626
- end
627
-
628
-
629
-
630
- # A response that contains a table of estimated converted currencies based on the Convert Currency Request.
631
- class ConvertCurrencyResponse < DataType
632
- def self.load_members
633
- include ResponseStatus
634
- object_of :responseEnvelope, ResponseEnvelope, :required => true
635
- object_of :estimatedAmountTable, CurrencyConversionTable, :required => true
636
- array_of :error, ErrorData
637
- end
638
- end
639
-
640
-
641
-
642
- # The request to execute the payment request.
643
- class ExecutePaymentRequest < DataType
644
- def self.load_members
645
- object_of :requestEnvelope, RequestEnvelope, :required => true
646
- object_of :payKey, String, :required => true
647
- # Describes the action that is performed by this API
648
- object_of :actionType, String
649
- object_of :fundingPlanId, String
650
- end
651
- end
652
-
653
-
654
-
655
- # Contains information related to Post Payment Disclosure Details This contains 1.Receivers information 2.Funds Avalibility Date
656
- class PostPaymentDisclosure < DataType
657
- def self.load_members
658
- object_of :accountIdentifier, AccountIdentifier, :required => true
659
- object_of :fundsAvailabilityDate, Date
660
- object_of :fundsAvailabilityDateDisclaimerText, String
661
- end
662
- end
663
-
664
-
665
-
666
- class PostPaymentDisclosureList < DataType
667
- def self.load_members
668
- array_of :postPaymentDisclosure, PostPaymentDisclosure, :required => true
669
- end
670
- end
671
-
672
-
673
-
674
- # The result of a payment execution.
675
- class ExecutePaymentResponse < DataType
676
- def self.load_members
677
- include ResponseStatus
678
- object_of :responseEnvelope, ResponseEnvelope, :required => true
679
- object_of :paymentExecStatus, String, :required => true
680
- object_of :payErrorList, PayErrorList
681
- object_of :postPaymentDisclosureList, PostPaymentDisclosureList
682
- array_of :error, ErrorData
683
- end
684
- end
685
-
686
-
687
-
688
- # The request to get the allowed funding sources available for a preapproval.
689
- class GetAllowedFundingSourcesRequest < DataType
690
- def self.load_members
691
- object_of :requestEnvelope, RequestEnvelope, :required => true
692
- object_of :key, String, :required => true
693
- end
694
- end
695
-
696
-
697
-
698
- # The response to get the backup funding sources available for a preapproval.
699
- class GetAllowedFundingSourcesResponse < DataType
700
- def self.load_members
701
- include ResponseStatus
702
- object_of :responseEnvelope, ResponseEnvelope, :required => true
703
- array_of :fundingSource, FundingSource
704
- array_of :error, ErrorData
705
- end
706
- end
707
-
708
-
709
-
710
- # The request to get the options of a payment request.
711
- class GetPaymentOptionsRequest < DataType
712
- def self.load_members
713
- object_of :requestEnvelope, RequestEnvelope, :required => true
714
- object_of :payKey, String, :required => true
715
- end
716
- end
717
-
718
-
719
-
720
- # The response message for the GetPaymentOption request
721
- class GetPaymentOptionsResponse < DataType
722
- def self.load_members
723
- include ResponseStatus
724
- object_of :responseEnvelope, ResponseEnvelope, :required => true
725
- object_of :initiatingEntity, InitiatingEntity
726
- object_of :displayOptions, DisplayOptions
727
- object_of :shippingAddressId, String
728
- object_of :senderOptions, SenderOptions
729
- array_of :receiverOptions, ReceiverOptions
730
- array_of :error, ErrorData
731
- end
732
- end
733
-
734
-
735
-
736
- # The request to look up the details of a PayRequest. The PaymentDetailsRequest can be made with either a payKey, trackingId, or a transactionId of the PayRequest.
737
- class PaymentDetailsRequest < DataType
738
- def self.load_members
739
- object_of :requestEnvelope, RequestEnvelope, :required => true
740
- object_of :payKey, String
741
- object_of :transactionId, String
742
- object_of :trackingId, String
743
- end
744
- end
745
-
746
-
747
-
748
- # The details of the PayRequest as specified in the Pay operation.
749
- class PaymentDetailsResponse < DataType
750
- def self.load_members
751
- include ResponseStatus
752
- object_of :responseEnvelope, ResponseEnvelope, :required => true
753
- object_of :cancelUrl, String, :required => true
754
- object_of :currencyCode, String, :required => true
755
- object_of :ipnNotificationUrl, String
756
- object_of :memo, String
757
- object_of :paymentInfoList, PaymentInfoList, :required => true
758
- object_of :returnUrl, String, :required => true
759
- object_of :senderEmail, String
760
- object_of :status, String, :required => true
761
- object_of :trackingId, String
762
- object_of :payKey, String, :required => true
763
- object_of :actionType, String, :required => true
764
- object_of :feesPayer, String, :required => true
765
- object_of :reverseAllParallelPaymentsOnError, Boolean
766
- object_of :preapprovalKey, String
767
- object_of :fundingConstraint, FundingConstraint
768
- object_of :sender, SenderIdentifier
769
- array_of :error, ErrorData
770
- end
771
- end
772
-
773
-
774
-
775
- # The PayRequest contains the payment instructions to make from sender to receivers.
776
- class PayRequest < DataType
777
- def self.load_members
778
- object_of :requestEnvelope, RequestEnvelope, :required => true
779
- object_of :clientDetails, ClientDetailsType
780
- object_of :actionType, String, :required => true
781
- object_of :cancelUrl, String, :required => true
782
- object_of :currencyCode, String, :required => true
783
- object_of :feesPayer, String
784
- object_of :ipnNotificationUrl, String
785
- object_of :memo, String
786
- object_of :pin, String
787
- object_of :preapprovalKey, String
788
- object_of :receiverList, ReceiverList, :required => true
789
- object_of :reverseAllParallelPaymentsOnError, Boolean
790
- object_of :senderEmail, String
791
- object_of :returnUrl, String, :required => true
792
- object_of :trackingId, String
793
- object_of :fundingConstraint, FundingConstraint
794
- object_of :sender, SenderIdentifier
795
- end
796
- end
797
-
798
-
799
-
800
- # The PayResponse contains the result of the Pay operation. The payKey and execution status of the request should always be provided.
801
- class PayResponse < DataType
802
- def self.load_members
803
- include ResponseStatus
804
- object_of :responseEnvelope, ResponseEnvelope, :required => true
805
- object_of :payKey, String, :required => true
806
- object_of :paymentExecStatus, String, :required => true
807
- object_of :payErrorList, PayErrorList
808
- object_of :paymentInfoList, PaymentInfoList, :required => true
809
- object_of :sender, SenderIdentifier
810
- object_of :defaultFundingPlan, FundingPlan
811
- object_of :warningDataList, WarningDataList
812
- array_of :error, ErrorData
813
- end
814
- end
815
-
816
-
817
-
818
- # The request to look up the details of a Preapproval.
819
- class PreapprovalDetailsRequest < DataType
820
- def self.load_members
821
- object_of :requestEnvelope, RequestEnvelope, :required => true
822
- object_of :preapprovalKey, String, :required => true
823
- object_of :getBillingAddress, Boolean
824
- end
825
- end
826
-
827
-
828
-
829
- # The details of the Preapproval as specified in the Preapproval operation.
830
- class PreapprovalDetailsResponse < DataType
831
- def self.load_members
832
- include ResponseStatus
833
- object_of :responseEnvelope, ResponseEnvelope, :required => true
834
- object_of :approved, Boolean, :required => true
835
- object_of :cancelUrl, String, :required => true
836
- object_of :curPayments, Integer, :required => true
837
- object_of :curPaymentsAmount, Float, :required => true
838
- object_of :curPeriodAttempts, Integer
839
- object_of :curPeriodEndingDate, DateTime
840
- object_of :currencyCode, String, :required => true
841
- object_of :dateOfMonth, Integer
842
- object_of :dayOfWeek, DayOfWeek
843
- object_of :endingDate, DateTime
844
- object_of :maxAmountPerPayment, Float
845
- object_of :maxNumberOfPayments, Integer
846
- object_of :maxNumberOfPaymentsPerPeriod, Integer
847
- object_of :maxTotalAmountOfAllPayments, Float
848
- object_of :paymentPeriod, String
849
- object_of :pinType, String
850
- object_of :returnUrl, String, :required => true
851
- object_of :senderEmail, String
852
- object_of :memo, String
853
- object_of :startingDate, DateTime, :required => true
854
- object_of :status, String, :required => true
855
- object_of :ipnNotificationUrl, String
856
- object_of :addressList, AddressList
857
- object_of :feesPayer, String
858
- object_of :displayMaxTotalAmount, Boolean
859
- object_of :sender, SenderIdentifier
860
- array_of :error, ErrorData
861
- end
862
- end
863
-
864
-
865
-
866
- # A request to create a Preapproval. A Preapproval is an agreement between a Paypal account holder (the sender) and the API caller (the service invoker) to make payment(s) on the the sender's behalf with various limitations defined.
867
- class PreapprovalRequest < DataType
868
- def self.load_members
869
- object_of :requestEnvelope, RequestEnvelope, :required => true
870
- object_of :clientDetails, ClientDetailsType
871
- object_of :cancelUrl, String, :required => true
872
- object_of :currencyCode, String, :required => true
873
- object_of :dateOfMonth, Integer
874
- object_of :dayOfWeek, DayOfWeek
875
- object_of :endingDate, DateTime
876
- object_of :maxAmountPerPayment, Float
877
- object_of :maxNumberOfPayments, Integer
878
- object_of :maxNumberOfPaymentsPerPeriod, Integer
879
- object_of :maxTotalAmountOfAllPayments, Float
880
- object_of :paymentPeriod, String
881
- object_of :returnUrl, String, :required => true
882
- object_of :memo, String
883
- object_of :ipnNotificationUrl, String
884
- object_of :senderEmail, String
885
- object_of :startingDate, DateTime, :required => true
886
- object_of :pinType, String
887
- object_of :feesPayer, String
888
- object_of :displayMaxTotalAmount, Boolean
889
- object_of :requireInstantFundingSource, Boolean
890
- object_of :sender, SenderIdentifier
891
- end
892
- end
893
-
894
-
895
-
896
- # The result of the PreapprovalRequest is a preapprovalKey.
897
- class PreapprovalResponse < DataType
898
- def self.load_members
899
- include ResponseStatus
900
- object_of :responseEnvelope, ResponseEnvelope, :required => true
901
- object_of :preapprovalKey, String, :required => true
902
- array_of :error, ErrorData
903
- end
904
- end
905
-
906
-
907
-
908
- # A request to make a refund based on various criteria. A refund can be made against the entire payKey, an individual transaction belonging to a payKey, a tracking id, or a specific receiver of a payKey.
909
- class RefundRequest < DataType
910
- def self.load_members
911
- object_of :requestEnvelope, RequestEnvelope, :required => true
912
- object_of :currencyCode, String
913
- object_of :payKey, String
914
- object_of :transactionId, String
915
- object_of :trackingId, String
916
- object_of :receiverList, ReceiverList
917
- end
918
- end
919
-
920
-
921
-
922
- # The result of a Refund request.
923
- class RefundResponse < DataType
924
- def self.load_members
925
- include ResponseStatus
926
- object_of :responseEnvelope, ResponseEnvelope, :required => true
927
- object_of :currencyCode, String, :required => true
928
- object_of :refundInfoList, RefundInfoList, :required => true
929
- array_of :error, ErrorData
930
- end
931
- end
932
-
933
-
934
-
935
- # The request to set the options of a payment request.
936
- class SetPaymentOptionsRequest < DataType
937
- def self.load_members
938
- object_of :requestEnvelope, RequestEnvelope, :required => true
939
- object_of :payKey, String, :required => true
940
- object_of :initiatingEntity, InitiatingEntity
941
- object_of :displayOptions, DisplayOptions
942
- object_of :shippingAddressId, String
943
- object_of :senderOptions, SenderOptions
944
- array_of :receiverOptions, ReceiverOptions
945
- end
946
- end
947
-
948
-
949
-
950
- # The response message for the SetPaymentOption request
951
- class SetPaymentOptionsResponse < DataType
952
- def self.load_members
953
- include ResponseStatus
954
- object_of :responseEnvelope, ResponseEnvelope, :required => true
955
- array_of :error, ErrorData
956
- end
957
- end
958
-
959
-
960
-
961
- # The request to get the funding plans available for a payment.
962
- class GetFundingPlansRequest < DataType
963
- def self.load_members
964
- object_of :requestEnvelope, RequestEnvelope, :required => true
965
- object_of :payKey, String, :required => true
966
- end
967
- end
968
-
969
-
970
-
971
- # The response to get the funding plans available for a payment.
972
- class GetFundingPlansResponse < DataType
973
- def self.load_members
974
- include ResponseStatus
975
- object_of :responseEnvelope, ResponseEnvelope, :required => true
976
- array_of :fundingPlan, FundingPlan
977
- array_of :error, ErrorData
978
- end
979
- end
980
-
981
-
982
-
983
- # The request to get the addresses available for a payment.
984
- class GetAvailableShippingAddressesRequest < DataType
985
- def self.load_members
986
- object_of :requestEnvelope, RequestEnvelope, :required => true
987
- # The key for which to provide the available addresses. Key can be an AdaptivePayments key such as payKey or preapprovalKey
988
- object_of :key, String, :required => true
989
- end
990
- end
991
-
992
-
993
-
994
- # The response to get the shipping addresses available for a payment.
995
- class GetAvailableShippingAddressesResponse < DataType
996
- def self.load_members
997
- include ResponseStatus
998
- object_of :responseEnvelope, ResponseEnvelope, :required => true
999
- array_of :availableAddress, Address
1000
- array_of :error, ErrorData
1001
- end
1002
- end
1003
-
1004
-
1005
-
1006
- # The request to get the addresses available for a payment.
1007
- class GetShippingAddressesRequest < DataType
1008
- def self.load_members
1009
- object_of :requestEnvelope, RequestEnvelope, :required => true
1010
- # The key for which to provide the available addresses. Key can be an AdaptivePayments key such as payKey or preapprovalKey
1011
- object_of :key, String, :required => true
1012
- end
1013
- end
1014
-
1015
-
1016
-
1017
- # The response to get the shipping addresses available for a payment.
1018
- class GetShippingAddressesResponse < DataType
1019
- def self.load_members
1020
- include ResponseStatus
1021
- object_of :responseEnvelope, ResponseEnvelope, :required => true
1022
- object_of :selectedAddress, Address
1023
- array_of :error, ErrorData
1024
- end
1025
- end
1026
-
1027
-
1028
-
1029
- # The request to get the remaining limits for a user
1030
- class GetUserLimitsRequest < DataType
1031
- def self.load_members
1032
- object_of :requestEnvelope, RequestEnvelope, :required => true
1033
- # The account identifier for the user
1034
- object_of :user, AccountIdentifier, :required => true
1035
- object_of :country, String, :required => true
1036
- object_of :currencyCode, String, :required => true
1037
- # List of limit types
1038
- array_of :limitType, String, :required => true
1039
- end
1040
- end
1041
-
1042
-
1043
-
1044
- # A response that contains a list of remaining limits
1045
- class GetUserLimitsResponse < DataType
1046
- def self.load_members
1047
- include ResponseStatus
1048
- object_of :responseEnvelope, ResponseEnvelope, :required => true
1049
- array_of :userLimit, UserLimit, :required => true
1050
- object_of :warningDataList, WarningDataList
1051
- array_of :error, ErrorData
1052
- end
1053
- end
1054
-
1055
-
1056
-
1057
- # ReceiverInfo needs to be populate for the receiver who doesn't have paypal account.
1058
- class ReceiverInfo < AccountIdentifier
1059
- def self.load_members
1060
- # The two-character ISO country code of the home country of the Receiver
1061
- object_of :countryCode, String
1062
- object_of :firstName, String
1063
- object_of :lastName, String
1064
- end
1065
- end
1066
-
1067
-
1068
-
1069
- # FeeDisclosure contains the information related to Fees and taxes.
1070
- class FeeDisclosure < DataType
1071
- def self.load_members
1072
- object_of :fee, CurrencyType, :required => true
1073
- object_of :taxes, CurrencyType, :required => true
1074
- end
1075
- end
1076
-
1077
-
1078
-
1079
- # SenderDisclosure contains the disclosure related to Sender
1080
- class SenderDisclosure < DataType
1081
- def self.load_members
1082
- object_of :amountToTransfer, CurrencyType, :required => true
1083
- object_of :feeDisclosure, FeeDisclosure
1084
- object_of :totalAmountToTransfer, CurrencyType, :required => true
1085
- end
1086
- end
1087
-
1088
-
1089
-
1090
- # This holds the conversion rate from "Sender currency for one bucks to equivalent value in the receivers currency"
1091
- class ConversionRate < DataType
1092
- def self.load_members
1093
- object_of :senderCurrency, String, :required => true
1094
- object_of :receiverCurrency, String, :required => true
1095
- object_of :exchangeRate, Float, :required => true
1096
- end
1097
- end
1098
-
1099
-
1100
-
1101
- # ReceiverDisclosure contains the disclosure related to Receiver/Receivers.
1102
- class ReceiverDisclosure < DataType
1103
- def self.load_members
1104
- object_of :accountIdentifier, AccountIdentifier, :required => true
1105
- object_of :amountReceivedFromSender, CurrencyType, :required => true
1106
- # The two-character ISO country code of the home country of the Receiver
1107
- object_of :countryCode, String, :required => true
1108
- object_of :conversionRate, ConversionRate, :required => true
1109
- object_of :feeDisclosure, FeeDisclosure
1110
- object_of :totalAmountReceived, CurrencyType, :required => true
1111
- end
1112
- end
1113
-
1114
-
1115
-
1116
- class ReceiverDisclosureList < DataType
1117
- def self.load_members
1118
- array_of :receiverDisclosure, ReceiverDisclosure, :required => true
1119
- end
1120
- end
1121
-
1122
-
1123
-
1124
- class ReceiverInfoList < DataType
1125
- def self.load_members
1126
- array_of :receiverInfo, ReceiverInfo, :required => true
1127
- end
1128
- end
1129
-
1130
-
1131
-
1132
- # GetPrePaymentDisclosureRequest is used to get the PrePayment Disclosure.; GetPrePaymentDisclosureRequest contains following parameters payKey :The pay key that identifies the payment for which you want to retrieve details. this is the pay key returned in the PayResponse message. receiverInfoList : This is an optional.This needs to be provided in case of Unilateral scenario. receiverInfoList has a list of ReceiverInfo type. List is provided here to support in future for Parallel/Chained Payemnts. Each ReceiverInfo has following variables firstName : firstName of recipient. lastName : lastName of recipient. countryCode : CountryCode of Recipient.
1133
- class GetPrePaymentDisclosureRequest < DataType
1134
- def self.load_members
1135
- object_of :requestEnvelope, RequestEnvelope, :required => true
1136
- object_of :payKey, String, :required => true
1137
- object_of :receiverInfoList, ReceiverInfoList
1138
- end
1139
- end
1140
-
1141
-
1142
-
1143
- # GetPrePaymentDisclosureResponse contains the information related to PrePayment disclosure. status : indicates the status of response. If Status = RTR then it means that this is RTR transaction. If Status = NON_RTR then it means that this is non RTR transaction. If Status = MISSING_RECEIVER_COUNTRY_INFORMATION then it means the Receiver country information is not found in PayPal database. So merchant has to call the API again with same set of parameter along with Receiver country code.This is useful in case of Unilateral scenario. where receiver is not holding paypal account. feePayer:Indicates who has agreed to Pay a Fee for the RTR transaction. Merchant can use this information to decide who actually has to pay the fee . senderDisclosure : This Variable Holds the disclosure related to sender. receiverDisclosureList : This list contains the disclosure information related to receivers. Merchant can just parse the details what ever is avaliable in the response and display the same to user.
1144
- class GetPrePaymentDisclosureResponse < DataType
1145
- def self.load_members
1146
- include ResponseStatus
1147
- object_of :responseEnvelope, ResponseEnvelope, :required => true
1148
- object_of :status, Status, :required => true
1149
- object_of :feesPayer, String
1150
- object_of :senderDisclosure, SenderDisclosure
1151
- object_of :receiverDisclosureList, ReceiverDisclosureList
1152
- object_of :disclaimer, String
1153
- array_of :error, ErrorData
1154
- end
1155
- end
1156
-
1157
-
1158
-
1159
-
1160
-
1161
- constants.each do |data_type_klass|
1162
- data_type_klass = const_get(data_type_klass)
1163
- data_type_klass.load_members if defined? data_type_klass.load_members
1164
- end
1165
-
1166
- end
1167
- end
1168
- end
1
+ # Stub objects for AdaptivePayments
2
+ # Auto generated code
3
+
4
+ require 'paypal-sdk-core'
5
+
6
+ module PayPal::SDK
7
+ module AdaptivePayments
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 AccountIdentifier < DataType
37
+ def self.load_members
38
+ object_of :email, String
39
+ object_of :phone, PhoneNumberType
40
+ object_of :accountId, String
41
+ end
42
+ end
43
+
44
+
45
+
46
+ class BaseAddress < DataType
47
+ def self.load_members
48
+ object_of :line1, String, :required => true
49
+ object_of :line2, String
50
+ object_of :city, String, :required => true
51
+ object_of :state, String
52
+ object_of :postalCode, String
53
+ object_of :countryCode, String, :required => true
54
+ object_of :type, String
55
+ end
56
+ end
57
+
58
+
59
+
60
+ # Details about the end user of the application invoking this service.
61
+ class ClientDetailsType < DataType
62
+ def self.load_members
63
+ object_of :ipAddress, String
64
+ object_of :deviceId, String
65
+ object_of :applicationId, String
66
+ object_of :model, String
67
+ object_of :geoLocation, String
68
+ object_of :customerType, String
69
+ object_of :partnerName, String
70
+ object_of :customerId, String
71
+ end
72
+ end
73
+
74
+
75
+
76
+ class CurrencyType < DataType
77
+ def self.load_members
78
+ object_of :code, String, :required => true
79
+ object_of :amount, Float, :required => true
80
+ end
81
+ end
82
+
83
+
84
+
85
+ # This type contains the detailed error information resulting from the service operation.
86
+ class ErrorData < DataType
87
+ def self.load_members
88
+ object_of :errorId, Integer
89
+ object_of :domain, String
90
+ object_of :subdomain, String
91
+ object_of :severity, ErrorSeverity
92
+ object_of :category, ErrorCategory
93
+ object_of :message, String
94
+ object_of :exceptionId, String
95
+ array_of :parameter, ErrorParameter
96
+ end
97
+ end
98
+
99
+
100
+
101
+ class ErrorParameter < DataType
102
+ def self.load_members
103
+ add_attribute :name, :required => true
104
+ object_of :value, String, :required => true
105
+ end
106
+ end
107
+
108
+
109
+
110
+ # This specifies a fault, encapsulating error data, with specific error codes.
111
+ class FaultMessage < DataType
112
+ def self.load_members
113
+ include ResponseStatus
114
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
115
+ array_of :error, ErrorData
116
+ end
117
+ end
118
+
119
+
120
+
121
+ class PhoneNumberType < DataType
122
+ def self.load_members
123
+ object_of :countryCode, String, :required => true
124
+ object_of :phoneNumber, String, :required => true
125
+ object_of :extension, String
126
+ end
127
+ end
128
+
129
+
130
+
131
+ # This specifies the list of parameters with every request to the service.
132
+ class RequestEnvelope < DataType
133
+ def self.load_members
134
+ # 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.
135
+ object_of :detailLevel, DetailLevelCode
136
+ # This should be the standard RFC 3066 language identification tag, e.g., en_US.
137
+ object_of :errorLanguage, String, :required => true
138
+ end
139
+ end
140
+
141
+
142
+
143
+ # This specifies a list of parameters with every response from a service.
144
+ class ResponseEnvelope < DataType
145
+ def self.load_members
146
+ object_of :timestamp, DateTime, :required => true
147
+ # Application level acknowledgment code.
148
+ object_of :ack, AckCode, :required => true
149
+ object_of :correlationId, String, :required => true
150
+ object_of :build, String, :required => true
151
+ end
152
+ end
153
+
154
+
155
+
156
+ # 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.
157
+ class AckCode < EnumType
158
+ self.options = { 'SUCCESS' => 'Success', 'FAILURE' => 'Failure', 'WARNING' => 'Warning', 'SUCCESSWITHWARNING' => 'SuccessWithWarning', 'FAILUREWITHWARNING' => 'FailureWithWarning' }
159
+ end
160
+
161
+
162
+
163
+ class DayOfWeek < EnumType
164
+ self.options = { 'NODAYSPECIFIED' => 'NO_DAY_SPECIFIED', 'SUNDAY' => 'SUNDAY', 'MONDAY' => 'MONDAY', 'TUESDAY' => 'TUESDAY', 'WEDNESDAY' => 'WEDNESDAY', 'THURSDAY' => 'THURSDAY', 'FRIDAY' => 'FRIDAY', 'SATURDAY' => 'SATURDAY' }
165
+ end
166
+
167
+
168
+
169
+ # DetailLevelCodeType
170
+ class DetailLevelCode < EnumType
171
+ self.options = { 'RETURNALL' => 'ReturnAll' }
172
+ end
173
+
174
+
175
+
176
+ class ErrorCategory < EnumType
177
+ self.options = { 'SYSTEM' => 'System', 'APPLICATION' => 'Application', 'REQUEST' => 'Request' }
178
+ end
179
+
180
+
181
+
182
+ class ErrorSeverity < EnumType
183
+ self.options = { 'ERROR' => 'Error', 'WARNING' => 'Warning' }
184
+ end
185
+
186
+
187
+
188
+ class Status < EnumType
189
+ self.options = { 'RTR' => 'RTR', 'NONRTR' => 'NON_RTR', 'MISSINGRECEIVERCOUNTRYINFORMATION' => 'MISSING_RECEIVER_COUNTRY_INFORMATION' }
190
+ end
191
+
192
+
193
+
194
+ class AgreementType < EnumType
195
+ self.options = { 'OFFLINE' => 'OFFLINE', 'ONLINE' => 'ONLINE' }
196
+ end
197
+
198
+
199
+
200
+ class PhoneType < EnumType
201
+ self.options = { 'NONE' => 'NONE', 'HOME' => 'HOME', 'WORK' => 'WORK', 'BUSINESS' => 'BUSINESS', 'MOBILE' => 'MOBILE', 'FAXHOME' => 'FAX_HOME', 'FAXBUSINESS' => 'FAX_BUSINESS' }
202
+ end
203
+
204
+
205
+
206
+ class Address < DataType
207
+ def self.load_members
208
+ object_of :addresseeName, String
209
+ object_of :baseAddress, BaseAddress, :required => true
210
+ object_of :addressId, String
211
+ end
212
+ end
213
+
214
+
215
+
216
+ class AddressList < DataType
217
+ def self.load_members
218
+ array_of :address, Address, :required => true
219
+ end
220
+ end
221
+
222
+
223
+
224
+ # A list of ISO currency codes.
225
+ class CurrencyCodeList < DataType
226
+ def self.load_members
227
+ array_of :currencyCode, String, :required => true
228
+ end
229
+ end
230
+
231
+
232
+
233
+ # A list of estimated currency conversions for a base currency.
234
+ class CurrencyConversionList < DataType
235
+ def self.load_members
236
+ object_of :baseAmount, CurrencyType, :required => true
237
+ object_of :currencyList, CurrencyList, :required => true
238
+ end
239
+ end
240
+
241
+
242
+
243
+ # A table that contains a list of estimated currency conversions for a base currency in each row.
244
+ class CurrencyConversionTable < DataType
245
+ def self.load_members
246
+ array_of :currencyConversionList, CurrencyConversionList, :required => true
247
+ end
248
+ end
249
+
250
+
251
+
252
+ # A list of ISO currencies.
253
+ class CurrencyList < DataType
254
+ def self.load_members
255
+ array_of :currency, CurrencyType, :required => true
256
+ end
257
+ end
258
+
259
+
260
+
261
+ # Customizable options that a client application can specify for display purposes.
262
+ class DisplayOptions < DataType
263
+ def self.load_members
264
+ object_of :emailHeaderImageUrl, String
265
+ object_of :emailMarketingImageUrl, String
266
+ object_of :headerImageUrl, String
267
+ object_of :businessName, String
268
+ end
269
+ end
270
+
271
+
272
+
273
+ class ErrorList < DataType
274
+ def self.load_members
275
+ array_of :error, ErrorData, :required => true
276
+ end
277
+ end
278
+
279
+
280
+
281
+ class FundingConstraint < DataType
282
+ def self.load_members
283
+ object_of :allowedFundingType, FundingTypeList
284
+ end
285
+ end
286
+
287
+
288
+
289
+ # FundingTypeInfo represents one allowed funding type.
290
+ class FundingTypeInfo < DataType
291
+ def self.load_members
292
+ object_of :fundingType, String, :required => true
293
+ end
294
+ end
295
+
296
+
297
+
298
+ # ShippingAddressInfo.
299
+ class ShippingAddressInfo < DataType
300
+ def self.load_members
301
+ object_of :addresseeName, String
302
+ object_of :street1, String
303
+ object_of :street2, String
304
+ object_of :city, String
305
+ object_of :state, String
306
+ object_of :zip, String
307
+ object_of :country, String
308
+ array_of :phone, PhoneNumber
309
+ end
310
+ end
311
+
312
+
313
+
314
+ class FundingTypeList < DataType
315
+ def self.load_members
316
+ array_of :fundingTypeInfo, FundingTypeInfo, :required => true
317
+ end
318
+ end
319
+
320
+
321
+
322
+ # Describes the conversion between 2 currencies.
323
+ class CurrencyConversion < DataType
324
+ def self.load_members
325
+ object_of :from, CurrencyType, :required => true
326
+ object_of :to, CurrencyType, :required => true
327
+ object_of :exchangeRate, Float, :required => true
328
+ end
329
+ end
330
+
331
+
332
+
333
+ # Funding source information.
334
+ class FundingSource < DataType
335
+ def self.load_members
336
+ object_of :lastFourOfAccountNumber, String
337
+ object_of :type, String, :required => true
338
+ object_of :displayName, String
339
+ object_of :fundingSourceId, String
340
+ object_of :allowed, Boolean
341
+ end
342
+ end
343
+
344
+
345
+
346
+ # Amount to be charged to a particular funding source.
347
+ class FundingPlanCharge < DataType
348
+ def self.load_members
349
+ object_of :charge, CurrencyType, :required => true
350
+ object_of :fundingSource, FundingSource, :required => true
351
+ end
352
+ end
353
+
354
+
355
+
356
+ # FundingPlan describes the funding sources to be used for a specific payment.
357
+ class FundingPlan < DataType
358
+ def self.load_members
359
+ object_of :fundingPlanId, String, :required => true
360
+ object_of :fundingAmount, CurrencyType, :required => true
361
+ object_of :backupFundingSource, FundingSource
362
+ object_of :senderFees, CurrencyType
363
+ object_of :currencyConversion, CurrencyConversion
364
+ array_of :charge, FundingPlanCharge, :required => true
365
+ end
366
+ end
367
+
368
+
369
+
370
+ # Details about the party that initiated this payment. The API user is making this payment on behalf of the initiator. The initiator can simply be an institution or a customer of the institution.
371
+ class InitiatingEntity < DataType
372
+ def self.load_members
373
+ object_of :institutionCustomer, InstitutionCustomer
374
+ end
375
+ end
376
+
377
+
378
+
379
+ # The customer of the initiating institution
380
+ class InstitutionCustomer < DataType
381
+ def self.load_members
382
+ # The unique identifier as assigned to the institution.
383
+ object_of :institutionId, String, :required => true
384
+ # The first (given) name of the end consumer as known by the institution.
385
+ object_of :firstName, String, :required => true
386
+ # The last (family) name of the end consumer as known by the institution.
387
+ object_of :lastName, String, :required => true
388
+ object_of :middleName, String
389
+ # The full name of the end consumer as known by the institution.
390
+ object_of :displayName, String, :required => true
391
+ # The unique identifier as assigned to the end consumer by the institution.
392
+ object_of :institutionCustomerId, String, :required => true
393
+ # The two-character ISO country code of the home country of the end consumer
394
+ object_of :countryCode, String, :required => true
395
+ object_of :email, String
396
+ object_of :dateOfBirth, Date
397
+ object_of :address, BaseAddress
398
+ end
399
+ end
400
+
401
+
402
+
403
+ # Describes an individual item for an invoice.
404
+ class InvoiceItem < DataType
405
+ def self.load_members
406
+ object_of :name, String
407
+ object_of :identifier, String
408
+ object_of :price, Float
409
+ object_of :itemPrice, Float
410
+ object_of :itemCount, Integer
411
+ end
412
+ end
413
+
414
+
415
+
416
+ # Describes a payment for a particular receiver (merchant), contains list of additional per item details.
417
+ class InvoiceData < DataType
418
+ def self.load_members
419
+ array_of :item, InvoiceItem
420
+ object_of :totalTax, Float
421
+ object_of :totalShipping, Float
422
+ end
423
+ end
424
+
425
+
426
+
427
+ # The error that resulted from an attempt to make a payment to a receiver.
428
+ class PayError < DataType
429
+ def self.load_members
430
+ object_of :receiver, Receiver, :required => true
431
+ object_of :error, ErrorData, :required => true
432
+ end
433
+ end
434
+
435
+
436
+
437
+ class PayErrorList < DataType
438
+ def self.load_members
439
+ array_of :payError, PayError, :required => true
440
+ end
441
+ end
442
+
443
+
444
+
445
+ # PaymentInfo represents the payment attempt made to a Receiver of a PayRequest. If the execution of the payment has not yet completed, there will not be any transaction details.
446
+ class PaymentInfo < DataType
447
+ def self.load_members
448
+ object_of :transactionId, String
449
+ object_of :transactionStatus, String
450
+ object_of :receiver, Receiver, :required => true
451
+ object_of :refundedAmount, Float
452
+ object_of :pendingRefund, Boolean
453
+ object_of :senderTransactionId, String
454
+ object_of :senderTransactionStatus, String
455
+ object_of :pendingReason, String
456
+ end
457
+ end
458
+
459
+
460
+
461
+ class PaymentInfoList < DataType
462
+ def self.load_members
463
+ array_of :paymentInfo, PaymentInfo, :required => true
464
+ end
465
+ end
466
+
467
+
468
+
469
+ # Receiver is the party where funds are transferred to. A primary receiver receives a payment directly from the sender in a chained split payment. A primary receiver should not be specified when making a single or parallel split payment.
470
+ class Receiver < DataType
471
+ def self.load_members
472
+ object_of :amount, Float, :required => true
473
+ object_of :email, String
474
+ object_of :phone, PhoneNumberType
475
+ object_of :primary, Boolean
476
+ object_of :invoiceId, String
477
+ object_of :paymentType, String
478
+ object_of :paymentSubType, String
479
+ object_of :accountId, String
480
+ end
481
+ end
482
+
483
+
484
+
485
+ class ReceiverList < DataType
486
+ def self.load_members
487
+ array_of :receiver, Receiver, :required => true
488
+ end
489
+ end
490
+
491
+
492
+
493
+ # The sender identifier type contains information to identify a PayPal account.
494
+ class ReceiverIdentifier < AccountIdentifier
495
+ def self.load_members
496
+ end
497
+ end
498
+
499
+
500
+
501
+ # Options that apply to the receiver of a payment, allows setting additional details for payment using invoice.
502
+ class ReceiverOptions < DataType
503
+ def self.load_members
504
+ object_of :description, String
505
+ object_of :customId, String
506
+ object_of :invoiceData, InvoiceData
507
+ object_of :receiver, ReceiverIdentifier, :required => true
508
+ object_of :referrerCode, String
509
+ end
510
+ end
511
+
512
+
513
+
514
+ # RefundInfo represents the refund attempt made to a Receiver of a PayRequest.
515
+ class RefundInfo < DataType
516
+ def self.load_members
517
+ object_of :receiver, Receiver, :required => true
518
+ object_of :refundStatus, String
519
+ object_of :refundNetAmount, Float
520
+ object_of :refundFeeAmount, Float
521
+ object_of :refundGrossAmount, Float
522
+ object_of :totalOfAllRefunds, Float
523
+ object_of :refundHasBecomeFull, Boolean
524
+ object_of :encryptedRefundTransactionId, String
525
+ object_of :refundTransactionStatus, String
526
+ object_of :errorList, ErrorList
527
+ end
528
+ end
529
+
530
+
531
+
532
+ class RefundInfoList < DataType
533
+ def self.load_members
534
+ array_of :refundInfo, RefundInfo, :required => true
535
+ end
536
+ end
537
+
538
+
539
+
540
+ # Options that apply to the sender of a payment.
541
+ class SenderOptions < DataType
542
+ def self.load_members
543
+ # Require the user to select a shipping address during the web flow.
544
+ object_of :requireShippingAddressSelection, Boolean
545
+ # Determines whether or not the UI pages should display the shipping address set by user in this SetPaymentOptions request.
546
+ object_of :addressOverride, Boolean
547
+ object_of :referrerCode, String
548
+ object_of :shippingAddress, ShippingAddressInfo
549
+ end
550
+ end
551
+
552
+
553
+
554
+ # Details about the payer's tax info passed in by the merchant or partner.
555
+ class TaxIdDetails < DataType
556
+ def self.load_members
557
+ # Tax id of the merchant/business.
558
+ object_of :taxId, String
559
+ # Tax type of the Tax Id.
560
+ object_of :taxIdType, String
561
+ end
562
+ end
563
+
564
+
565
+
566
+ # The sender identifier type contains information to identify a PayPal account.
567
+ class SenderIdentifier < AccountIdentifier
568
+ def self.load_members
569
+ object_of :useCredentials, Boolean
570
+ object_of :taxIdDetails, TaxIdDetails
571
+ end
572
+ end
573
+
574
+
575
+
576
+ class UserLimit < DataType
577
+ def self.load_members
578
+ object_of :limitType, String, :required => true
579
+ object_of :limitAmount, CurrencyType, :required => true
580
+ end
581
+ end
582
+
583
+
584
+
585
+ # This type contains the detailed warning information resulting from the service operation.
586
+ class WarningData < DataType
587
+ def self.load_members
588
+ object_of :warningId, Integer
589
+ object_of :message, String
590
+ end
591
+ end
592
+
593
+
594
+
595
+ class WarningDataList < DataType
596
+ def self.load_members
597
+ array_of :warningData, WarningData, :required => true
598
+ end
599
+ end
600
+
601
+
602
+
603
+ # The request to cancel a Preapproval.
604
+ class CancelPreapprovalRequest < DataType
605
+ def self.load_members
606
+ object_of :requestEnvelope, RequestEnvelope, :required => true
607
+ object_of :preapprovalKey, String, :required => true
608
+ end
609
+ end
610
+
611
+
612
+
613
+ # The result of the CancelPreapprovalRequest.
614
+ class CancelPreapprovalResponse < DataType
615
+ def self.load_members
616
+ include ResponseStatus
617
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
618
+ array_of :error, ErrorData
619
+ end
620
+ end
621
+
622
+
623
+
624
+ # The request to confirm a Preapproval.
625
+ class ConfirmPreapprovalRequest < DataType
626
+ def self.load_members
627
+ object_of :requestEnvelope, RequestEnvelope, :required => true
628
+ object_of :preapprovalKey, String, :required => true
629
+ object_of :fundingSourceId, String
630
+ object_of :pin, String
631
+ object_of :agreementType, AgreementType
632
+ end
633
+ end
634
+
635
+
636
+
637
+ # The result of the ConfirmPreapprovalRequest.
638
+ class ConfirmPreapprovalResponse < DataType
639
+ def self.load_members
640
+ include ResponseStatus
641
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
642
+ array_of :error, ErrorData
643
+ end
644
+ end
645
+
646
+
647
+
648
+ # A request to convert one or more currencies into their estimated values in other currencies.
649
+ class ConvertCurrencyRequest < DataType
650
+ def self.load_members
651
+ object_of :requestEnvelope, RequestEnvelope, :required => true
652
+ object_of :baseAmountList, CurrencyList, :required => true
653
+ object_of :convertToCurrencyList, CurrencyCodeList, :required => true
654
+ # The two-character ISO country code where fx suppposed to happen
655
+ object_of :countryCode, String
656
+ object_of :conversionType, String
657
+ end
658
+ end
659
+
660
+
661
+
662
+ # A response that contains a table of estimated converted currencies based on the Convert Currency Request.
663
+ class ConvertCurrencyResponse < DataType
664
+ def self.load_members
665
+ include ResponseStatus
666
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
667
+ object_of :estimatedAmountTable, CurrencyConversionTable, :required => true
668
+ array_of :error, ErrorData
669
+ end
670
+ end
671
+
672
+
673
+
674
+ # The request to execute the payment request.
675
+ class ExecutePaymentRequest < DataType
676
+ def self.load_members
677
+ object_of :requestEnvelope, RequestEnvelope, :required => true
678
+ object_of :payKey, String, :required => true
679
+ # Describes the action that is performed by this API
680
+ object_of :actionType, String
681
+ object_of :fundingPlanId, String
682
+ end
683
+ end
684
+
685
+
686
+
687
+ # Contains information related to Post Payment Disclosure Details This contains 1.Receivers information 2.Funds Avalibility Date
688
+ class PostPaymentDisclosure < DataType
689
+ def self.load_members
690
+ object_of :accountIdentifier, AccountIdentifier, :required => true
691
+ object_of :fundsAvailabilityDate, Date
692
+ object_of :fundsAvailabilityDateDisclaimerText, String
693
+ end
694
+ end
695
+
696
+
697
+
698
+ class PostPaymentDisclosureList < DataType
699
+ def self.load_members
700
+ array_of :postPaymentDisclosure, PostPaymentDisclosure, :required => true
701
+ end
702
+ end
703
+
704
+
705
+
706
+ # The result of a payment execution.
707
+ class ExecutePaymentResponse < DataType
708
+ def self.load_members
709
+ include ResponseStatus
710
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
711
+ object_of :paymentExecStatus, String, :required => true
712
+ object_of :payErrorList, PayErrorList
713
+ object_of :postPaymentDisclosureList, PostPaymentDisclosureList
714
+ array_of :error, ErrorData
715
+ end
716
+ end
717
+
718
+
719
+
720
+ # The request to get the allowed funding sources available for a preapproval.
721
+ class GetAllowedFundingSourcesRequest < DataType
722
+ def self.load_members
723
+ object_of :requestEnvelope, RequestEnvelope, :required => true
724
+ object_of :key, String, :required => true
725
+ end
726
+ end
727
+
728
+
729
+
730
+ # The response to get the backup funding sources available for a preapproval.
731
+ class GetAllowedFundingSourcesResponse < DataType
732
+ def self.load_members
733
+ include ResponseStatus
734
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
735
+ array_of :fundingSource, FundingSource
736
+ array_of :error, ErrorData
737
+ end
738
+ end
739
+
740
+
741
+
742
+ # The request to get the options of a payment request.
743
+ class GetPaymentOptionsRequest < DataType
744
+ def self.load_members
745
+ object_of :requestEnvelope, RequestEnvelope, :required => true
746
+ object_of :payKey, String, :required => true
747
+ end
748
+ end
749
+
750
+
751
+
752
+ # The response message for the GetPaymentOption request
753
+ class GetPaymentOptionsResponse < DataType
754
+ def self.load_members
755
+ include ResponseStatus
756
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
757
+ object_of :initiatingEntity, InitiatingEntity
758
+ object_of :displayOptions, DisplayOptions
759
+ object_of :shippingAddressId, String
760
+ object_of :senderOptions, SenderOptions
761
+ array_of :receiverOptions, ReceiverOptions
762
+ array_of :error, ErrorData
763
+ end
764
+ end
765
+
766
+
767
+
768
+ # The request to look up the details of a PayRequest. The PaymentDetailsRequest can be made with either a payKey, trackingId, or a transactionId of the PayRequest.
769
+ class PaymentDetailsRequest < DataType
770
+ def self.load_members
771
+ object_of :requestEnvelope, RequestEnvelope, :required => true
772
+ object_of :payKey, String
773
+ object_of :transactionId, String
774
+ object_of :trackingId, String
775
+ end
776
+ end
777
+
778
+
779
+
780
+ # The details of the PayRequest as specified in the Pay operation.
781
+ class PaymentDetailsResponse < DataType
782
+ def self.load_members
783
+ include ResponseStatus
784
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
785
+ object_of :cancelUrl, String, :required => true
786
+ object_of :currencyCode, String, :required => true
787
+ object_of :ipnNotificationUrl, String
788
+ object_of :memo, String
789
+ object_of :paymentInfoList, PaymentInfoList, :required => true
790
+ object_of :returnUrl, String, :required => true
791
+ object_of :senderEmail, String
792
+ object_of :status, String, :required => true
793
+ object_of :trackingId, String
794
+ object_of :payKey, String, :required => true
795
+ object_of :actionType, String, :required => true
796
+ object_of :feesPayer, String, :required => true
797
+ object_of :reverseAllParallelPaymentsOnError, Boolean
798
+ object_of :preapprovalKey, String
799
+ object_of :fundingConstraint, FundingConstraint
800
+ object_of :sender, SenderIdentifier
801
+ object_of :shippingAddress, ShippingAddressInfo
802
+ object_of :payKeyExpirationDate, DateTime
803
+ array_of :error, ErrorData
804
+ end
805
+ end
806
+
807
+
808
+
809
+ # The PayRequest contains the payment instructions to make from sender to receivers.
810
+ class PayRequest < DataType
811
+ def self.load_members
812
+ object_of :requestEnvelope, RequestEnvelope, :required => true
813
+ object_of :clientDetails, ClientDetailsType
814
+ object_of :actionType, String, :required => true
815
+ object_of :cancelUrl, String, :required => true
816
+ object_of :currencyCode, String, :required => true
817
+ object_of :feesPayer, String
818
+ object_of :ipnNotificationUrl, String
819
+ object_of :memo, String
820
+ object_of :pin, String
821
+ object_of :preapprovalKey, String
822
+ object_of :receiverList, ReceiverList, :required => true
823
+ object_of :reverseAllParallelPaymentsOnError, Boolean
824
+ object_of :senderEmail, String
825
+ object_of :returnUrl, String, :required => true
826
+ object_of :trackingId, String
827
+ object_of :fundingConstraint, FundingConstraint
828
+ object_of :sender, SenderIdentifier
829
+ # The pay key expires after the duration specified in this column. If not provided, it defaults to normal expiration behavior. Valid values are 5 minutes to 30 days.
830
+ object_of :payKeyDuration, String
831
+ end
832
+ end
833
+
834
+
835
+
836
+ # The PayResponse contains the result of the Pay operation. The payKey and execution status of the request should always be provided.
837
+ class PayResponse < DataType
838
+ def self.load_members
839
+ include ResponseStatus
840
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
841
+ object_of :payKey, String, :required => true
842
+ object_of :paymentExecStatus, String, :required => true
843
+ object_of :payErrorList, PayErrorList
844
+ object_of :paymentInfoList, PaymentInfoList, :required => true
845
+ object_of :sender, SenderIdentifier
846
+ object_of :defaultFundingPlan, FundingPlan
847
+ object_of :warningDataList, WarningDataList
848
+ array_of :error, ErrorData
849
+ end
850
+ end
851
+
852
+
853
+
854
+ # The request to look up the details of a Preapproval.
855
+ class PreapprovalDetailsRequest < DataType
856
+ def self.load_members
857
+ object_of :requestEnvelope, RequestEnvelope, :required => true
858
+ object_of :preapprovalKey, String, :required => true
859
+ object_of :getBillingAddress, Boolean
860
+ end
861
+ end
862
+
863
+
864
+
865
+ # The details of the Preapproval as specified in the Preapproval operation.
866
+ class PreapprovalDetailsResponse < DataType
867
+ def self.load_members
868
+ include ResponseStatus
869
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
870
+ object_of :approved, Boolean, :required => true
871
+ object_of :cancelUrl, String, :required => true
872
+ object_of :curPayments, Integer, :required => true
873
+ object_of :curPaymentsAmount, Float, :required => true
874
+ object_of :curPeriodAttempts, Integer
875
+ object_of :curPeriodEndingDate, DateTime
876
+ object_of :currencyCode, String, :required => true
877
+ object_of :dateOfMonth, Integer
878
+ object_of :dayOfWeek, DayOfWeek
879
+ object_of :endingDate, DateTime
880
+ object_of :maxAmountPerPayment, Float
881
+ object_of :maxNumberOfPayments, Integer
882
+ object_of :maxNumberOfPaymentsPerPeriod, Integer
883
+ object_of :maxTotalAmountOfAllPayments, Float
884
+ object_of :paymentPeriod, String
885
+ object_of :pinType, String
886
+ object_of :returnUrl, String, :required => true
887
+ object_of :senderEmail, String
888
+ object_of :memo, String
889
+ object_of :startingDate, DateTime, :required => true
890
+ object_of :status, String, :required => true
891
+ object_of :ipnNotificationUrl, String
892
+ object_of :addressList, AddressList
893
+ object_of :feesPayer, String
894
+ object_of :displayMaxTotalAmount, Boolean
895
+ object_of :sender, SenderIdentifier
896
+ object_of :agreementType, AgreementType
897
+ array_of :error, ErrorData
898
+ end
899
+ end
900
+
901
+
902
+
903
+ # A request to create a Preapproval. A Preapproval is an agreement between a Paypal account holder (the sender) and the API caller (the service invoker) to make payment(s) on the the sender's behalf with various limitations defined.
904
+ class PreapprovalRequest < DataType
905
+ def self.load_members
906
+ object_of :requestEnvelope, RequestEnvelope, :required => true
907
+ object_of :clientDetails, ClientDetailsType
908
+ object_of :cancelUrl, String, :required => true
909
+ object_of :currencyCode, String, :required => true
910
+ object_of :dateOfMonth, Integer
911
+ object_of :dayOfWeek, DayOfWeek
912
+ object_of :endingDate, DateTime
913
+ object_of :maxAmountPerPayment, Float
914
+ object_of :maxNumberOfPayments, Integer
915
+ object_of :maxNumberOfPaymentsPerPeriod, Integer
916
+ object_of :maxTotalAmountOfAllPayments, Float
917
+ object_of :paymentPeriod, String
918
+ object_of :returnUrl, String, :required => true
919
+ object_of :memo, String
920
+ object_of :ipnNotificationUrl, String
921
+ object_of :senderEmail, String
922
+ object_of :startingDate, DateTime, :required => true
923
+ object_of :pinType, String
924
+ object_of :feesPayer, String
925
+ object_of :displayMaxTotalAmount, Boolean
926
+ object_of :requireInstantFundingSource, Boolean
927
+ object_of :sender, SenderIdentifier
928
+ end
929
+ end
930
+
931
+
932
+
933
+ # The result of the PreapprovalRequest is a preapprovalKey.
934
+ class PreapprovalResponse < DataType
935
+ def self.load_members
936
+ include ResponseStatus
937
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
938
+ object_of :preapprovalKey, String, :required => true
939
+ array_of :error, ErrorData
940
+ end
941
+ end
942
+
943
+
944
+
945
+ # A request to make a refund based on various criteria. A refund can be made against the entire payKey, an individual transaction belonging to a payKey, a tracking id, or a specific receiver of a payKey.
946
+ class RefundRequest < DataType
947
+ def self.load_members
948
+ object_of :requestEnvelope, RequestEnvelope, :required => true
949
+ object_of :currencyCode, String
950
+ object_of :payKey, String
951
+ object_of :transactionId, String
952
+ object_of :trackingId, String
953
+ object_of :receiverList, ReceiverList
954
+ end
955
+ end
956
+
957
+
958
+
959
+ # The result of a Refund request.
960
+ class RefundResponse < DataType
961
+ def self.load_members
962
+ include ResponseStatus
963
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
964
+ object_of :currencyCode, String, :required => true
965
+ object_of :refundInfoList, RefundInfoList, :required => true
966
+ array_of :error, ErrorData
967
+ end
968
+ end
969
+
970
+
971
+
972
+ # Phone number with Type of phone number
973
+ class PhoneNumber < PhoneNumberType
974
+ def self.load_members
975
+ object_of :type, PhoneType, :required => true
976
+ end
977
+ end
978
+
979
+
980
+
981
+ # The request to set the options of a payment request.
982
+ class SetPaymentOptionsRequest < DataType
983
+ def self.load_members
984
+ object_of :requestEnvelope, RequestEnvelope, :required => true
985
+ object_of :payKey, String, :required => true
986
+ object_of :initiatingEntity, InitiatingEntity
987
+ object_of :displayOptions, DisplayOptions
988
+ object_of :shippingAddressId, String
989
+ object_of :senderOptions, SenderOptions
990
+ array_of :receiverOptions, ReceiverOptions
991
+ end
992
+ end
993
+
994
+
995
+
996
+ # The response message for the SetPaymentOption request
997
+ class SetPaymentOptionsResponse < DataType
998
+ def self.load_members
999
+ include ResponseStatus
1000
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1001
+ array_of :error, ErrorData
1002
+ end
1003
+ end
1004
+
1005
+
1006
+
1007
+ # The request to get the funding plans available for a payment.
1008
+ class GetFundingPlansRequest < DataType
1009
+ def self.load_members
1010
+ object_of :requestEnvelope, RequestEnvelope, :required => true
1011
+ object_of :payKey, String, :required => true
1012
+ end
1013
+ end
1014
+
1015
+
1016
+
1017
+ # The response to get the funding plans available for a payment.
1018
+ class GetFundingPlansResponse < DataType
1019
+ def self.load_members
1020
+ include ResponseStatus
1021
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1022
+ array_of :fundingPlan, FundingPlan
1023
+ array_of :error, ErrorData
1024
+ end
1025
+ end
1026
+
1027
+
1028
+
1029
+ # The request to get the addresses available for a payment.
1030
+ class GetAvailableShippingAddressesRequest < DataType
1031
+ def self.load_members
1032
+ object_of :requestEnvelope, RequestEnvelope, :required => true
1033
+ # The key for which to provide the available addresses. Key can be an AdaptivePayments key such as payKey or preapprovalKey
1034
+ object_of :key, String, :required => true
1035
+ end
1036
+ end
1037
+
1038
+
1039
+
1040
+ # The response to get the shipping addresses available for a payment.
1041
+ class GetAvailableShippingAddressesResponse < DataType
1042
+ def self.load_members
1043
+ include ResponseStatus
1044
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1045
+ array_of :availableAddress, Address
1046
+ array_of :error, ErrorData
1047
+ end
1048
+ end
1049
+
1050
+
1051
+
1052
+ # The request to get the addresses available for a payment.
1053
+ class GetShippingAddressesRequest < DataType
1054
+ def self.load_members
1055
+ object_of :requestEnvelope, RequestEnvelope, :required => true
1056
+ # The key for which to provide the available addresses. Key can be an AdaptivePayments key such as payKey or preapprovalKey
1057
+ object_of :key, String, :required => true
1058
+ end
1059
+ end
1060
+
1061
+
1062
+
1063
+ # The response to get the shipping addresses available for a payment.
1064
+ class GetShippingAddressesResponse < DataType
1065
+ def self.load_members
1066
+ include ResponseStatus
1067
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1068
+ object_of :selectedAddress, Address
1069
+ array_of :error, ErrorData
1070
+ end
1071
+ end
1072
+
1073
+
1074
+
1075
+ # The request to get the remaining limits for a user
1076
+ class GetUserLimitsRequest < DataType
1077
+ def self.load_members
1078
+ object_of :requestEnvelope, RequestEnvelope, :required => true
1079
+ # The account identifier for the user
1080
+ object_of :user, AccountIdentifier, :required => true
1081
+ object_of :country, String, :required => true
1082
+ object_of :currencyCode, String, :required => true
1083
+ # List of limit types
1084
+ array_of :limitType, String, :required => true
1085
+ end
1086
+ end
1087
+
1088
+
1089
+
1090
+ # A response that contains a list of remaining limits
1091
+ class GetUserLimitsResponse < DataType
1092
+ def self.load_members
1093
+ include ResponseStatus
1094
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1095
+ array_of :userLimit, UserLimit, :required => true
1096
+ object_of :warningDataList, WarningDataList
1097
+ array_of :error, ErrorData
1098
+ end
1099
+ end
1100
+
1101
+
1102
+
1103
+ # ReceiverInfo needs to be populate for the receiver who doesn't have paypal account.
1104
+ class ReceiverInfo < AccountIdentifier
1105
+ def self.load_members
1106
+ # The two-character ISO country code of the home country of the Receiver
1107
+ object_of :countryCode, String
1108
+ object_of :firstName, String
1109
+ object_of :lastName, String
1110
+ end
1111
+ end
1112
+
1113
+
1114
+
1115
+ # FeeDisclosure contains the information related to Fees and taxes.
1116
+ class FeeDisclosure < DataType
1117
+ def self.load_members
1118
+ object_of :fee, CurrencyType, :required => true
1119
+ object_of :taxes, CurrencyType, :required => true
1120
+ end
1121
+ end
1122
+
1123
+
1124
+
1125
+ # SenderDisclosure contains the disclosure related to Sender
1126
+ class SenderDisclosure < DataType
1127
+ def self.load_members
1128
+ object_of :amountToTransfer, CurrencyType, :required => true
1129
+ object_of :feeDisclosure, FeeDisclosure
1130
+ object_of :totalAmountToTransfer, CurrencyType, :required => true
1131
+ end
1132
+ end
1133
+
1134
+
1135
+
1136
+ # This holds the conversion rate from "Sender currency for one bucks to equivalent value in the receivers currency"
1137
+ class ConversionRate < DataType
1138
+ def self.load_members
1139
+ object_of :senderCurrency, String, :required => true
1140
+ object_of :receiverCurrency, String, :required => true
1141
+ object_of :exchangeRate, Float, :required => true
1142
+ end
1143
+ end
1144
+
1145
+
1146
+
1147
+ # ReceiverDisclosure contains the disclosure related to Receiver/Receivers.
1148
+ class ReceiverDisclosure < DataType
1149
+ def self.load_members
1150
+ object_of :accountIdentifier, AccountIdentifier, :required => true
1151
+ object_of :amountReceivedFromSender, CurrencyType, :required => true
1152
+ # The two-character ISO country code of the home country of the Receiver
1153
+ object_of :countryCode, String, :required => true
1154
+ object_of :conversionRate, ConversionRate, :required => true
1155
+ object_of :feeDisclosure, FeeDisclosure
1156
+ object_of :totalAmountReceived, CurrencyType, :required => true
1157
+ end
1158
+ end
1159
+
1160
+
1161
+
1162
+ class ReceiverDisclosureList < DataType
1163
+ def self.load_members
1164
+ array_of :receiverDisclosure, ReceiverDisclosure, :required => true
1165
+ end
1166
+ end
1167
+
1168
+
1169
+
1170
+ class ReceiverInfoList < DataType
1171
+ def self.load_members
1172
+ array_of :receiverInfo, ReceiverInfo, :required => true
1173
+ end
1174
+ end
1175
+
1176
+
1177
+
1178
+ # GetPrePaymentDisclosureRequest is used to get the PrePayment Disclosure.; GetPrePaymentDisclosureRequest contains following parameters payKey :The pay key that identifies the payment for which you want to retrieve details. this is the pay key returned in the PayResponse message. receiverInfoList : This is an optional.This needs to be provided in case of Unilateral scenario. receiverInfoList has a list of ReceiverInfo type. List is provided here to support in future for Parallel/Chained Payemnts. Each ReceiverInfo has following variables firstName : firstName of recipient. lastName : lastName of recipient. countryCode : CountryCode of Recipient.
1179
+ class GetPrePaymentDisclosureRequest < DataType
1180
+ def self.load_members
1181
+ object_of :requestEnvelope, RequestEnvelope, :required => true
1182
+ object_of :payKey, String, :required => true
1183
+ object_of :receiverInfoList, ReceiverInfoList
1184
+ end
1185
+ end
1186
+
1187
+
1188
+
1189
+ # GetPrePaymentDisclosureResponse contains the information related to PrePayment disclosure. status : indicates the status of response. If Status = RTR then it means that this is RTR transaction. If Status = NON_RTR then it means that this is non RTR transaction. If Status = MISSING_RECEIVER_COUNTRY_INFORMATION then it means the Receiver country information is not found in PayPal database. So merchant has to call the API again with same set of parameter along with Receiver country code.This is useful in case of Unilateral scenario. where receiver is not holding paypal account. feePayer:Indicates who has agreed to Pay a Fee for the RTR transaction. Merchant can use this information to decide who actually has to pay the fee . senderDisclosure : This Variable Holds the disclosure related to sender. receiverDisclosureList : This list contains the disclosure information related to receivers. Merchant can just parse the details what ever is avaliable in the response and display the same to user.
1190
+ class GetPrePaymentDisclosureResponse < DataType
1191
+ def self.load_members
1192
+ include ResponseStatus
1193
+ object_of :responseEnvelope, ResponseEnvelope, :required => true
1194
+ object_of :status, Status, :required => true
1195
+ object_of :feesPayer, String
1196
+ object_of :senderDisclosure, SenderDisclosure
1197
+ object_of :receiverDisclosureList, ReceiverDisclosureList
1198
+ object_of :disclaimer, String
1199
+ array_of :error, ErrorData
1200
+ end
1201
+ end
1202
+
1203
+
1204
+
1205
+
1206
+
1207
+ constants.each do |data_type_klass|
1208
+ data_type_klass = const_get(data_type_klass)
1209
+ data_type_klass.load_members if defined? data_type_klass.load_members
1210
+ end
1211
+
1212
+ end
1213
+ end
1214
+ end