pagseguro-oficial 2.5.0 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -1
  3. data/CONTRIBUTING.md +39 -0
  4. data/Dockerfile +20 -0
  5. data/README.md +22 -0
  6. data/docker-compose.yml +5 -0
  7. data/examples/checkout/create_payment_request.rb +1 -1
  8. data/examples/direct/create_transaction_using_boleto.rb +1 -1
  9. data/examples/direct/create_transaction_using_credit_card.rb +1 -1
  10. data/examples/direct/create_transaction_using_online_debit.rb +1 -1
  11. data/examples/preapproval/cancel_preapproval.rb +26 -0
  12. data/examples/preapproval/change_preapproval_payment.rb +50 -0
  13. data/examples/preapproval/change_preapproval_status.rb +29 -0
  14. data/examples/preapproval/charge_preapproval.rb +36 -0
  15. data/examples/preapproval/create_preapproval.rb +68 -0
  16. data/examples/preapproval/create_preapproval_auto.rb +53 -0
  17. data/examples/preapproval/create_preapproval_discount.rb +30 -0
  18. data/examples/preapproval/create_preapproval_manual.rb +58 -0
  19. data/examples/preapproval/create_preapproval_transparent.rb +41 -0
  20. data/examples/preapproval/preapproval_retry.rb +29 -0
  21. data/examples/preapproval/search/search_by_date_interval.rb +45 -0
  22. data/examples/preapproval/search/search_by_days_interval.rb +46 -0
  23. data/examples/preapproval/search/search_by_notification_code.rb +50 -0
  24. data/examples/preapproval/search/search_by_subscription_code.rb +50 -0
  25. data/examples/preapproval/search/search_subscription_payment_orders.rb +53 -0
  26. data/examples/split_payment/create_payment_request.rb +1 -1
  27. data/examples/split_payment/create_transaction_using_boleto.rb +118 -0
  28. data/examples/split_payment/create_transaction_using_credit_card.rb +152 -0
  29. data/lib/pagseguro.rb +33 -1
  30. data/lib/pagseguro/credit_card_transaction_request.rb +1 -1
  31. data/lib/pagseguro/document.rb +8 -0
  32. data/lib/pagseguro/holder.rb +8 -0
  33. data/lib/pagseguro/manual_subscription_charger.rb +59 -0
  34. data/lib/pagseguro/manual_subscription_charger/request_serializer.rb +50 -0
  35. data/lib/pagseguro/manual_subscription_charger/response.rb +36 -0
  36. data/lib/pagseguro/manual_subscription_charger/response_serializer.rb +17 -0
  37. data/lib/pagseguro/payment_request/request_serializer.rb +25 -1
  38. data/lib/pagseguro/receiver.rb +3 -0
  39. data/lib/pagseguro/request.rb +32 -2
  40. data/lib/pagseguro/sender.rb +21 -3
  41. data/lib/pagseguro/subscription.rb +132 -0
  42. data/lib/pagseguro/subscription/request_serializer.rb +129 -0
  43. data/lib/pagseguro/subscription/response.rb +49 -0
  44. data/lib/pagseguro/subscription/response_serializer.rb +62 -0
  45. data/lib/pagseguro/subscription/subscription_search.rb +135 -0
  46. data/lib/pagseguro/subscription_canceller.rb +30 -0
  47. data/lib/pagseguro/subscription_canceller/response.rb +34 -0
  48. data/lib/pagseguro/subscription_change_payment.rb +46 -0
  49. data/lib/pagseguro/subscription_change_payment/request_serializer.rb +80 -0
  50. data/lib/pagseguro/subscription_change_payment/response.rb +26 -0
  51. data/lib/pagseguro/subscription_change_status.rb +50 -0
  52. data/lib/pagseguro/subscription_change_status/request_serializer.rb +28 -0
  53. data/lib/pagseguro/subscription_change_status/response.rb +26 -0
  54. data/lib/pagseguro/subscription_discount.rb +41 -0
  55. data/lib/pagseguro/subscription_discount/request_serializer.rb +34 -0
  56. data/lib/pagseguro/subscription_discount/response.rb +34 -0
  57. data/lib/pagseguro/subscription_payment_method.rb +21 -0
  58. data/lib/pagseguro/subscription_payment_order.rb +57 -0
  59. data/lib/pagseguro/subscription_payment_order/response.rb +37 -0
  60. data/lib/pagseguro/subscription_payment_order/response_serializer.rb +51 -0
  61. data/lib/pagseguro/subscription_plan.rb +69 -0
  62. data/lib/pagseguro/subscription_plan/request_serializer.rb +81 -0
  63. data/lib/pagseguro/subscription_plan/response.rb +36 -0
  64. data/lib/pagseguro/subscription_plan/response_serializer.rb +17 -0
  65. data/lib/pagseguro/subscription_retry.rb +35 -0
  66. data/lib/pagseguro/subscription_retry/response.rb +34 -0
  67. data/lib/pagseguro/subscription_search_payment_orders.rb +131 -0
  68. data/lib/pagseguro/subscription_transaction.rb +29 -0
  69. data/lib/pagseguro/subscription_transactions.rb +5 -0
  70. data/lib/pagseguro/transaction.rb +0 -10
  71. data/lib/pagseguro/transaction/serializer.rb +19 -2
  72. data/lib/pagseguro/transaction_request.rb +26 -1
  73. data/lib/pagseguro/transaction_request/request_serializer.rb +164 -1
  74. data/lib/pagseguro/version.rb +1 -1
  75. data/spec/fixtures/manual_subscription_charger/fail.xml +6 -0
  76. data/spec/fixtures/manual_subscription_charger/success.xml +4 -0
  77. data/spec/fixtures/subscription/fail.xml +6 -0
  78. data/spec/fixtures/subscription/find_success.xml +28 -0
  79. data/spec/fixtures/subscription/search_success.xml +18 -0
  80. data/spec/fixtures/subscription/success.xml +4 -0
  81. data/spec/fixtures/subscription_canceller/fail.xml +6 -0
  82. data/spec/fixtures/subscription_change_payment/fail.xml +7 -0
  83. data/spec/fixtures/subscription_change_status/fail.xml +7 -0
  84. data/spec/fixtures/subscription_discount/fail.xml +6 -0
  85. data/spec/fixtures/subscription_payment_order/success.xml +18 -0
  86. data/spec/fixtures/subscription_plan/fail.xml +6 -0
  87. data/spec/fixtures/subscription_plan/success.xml +4 -0
  88. data/spec/fixtures/subscription_retry/fail.xml +7 -0
  89. data/spec/fixtures/subscription_search_payment_orders/success.xml +43 -0
  90. data/spec/fixtures/transactions/without_status_and_type.xml +71 -0
  91. data/spec/pagseguro/credit_card_transaction_request_spec.rb +1 -1
  92. data/spec/pagseguro/document_spec.rb +15 -0
  93. data/spec/pagseguro/holder_spec.rb +1 -0
  94. data/spec/pagseguro/manual_subscription_charger/request_serializer_spec.rb +79 -0
  95. data/spec/pagseguro/manual_subscription_charger/response_serializer_spec.rb +10 -0
  96. data/spec/pagseguro/manual_subscription_charger/response_spec.rb +65 -0
  97. data/spec/pagseguro/manual_subscription_charger_spec.rb +68 -0
  98. data/spec/pagseguro/payment_request/request_serializer_spec.rb +54 -22
  99. data/spec/pagseguro/receiver_spec.rb +1 -0
  100. data/spec/pagseguro/sender_spec.rb +16 -2
  101. data/spec/pagseguro/subscription/request_serializer_spec.rb +233 -0
  102. data/spec/pagseguro/subscription/response_serializer_spec.rb +46 -0
  103. data/spec/pagseguro/subscription/response_spec.rb +79 -0
  104. data/spec/pagseguro/subscription/subscription_search_spec.rb +154 -0
  105. data/spec/pagseguro/subscription_canceller/response_spec.rb +58 -0
  106. data/spec/pagseguro/subscription_canceller_spec.rb +57 -0
  107. data/spec/pagseguro/subscription_change_payment/request_serializer_spec.rb +150 -0
  108. data/spec/pagseguro/subscription_change_payment/response_spec.rb +41 -0
  109. data/spec/pagseguro/subscription_change_payment_spec.rb +60 -0
  110. data/spec/pagseguro/subscription_change_status/request_serializer_spec.rb +19 -0
  111. data/spec/pagseguro/subscription_change_status/response_spec.rb +41 -0
  112. data/spec/pagseguro/subscription_change_status_spec.rb +53 -0
  113. data/spec/pagseguro/subscription_discount/request_serializer_spec.rb +27 -0
  114. data/spec/pagseguro/subscription_discount/response_spec.rb +58 -0
  115. data/spec/pagseguro/subscription_discount_spec.rb +60 -0
  116. data/spec/pagseguro/subscription_payment_method_spec.rb +10 -0
  117. data/spec/pagseguro/subscription_payment_order/response_serializer_spec.rb +24 -0
  118. data/spec/pagseguro/subscription_payment_order/response_spec.rb +55 -0
  119. data/spec/pagseguro/subscription_payment_order_spec.rb +27 -0
  120. data/spec/pagseguro/subscription_plan/request_serializer_spec.rb +253 -0
  121. data/spec/pagseguro/subscription_plan/response_serializer_spec.rb +10 -0
  122. data/spec/pagseguro/subscription_plan/response_spec.rb +65 -0
  123. data/spec/pagseguro/subscription_plan_spec.rb +118 -0
  124. data/spec/pagseguro/subscription_retry/response_spec.rb +58 -0
  125. data/spec/pagseguro/subscription_retry_spec.rb +62 -0
  126. data/spec/pagseguro/subscription_search_payment_order_spec.rb +129 -0
  127. data/spec/pagseguro/subscription_spec.rb +137 -0
  128. data/spec/pagseguro/subscription_transaction_spec.rb +24 -0
  129. data/spec/pagseguro/subscription_transactions_spec.rb +37 -0
  130. data/spec/pagseguro/transaction/response_spec.rb +0 -42
  131. data/spec/pagseguro/transaction/serializer_spec.rb +5 -6
  132. data/spec/pagseguro/transaction_request/request_serializer_spec.rb +623 -159
  133. data/spec/pagseguro/transaction_request_spec.rb +26 -0
  134. data/spec/pagseguro/transaction_spec.rb +0 -48
  135. data/spec/spec_helper.rb +1 -0
  136. metadata +154 -8
  137. data/examples/checkout/search/search_transaction_status_history.rb +0 -22
  138. data/lib/pagseguro/transaction/status_collection.rb +0 -20
  139. data/spec/fixtures/transactions/status_history.xml +0 -12
  140. data/spec/pagseguro/transaction/status_collection_spec.rb +0 -43
