paypal-sdk-adaptivepayments 1.96.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +17 -0
- data/README.md +163 -0
- data/Rakefile +14 -0
- data/lib/paypal-sdk/adaptive_payments/api.rb +21 -0
- data/lib/paypal-sdk/adaptive_payments/data_types.rb +998 -0
- data/lib/paypal-sdk/adaptive_payments/services.rb +325 -0
- data/lib/paypal-sdk/adaptive_payments/version.rb +7 -0
- data/lib/paypal-sdk/adaptive_payments.rb +16 -0
- data/lib/paypal-sdk-adaptivepayments.rb +2 -0
- data/spec/adaptive_payments_spec.rb +27 -0
- data/spec/config/cert_key.pem +33 -0
- data/spec/config/paypal.yml +25 -0
- data/spec/convert_currency_spec.rb +39 -0
- data/spec/spec_helper.rb +6 -0
- metadata +86 -0
@@ -0,0 +1,325 @@
|
|
1
|
+
require 'paypal-sdk-core'
|
2
|
+
require 'paypal-sdk/adaptive_payments/data_types'
|
3
|
+
|
4
|
+
# AUTO GENERATED code for AdaptivePayments
|
5
|
+
module PayPal::SDK
|
6
|
+
module AdaptivePayments
|
7
|
+
|
8
|
+
# Service Version
|
9
|
+
SERVICE_VERSION = "1.8.2"
|
10
|
+
# Service Name
|
11
|
+
SERVICE_NAME = "AdaptivePayments"
|
12
|
+
|
13
|
+
module Services
|
14
|
+
include DataTypes
|
15
|
+
|
16
|
+
|
17
|
+
# Service Call: CancelPreapproval
|
18
|
+
# @param CancelPreapprovalRequest
|
19
|
+
# @return CancelPreapprovalResponse
|
20
|
+
def CancelPreapproval(options = {} , http_header = {})
|
21
|
+
request_object = BuildCancelPreapproval(options)
|
22
|
+
request_hash = request_object.to_hash
|
23
|
+
response_hash = request("CancelPreapproval", request_hash, http_header)
|
24
|
+
CancelPreapprovalResponse.new(response_hash)
|
25
|
+
end
|
26
|
+
alias_method :cancel_preapproval, :CancelPreapproval
|
27
|
+
|
28
|
+
def BuildCancelPreapproval(options = {}, &block)
|
29
|
+
klass = CancelPreapprovalRequest
|
30
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
31
|
+
object.instance_eval(&block) if block
|
32
|
+
object
|
33
|
+
end
|
34
|
+
alias_method :build_cancel_preapproval, :BuildCancelPreapproval
|
35
|
+
|
36
|
+
# Service Call: ConfirmPreapproval
|
37
|
+
# @param ConfirmPreapprovalRequest
|
38
|
+
# @return ConfirmPreapprovalResponse
|
39
|
+
def ConfirmPreapproval(options = {} , http_header = {})
|
40
|
+
request_object = BuildConfirmPreapproval(options)
|
41
|
+
request_hash = request_object.to_hash
|
42
|
+
response_hash = request("ConfirmPreapproval", request_hash, http_header)
|
43
|
+
ConfirmPreapprovalResponse.new(response_hash)
|
44
|
+
end
|
45
|
+
alias_method :confirm_preapproval, :ConfirmPreapproval
|
46
|
+
|
47
|
+
def BuildConfirmPreapproval(options = {}, &block)
|
48
|
+
klass = ConfirmPreapprovalRequest
|
49
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
50
|
+
object.instance_eval(&block) if block
|
51
|
+
object
|
52
|
+
end
|
53
|
+
alias_method :build_confirm_preapproval, :BuildConfirmPreapproval
|
54
|
+
|
55
|
+
# Service Call: ConvertCurrency
|
56
|
+
# @param ConvertCurrencyRequest
|
57
|
+
# @return ConvertCurrencyResponse
|
58
|
+
def ConvertCurrency(options = {} , http_header = {})
|
59
|
+
request_object = BuildConvertCurrency(options)
|
60
|
+
request_hash = request_object.to_hash
|
61
|
+
response_hash = request("ConvertCurrency", request_hash, http_header)
|
62
|
+
ConvertCurrencyResponse.new(response_hash)
|
63
|
+
end
|
64
|
+
alias_method :convert_currency, :ConvertCurrency
|
65
|
+
|
66
|
+
def BuildConvertCurrency(options = {}, &block)
|
67
|
+
klass = ConvertCurrencyRequest
|
68
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
69
|
+
object.instance_eval(&block) if block
|
70
|
+
object
|
71
|
+
end
|
72
|
+
alias_method :build_convert_currency, :BuildConvertCurrency
|
73
|
+
|
74
|
+
# Service Call: ExecutePayment
|
75
|
+
# @param ExecutePaymentRequest
|
76
|
+
# @return ExecutePaymentResponse
|
77
|
+
def ExecutePayment(options = {} , http_header = {})
|
78
|
+
request_object = BuildExecutePayment(options)
|
79
|
+
request_hash = request_object.to_hash
|
80
|
+
response_hash = request("ExecutePayment", request_hash, http_header)
|
81
|
+
ExecutePaymentResponse.new(response_hash)
|
82
|
+
end
|
83
|
+
alias_method :execute_payment, :ExecutePayment
|
84
|
+
|
85
|
+
def BuildExecutePayment(options = {}, &block)
|
86
|
+
klass = ExecutePaymentRequest
|
87
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
88
|
+
object.instance_eval(&block) if block
|
89
|
+
object
|
90
|
+
end
|
91
|
+
alias_method :build_execute_payment, :BuildExecutePayment
|
92
|
+
|
93
|
+
# Service Call: GetAllowedFundingSources
|
94
|
+
# @param GetAllowedFundingSourcesRequest
|
95
|
+
# @return GetAllowedFundingSourcesResponse
|
96
|
+
def GetAllowedFundingSources(options = {} , http_header = {})
|
97
|
+
request_object = BuildGetAllowedFundingSources(options)
|
98
|
+
request_hash = request_object.to_hash
|
99
|
+
response_hash = request("GetAllowedFundingSources", request_hash, http_header)
|
100
|
+
GetAllowedFundingSourcesResponse.new(response_hash)
|
101
|
+
end
|
102
|
+
alias_method :get_allowed_funding_sources, :GetAllowedFundingSources
|
103
|
+
|
104
|
+
def BuildGetAllowedFundingSources(options = {}, &block)
|
105
|
+
klass = GetAllowedFundingSourcesRequest
|
106
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
107
|
+
object.instance_eval(&block) if block
|
108
|
+
object
|
109
|
+
end
|
110
|
+
alias_method :build_get_allowed_funding_sources, :BuildGetAllowedFundingSources
|
111
|
+
|
112
|
+
# Service Call: GetPaymentOptions
|
113
|
+
# @param GetPaymentOptionsRequest
|
114
|
+
# @return GetPaymentOptionsResponse
|
115
|
+
def GetPaymentOptions(options = {} , http_header = {})
|
116
|
+
request_object = BuildGetPaymentOptions(options)
|
117
|
+
request_hash = request_object.to_hash
|
118
|
+
response_hash = request("GetPaymentOptions", request_hash, http_header)
|
119
|
+
GetPaymentOptionsResponse.new(response_hash)
|
120
|
+
end
|
121
|
+
alias_method :get_payment_options, :GetPaymentOptions
|
122
|
+
|
123
|
+
def BuildGetPaymentOptions(options = {}, &block)
|
124
|
+
klass = GetPaymentOptionsRequest
|
125
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
126
|
+
object.instance_eval(&block) if block
|
127
|
+
object
|
128
|
+
end
|
129
|
+
alias_method :build_get_payment_options, :BuildGetPaymentOptions
|
130
|
+
|
131
|
+
# Service Call: PaymentDetails
|
132
|
+
# @param PaymentDetailsRequest
|
133
|
+
# @return PaymentDetailsResponse
|
134
|
+
def PaymentDetails(options = {} , http_header = {})
|
135
|
+
request_object = BuildPaymentDetails(options)
|
136
|
+
request_hash = request_object.to_hash
|
137
|
+
response_hash = request("PaymentDetails", request_hash, http_header)
|
138
|
+
PaymentDetailsResponse.new(response_hash)
|
139
|
+
end
|
140
|
+
alias_method :payment_details, :PaymentDetails
|
141
|
+
|
142
|
+
def BuildPaymentDetails(options = {}, &block)
|
143
|
+
klass = PaymentDetailsRequest
|
144
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
145
|
+
object.instance_eval(&block) if block
|
146
|
+
object
|
147
|
+
end
|
148
|
+
alias_method :build_payment_details, :BuildPaymentDetails
|
149
|
+
|
150
|
+
# Service Call: Pay
|
151
|
+
# @param PayRequest
|
152
|
+
# @return PayResponse
|
153
|
+
def Pay(options = {} , http_header = {})
|
154
|
+
request_object = BuildPay(options)
|
155
|
+
request_hash = request_object.to_hash
|
156
|
+
response_hash = request("Pay", request_hash, http_header)
|
157
|
+
PayResponse.new(response_hash)
|
158
|
+
end
|
159
|
+
alias_method :pay, :Pay
|
160
|
+
|
161
|
+
def BuildPay(options = {}, &block)
|
162
|
+
klass = PayRequest
|
163
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
164
|
+
object.instance_eval(&block) if block
|
165
|
+
object
|
166
|
+
end
|
167
|
+
alias_method :build_pay, :BuildPay
|
168
|
+
|
169
|
+
# Service Call: PreapprovalDetails
|
170
|
+
# @param PreapprovalDetailsRequest
|
171
|
+
# @return PreapprovalDetailsResponse
|
172
|
+
def PreapprovalDetails(options = {} , http_header = {})
|
173
|
+
request_object = BuildPreapprovalDetails(options)
|
174
|
+
request_hash = request_object.to_hash
|
175
|
+
response_hash = request("PreapprovalDetails", request_hash, http_header)
|
176
|
+
PreapprovalDetailsResponse.new(response_hash)
|
177
|
+
end
|
178
|
+
alias_method :preapproval_details, :PreapprovalDetails
|
179
|
+
|
180
|
+
def BuildPreapprovalDetails(options = {}, &block)
|
181
|
+
klass = PreapprovalDetailsRequest
|
182
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
183
|
+
object.instance_eval(&block) if block
|
184
|
+
object
|
185
|
+
end
|
186
|
+
alias_method :build_preapproval_details, :BuildPreapprovalDetails
|
187
|
+
|
188
|
+
# Service Call: Preapproval
|
189
|
+
# @param PreapprovalRequest
|
190
|
+
# @return PreapprovalResponse
|
191
|
+
def Preapproval(options = {} , http_header = {})
|
192
|
+
request_object = BuildPreapproval(options)
|
193
|
+
request_hash = request_object.to_hash
|
194
|
+
response_hash = request("Preapproval", request_hash, http_header)
|
195
|
+
PreapprovalResponse.new(response_hash)
|
196
|
+
end
|
197
|
+
alias_method :preapproval, :Preapproval
|
198
|
+
|
199
|
+
def BuildPreapproval(options = {}, &block)
|
200
|
+
klass = PreapprovalRequest
|
201
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
202
|
+
object.instance_eval(&block) if block
|
203
|
+
object
|
204
|
+
end
|
205
|
+
alias_method :build_preapproval, :BuildPreapproval
|
206
|
+
|
207
|
+
# Service Call: Refund
|
208
|
+
# @param RefundRequest
|
209
|
+
# @return RefundResponse
|
210
|
+
def Refund(options = {} , http_header = {})
|
211
|
+
request_object = BuildRefund(options)
|
212
|
+
request_hash = request_object.to_hash
|
213
|
+
response_hash = request("Refund", request_hash, http_header)
|
214
|
+
RefundResponse.new(response_hash)
|
215
|
+
end
|
216
|
+
alias_method :refund, :Refund
|
217
|
+
|
218
|
+
def BuildRefund(options = {}, &block)
|
219
|
+
klass = RefundRequest
|
220
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
221
|
+
object.instance_eval(&block) if block
|
222
|
+
object
|
223
|
+
end
|
224
|
+
alias_method :build_refund, :BuildRefund
|
225
|
+
|
226
|
+
# Service Call: SetPaymentOptions
|
227
|
+
# @param SetPaymentOptionsRequest
|
228
|
+
# @return SetPaymentOptionsResponse
|
229
|
+
def SetPaymentOptions(options = {} , http_header = {})
|
230
|
+
request_object = BuildSetPaymentOptions(options)
|
231
|
+
request_hash = request_object.to_hash
|
232
|
+
response_hash = request("SetPaymentOptions", request_hash, http_header)
|
233
|
+
SetPaymentOptionsResponse.new(response_hash)
|
234
|
+
end
|
235
|
+
alias_method :set_payment_options, :SetPaymentOptions
|
236
|
+
|
237
|
+
def BuildSetPaymentOptions(options = {}, &block)
|
238
|
+
klass = SetPaymentOptionsRequest
|
239
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
240
|
+
object.instance_eval(&block) if block
|
241
|
+
object
|
242
|
+
end
|
243
|
+
alias_method :build_set_payment_options, :BuildSetPaymentOptions
|
244
|
+
|
245
|
+
# Service Call: GetFundingPlans
|
246
|
+
# @param GetFundingPlansRequest
|
247
|
+
# @return GetFundingPlansResponse
|
248
|
+
def GetFundingPlans(options = {} , http_header = {})
|
249
|
+
request_object = BuildGetFundingPlans(options)
|
250
|
+
request_hash = request_object.to_hash
|
251
|
+
response_hash = request("GetFundingPlans", request_hash, http_header)
|
252
|
+
GetFundingPlansResponse.new(response_hash)
|
253
|
+
end
|
254
|
+
alias_method :get_funding_plans, :GetFundingPlans
|
255
|
+
|
256
|
+
def BuildGetFundingPlans(options = {}, &block)
|
257
|
+
klass = GetFundingPlansRequest
|
258
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
259
|
+
object.instance_eval(&block) if block
|
260
|
+
object
|
261
|
+
end
|
262
|
+
alias_method :build_get_funding_plans, :BuildGetFundingPlans
|
263
|
+
|
264
|
+
# Service Call: GetAvailableShippingAddresses
|
265
|
+
# @param GetAvailableShippingAddressesRequest
|
266
|
+
# @return GetAvailableShippingAddressesResponse
|
267
|
+
def GetAvailableShippingAddresses(options = {} , http_header = {})
|
268
|
+
request_object = BuildGetAvailableShippingAddresses(options)
|
269
|
+
request_hash = request_object.to_hash
|
270
|
+
response_hash = request("GetAvailableShippingAddresses", request_hash, http_header)
|
271
|
+
GetAvailableShippingAddressesResponse.new(response_hash)
|
272
|
+
end
|
273
|
+
alias_method :get_available_shipping_addresses, :GetAvailableShippingAddresses
|
274
|
+
|
275
|
+
def BuildGetAvailableShippingAddresses(options = {}, &block)
|
276
|
+
klass = GetAvailableShippingAddressesRequest
|
277
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
278
|
+
object.instance_eval(&block) if block
|
279
|
+
object
|
280
|
+
end
|
281
|
+
alias_method :build_get_available_shipping_addresses, :BuildGetAvailableShippingAddresses
|
282
|
+
|
283
|
+
# Service Call: GetShippingAddresses
|
284
|
+
# @param GetShippingAddressesRequest
|
285
|
+
# @return GetShippingAddressesResponse
|
286
|
+
def GetShippingAddresses(options = {} , http_header = {})
|
287
|
+
request_object = BuildGetShippingAddresses(options)
|
288
|
+
request_hash = request_object.to_hash
|
289
|
+
response_hash = request("GetShippingAddresses", request_hash, http_header)
|
290
|
+
GetShippingAddressesResponse.new(response_hash)
|
291
|
+
end
|
292
|
+
alias_method :get_shipping_addresses, :GetShippingAddresses
|
293
|
+
|
294
|
+
def BuildGetShippingAddresses(options = {}, &block)
|
295
|
+
klass = GetShippingAddressesRequest
|
296
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
297
|
+
object.instance_eval(&block) if block
|
298
|
+
object
|
299
|
+
end
|
300
|
+
alias_method :build_get_shipping_addresses, :BuildGetShippingAddresses
|
301
|
+
|
302
|
+
# Service Call: GetUserLimits
|
303
|
+
# @param GetUserLimitsRequest
|
304
|
+
# @return GetUserLimitsResponse
|
305
|
+
def GetUserLimits(options = {} , http_header = {})
|
306
|
+
request_object = BuildGetUserLimits(options)
|
307
|
+
request_hash = request_object.to_hash
|
308
|
+
response_hash = request("GetUserLimits", request_hash, http_header)
|
309
|
+
GetUserLimitsResponse.new(response_hash)
|
310
|
+
end
|
311
|
+
alias_method :get_user_limits, :GetUserLimits
|
312
|
+
|
313
|
+
def BuildGetUserLimits(options = {}, &block)
|
314
|
+
klass = GetUserLimitsRequest
|
315
|
+
object = options.is_a?(klass) ? options : klass.new(options || {})
|
316
|
+
object.instance_eval(&block) if block
|
317
|
+
object
|
318
|
+
end
|
319
|
+
alias_method :build_get_user_limits, :BuildGetUserLimits
|
320
|
+
|
321
|
+
|
322
|
+
end
|
323
|
+
|
324
|
+
end
|
325
|
+
end
|
@@ -0,0 +1,16 @@
|
|
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 :API, "paypal-sdk/adaptive_payments/api"
|
10
|
+
|
11
|
+
def self.new(*args)
|
12
|
+
API.new(*args)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "AdaptivePayments" do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@client = PayPal::SDK::AdaptivePayments::API.new
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "Services" do
|
10
|
+
PayPal::SDK::AdaptivePayments::Services.instance_methods.select{|s| s =~ /^[A-Z]/ and s !~ /^Build/ }.each do |service_method|
|
11
|
+
it "make empty request to #{service_method}" do
|
12
|
+
response = @client.send(service_method, {})
|
13
|
+
response.response_envelope.ack.should_not be_nil
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "DataTypes" do
|
19
|
+
PayPal::SDK::AdaptivePayments::DataTypes.constants.each do |const_name|
|
20
|
+
it "create object for #{const_name}" do
|
21
|
+
klass = PayPal::SDK::AdaptivePayments::DataTypes.const_get(const_name)
|
22
|
+
klass.new.should be_a klass
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIICXAIBAAKBgQCx/rJhKDRYhs9WZj66FA+HidsrKwvep3g+YNbm1fXmjcg2rEmC
|
3
|
+
kq71+Ftw9rx0Uz7vmg6vcsASUgOyeNG7mVB1SsXc6j+JAzZsmpzxHI0QKm+nBNTS
|
4
|
+
OAp5NWn6NZQfu3BNAJ/Mok/iL3am2DWXV6dU74J66rBpwIJfzs9kmw8ZGwIDAQAB
|
5
|
+
AoGAa/V1sCQ4i7FItLjTNv3P5X+h5W74hhXBguQttFj2Ct7YHwEknQPnBt2aaMve
|
6
|
+
xhdvxtgELDpHcVU5VNifLU/yUg3+DSr/YkpBWOcNTCt1seW/z5s+jr2fQERQKbyf
|
7
|
+
SXWMTqwrQ19iQoCPYaj7Drf68JhksQCaYN650g7+B/QmSBECQQDp6r75fzDtEWrr
|
8
|
+
O4Sl9plK6CRLqQQ3LveAw4JV31N2UAqgAYtzRqD6K+SviAVtX9xxuv983qQxsfX4
|
9
|
+
ozE9sGXPAkEAwsxwR1s2Acuy10h3Xj6VtnFB3PpUrkSI9c9ZxF4CMf/+AS/b2UEe
|
10
|
+
QhH60WHY8ccgKT/DoPWBcEu2o0f9nPw29QJBAI480zHNeMe/Hp+5iliM0fvtmxxy
|
11
|
+
wwB3S8L9n4RuD0dTNpLDPbO0D/DvvdhKwtoWP2rcxbx9eaRKTYKKYUfcupsCQAkP
|
12
|
+
SQmIjHJ47tBkZmjTsFLT4aRNYDLarSQBiMNBPAjnRwD3INpx1N5tx6SFUHmuMSi5
|
13
|
+
9nc9888tNklRx9HNSSECQHgs9ExBpA6WbRVcgiizOKH7fmNxAB5f6TQ2W1QHMUb+
|
14
|
+
UhZpwuDelOIfzJAQUZGTZk8a8uVmyXU5hTf3ZDbrnJ8=
|
15
|
+
-----END RSA PRIVATE KEY-----
|
16
|
+
|
17
|
+
-----BEGIN CERTIFICATE-----
|
18
|
+
MIICpjCCAg+gAwIBAgIDD96nMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYDVQQGEwJV
|
19
|
+
UzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxFTATBgNV
|
20
|
+
BAoTDFBheVBhbCwgSW5jLjEWMBQGA1UECxQNc2FuZGJveF9jZXJ0czEbMBkGA1UE
|
21
|
+
AxQSc2FuZGJveF9jYW1lcmNoYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwu
|
22
|
+
Y29tMB4XDTA5MTAxNTA2Mzg1N1oXDTE5MTAxMzA2Mzg1N1owgYAxLTArBgNVBAMU
|
23
|
+
JHBsYXRmb18xMjU1MTcwNjk0X2Jpel9hcGkxLmdtYWlsLmNvbTEiMCAGA1UEChMZ
|
24
|
+
cGxhdGZvcm0gc2RrJ3MgVGVzdCBTdG9yZTERMA8GA1UEBxMIU2FuIEpvc2UxCzAJ
|
25
|
+
BgNVBAgTAkNBMQswCQYDVQQGEwJVUzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
|
26
|
+
gYEAsf6yYSg0WIbPVmY+uhQPh4nbKysL3qd4PmDW5tX15o3INqxJgpKu9fhbcPa8
|
27
|
+
dFM+75oOr3LAElIDsnjRu5lQdUrF3Oo/iQM2bJqc8RyNECpvpwTU0jgKeTVp+jWU
|
28
|
+
H7twTQCfzKJP4i92ptg1l1enVO+CeuqwacCCX87PZJsPGRsCAwEAAaMNMAswCQYD
|
29
|
+
VR0TBAIwADANBgkqhkiG9w0BAQUFAAOBgQCgH3kwXMJtcAaCBQLKz5TGFogJp/C3
|
30
|
+
06MvjYzdbDrx9Rjf/252UhD8dMPUP5FhU1KXduL+KIEYawPbDQ9+lV58JgM12R0p
|
31
|
+
EhCODDI/lDvzbfxUnYgkJ5cnFhTZpcAqVzWuinUnG8jAL9XKiEyu/C73ePMPWPbt
|
32
|
+
otoWi+Tk828Qlw==
|
33
|
+
-----END CERTIFICATE-----
|
@@ -0,0 +1,25 @@
|
|
1
|
+
test: &default
|
2
|
+
username: jb-us-seller_api1.paypal.com
|
3
|
+
password: WX4WTU3S8MY44S7F
|
4
|
+
signature: AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
5
|
+
app_id: APP-80W284485P519543T
|
6
|
+
http_timeout: 30
|
7
|
+
mode: sandbox
|
8
|
+
redirect_url: "https://www.sandbox.paypal.com/webscr&cmd="
|
9
|
+
dev_central_url: "https://developer.paypal.com"
|
10
|
+
development:
|
11
|
+
<<: *default
|
12
|
+
|
13
|
+
with_certificate:
|
14
|
+
<<: *default
|
15
|
+
username: platfo_1255170694_biz_api1.gmail.com
|
16
|
+
password: 2DPPKUPKB7DQLXNR
|
17
|
+
signature:
|
18
|
+
cert_path: "spec/config/cert_key.pem"
|
19
|
+
app_id: APP-80W284485P519543T
|
20
|
+
soap_end_point: "https://api.sandbox.paypal.com/2.0/"
|
21
|
+
|
22
|
+
with_oauth_token:
|
23
|
+
<<: *default
|
24
|
+
token: H2kLxjm9lCxQdnOYxkH29I53TpZyIXez4GtHhAVGpiU3DiVTz5eNPQ
|
25
|
+
token_secret: MnZ-iPdDqGLEfQIuTIfUN4uK9lU
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "ConvertCurrency" do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@client = PayPal::SDK::AdaptivePayments::API.new
|
7
|
+
end
|
8
|
+
|
9
|
+
it "with hash" do
|
10
|
+
response = @client.convert_currency({
|
11
|
+
"baseAmountList" => { "currency" => [ { "code" => "USD", "amount" => "2.0"} ]},
|
12
|
+
"convertToCurrencyList" => { "currencyCode" => ["GBP"] } })
|
13
|
+
response.response_envelope.ack.should eql "Success"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "with request object" do
|
17
|
+
convert_currency_request = @client.build_convert_currency()
|
18
|
+
convert_currency_request.baseAmountList.currency[0].code = "USD"
|
19
|
+
convert_currency_request.baseAmountList.currency[0].amount = 2.0
|
20
|
+
convert_currency_request.convertToCurrencyList.currencyCode = [ "GBP" ]
|
21
|
+
|
22
|
+
response = @client.convert_currency(convert_currency_request)
|
23
|
+
response.response_envelope.ack.should eql "Success"
|
24
|
+
end
|
25
|
+
|
26
|
+
it "with block" do
|
27
|
+
convert_currency_request = @client.build_convert_currency do
|
28
|
+
baseAmountList do
|
29
|
+
currency[0].code = "USD"
|
30
|
+
currency[0].amount = 2.0
|
31
|
+
end
|
32
|
+
convertToCurrencyList.currencyCode = [ "GBP" ]
|
33
|
+
end
|
34
|
+
|
35
|
+
response = @client.convert_currency(convert_currency_request)
|
36
|
+
response.response_envelope.ack.should eql "Success"
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: paypal-sdk-adaptivepayments
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.96.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- PayPal
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: paypal-sdk-core
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.0
|
30
|
+
description: AdaptivePayments SDK
|
31
|
+
email:
|
32
|
+
- DL-PP-Platform-Ruby-SDK@ebay.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- spec/spec_helper.rb
|
38
|
+
- spec/convert_currency_spec.rb
|
39
|
+
- spec/config/paypal.yml
|
40
|
+
- spec/config/cert_key.pem
|
41
|
+
- spec/adaptive_payments_spec.rb
|
42
|
+
- lib/paypal-sdk-adaptivepayments.rb
|
43
|
+
- lib/paypal-sdk/adaptive_payments/services.rb
|
44
|
+
- lib/paypal-sdk/adaptive_payments/api.rb
|
45
|
+
- lib/paypal-sdk/adaptive_payments/version.rb
|
46
|
+
- lib/paypal-sdk/adaptive_payments/data_types.rb
|
47
|
+
- lib/paypal-sdk/adaptive_payments.rb
|
48
|
+
- Rakefile
|
49
|
+
- README.md
|
50
|
+
- Gemfile
|
51
|
+
homepage: https://www.x.com/
|
52
|
+
licenses: []
|
53
|
+
post_install_message:
|
54
|
+
rdoc_options: []
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
hash: -159198867
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
hash: -159198867
|
75
|
+
requirements: []
|
76
|
+
rubyforge_project:
|
77
|
+
rubygems_version: 1.8.24
|
78
|
+
signing_key:
|
79
|
+
specification_version: 3
|
80
|
+
summary: AdaptivePayments SDK
|
81
|
+
test_files:
|
82
|
+
- spec/spec_helper.rb
|
83
|
+
- spec/convert_currency_spec.rb
|
84
|
+
- spec/config/paypal.yml
|
85
|
+
- spec/config/cert_key.pem
|
86
|
+
- spec/adaptive_payments_spec.rb
|