moip2 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +6 -12
- data/Gemfile +0 -1
- data/Gemfile.lock +4 -4
- data/README.md +142 -14
- data/changelog.md +55 -3
- data/examples/ecommerce/payment-with-boleto.rb +129 -0
- data/examples/ecommerce/payment-with-credit-card.rb +119 -0
- data/examples/ecommerce/payment-with-hash.rb +101 -0
- data/examples/marketplace/create-classical-account-company.rb +74 -0
- data/examples/marketplace/create-classical-account-without-company.rb +47 -0
- data/examples/marketplace/moip-connect.rb +31 -0
- data/examples/marketplace/payment-with-escrow.rb +88 -0
- data/examples/marketplace/payment-with-pre-authorization.rb +87 -0
- data/examples/marketplace/shared-cart.rb +220 -0
- data/lib/moip2/api.rb +17 -2
- data/lib/moip2/balances_api.rb +18 -0
- data/lib/moip2/bank_accounts_api.rb +51 -0
- data/lib/moip2/client.rb +11 -11
- data/lib/moip2/connect_api.rb +2 -13
- data/lib/moip2/connect_client.rb +11 -0
- data/lib/moip2/entry_api.rb +21 -0
- data/lib/moip2/multi_payment_api.rb +8 -0
- data/lib/moip2/order_api.rb +2 -1
- data/lib/moip2/resource/balances.rb +12 -0
- data/lib/moip2/resource/bank_account.rb +12 -0
- data/lib/moip2/resource/entry.rb +13 -0
- data/lib/moip2/version.rb +1 -1
- data/lib/moip2/webhooks_api.rb +20 -4
- data/lib/moip2.rb +7 -0
- data/moip2.gemspec +2 -0
- data/spec/moip2/balances_api_spec.rb +22 -0
- data/spec/moip2/bank_accounts_api_spec.rb +173 -0
- data/spec/moip2/client_spec.rb +13 -76
- data/spec/moip2/connect_api_spec.rb +1 -1
- data/spec/moip2/connect_client_spec.rb +63 -0
- data/spec/moip2/customer_api_spec.rb +3 -3
- data/spec/moip2/entry_api_spec.rb +43 -0
- data/spec/moip2/multi_payment_api_spec.rb +32 -2
- data/spec/moip2/order_api_spec.rb +24 -1
- data/spec/moip2/response_spec.rb +2 -6
- data/spec/moip2/webhooks_spec.rb +87 -11
- data/spec/moip2_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -14
- data/vcr_cassettes/bank_account_create_fail.yml +39 -0
- data/vcr_cassettes/bank_account_create_sucess.yml +41 -0
- data/vcr_cassettes/bank_account_deleted_existent.yml +38 -0
- data/vcr_cassettes/bank_account_deleted_nonexistent.yml +38 -0
- data/vcr_cassettes/bank_account_find_all.yml +9525 -0
- data/vcr_cassettes/bank_account_show_existent.yml +40 -0
- data/vcr_cassettes/bank_account_show_nonexistent.yml +38 -0
- data/vcr_cassettes/bank_account_update.yml +41 -0
- data/vcr_cassettes/capture_multi_payment_sucess.yml +44 -0
- data/vcr_cassettes/find_all_entries.yml +63 -0
- data/vcr_cassettes/find_all_orders_q_search.yml +39 -0
- data/vcr_cassettes/{get_webhooks.yml → find_all_webhooks.yml} +1 -1
- data/vcr_cassettes/find_all_webhooks_event.yml +42 -0
- data/vcr_cassettes/find_all_webhooks_limit.yml +48 -0
- data/vcr_cassettes/find_all_webhooks_multi_params.yml +38 -0
- data/vcr_cassettes/find_all_webhooks_no_filter.yml +58 -0
- data/vcr_cassettes/find_all_webhooks_offset.yml +58 -0
- data/vcr_cassettes/find_all_webhooks_resource_id.yml +38 -0
- data/vcr_cassettes/get_balances.yml +44 -0
- data/vcr_cassettes/show_entries.yml +43 -0
- data/vcr_cassettes/void_multi_payment_sucess.yml +46 -0
- metadata +50 -4
@@ -0,0 +1,63 @@
|
|
1
|
+
describe Moip2::ConnectClient do
|
2
|
+
let(:auth) do
|
3
|
+
Moip2::Auth::Basic.new("TOKEN", "SECRET")
|
4
|
+
end
|
5
|
+
|
6
|
+
let(:oauth) do
|
7
|
+
Moip2::Auth::OAuth.new "9fdc242631454d4c95d82e27b4127394_v2"
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "initialize env with string" do
|
11
|
+
let(:client) do
|
12
|
+
described_class.new "sandbox", auth
|
13
|
+
end
|
14
|
+
|
15
|
+
it { expect(client.env).to eq :sandbox }
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "initialize on sandbox with OAuth" do
|
19
|
+
let(:client) do
|
20
|
+
described_class.new :sandbox, oauth
|
21
|
+
end
|
22
|
+
|
23
|
+
it { expect(client.uri).to eq "https://connect-sandbox.moip.com.br" }
|
24
|
+
it { expect(client.env).to eq :sandbox }
|
25
|
+
it do
|
26
|
+
expect(client.opts[:headers]["Authorization"]).
|
27
|
+
to eq "OAuth 9fdc242631454d4c95d82e27b4127394_v2"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "initialize on production with OAuth" do
|
32
|
+
let(:client) do
|
33
|
+
described_class.new :production, oauth
|
34
|
+
end
|
35
|
+
|
36
|
+
it { expect(client.uri).to eq "https://connect.moip.com.br" }
|
37
|
+
it { expect(client.env).to eq :production }
|
38
|
+
it do
|
39
|
+
expect(client.opts[:headers]["Authorization"]).
|
40
|
+
to eq "OAuth 9fdc242631454d4c95d82e27b4127394_v2"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "initialize on sandbox with Basic authentication" do
|
45
|
+
let(:client) do
|
46
|
+
described_class.new :sandbox, auth
|
47
|
+
end
|
48
|
+
|
49
|
+
it { expect(client.uri).to eq "https://connect-sandbox.moip.com.br" }
|
50
|
+
it { expect(client.env).to eq :sandbox }
|
51
|
+
it { expect(client.opts[:headers]["Authorization"]).to eq "Basic VE9LRU46U0VDUkVU" }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "initialize on production with Basic authentication" do
|
55
|
+
let(:client) do
|
56
|
+
described_class.new :production, auth
|
57
|
+
end
|
58
|
+
|
59
|
+
it { expect(client.uri).to eq "https://connect.moip.com.br" }
|
60
|
+
it { expect(client.env).to eq :production }
|
61
|
+
it { expect(client.opts[:headers]["Authorization"]).to eq "Basic VE9LRU46U0VDUkVU" }
|
62
|
+
end
|
63
|
+
end
|
@@ -25,7 +25,7 @@ describe Moip2::CustomerApi do
|
|
25
25
|
it {
|
26
26
|
expect(
|
27
27
|
customer._links.self.href,
|
28
|
-
).to eq "
|
28
|
+
).to eq "https://sandbox.moip.com.br/v2/customers/CUS-B6LE6HLFFXKF"
|
29
29
|
}
|
30
30
|
end
|
31
31
|
|
@@ -110,7 +110,7 @@ describe Moip2::CustomerApi do
|
|
110
110
|
it {
|
111
111
|
expect(
|
112
112
|
created_customer_with_funding_instrument._links.self.href,
|
113
|
-
).to eq "
|
113
|
+
).to eq "https://sandbox.moip.com.br/v2/customers/CUS-E5CO735TBXTI"
|
114
114
|
}
|
115
115
|
end
|
116
116
|
|
@@ -161,7 +161,7 @@ describe Moip2::CustomerApi do
|
|
161
161
|
it {
|
162
162
|
expect(
|
163
163
|
created_customer._links.self.href,
|
164
|
-
).to eq "
|
164
|
+
).to eq "https://sandbox.moip.com.br/v2/customers/CUS-4GESZSOAH7HX"
|
165
165
|
}
|
166
166
|
end
|
167
167
|
|
@@ -0,0 +1,43 @@
|
|
1
|
+
describe Moip2::EntryApi do
|
2
|
+
let(:entry_api) { described_class.new(sandbox_oauth_client) }
|
3
|
+
|
4
|
+
describe "#show" do
|
5
|
+
let(:created_entry_show) do
|
6
|
+
VCR.use_cassette("show_entries") do
|
7
|
+
entry_api.show("ENT-2JHP5A593QSW")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "show especif entry" do
|
12
|
+
expect(created_entry_show.description).to eq "Cartao de credito - Pedido ORD-UF4E00XMFDL1"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "verify if amout present" do
|
16
|
+
expect(created_entry_show.installment.amount).to eq 1
|
17
|
+
end
|
18
|
+
|
19
|
+
it "verify if amout type present" do
|
20
|
+
expect(created_entry_show.type).to eq "CREDIT_CARD"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "verify if status present" do
|
24
|
+
expect(created_entry_show["status"]).to eq "SETTLED"
|
25
|
+
end
|
26
|
+
|
27
|
+
it "verify if events present" do
|
28
|
+
expect(created_entry_show.event_id).to eq "PAY-AQITTDNDKBU9"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe "#find_all" do
|
33
|
+
let(:created_entries_find_all) do
|
34
|
+
VCR.use_cassette("find_all_entries") do
|
35
|
+
entry_api.find_all
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "find all entries" do
|
40
|
+
expect(created_entries_find_all.parsed_response.first["external_id"]).to eq"ENT-2JHP5A593QSW"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -8,8 +8,8 @@ describe Moip2::MultiPaymentApi do
|
|
8
8
|
fundingInstrument: {
|
9
9
|
method: "CREDIT_CARD",
|
10
10
|
creditCard: {
|
11
|
-
expirationMonth: 05,
|
12
|
-
expirationYear: 18,
|
11
|
+
expirationMonth: "05",
|
12
|
+
expirationYear: "18",
|
13
13
|
number: "4012001038443335",
|
14
14
|
cvc: "123",
|
15
15
|
holder: {
|
@@ -56,4 +56,34 @@ describe Moip2::MultiPaymentApi do
|
|
56
56
|
expect(multi_payment.status).to eq "AUTHORIZED"
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
describe "#capture" do
|
61
|
+
let(:capture) do
|
62
|
+
VCR.use_cassette("capture_multi_payment_sucess") do
|
63
|
+
multi_payment_api.capture("MPY-89Q4R26EKU9D")
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
it "updates the multipayment's statuses" do
|
68
|
+
expect(capture.status).to eq("AUTHORIZED")
|
69
|
+
expect(capture.payments).to satisfy do |payments|
|
70
|
+
payments.all? { |payment| payment.status == "AUTHORIZED" }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "#void" do
|
76
|
+
let(:capture) do
|
77
|
+
VCR.use_cassette("void_multi_payment_sucess") do
|
78
|
+
multi_payment_api.void("MPY-4XRLP4YBLVFB")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
it "updates the multipayment's statuses" do
|
83
|
+
expect(capture.status).to eq("CANCELLED")
|
84
|
+
expect(capture.payments).to satisfy do |payments|
|
85
|
+
payments.all? { |payment| payment.status == "CANCELLED" }
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
59
89
|
end
|
@@ -76,7 +76,7 @@ describe Moip2::OrderApi do
|
|
76
76
|
expect(created_order.customer._links).to_not be_nil
|
77
77
|
expect(
|
78
78
|
created_order.customer._links.self.href,
|
79
|
-
).to eq "
|
79
|
+
).to eq "https://sandbox.moip.com.br/v2/customers/CUS-B6LE6HLFFXKF"
|
80
80
|
end
|
81
81
|
|
82
82
|
it "returns an Order object" do
|
@@ -214,5 +214,28 @@ describe Moip2::OrderApi do
|
|
214
214
|
end
|
215
215
|
end
|
216
216
|
end
|
217
|
+
|
218
|
+
context "when passing ownID search with `q`" do
|
219
|
+
subject(:response) do
|
220
|
+
VCR.use_cassette("find_all_orders_q_search") do
|
221
|
+
order_api.find_all(q: "25051990")
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
it { expect(response).to be_a(Moip2::Resource::Order) }
|
226
|
+
it { expect(response._links).not_to be_nil }
|
227
|
+
it { expect(response.summary).not_to be_nil }
|
228
|
+
|
229
|
+
it "_links.next has the right filters" do
|
230
|
+
expect(response._links.next.href).to eq(
|
231
|
+
"https://test.moip.com.br/v2/orders" \
|
232
|
+
"?q=25051990&filters=&limit=0&offset=0",
|
233
|
+
)
|
234
|
+
end
|
235
|
+
|
236
|
+
it "all orders satisfy the status constraint" do
|
237
|
+
expect(response.orders.first.own_id).to eq("25051990")
|
238
|
+
end
|
239
|
+
end
|
217
240
|
end
|
218
241
|
end
|
data/spec/moip2/response_spec.rb
CHANGED
@@ -15,9 +15,7 @@ describe Moip2::Response do
|
|
15
15
|
|
16
16
|
describe "#success?" do
|
17
17
|
let(:success_response) do
|
18
|
-
double("Success Response"
|
19
|
-
allow(success_response).to receive(:code).and_return(200)
|
20
|
-
end
|
18
|
+
double("Success Response", code: 200)
|
21
19
|
end
|
22
20
|
|
23
21
|
let(:response) { described_class.new(success_response, parsed_json) }
|
@@ -29,9 +27,7 @@ describe Moip2::Response do
|
|
29
27
|
|
30
28
|
describe "#client_error?" do
|
31
29
|
let(:error_response) do
|
32
|
-
double("Error Response"
|
33
|
-
allow(error_response).to receive(:code).and_return(400)
|
34
|
-
end
|
30
|
+
double("Error Response", code: 400)
|
35
31
|
end
|
36
32
|
|
37
33
|
let(:response) { described_class.new(error_response, {}) }
|
data/spec/moip2/webhooks_spec.rb
CHANGED
@@ -1,20 +1,96 @@
|
|
1
1
|
describe Moip2::WebhooksApi do
|
2
2
|
let(:webhooks_api) { described_class.new sandbox_oauth_client }
|
3
3
|
|
4
|
-
describe "#
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
describe "#find_all" do
|
5
|
+
context "when passing no filters" do
|
6
|
+
subject(:response) do
|
7
|
+
VCR.use_cassette("find_all_webhooks_no_filter") do
|
8
|
+
webhooks_api.find_all
|
9
|
+
end
|
8
10
|
end
|
11
|
+
|
12
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
13
|
+
it { expect(response.webhooks.size).to eq(20) }
|
14
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
15
|
+
it { expect(response.webhooks.first.id).to eq("EVE-DYPUJBZLJAPP") }
|
16
|
+
it { expect(response.webhooks.first.resource_id).to eq("ORD-2M8Q09MMCCE2") }
|
17
|
+
it { expect(response.webhooks.first.event).to eq("ORDER.PAID") }
|
18
|
+
end
|
19
|
+
|
20
|
+
context "when passing limit" do
|
21
|
+
subject(:response) do
|
22
|
+
VCR.use_cassette("find_all_webhooks_limit") do
|
23
|
+
webhooks_api.find_all(limit: 10)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
28
|
+
it { expect(response.webhooks.size).to eq(10) }
|
29
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
30
|
+
it { expect(response.webhooks.first.id).to eq("EVE-DYPUJBZLJAPP") }
|
31
|
+
it { expect(response.webhooks.first.resource_id).to eq("ORD-2M8Q09MMCCE2") }
|
32
|
+
it { expect(response.webhooks.first.event).to eq("ORDER.PAID") }
|
33
|
+
end
|
34
|
+
|
35
|
+
context "when passing offset" do
|
36
|
+
subject(:response) do
|
37
|
+
VCR.use_cassette("find_all_webhooks_offset") do
|
38
|
+
webhooks_api.find_all(offset: 10)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
43
|
+
it { expect(response.webhooks.size).to eq(20) }
|
44
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
45
|
+
it { expect(response.webhooks.first.id).to eq("EVE-NBIW53UT95VL") }
|
46
|
+
it { expect(response.webhooks.first.resource_id).to eq("PAY-M1A3GR2L5GF6") }
|
47
|
+
it { expect(response.webhooks.first.event).to eq("PAYMENT.AUTHORIZED") }
|
9
48
|
end
|
10
49
|
|
11
|
-
context "when
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
50
|
+
context "when passing resource id" do
|
51
|
+
subject(:response) do
|
52
|
+
VCR.use_cassette("find_all_webhooks_resource_id") do
|
53
|
+
webhooks_api.find_all(resource_id: "PAY-REJJ9F12MF7R")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
58
|
+
it { expect(response.webhooks.size).to eq(20) }
|
59
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
60
|
+
it { expect(response.webhooks.first.id).to eq("EVE-Y3IHX8P55I6Z") }
|
61
|
+
it { expect(response.webhooks.first.resource_id).to eq("PAY-REJJ9F12MF7R") }
|
62
|
+
it { expect(response.webhooks.first.event).to eq("PAYMENT.WAITING") }
|
63
|
+
end
|
64
|
+
|
65
|
+
context "when passing event" do
|
66
|
+
subject(:response) do
|
67
|
+
VCR.use_cassette("find_all_webhooks_event") do
|
68
|
+
webhooks_api.find_all(event: "PAYMENT.WAITING")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
73
|
+
it { expect(response.webhooks.size).to eq(4) }
|
74
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
75
|
+
it { expect(response.webhooks.first.id).to eq("EVE-C3PSMS9LZTSD") }
|
76
|
+
it { expect(response.webhooks.first.resource_id).to eq("PAY-XWNRC9MZTCO8") }
|
77
|
+
end
|
78
|
+
|
79
|
+
context "when passing event, resource id and limit" do
|
80
|
+
subject(:response) do
|
81
|
+
VCR.use_cassette("find_all_webhooks_multi_params") do
|
82
|
+
webhooks_api.find_all(event: "PAYMENT.WAITING",
|
83
|
+
resource_id: "PAY-REJJ9F12MF7R",
|
84
|
+
limit: 2,
|
85
|
+
offset: 2)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
it { expect(response).to be_a(Moip2::Resource::Webhooks) }
|
89
|
+
it { expect(response.webhooks.size).to eq(2) }
|
90
|
+
it { expect(response.webhooks.first).to be_a(Moip2::Resource::Webhooks) }
|
91
|
+
it { expect(response.webhooks.first.id).to eq("EVE-JLC485YHPXMS") }
|
92
|
+
it { expect(response.webhooks.first.resource_id).to eq("PAY-REJJ9F12MF7R") }
|
93
|
+
it { expect(response.webhooks.first.event).to eq("PAYMENT.WAITING") }
|
18
94
|
end
|
19
95
|
end
|
20
96
|
end
|
data/spec/moip2_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -7,8 +7,6 @@ SimpleCov.start
|
|
7
7
|
|
8
8
|
RSpec.configure do |config|
|
9
9
|
end
|
10
|
-
ENV["sandbox_url"] = "https://sandbox.moip.com.br"
|
11
|
-
ENV["connect_sandbox_url"] = "https://connect-sandbox.moip.com.br"
|
12
10
|
|
13
11
|
VCR.configure do |c|
|
14
12
|
c.cassette_library_dir = "vcr_cassettes"
|
@@ -36,18 +34,9 @@ def sandbox_client
|
|
36
34
|
end
|
37
35
|
|
38
36
|
def sandbox_oauth_client
|
39
|
-
Moip2::Client.new
|
37
|
+
Moip2::Client.new(:sandbox, sandbox_oauth)
|
40
38
|
end
|
41
39
|
|
42
|
-
def
|
43
|
-
Moip2::
|
44
|
-
end
|
45
|
-
|
46
|
-
def sandbox_client_connect
|
47
|
-
Moip2::Client.new(
|
48
|
-
:sandbox,
|
49
|
-
sandbox_auth,
|
50
|
-
ENV["connect_sandbox_url"],
|
51
|
-
{},
|
52
|
-
)
|
40
|
+
def sandbox_connect_client
|
41
|
+
Moip2::ConnectClient.new(:sandbox, sandbox_auth)
|
53
42
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://01010101010101010101010101010101:ABABABABABABABABABABABABABABABABABABABAB@sandbox.moip.com.br/v2/accounts/MPA-F00B4R123456/bankaccounts
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"bankNumber":"237","agencyNumber":"12345","agencyCheckNumber":"0","accountNumber":"12345678","accountCheckNumber":"7","type":"CHECKING","holder":{"taxDocument":{"type":"CPF","number":"255.328.259-12"},"fullname":"Jose
|
9
|
+
Silva dos Santos"}}'
|
10
|
+
headers:
|
11
|
+
Content-Type:
|
12
|
+
- application/json
|
13
|
+
User-Agent:
|
14
|
+
- MoipRubySDK/1.0.0 (+https://github.com/moip/moip-sdk-ruby)
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 401
|
18
|
+
message: Unauthorized
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Wed, 01 Nov 2017 21:57:03 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Newrelic-App-Data:
|
25
|
+
- PxQFUlBXAQoTV1VaDgMOVUYdFGQHBDcQUQxLA1tMXV1dORYzVBJHNQFUZAQUFVFQVThOFAVtGAcHUllGDBIQPh8ZWQFbV0FcRyxdHG1OUQMKXVYCBQxNXUQXQUpnfmQyTRMaA0xWT1ceVwtXAQpxHwdJC1IJTREBXFADBQMBXVIBBwRUBFQDREhXV18RAz4=
|
26
|
+
Content-Type:
|
27
|
+
- text/plain; charset=UTF-8
|
28
|
+
Content-Length:
|
29
|
+
- '0'
|
30
|
+
X-Content-Type-Options:
|
31
|
+
- nosniff
|
32
|
+
Vary:
|
33
|
+
- Accept-Encoding,Origin
|
34
|
+
body:
|
35
|
+
encoding: UTF-8
|
36
|
+
string: ''
|
37
|
+
http_version:
|
38
|
+
recorded_at: Wed, 01 Nov 2017 21:57:03 GMT
|
39
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://01010101010101010101010101010101:ABABABABABABABABABABABABABABABABABABABAB@sandbox.moip.com.br/v2/accounts/MPA-CULBBYHD11/bankaccounts
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"bankNumber":"237","agencyNumber":"12345","agencyCheckNumber":"0","accountNumber":"12345678","accountCheckNumber":"7","type":"CHECKING","holder":{"taxDocument":{"type":"CPF","number":"255.328.259-12"},"fullname":"Jose
|
9
|
+
Silva dos Santos"}}'
|
10
|
+
headers:
|
11
|
+
Content-Type:
|
12
|
+
- application/json
|
13
|
+
User-Agent:
|
14
|
+
- MoipRubySDK/1.0.0 (+https://github.com/moip/moip-sdk-ruby)
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 201
|
18
|
+
message: Created
|
19
|
+
headers:
|
20
|
+
Date:
|
21
|
+
- Wed, 01 Nov 2017 21:57:02 GMT
|
22
|
+
Server:
|
23
|
+
- Apache
|
24
|
+
X-Newrelic-App-Data:
|
25
|
+
- PxQFUlBXAQoTV1VaDgMOVUYdFGQHBDcQUQxLA1tMXV1dORYzVBJHNQFUZAQUFVFQVThOFAVtGAcHUllGDBIQPh8ZWQFbV0FcRyxdHG1OUQMKXVYCBQxNXUQXQUpnfmQyTRMaA0xWT1IeUwlWDg8NCwBJC1IJTRFbAlADAlRUClYFVFgEAlAFREhXV18RAz4=
|
26
|
+
Content-Type:
|
27
|
+
- application/json
|
28
|
+
Content-Length:
|
29
|
+
- '479'
|
30
|
+
X-Content-Type-Options:
|
31
|
+
- nosniff
|
32
|
+
Vary:
|
33
|
+
- Accept-Encoding,Origin
|
34
|
+
body:
|
35
|
+
encoding: UTF-8
|
36
|
+
string: '{"id":"BKA-D2YYYVIXCENW","agencyNumber":"12345","holder":{"taxDocument":{"number":"255.328.259-12","type":"CPF"},"thirdParty":false,"fullname":"Jose
|
37
|
+
Silva dos Santos"},"accountNumber":"12345678","status":"NOT_VERIFIED","createdAt":"2017-11-01T19:57:02.703-02:00","accountCheckNumber":"7","_links":{"self":{"href":"https://sandbox.moip.com.br//accounts/BKA-D2YYYVIXCENW/bankaccounts"}},"bankName":"BANCO
|
38
|
+
BRADESCO S.A.","type":"CHECKING","agencyCheckNumber":"0","bankNumber":"237"}'
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 01 Nov 2017 21:57:02 GMT
|
41
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://01010101010101010101010101010101:ABABABABABABABABABABABABABABABABABABABAB@sandbox.moip.com.br/v2/bankaccounts/BKA-YBG1D8FKXXMT
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- MoipRubySDK/1.0.0 (+https://github.com/moip/moip-sdk-ruby)
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: OK
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Wed, 01 Nov 2017 21:33:52 GMT
|
21
|
+
Server:
|
22
|
+
- Apache
|
23
|
+
X-Newrelic-App-Data:
|
24
|
+
- PxQFUlBXAQoTV1VaDgMOVUYdFGQHBDcQUQxLA1tMXV1dORYzVBJHNQFUZAQUFVFQVThOFAVtGAQFX11SAQUMF14WSz4XQ1ZTXQ5wBUxBGyYhenI1I0oaHwBKUU4HHwdeXAMGBlNeT1IcQAhXAVsNVwVXCAAIWQEHAVUVTQACVEBVOQ==
|
25
|
+
Content-Type:
|
26
|
+
- text/plain; charset=UTF-8
|
27
|
+
Content-Length:
|
28
|
+
- '0'
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
Vary:
|
32
|
+
- Accept-Encoding,Origin
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: ''
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 01 Nov 2017 21:33:52 GMT
|
38
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://01010101010101010101010101010101:ABABABABABABABABABABABABABABABABABABABAB@sandbox.moip.com.br/v2/bankaccounts/BKA-F00B4R123456
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
User-Agent:
|
13
|
+
- MoipRubySDK/1.0.0 (+https://github.com/moip/moip-sdk-ruby)
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 404
|
17
|
+
message: Not Found
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Wed, 01 Nov 2017 21:39:05 GMT
|
21
|
+
Server:
|
22
|
+
- Apache
|
23
|
+
X-Newrelic-App-Data:
|
24
|
+
- PxQFUlBXAQoTV1VaDgMOVUYdFGQHBDcQUQxLA1tMXV1dORYzVBJHNQFUZAQUFVFQVThOFAVtGAQFX11SAQUMF14WSz4XQ1ZTXQ5wBUxBGyYhenI1I0oaHwBKUU4HHwdTUgEABFZUT1IcQFkHAQAGAVVSCFMDVgBTUAIVTQACVEBVOQ==
|
25
|
+
Content-Type:
|
26
|
+
- text/plain; charset=UTF-8
|
27
|
+
Content-Length:
|
28
|
+
- '0'
|
29
|
+
X-Content-Type-Options:
|
30
|
+
- nosniff
|
31
|
+
Vary:
|
32
|
+
- Accept-Encoding,Origin
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: ''
|
36
|
+
http_version:
|
37
|
+
recorded_at: Wed, 01 Nov 2017 21:39:05 GMT
|
38
|
+
recorded_with: VCR 2.9.3
|