@@ -4,6 +4,7 @@ describe PagSeguro::TransactionRequest do |variable|
4
4
  let(:xml_parsed) { Nokogiri::XML(raw_xml) }
5
5
 
6
6
  it_assigns_attribute :currency
7
+ it_assigns_attribute :primary_receiver
7
8
  it_assigns_attribute :extra_amount
8
9
  it_assigns_attribute :reference
9
10
  it_assigns_attribute :notification_url
@@ -71,6 +72,31 @@ describe PagSeguro::TransactionRequest do |variable|
71
72
  end
72
73
  end
73
74
 
75
+ describe '#receivers' do
76
+ subject do
77
+ PagSeguro::TransactionRequest.new receivers: receivers
78
+ end
79
+
80
+ let(:receivers) do
81
+ [
82
+ { email: 'a@example.com', split: { amount: 1 } },
83
+ { email: 'b@example.com', split: { amount: 1 } }
84
+ ]
85
+ end
86
+
87
+ context 'ensure receivers' do
88
+ it 'are PagSeguro::Receiver' do
89
+ subject.receivers.each do |receiver|
90
+ expect(receiver).to be_a(PagSeguro::Receiver)
91
+ end
92
+ end
93
+
94
+ it 'have correct keys' do
95
+ expect(subject.receivers[0].email).to eq 'a@example.com'
96
+ end
97
+ end
98
+ end
99
+
74
100
  describe "#create" do
