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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/CONTRIBUTING.md +39 -0
- data/Dockerfile +20 -0
- data/README.md +22 -0
- data/docker-compose.yml +5 -0
- data/examples/checkout/create_payment_request.rb +1 -1
- data/examples/direct/create_transaction_using_boleto.rb +1 -1
- data/examples/direct/create_transaction_using_credit_card.rb +1 -1
- data/examples/direct/create_transaction_using_online_debit.rb +1 -1
- data/examples/preapproval/cancel_preapproval.rb +26 -0
- data/examples/preapproval/change_preapproval_payment.rb +50 -0
- data/examples/preapproval/change_preapproval_status.rb +29 -0
- data/examples/preapproval/charge_preapproval.rb +36 -0
- data/examples/preapproval/create_preapproval.rb +68 -0
- data/examples/preapproval/create_preapproval_auto.rb +53 -0
- data/examples/preapproval/create_preapproval_discount.rb +30 -0
- data/examples/preapproval/create_preapproval_manual.rb +58 -0
- data/examples/preapproval/create_preapproval_transparent.rb +41 -0
- data/examples/preapproval/preapproval_retry.rb +29 -0
- data/examples/preapproval/search/search_by_date_interval.rb +45 -0
- data/examples/preapproval/search/search_by_days_interval.rb +46 -0
- data/examples/preapproval/search/search_by_notification_code.rb +50 -0
- data/examples/preapproval/search/search_by_subscription_code.rb +50 -0
- data/examples/preapproval/search/search_subscription_payment_orders.rb +53 -0
- data/examples/split_payment/create_payment_request.rb +1 -1
- data/examples/split_payment/create_transaction_using_boleto.rb +118 -0
- data/examples/split_payment/create_transaction_using_credit_card.rb +152 -0
- data/lib/pagseguro.rb +33 -1
- data/lib/pagseguro/credit_card_transaction_request.rb +1 -1
- data/lib/pagseguro/document.rb +8 -0
- data/lib/pagseguro/holder.rb +8 -0
- data/lib/pagseguro/manual_subscription_charger.rb +59 -0
- data/lib/pagseguro/manual_subscription_charger/request_serializer.rb +50 -0
- data/lib/pagseguro/manual_subscription_charger/response.rb +36 -0
- data/lib/pagseguro/manual_subscription_charger/response_serializer.rb +17 -0
- data/lib/pagseguro/payment_request/request_serializer.rb +25 -1
- data/lib/pagseguro/receiver.rb +3 -0
- data/lib/pagseguro/request.rb +32 -2
- data/lib/pagseguro/sender.rb +21 -3
- data/lib/pagseguro/subscription.rb +132 -0
- data/lib/pagseguro/subscription/request_serializer.rb +129 -0
- data/lib/pagseguro/subscription/response.rb +49 -0
- data/lib/pagseguro/subscription/response_serializer.rb +62 -0
- data/lib/pagseguro/subscription/subscription_search.rb +135 -0
- data/lib/pagseguro/subscription_canceller.rb +30 -0
- data/lib/pagseguro/subscription_canceller/response.rb +34 -0
- data/lib/pagseguro/subscription_change_payment.rb +46 -0
- data/lib/pagseguro/subscription_change_payment/request_serializer.rb +80 -0
- data/lib/pagseguro/subscription_change_payment/response.rb +26 -0
- data/lib/pagseguro/subscription_change_status.rb +50 -0
- data/lib/pagseguro/subscription_change_status/request_serializer.rb +28 -0
- data/lib/pagseguro/subscription_change_status/response.rb +26 -0
- data/lib/pagseguro/subscription_discount.rb +41 -0
- data/lib/pagseguro/subscription_discount/request_serializer.rb +34 -0
- data/lib/pagseguro/subscription_discount/response.rb +34 -0
- data/lib/pagseguro/subscription_payment_method.rb +21 -0
- data/lib/pagseguro/subscription_payment_order.rb +57 -0
- data/lib/pagseguro/subscription_payment_order/response.rb +37 -0
- data/lib/pagseguro/subscription_payment_order/response_serializer.rb +51 -0
- data/lib/pagseguro/subscription_plan.rb +69 -0
- data/lib/pagseguro/subscription_plan/request_serializer.rb +81 -0
- data/lib/pagseguro/subscription_plan/response.rb +36 -0
- data/lib/pagseguro/subscription_plan/response_serializer.rb +17 -0
- data/lib/pagseguro/subscription_retry.rb +35 -0
- data/lib/pagseguro/subscription_retry/response.rb +34 -0
- data/lib/pagseguro/subscription_search_payment_orders.rb +131 -0
- data/lib/pagseguro/subscription_transaction.rb +29 -0
- data/lib/pagseguro/subscription_transactions.rb +5 -0
- data/lib/pagseguro/transaction.rb +0 -10
- data/lib/pagseguro/transaction/serializer.rb +19 -2
- data/lib/pagseguro/transaction_request.rb +26 -1
- data/lib/pagseguro/transaction_request/request_serializer.rb +164 -1
- data/lib/pagseguro/version.rb +1 -1
- data/spec/fixtures/manual_subscription_charger/fail.xml +6 -0
- data/spec/fixtures/manual_subscription_charger/success.xml +4 -0
- data/spec/fixtures/subscription/fail.xml +6 -0
- data/spec/fixtures/subscription/find_success.xml +28 -0
- data/spec/fixtures/subscription/search_success.xml +18 -0
- data/spec/fixtures/subscription/success.xml +4 -0
- data/spec/fixtures/subscription_canceller/fail.xml +6 -0
- data/spec/fixtures/subscription_change_payment/fail.xml +7 -0
- data/spec/fixtures/subscription_change_status/fail.xml +7 -0
- data/spec/fixtures/subscription_discount/fail.xml +6 -0
- data/spec/fixtures/subscription_payment_order/success.xml +18 -0
- data/spec/fixtures/subscription_plan/fail.xml +6 -0
- data/spec/fixtures/subscription_plan/success.xml +4 -0
- data/spec/fixtures/subscription_retry/fail.xml +7 -0
- data/spec/fixtures/subscription_search_payment_orders/success.xml +43 -0
- data/spec/fixtures/transactions/without_status_and_type.xml +71 -0
- data/spec/pagseguro/credit_card_transaction_request_spec.rb +1 -1
- data/spec/pagseguro/document_spec.rb +15 -0
- data/spec/pagseguro/holder_spec.rb +1 -0
- data/spec/pagseguro/manual_subscription_charger/request_serializer_spec.rb +79 -0
- data/spec/pagseguro/manual_subscription_charger/response_serializer_spec.rb +10 -0
- data/spec/pagseguro/manual_subscription_charger/response_spec.rb +65 -0
- data/spec/pagseguro/manual_subscription_charger_spec.rb +68 -0
- data/spec/pagseguro/payment_request/request_serializer_spec.rb +54 -22
- data/spec/pagseguro/receiver_spec.rb +1 -0
- data/spec/pagseguro/sender_spec.rb +16 -2
- data/spec/pagseguro/subscription/request_serializer_spec.rb +233 -0
- data/spec/pagseguro/subscription/response_serializer_spec.rb +46 -0
- data/spec/pagseguro/subscription/response_spec.rb +79 -0
- data/spec/pagseguro/subscription/subscription_search_spec.rb +154 -0
- data/spec/pagseguro/subscription_canceller/response_spec.rb +58 -0
- data/spec/pagseguro/subscription_canceller_spec.rb +57 -0
- data/spec/pagseguro/subscription_change_payment/request_serializer_spec.rb +150 -0
- data/spec/pagseguro/subscription_change_payment/response_spec.rb +41 -0
- data/spec/pagseguro/subscription_change_payment_spec.rb +60 -0
- data/spec/pagseguro/subscription_change_status/request_serializer_spec.rb +19 -0
- data/spec/pagseguro/subscription_change_status/response_spec.rb +41 -0
- data/spec/pagseguro/subscription_change_status_spec.rb +53 -0
- data/spec/pagseguro/subscription_discount/request_serializer_spec.rb +27 -0
- data/spec/pagseguro/subscription_discount/response_spec.rb +58 -0
- data/spec/pagseguro/subscription_discount_spec.rb +60 -0
- data/spec/pagseguro/subscription_payment_method_spec.rb +10 -0
- data/spec/pagseguro/subscription_payment_order/response_serializer_spec.rb +24 -0
- data/spec/pagseguro/subscription_payment_order/response_spec.rb +55 -0
- data/spec/pagseguro/subscription_payment_order_spec.rb +27 -0
- data/spec/pagseguro/subscription_plan/request_serializer_spec.rb +253 -0
- data/spec/pagseguro/subscription_plan/response_serializer_spec.rb +10 -0
- data/spec/pagseguro/subscription_plan/response_spec.rb +65 -0
- data/spec/pagseguro/subscription_plan_spec.rb +118 -0
- data/spec/pagseguro/subscription_retry/response_spec.rb +58 -0
- data/spec/pagseguro/subscription_retry_spec.rb +62 -0
- data/spec/pagseguro/subscription_search_payment_order_spec.rb +129 -0
- data/spec/pagseguro/subscription_spec.rb +137 -0
- data/spec/pagseguro/subscription_transaction_spec.rb +24 -0
- data/spec/pagseguro/subscription_transactions_spec.rb +37 -0
- data/spec/pagseguro/transaction/response_spec.rb +0 -42
- data/spec/pagseguro/transaction/serializer_spec.rb +5 -6
- data/spec/pagseguro/transaction_request/request_serializer_spec.rb +623 -159
- data/spec/pagseguro/transaction_request_spec.rb +26 -0
- data/spec/pagseguro/transaction_spec.rb +0 -48
- data/spec/spec_helper.rb +1 -0
- metadata +154 -8
- data/examples/checkout/search/search_transaction_status_history.rb +0 -22
- data/lib/pagseguro/transaction/status_collection.rb +0 -20
- data/spec/fixtures/transactions/status_history.xml +0 -12
- 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
|