mercado_pago_rails 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15165876e4bd39b58fbaf0cb031867beede10111
|
4
|
+
data.tar.gz: aab174c00ac0eeb7fe4a252c20d365a57680c5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 446612d199cee48bf72a3ac7574be647fbae63128261c175877914344ca695d16ea112ada998af5a4f979a66612dd69b1ef490d46df4f86382f489354d177acc
|
7
|
+
data.tar.gz: 913a95f7699125947c4f7f6e2ff76653510e9fdcd46b90e5e5b72046a8b66c020679eb6dab2783096d8e32d047d3e2f0341c106d189d528d7b1808a7e0aba274
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0-
|
1
|
+
2.0.0-p195
|
data/lib/mercado_pago_rails.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require "mercado_pago_rails/mercado_pago_checkout"
|
2
2
|
require "mercado_pago_rails/mercado_pago_response"
|
3
|
+
require "mercado_pago_rails/mercado_pago_rails_helper"
|
3
4
|
require "mercado_pago_rails/version"
|
4
5
|
|
5
6
|
module MercadoPagoRails
|
6
7
|
|
7
8
|
def generate_purchase(mercado_pago_object, urls = {})
|
8
|
-
purchase =
|
9
|
+
purchase = MercadoPagoRailsHelper.mp.create_preference(get_data(mercado_pago_object, urls))
|
9
10
|
mercado_pago_object.new_status(purchase['response']['error'] ? "error" : "pending")
|
10
11
|
MercadoPagoResponse.new(purchase)
|
11
12
|
end
|
@@ -1,51 +1,51 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'mercado_pago_rails/
|
2
|
+
require 'mercado_pago_rails/mercado_pago_rails_helper'
|
3
3
|
require_relative 'test_contexts'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe MercadoPagoRailsHelper do
|
6
6
|
|
7
7
|
describe "#set_handlers" do
|
8
8
|
|
9
9
|
context "when not all handlers are set" do
|
10
10
|
|
11
11
|
it "it raises an exception" do
|
12
|
-
expect {
|
12
|
+
expect { MercadoPagoRailsHelper.set_handlers(approved: TestContexts::ApprovedContext, pending: TestContexts::PendingContext, in_process: TestContexts::InProcessContext,
|
13
13
|
in_mediation: TestContexts::InMediationContext, rejected: TestContexts::RejectedContext, cancelled: TestContexts::CancelledContext) }.to raise_error
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
context "when all handlers are set" do
|
18
18
|
before do
|
19
|
-
|
19
|
+
MercadoPagoRailsHelper.set_handlers(approved: TestContexts::ApprovedContext, pending: TestContexts::PendingContext, in_process: TestContexts::InProcessContext,
|
20
20
|
in_mediation: TestContexts::InMediationContext, rejected: TestContexts::RejectedContext, cancelled: TestContexts::CancelledContext, refunded: TestContexts::RefundedContext)
|
21
21
|
end
|
22
22
|
|
23
23
|
it "it returns the right context for approved status" do
|
24
|
-
|
24
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::APPROVED.to_s), nil).class.should eq TestContexts::ApprovedContext
|
25
25
|
end
|
26
26
|
|
27
27
|
it "it returns the right context for pending status" do
|
28
|
-
|
28
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::PENDING.to_s), nil).class.should eq TestContexts::PendingContext
|
29
29
|
end
|
30
30
|
|
31
31
|
it "it returns the right context for in_process status" do
|
32
|
-
|
32
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::IN_PROCESS.to_s), nil).class.should eq TestContexts::InProcessContext
|
33
33
|
end
|
34
34
|
|
35
35
|
it "it returns the right context for in mediation status" do
|
36
|
-
|
36
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::IN_MEDIATION.to_s), nil).class.should eq TestContexts::InMediationContext
|
37
37
|
end
|
38
38
|
|
39
39
|
it "it returns the right context for rejected status" do
|
40
|
-
|
40
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::REJECTED.to_s), nil).class.should eq TestContexts::RejectedContext
|
41
41
|
end
|
42
42
|
|
43
43
|
it "it returns the right context for cancelled status" do
|
44
|
-
|
44
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::CANCELLED.to_s), nil).class.should eq TestContexts::CancelledContext
|
45
45
|
end
|
46
46
|
|
47
47
|
it "it returns the right context for refunded status" do
|
48
|
-
|
48
|
+
MercadoPagoRailsHelper.get_context(get_response(MercadoPagoRailsHelper::REFUNDED.to_s), nil).class.should eq TestContexts::RefundedContext
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mercado_pago_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matias De Santi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -125,7 +125,7 @@ files:
|
|
125
125
|
- Rakefile
|
126
126
|
- lib/mercado_pago_rails.rb
|
127
127
|
- lib/mercado_pago_rails/mercado_pago_checkout.rb
|
128
|
-
- lib/mercado_pago_rails/
|
128
|
+
- lib/mercado_pago_rails/mercado_pago_rails_helper.rb
|
129
129
|
- lib/mercado_pago_rails/mercado_pago_response.rb
|
130
130
|
- lib/mercado_pago_rails/version.rb
|
131
131
|
- mercado_pago_rails.gemspec
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.0.
|
158
|
+
rubygems_version: 2.0.2
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: This gem makes communication with mercado pago easy at the time of generating
|