75
101
  let(:transaction_request) { PagSeguro::TransactionRequest.new }
76
102
  let(:request) { double(:request, success?: true, xml?: true, body: raw_xml) }
@@ -130,54 +130,6 @@ describe PagSeguro::Transaction do
130
130
  end
131
131
  end
132
132
 
133
- describe ".find_status_history" do
134
- before do
135
- allow(PagSeguro::Request).to receive(:get)
136
- .with("transactions/CODE/statusHistory", "v3", {})
137
- .and_return(response)
138
- end
139
- let(:parsed_xml) { Nokogiri::XML(raw_xml) }
140
- let(:response) do
141
- double(:Response, xml?: true, success?: true, errors?: false, body: raw_xml, data: parsed_xml)
142
- end
143
- subject { PagSeguro::Transaction.find_status_history("CODE") }
144
-
145
- context "when request succeds" do
146
- let(:raw_xml) { File.read("./spec/fixtures/transactions/status_history.xml") }
147
-
148
- it "returns an instance of StatusCollection" do
149
- expect(subject).to be_a(PagSeguro::Transaction::StatusCollection)
150
- end
151
-
152
- it "returns a collection with errors object" do
153
- expect(subject.errors).to be_a(PagSeguro::Errors)
154
- end
155
-
156
- it "returns a collection with no errors" do
157
- expect(subject.errors).to be_empty
158
- end
159
- end
160
-
161
- context "when request fails" do
162
- before do
163
- allow(response).to receive_messages(
164
- success?: false,
165
- error?: true,
166
- error: Aitch::NotFoundError
167
- )
168
- end
169
- let(:raw_xml) { File.read("./spec/fixtures/invalid_code.xml") }
170
-
171
- it "returns an instance of StatusCollection" do
172
- expect(subject).to be_a(PagSeguro::Transaction::StatusCollection)
173
- end
174
-
175
- it "returns a collection with errors" do
176
- expect(subject.errors).not_to be_empty
177
- end
178
- end
179
- end
180
-
181
133
  describe ".find_by_date" do
