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
@@ -1,43 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe PagSeguro::Transaction::StatusCollection do
4
- let(:statuses) { [PagSeguro::TransactionStatus.new] }
5
-
6
- it "should have a PagSeguro::Errors instance" do
7
- expect(subject.errors).to be_a(PagSeguro::Errors)
8
- end
9
-
10
- context "when there are no statuses" do
11
- before do
12
- subject.statuses = []
13
- end
14
-
15
- it "is blank" do
16
- expect(subject).to be_empty
17
- end
18
-
19
- it "doesn't have any status" do
20
- expect(subject).not_to be_any
21
- end
22
- end
23
-
24
- context "when there are statuses" do
25
- before do
26
- subject.statuses = statuses
27
- end
28
-
29
- it "is not blank" do
30
- expect(subject).not_to be_empty
31
- end
32
-
33
- it "has any status" do
34
- expect(subject).to be_any
35
- end
36
-
37
- it "has PagSeguro::TransactionStatus instances" do
38
- subject.each do |status|
39
- expect(status).to be_a(PagSeguro::TransactionStatus)
40
- end
41
- end
42
- end
43
- end