182
134
  it "initializes search with default options" do
183
135
  now = Time.now
@@ -26,6 +26,7 @@ RSpec.configure do |config|
26
26
  config.after do
27
27
  PagSeguro.configure do |config|
28
28
  config.app_id = nil
29
+ config.environment = :production
29
30
  config.app_key = nil
30
31
  config.email = nil
31
32
  config.token = nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagseguro-oficial
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aitch
@@ -147,10 +147,13 @@ files:
147
147
  - ".rspec"
148
148
  - ".travis.yml"
149
149
  - CHANGELOG.md
150
+ - CONTRIBUTING.md
151
+ - Dockerfile
150
152
  - Gemfile
151
153
  - LICENSE-2.0.txt
152
154
  - README.md
153
155
  - Rakefile
156
+ - docker-compose.yml
154
157
  - docs/transparent_checkout.md
155
158
  - examples/authorization/create_authorization.rb
156
159
  - examples/authorization/create_authorization_with_account.rb
@@ -164,16 +167,32 @@ files:
164
167
  - examples/checkout/search/search_transaction_by_code.rb
165
168
  - examples/checkout/search/search_transaction_by_notification_code.rb
166
169
  - examples/checkout/search/search_transaction_by_reference.rb
167
- - examples/checkout/search/search_transaction_status_history.rb
168
170
  - examples/checkout/search/search_transactions_by_date.rb
169
171
  - examples/create_session.rb
170
172
  - examples/direct/create_transaction_using_boleto.rb
171
173
  - examples/direct/create_transaction_using_credit_card.rb
172
174
  - examples/direct/create_transaction_using_online_debit.rb
173
175
  - examples/get_installments.rb
176
+ - examples/preapproval/cancel_preapproval.rb
177
+ - examples/preapproval/change_preapproval_payment.rb
178
+ - examples/preapproval/change_preapproval_status.rb
179
+ - examples/preapproval/charge_preapproval.rb
180
+ - examples/preapproval/create_preapproval.rb
181
+ - examples/preapproval/create_preapproval_auto.rb
182
+ - examples/preapproval/create_preapproval_discount.rb
183
+ - examples/preapproval/create_preapproval_manual.rb
184
+ - examples/preapproval/create_preapproval_transparent.rb
185
+ - examples/preapproval/preapproval_retry.rb
186
+ - examples/preapproval/search/search_by_date_interval.rb
187
+ - examples/preapproval/search/search_by_days_interval.rb
188
+ - examples/preapproval/search/search_by_notification_code.rb
189
+ - examples/preapproval/search/search_by_subscription_code.rb
190
+ - examples/preapproval/search/search_subscription_payment_orders.rb
174
191
  - examples/request_transaction_cancellation.rb
175
192
  - examples/split_payment/create_authorization.rb
176
193
  - examples/split_payment/create_payment_request.rb
194
+ - examples/split_payment/create_transaction_using_boleto.rb
195
+ - examples/split_payment/create_transaction_using_credit_card.rb
177
196
  - lib/pagseguro-oficial.rb
178
197
  - lib/pagseguro.rb
179
198
  - lib/pagseguro/account.rb
@@ -211,6 +230,10 @@ files:
211
230
  - lib/pagseguro/installment/response_serializer.rb
212
231
  - lib/pagseguro/item.rb
213
232
  - lib/pagseguro/items.rb
233
+ - lib/pagseguro/manual_subscription_charger.rb
234
+ - lib/pagseguro/manual_subscription_charger/request_serializer.rb
235
+ - lib/pagseguro/manual_subscription_charger/response.rb
236
+ - lib/pagseguro/manual_subscription_charger/response_serializer.rb
214
237
  - lib/pagseguro/notification.rb
215
238
  - lib/pagseguro/notification/authorization.rb
216
239
  - lib/pagseguro/notification/transaction.rb
@@ -235,6 +258,35 @@ files:
235
258
  - lib/pagseguro/session/response.rb
236
259
  - lib/pagseguro/session/response_serializer.rb
237
260
  - lib/pagseguro/shipping.rb
261
+ - lib/pagseguro/subscription.rb
262
+ - lib/pagseguro/subscription/request_serializer.rb
263
+ - lib/pagseguro/subscription/response.rb
264
+ - lib/pagseguro/subscription/response_serializer.rb
265
+ - lib/pagseguro/subscription/subscription_search.rb
266
+ - lib/pagseguro/subscription_canceller.rb
267
+ - lib/pagseguro/subscription_canceller/response.rb
268
+ - lib/pagseguro/subscription_change_payment.rb
269
+ - lib/pagseguro/subscription_change_payment/request_serializer.rb
270
+ - lib/pagseguro/subscription_change_payment/response.rb
271
+ - lib/pagseguro/subscription_change_status.rb
272
+ - lib/pagseguro/subscription_change_status/request_serializer.rb
273
+ - lib/pagseguro/subscription_change_status/response.rb
274
+ - lib/pagseguro/subscription_discount.rb
275
+ - lib/pagseguro/subscription_discount/request_serializer.rb
276
+ - lib/pagseguro/subscription_discount/response.rb
277
+ - lib/pagseguro/subscription_payment_method.rb
278
+ - lib/pagseguro/subscription_payment_order.rb
279
+ - lib/pagseguro/subscription_payment_order/response.rb
280
+ - lib/pagseguro/subscription_payment_order/response_serializer.rb
281
+ - lib/pagseguro/subscription_plan.rb
282
+ - lib/pagseguro/subscription_plan/request_serializer.rb
283
+ - lib/pagseguro/subscription_plan/response.rb
284
+ - lib/pagseguro/subscription_plan/response_serializer.rb
285
+ - lib/pagseguro/subscription_retry.rb
286
+ - lib/pagseguro/subscription_retry/response.rb
287
+ - lib/pagseguro/subscription_search_payment_orders.rb
288
+ - lib/pagseguro/subscription_transaction.rb
289
+ - lib/pagseguro/subscription_transactions.rb
238
290
  - lib/pagseguro/transaction.rb
239
291
  - lib/pagseguro/transaction/collection.rb
240
292
  - lib/pagseguro/transaction/response.rb
@@ -243,7 +295,6 @@ files:
243
295
  - lib/pagseguro/transaction/search/search_by_date.rb
244
296
  - lib/pagseguro/transaction/search/search_by_reference.rb
245
297
  - lib/pagseguro/transaction/serializer.rb
246
- - lib/pagseguro/transaction/status_collection.rb
247
298
  - lib/pagseguro/transaction_cancellation.rb
248
299
  - lib/pagseguro/transaction_cancellation/request_serializer.rb
249
300
  - lib/pagseguro/transaction_cancellation/response.rb
@@ -269,16 +320,31 @@ files:
269
320
  - spec/fixtures/by_date/success.xml
270
321
  - spec/fixtures/installment/success.xml
271
322
  - spec/fixtures/invalid_code.xml
323
+ - spec/fixtures/manual_subscription_charger/fail.xml
324
+ - spec/fixtures/manual_subscription_charger/success.xml
272
325
  - spec/fixtures/payment_request/failure.xml
273
326
  - spec/fixtures/payment_request/success.xml
274
327
  - spec/fixtures/refund/success.xml
275
328
  - spec/fixtures/session/success.xml
329
+ - spec/fixtures/subscription/fail.xml
330
+ - spec/fixtures/subscription/find_success.xml
331
+ - spec/fixtures/subscription/search_success.xml
332
+ - spec/fixtures/subscription/success.xml
333
+ - spec/fixtures/subscription_canceller/fail.xml
334
+ - spec/fixtures/subscription_change_payment/fail.xml
335
+ - spec/fixtures/subscription_change_status/fail.xml
336
+ - spec/fixtures/subscription_discount/fail.xml
337
+ - spec/fixtures/subscription_payment_order/success.xml
338
+ - spec/fixtures/subscription_plan/fail.xml
339
+ - spec/fixtures/subscription_plan/success.xml
340
+ - spec/fixtures/subscription_retry/fail.xml
341
+ - spec/fixtures/subscription_search_payment_orders/success.xml
276
342
  - spec/fixtures/transaction_cancellation/success.xml
277
343
  - spec/fixtures/transaction_request/success.xml
278
344
  - spec/fixtures/transactions/additional.xml
279
345
  - spec/fixtures/transactions/search.xml
280
- - spec/fixtures/transactions/status_history.xml
281
346
  - spec/fixtures/transactions/success.xml
347
+ - spec/fixtures/transactions/without_status_and_type.xml
282
348
  - spec/pagseguro/account_credentials_spec.rb
283
349
  - spec/pagseguro/account_spec.rb
284
350
  - spec/pagseguro/address_spec.rb
@@ -312,6 +378,10 @@ files:
312
378
  - spec/pagseguro/installment_spec.rb
313
379
  - spec/pagseguro/item_spec.rb
314
380
  - spec/pagseguro/items_spec.rb
381
+ - spec/pagseguro/manual_subscription_charger/request_serializer_spec.rb
382
+ - spec/pagseguro/manual_subscription_charger/response_serializer_spec.rb
383
+ - spec/pagseguro/manual_subscription_charger/response_spec.rb
384
+ - spec/pagseguro/manual_subscription_charger_spec.rb
315
385
  - spec/pagseguro/notification_spec.rb
316
386
  - spec/pagseguro/online_debit_transaction_request_spec.rb
317
387
  - spec/pagseguro/pagseguro_spec.rb
@@ -335,6 +405,35 @@ files:
335
405
  - spec/pagseguro/session/response_spec.rb
336
406
  - spec/pagseguro/session_spec.rb
337
407
  - spec/pagseguro/shipping_spec.rb
408
+ - spec/pagseguro/subscription/request_serializer_spec.rb
409
+ - spec/pagseguro/subscription/response_serializer_spec.rb
410
+ - spec/pagseguro/subscription/response_spec.rb
411
+ - spec/pagseguro/subscription/subscription_search_spec.rb
412
+ - spec/pagseguro/subscription_canceller/response_spec.rb
413
+ - spec/pagseguro/subscription_canceller_spec.rb
414
+ - spec/pagseguro/subscription_change_payment/request_serializer_spec.rb
415
+ - spec/pagseguro/subscription_change_payment/response_spec.rb
416
+ - spec/pagseguro/subscription_change_payment_spec.rb
417
+ - spec/pagseguro/subscription_change_status/request_serializer_spec.rb
418
+ - spec/pagseguro/subscription_change_status/response_spec.rb
419
+ - spec/pagseguro/subscription_change_status_spec.rb
420
+ - spec/pagseguro/subscription_discount/request_serializer_spec.rb
421
+ - spec/pagseguro/subscription_discount/response_spec.rb
422
+ - spec/pagseguro/subscription_discount_spec.rb
423
+ - spec/pagseguro/subscription_payment_method_spec.rb
424
+ - spec/pagseguro/subscription_payment_order/response_serializer_spec.rb
425
+ - spec/pagseguro/subscription_payment_order/response_spec.rb
426
+ - spec/pagseguro/subscription_payment_order_spec.rb
427
+ - spec/pagseguro/subscription_plan/request_serializer_spec.rb
428
+ - spec/pagseguro/subscription_plan/response_serializer_spec.rb
429
+ - spec/pagseguro/subscription_plan/response_spec.rb
430
+ - spec/pagseguro/subscription_plan_spec.rb
431
+ - spec/pagseguro/subscription_retry/response_spec.rb
432
+ - spec/pagseguro/subscription_retry_spec.rb
433
+ - spec/pagseguro/subscription_search_payment_order_spec.rb
434
+ - spec/pagseguro/subscription_spec.rb
435
+ - spec/pagseguro/subscription_transaction_spec.rb
436
+ - spec/pagseguro/subscription_transactions_spec.rb
338
437
  - spec/pagseguro/transaction/collection_spec.rb
339
438
  - spec/pagseguro/transaction/response_spec.rb
340
439
  - spec/pagseguro/transaction/search/search_abandoned_spec.rb
@@ -342,7 +441,6 @@ files:
342
441
  - spec/pagseguro/transaction/search/search_by_reference_spec.rb
343
442
  - spec/pagseguro/transaction/search_spec.rb
344
443
  - spec/pagseguro/transaction/serializer_spec.rb
345
- - spec/pagseguro/transaction/status_collection_spec.rb
346
444
  - spec/pagseguro/transaction_cancellation/request_serializer_spec.rb
347
445
  - spec/pagseguro/transaction_cancellation/response_serializer_spec.rb
348
446
  - spec/pagseguro/transaction_cancellation/response_spec.rb
@@ -397,16 +495,31 @@ test_files:
397
495
  - spec/fixtures/by_date/success.xml
398
496
  - spec/fixtures/installment/success.xml
399
497
  - spec/fixtures/invalid_code.xml
498
+ - spec/fixtures/manual_subscription_charger/fail.xml
499
+ - spec/fixtures/manual_subscription_charger/success.xml
400
500
  - spec/fixtures/payment_request/failure.xml
401
501
  - spec/fixtures/payment_request/success.xml
402
502
  - spec/fixtures/refund/success.xml
403
503
  - spec/fixtures/session/success.xml
504
+ - spec/fixtures/subscription/fail.xml
505
+ - spec/fixtures/subscription/find_success.xml
506
+ - spec/fixtures/subscription/search_success.xml
507
+ - spec/fixtures/subscription/success.xml
508
+ - spec/fixtures/subscription_canceller/fail.xml
509
+ - spec/fixtures/subscription_change_payment/fail.xml
510
+ - spec/fixtures/subscription_change_status/fail.xml
511
+ - spec/fixtures/subscription_discount/fail.xml
512
+ - spec/fixtures/subscription_payment_order/success.xml
513
+ - spec/fixtures/subscription_plan/fail.xml
514
+ - spec/fixtures/subscription_plan/success.xml
515
+ - spec/fixtures/subscription_retry/fail.xml
516
+ - spec/fixtures/subscription_search_payment_orders/success.xml
404
517
  - spec/fixtures/transaction_cancellation/success.xml
405
518
  - spec/fixtures/transaction_request/success.xml
406
519
  - spec/fixtures/transactions/additional.xml
407
520
  - spec/fixtures/transactions/search.xml
408
- - spec/fixtures/transactions/status_history.xml
409
521
  - spec/fixtures/transactions/success.xml
522
+ - spec/fixtures/transactions/without_status_and_type.xml
410
523
  - spec/pagseguro/account_credentials_spec.rb
411
524
  - spec/pagseguro/account_spec.rb
412
525
  - spec/pagseguro/address_spec.rb
@@ -440,6 +553,10 @@ test_files:
440
553
  - spec/pagseguro/installment_spec.rb
441
554
  - spec/pagseguro/item_spec.rb
442
555
  - spec/pagseguro/items_spec.rb
556
+ - spec/pagseguro/manual_subscription_charger/request_serializer_spec.rb
557
+ - spec/pagseguro/manual_subscription_charger/response_serializer_spec.rb
558
+ - spec/pagseguro/manual_subscription_charger/response_spec.rb
559
+ - spec/pagseguro/manual_subscription_charger_spec.rb
443
560
  - spec/pagseguro/notification_spec.rb
444
561
  - spec/pagseguro/online_debit_transaction_request_spec.rb
445
562
  - spec/pagseguro/pagseguro_spec.rb
@@ -463,6 +580,35 @@ test_files:
463
580
  - spec/pagseguro/session/response_spec.rb
464
581
  - spec/pagseguro/session_spec.rb
465
582
  - spec/pagseguro/shipping_spec.rb
583
+ - spec/pagseguro/subscription/request_serializer_spec.rb
584
+ - spec/pagseguro/subscription/response_serializer_spec.rb
585
+ - spec/pagseguro/subscription/response_spec.rb
586
+ - spec/pagseguro/subscription/subscription_search_spec.rb
587
+ - spec/pagseguro/subscription_canceller/response_spec.rb
588
+ - spec/pagseguro/subscription_canceller_spec.rb
589
+ - spec/pagseguro/subscription_change_payment/request_serializer_spec.rb
590
+ - spec/pagseguro/subscription_change_payment/response_spec.rb
591
+ - spec/pagseguro/subscription_change_payment_spec.rb
592
+ - spec/pagseguro/subscription_change_status/request_serializer_spec.rb
593
+ - spec/pagseguro/subscription_change_status/response_spec.rb
594
+ - spec/pagseguro/subscription_change_status_spec.rb
595
+ - spec/pagseguro/subscription_discount/request_serializer_spec.rb
596
+ - spec/pagseguro/subscription_discount/response_spec.rb
597
+ - spec/pagseguro/subscription_discount_spec.rb
598
+ - spec/pagseguro/subscription_payment_method_spec.rb
599
+ - spec/pagseguro/subscription_payment_order/response_serializer_spec.rb
600
+ - spec/pagseguro/subscription_payment_order/response_spec.rb
601
+ - spec/pagseguro/subscription_payment_order_spec.rb
602
+ - spec/pagseguro/subscription_plan/request_serializer_spec.rb
603
+ - spec/pagseguro/subscription_plan/response_serializer_spec.rb
604
+ - spec/pagseguro/subscription_plan/response_spec.rb
605
+ - spec/pagseguro/subscription_plan_spec.rb
606
+ - spec/pagseguro/subscription_retry/response_spec.rb
607
+ - spec/pagseguro/subscription_retry_spec.rb
608
+ - spec/pagseguro/subscription_search_payment_order_spec.rb
609
+ - spec/pagseguro/subscription_spec.rb
610
+ - spec/pagseguro/subscription_transaction_spec.rb
611
+ - spec/pagseguro/subscription_transactions_spec.rb
466
612
  - spec/pagseguro/transaction/collection_spec.rb
467
613
  - spec/pagseguro/transaction/response_spec.rb
468
614
  - spec/pagseguro/transaction/search/search_abandoned_spec.rb
@@ -470,7 +616,6 @@ test_files:
470
616
  - spec/pagseguro/transaction/search/search_by_reference_spec.rb
471
617
  - spec/pagseguro/transaction/search_spec.rb
472
618
  - spec/pagseguro/transaction/serializer_spec.rb
473
- - spec/pagseguro/transaction/status_collection_spec.rb
474
619
  - spec/pagseguro/transaction_cancellation/request_serializer_spec.rb
475
620
  - spec/pagseguro/transaction_cancellation/response_serializer_spec.rb
476
621
  - spec/pagseguro/transaction_cancellation/response_spec.rb
@@ -491,3 +636,4 @@ test_files:
491
636
  - spec/support/helpers.rb
492
637
  - spec/support/mass_assignment_macro.rb
493
638
  - spec/support/shared_examples_for_configuration.rb
639
+ has_rdoc:
@@ -1,22 +0,0 @@
1
- require_relative "../../boot"
2
-
3
- # Search Transaction Status History
4
- #
5
- # You need to set your credentials in the application config
6
- #
7
- # P.S: See the boot file example for more details
8
-
9
- response = PagSeguro::Transaction.find_status_history("transaction_code")
10
-
11
- puts response.inspect
12
-
13
- if response.errors.any?
14
- puts response.errors.join("\n")
15
- else
16
- response.each do |status|
17
- puts "STATUS:"
18
- puts " code: #{status.code}"
19
- puts " date: #{status.date}"
20
- puts " notification_code: #{status.notification_code}"
21
- end
22
- end
@@ -1,20 +0,0 @@
1
- module PagSeguro
2
- class Transaction
3
- class StatusCollection
4
- extend Forwardable
5
-
6
- def_delegators :@statuses, :each, :empty?, :any?
7
-
8
- def statuses=(objects)
9
- @statuses = objects
10
- end
11
-
12
- def errors
13
- @errors ||= Errors.new
14
- end
15
-
16
- # PagSeguro::TransactionStatus instances.
17
- attr_reader :statuses
18
- end
19
- end
20
- end
@@ -1,12 +0,0 @@
1
- <statusHistory>
2
- <status>
3
- <code>1</code>
4
- <date>2015-02-24T10:23:34.000-03:00</date>
5
- <notificationCode>B7C381-7AADE5ADE576-8CC4159F8FBB-25C7D6</notificationCode>
6
- </status>
7
- <status>
8
- <code>3</code>
9
- <date>2015-02-24T10:23:36.000-03:00</date>
10
- <notificationCode>0EF4E7-1F96B496B41B-CFF4ABAFABF3-47CEF2</notificationCode>
11
- </status>
12
- </statusHistory>