punto_pagos_rails 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0802b882684f0f88e366a6286bf88001576d7040
4
- data.tar.gz: 0abf35bab91213a7d0e99ecd01a97c825b33cca7
3
+ metadata.gz: 38ee4d459254a4db352d99772377056e970256bd
4
+ data.tar.gz: cb7cb0328bec57a0d1372a3bd63f1a8afc024937
5
5
  SHA512:
6
- metadata.gz: a8c5528f759e9dd8be5c6604d2c1036ae84840f69401f7ce8e18b108b3345371806555d9538d982359cbd6e61ab60aadeb03ae6462b640c31d532a03e75d0de6
7
- data.tar.gz: 15942f1a64c89f99f86dc81dc0df429bf1fcbe78d3bcf4398e0565c0d9cb35fdd283e0356df07d461215b8050d73aead3ac846b520e8d75a62e5d6e808a5d6dd
6
+ metadata.gz: d0a4dbd040088c855bb2bb90d124cdcfa6f1f4955aa99a7a6ad17faaaa884bc29310bb75a885e80d434e235667c2ee221549e801becca94623a0313ca1c19207
7
+ data.tar.gz: 25c12ef1d73c0553186b23d97a20594b0952d6fbaa232064a6b1374a870746d7167c4a55dca5e96209f20984bdb0c32c21887f5f67a5c9878c420b8f855a2356
@@ -7,7 +7,12 @@ module PuntoPagosRails
7
7
  redirect_to srv.process_url
8
8
  else
9
9
  @resource = resource_by_id
10
- render_payment_error_view srv.error
10
+ if error_url = PuntoPagosRails.error_url
11
+ url = instance_exec(@resource, &error_url)
12
+ redirect_to url
13
+ else
14
+ render_payment_error_view srv.error
15
+ end
11
16
  end
12
17
  end
13
18
 
@@ -16,14 +21,28 @@ module PuntoPagosRails
16
21
  render json: response
17
22
  end
18
23
 
24
+ def notification_no_ssl
25
+ response = TransactionService.validate(params[:token], transaction)
26
+ head 200
27
+ end
28
+
19
29
  def success
20
30
  @resource = resource_by_token
31
+ if success_url_block = PuntoPagosRails.success_url
32
+ url = instance_exec(@resource, &success_url_block)
33
+ redirect_to url
34
+ end
21
35
  end
22
36
 
23
37
  def error
24
38
  @resource = resource_by_token
25
39
  translated_error = I18n.t("punto_pagos_rails.errors.invalid_puntopagos_payment")
26
- render_payment_error_view translated_error
40
+ if error_url = PuntoPagosRails.error_url
41
+ url = instance_exec(@resource, translated_error , &error_url)
42
+ redirect_to url
43
+ else
44
+ render_payment_error_view translated_error
45
+ end
27
46
  end
28
47
 
29
48
  private
@@ -39,8 +58,12 @@ module PuntoPagosRails
39
58
  end
40
59
  end
41
60
 
61
+ def transaction
62
+ @transcation ||= Transaction.find_by(token: params[:token])
63
+ end
64
+
42
65
  def resource_by_token
43
- Transaction.find_by(token: params[:token]).try(:resource)
66
+ transaction.try(:resource)
44
67
  end
45
68
 
46
69
  def resource_by_id
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  PuntoPagosRails::Engine.routes.draw do
2
2
  post "transactions/notification", to: 'transactions#notification'
3
+ get "transactions/notification/:token", to: 'transactions#notification_no_ssl'
3
4
  get "transactions/error/:token", to: 'transactions#error', as: :transaction_error
4
5
  get "transactions/success/:token", to: 'transactions#success', as: :transaction_success
5
6
  post "transactions/create", to: 'transactions#create', as: :transaction_create
@@ -6,6 +6,9 @@ module PuntoPagosRails
6
6
  extend self
7
7
 
8
8
  attr_accessor :resource_class_name
9
+ attr_accessor :success_url
10
+ attr_accessor :error_url
11
+
9
12
 
10
13
  def resource_class
11
14
  resource_class_name.constantize
@@ -33,6 +33,16 @@ module PuntoPagosRails
33
33
  end
34
34
  end
35
35
 
36
+ def self.validate(token, transaction)
37
+ status = PuntoPagos::Status.new
38
+ status.check token, transaction.id.to_s, transaction.amount_to_s
39
+ if status.valid?
40
+ respond_success(token)
41
+ else
42
+ respond_error(token, status.error)
43
+ end
44
+ end
45
+
36
46
  def error
37
47
  resource.errors.messages[:base].first
38
48
  end
@@ -1,3 +1,3 @@
1
1
  module PuntoPagosRails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,13 +1,21 @@
1
1
  class Ticket < ActiveRecord::Base
2
2
  include PuntoPagosRails::ResourceExtension
3
3
 
4
- attr_reader :message
5
-
6
4
  set_callback :payment_success, :after do
7
- @message = "successful payment! #{self.id}"
5
+ confirm_payment
8
6
  end
9
7
 
10
8
  set_callback :payment_error, :after do
11
- @message = "error paying ticket #{self.id}"
9
+ release_tickets
10
+ end
11
+
12
+ def confirm_payment
13
+ self.message = "successful payment! #{self.id}"
14
+ save!
15
+ end
16
+
17
+ def release_tickets
18
+ self.message = "error paying ticket #{self.id}"
19
+ save!
12
20
  end
13
21
  end
Binary file
@@ -2,6 +2,7 @@ class CreateTickets < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :tickets do |t|
4
4
  t.integer :amount
5
+ t.string :message
5
6
 
6
7
  t.timestamps
7
8
  end
@@ -25,6 +25,7 @@ ActiveRecord::Schema.define(version: 20141026172011) do
25
25
 
26
26
  create_table "tickets", force: true do |t|
27
27
  t.integer "amount"
28
+ t.string "message"
28
29
  t.datetime "created_at"
29
30
  t.datetime "updated_at"
30
31
  end
Binary file
@@ -5369,3 +5369,10 @@ Started GET "/assets/punto_pagos_rails/application.js?body=1" for 127.0.0.1 at 2
5369
5369
  PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? ORDER BY "punto_pagos_rails_transactions"."id" DESC LIMIT 1 [["resource_id", 39]]
5370
5370
  Ticket Load (0.2ms) SELECT "tickets".* FROM "tickets" ORDER BY "tickets"."id" DESC LIMIT 1
5371
5371
  PuntoPagosRails::Transaction Load (0.3ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 39]]
5372
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
5373
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5374
+  (2.0ms) DROP TABLE "punto_pagos_rails_transactions"
5375
+  (0.8ms) CREATE TABLE "punto_pagos_rails_transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_id" integer, "token" varchar(255), "amount" integer, "error" varchar(255), "state" varchar(255), "created_at" datetime, "updated_at" datetime)
5376
+  (0.9ms) DROP TABLE "tickets"
5377
+  (0.7ms) CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "message" varchar(255), "created_at" datetime, "updated_at" datetime)
5378
+  (0.3ms) SELECT version FROM "schema_migrations"
@@ -4622,3 +4622,716 @@
4622
4622
   (0.5ms) rollback transaction
4623
4623
   (0.1ms) begin transaction
4624
4624
   (0.0ms) rollback transaction
4625
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
4626
+  (0.3ms) begin transaction
4627
+  (0.0ms) rollback transaction
4628
+  (0.0ms) begin transaction
4629
+  (0.1ms) SAVEPOINT active_record_1
4630
+ SQL (0.9ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.218311"], ["updated_at", "2015-09-07 17:28:00.218311"]]
4631
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4632
+  (0.1ms) SAVEPOINT active_record_1
4633
+ SQL (1.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.274162"], ["resource_id", 1], ["state", "pending"], ["token", "hg6oydQYx1MQZbrsCu6xLg=="], ["updated_at", "2015-09-07 17:28:00.274162"]]
4634
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4635
+  (0.1ms) SAVEPOINT active_record_1
4636
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:28:00.278055"]]
4637
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4638
+  (0.9ms) rollback transaction
4639
+  (0.1ms) begin transaction
4640
+  (0.1ms) SAVEPOINT active_record_1
4641
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.283490"], ["updated_at", "2015-09-07 17:28:00.283490"]]
4642
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4643
+  (0.0ms) SAVEPOINT active_record_1
4644
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.285316"], ["resource_id", 1], ["state", "pending"], ["token", "t/bDBcZfXOJs36kHa/Xduw=="], ["updated_at", "2015-09-07 17:28:00.285316"]]
4645
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4646
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'completed' WHERE "punto_pagos_rails_transactions"."id" = 1
4647
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
4648
+  (0.5ms) rollback transaction
4649
+  (0.1ms) begin transaction
4650
+  (0.1ms) SAVEPOINT active_record_1
4651
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.297225"], ["updated_at", "2015-09-07 17:28:00.297225"]]
4652
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4653
+  (0.0ms) SAVEPOINT active_record_1
4654
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.299018"], ["resource_id", 1], ["state", "pending"], ["token", "Cwso4l6W65rj7HV8kve5KQ=="], ["updated_at", "2015-09-07 17:28:00.299018"]]
4655
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4656
+  (0.1ms) SAVEPOINT active_record_1
4657
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:28:00.300862"]]
4658
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4659
+  (0.7ms) rollback transaction
4660
+  (0.0ms) begin transaction
4661
+  (0.0ms) SAVEPOINT active_record_1
4662
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.304673"], ["updated_at", "2015-09-07 17:28:00.304673"]]
4663
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4664
+  (0.0ms) SAVEPOINT active_record_1
4665
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.306800"], ["resource_id", 1], ["state", "pending"], ["token", "EEck++6hs89tMa3L1APKrg=="], ["updated_at", "2015-09-07 17:28:00.306800"]]
4666
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4667
+  (0.1ms) SAVEPOINT active_record_1
4668
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:28:00.308883"]]
4669
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4670
+  (0.7ms) rollback transaction
4671
+  (0.0ms) begin transaction
4672
+  (0.1ms) SAVEPOINT active_record_1
4673
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.313136"], ["updated_at", "2015-09-07 17:28:00.313136"]]
4674
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4675
+  (0.0ms) SAVEPOINT active_record_1
4676
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.314921"], ["resource_id", 1], ["state", "pending"], ["token", "tkdWP6GmNvbR59k6Tu4VNQ=="], ["updated_at", "2015-09-07 17:28:00.314921"]]
4677
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4678
+  (0.1ms) SAVEPOINT active_record_1
4679
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:28:00.317636"]]
4680
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4681
+  (0.7ms) rollback transaction
4682
+  (0.0ms) begin transaction
4683
+  (0.1ms) SAVEPOINT active_record_1
4684
+ SQL (0.6ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.323352"], ["updated_at", "2015-09-07 17:28:00.323352"]]
4685
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4686
+  (0.0ms) SAVEPOINT active_record_1
4687
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.327183"], ["resource_id", 1], ["state", "pending"], ["token", "XfMQeKzqJ2CgsutEgT1N9Q=="], ["updated_at", "2015-09-07 17:28:00.327183"]]
4688
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4689
+  (0.1ms) SAVEPOINT active_record_1
4690
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:28:00.329484"]]
4691
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4692
+  (0.5ms) rollback transaction
4693
+  (0.1ms) begin transaction
4694
+  (0.1ms) SAVEPOINT active_record_1
4695
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.333539"], ["updated_at", "2015-09-07 17:28:00.333539"]]
4696
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4697
+  (0.0ms) SAVEPOINT active_record_1
4698
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.335247"], ["resource_id", 1], ["state", "pending"], ["token", "FasXTVUynyODNApcjosLaQ=="], ["updated_at", "2015-09-07 17:28:00.335247"]]
4699
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4700
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'rejected' WHERE "punto_pagos_rails_transactions"."id" = 1
4701
+ PuntoPagosRails::Transaction Load (0.0ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
4702
+  (0.5ms) rollback transaction
4703
+  (0.1ms) begin transaction
4704
+  (0.1ms) SAVEPOINT active_record_1
4705
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.343651"], ["updated_at", "2015-09-07 17:28:00.343651"]]
4706
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4707
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4708
+  (0.2ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
4709
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4710
+  (0.1ms) SAVEPOINT active_record_1
4711
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.355987"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.355987"]]
4712
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4713
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4714
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4715
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
4716
+  (0.6ms) rollback transaction
4717
+  (0.1ms) begin transaction
4718
+  (0.1ms) SAVEPOINT active_record_1
4719
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.369137"], ["updated_at", "2015-09-07 17:28:00.369137"]]
4720
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4721
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4722
+  (0.1ms) SAVEPOINT active_record_1
4723
+ SQL (0.8ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.372934"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.372934"]]
4724
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4725
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4726
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4727
+  (0.0ms) SAVEPOINT active_record_1
4728
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:28:00.379295"]]
4729
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4730
+  (0.6ms) rollback transaction
4731
+  (0.1ms) begin transaction
4732
+  (0.1ms) SAVEPOINT active_record_1
4733
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.383224"], ["updated_at", "2015-09-07 17:28:00.383224"]]
4734
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4735
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4736
+  (0.0ms) SAVEPOINT active_record_1
4737
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.385864"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.385864"]]
4738
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4739
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4740
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4741
+  (0.0ms) SAVEPOINT active_record_1
4742
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:28:00.388457"]]
4743
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4744
+  (0.7ms) rollback transaction
4745
+  (0.0ms) begin transaction
4746
+  (0.1ms) SAVEPOINT active_record_1
4747
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.392990"], ["updated_at", "2015-09-07 17:28:00.392990"]]
4748
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4749
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4750
+  (0.0ms) SAVEPOINT active_record_1
4751
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.395794"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.395794"]]
4752
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4753
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4754
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4755
+  (0.0ms) SAVEPOINT active_record_1
4756
+ SQL (0.0ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:28:00.398287"]]
4757
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4758
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? ORDER BY "punto_pagos_rails_transactions"."id" DESC LIMIT 1 [["resource_id", 1]]
4759
+  (0.5ms) rollback transaction
4760
+  (0.0ms) begin transaction
4761
+  (0.1ms) SAVEPOINT active_record_1
4762
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.403016"], ["updated_at", "2015-09-07 17:28:00.403016"]]
4763
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4764
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4765
+  (0.0ms) SAVEPOINT active_record_1
4766
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.405612"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.405612"]]
4767
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4768
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4769
+  (0.6ms) rollback transaction
4770
+  (0.1ms) begin transaction
4771
+  (0.1ms) SAVEPOINT active_record_1
4772
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "state", "token", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.410576"], ["state", "pending"], ["token", "REPEATED_TOKEN"], ["updated_at", "2015-09-07 17:28:00.410576"]]
4773
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4774
+  (0.1ms) SAVEPOINT active_record_1
4775
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.412520"], ["updated_at", "2015-09-07 17:28:00.412520"]]
4776
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4777
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4778
+  (0.0ms) SAVEPOINT active_record_1
4779
+ SQL (0.1ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.414914"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.414914"]]
4780
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4781
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4782
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'REPEATED_TOKEN'
4783
+  (0.7ms) rollback transaction
4784
+  (0.1ms) begin transaction
4785
+  (0.1ms) SAVEPOINT active_record_1
4786
+ SQL (0.8ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.419933"], ["updated_at", "2015-09-07 17:28:00.419933"]]
4787
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4788
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4789
+  (0.1ms) SAVEPOINT active_record_1
4790
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.425657"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.425657"]]
4791
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4792
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4793
+  (0.6ms) rollback transaction
4794
+  (0.1ms) begin transaction
4795
+  (0.1ms) SAVEPOINT active_record_1
4796
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.430392"], ["updated_at", "2015-09-07 17:28:00.430392"]]
4797
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4798
+  (0.1ms) SAVEPOINT active_record_1
4799
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.432932"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:28:00.432932"]]
4800
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4801
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4802
+  (0.7ms) rollback transaction
4803
+  (0.1ms) begin transaction
4804
+  (0.1ms) SAVEPOINT active_record_1
4805
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.439471"], ["updated_at", "2015-09-07 17:28:00.439471"]]
4806
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4807
+  (0.0ms) SAVEPOINT active_record_1
4808
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.441457"], ["resource_id", 1], ["state", "pending"], ["token", "iWmKNsGDQUbVt0fWoT69fg=="], ["updated_at", "2015-09-07 17:28:00.441457"]]
4809
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4810
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'iWmKNsGDQUbVt0fWoT69fg==' LIMIT 1
4811
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4812
+  (0.1ms) SAVEPOINT active_record_1
4813
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:28:00.446150"]]
4814
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4815
+  (0.4ms) rollback transaction
4816
+  (0.1ms) begin transaction
4817
+  (0.1ms) SAVEPOINT active_record_1
4818
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.450236"], ["updated_at", "2015-09-07 17:28:00.450236"]]
4819
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4820
+  (0.0ms) SAVEPOINT active_record_1
4821
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.452073"], ["resource_id", 1], ["state", "pending"], ["token", "aMkYyxYTZtDGh/VfJriOFg=="], ["updated_at", "2015-09-07 17:28:00.452073"]]
4822
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4823
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'aMkYyxYTZtDGh/VfJriOFg==' LIMIT 1
4824
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4825
+  (0.0ms) SAVEPOINT active_record_1
4826
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:28:00.455835"]]
4827
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4828
+  (0.6ms) rollback transaction
4829
+  (0.1ms) begin transaction
4830
+  (0.1ms) SAVEPOINT active_record_1
4831
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:28:00.460871"], ["updated_at", "2015-09-07 17:28:00.460871"]]
4832
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4833
+  (0.1ms) SAVEPOINT active_record_1
4834
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:28:00.463657"], ["resource_id", 1], ["state", "pending"], ["token", "DiCz1uI9HaPM8HWEC6kyIw=="], ["updated_at", "2015-09-07 17:28:00.463657"]]
4835
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4836
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'DiCz1uI9HaPM8HWEC6kyIw==' LIMIT 1
4837
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4838
+  (0.1ms) SAVEPOINT active_record_1
4839
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "error" = ?, "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["error", "Transaccion Incompleta"], ["state", "rejected"], ["updated_at", "2015-09-07 17:28:00.467514"]]
4840
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4841
+  (0.5ms) rollback transaction
4842
+  (0.1ms) begin transaction
4843
+  (0.1ms) rollback transaction
4844
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
4845
+ Migrating to CreateTickets (20141026172010)
4846
+  (0.1ms) begin transaction
4847
+  (0.1ms) CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "message" varchar(255), "created_at" datetime, "updated_at" datetime) 
4848
+ SQLite3::SQLException: table "tickets" already exists: CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "message" varchar(255), "created_at" datetime, "updated_at" datetime)
4849
+  (0.0ms) rollback transaction
4850
+ ActiveRecord::SchemaMigration Load (2.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
4851
+  (0.3ms) begin transaction
4852
+  (0.1ms) rollback transaction
4853
+  (0.0ms) begin transaction
4854
+  (0.1ms) SAVEPOINT active_record_1
4855
+ SQL (0.9ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:05.886232"], ["updated_at", "2015-09-07 17:34:05.886232"]]
4856
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4857
+  (0.1ms) SAVEPOINT active_record_1
4858
+ SQL (1.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:05.962090"], ["resource_id", 1], ["state", "pending"], ["token", "5ubnQcbLwfTskLgLvtQLAA=="], ["updated_at", "2015-09-07 17:34:05.962090"]]
4859
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4860
+  (0.1ms) SAVEPOINT active_record_1
4861
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:34:05.966371"]]
4862
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4863
+  (0.5ms) rollback transaction
4864
+  (0.1ms) begin transaction
4865
+  (0.1ms) SAVEPOINT active_record_1
4866
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:05.971932"], ["updated_at", "2015-09-07 17:34:05.971932"]]
4867
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4868
+  (0.0ms) SAVEPOINT active_record_1
4869
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:05.973899"], ["resource_id", 1], ["state", "pending"], ["token", "+EzQxQ2/hqS+WXAvofEjPw=="], ["updated_at", "2015-09-07 17:34:05.973899"]]
4870
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4871
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'rejected' WHERE "punto_pagos_rails_transactions"."id" = 1
4872
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
4873
+  (2.3ms) rollback transaction
4874
+  (0.7ms) begin transaction
4875
+  (0.1ms) SAVEPOINT active_record_1
4876
+ SQL (0.5ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.000649"], ["updated_at", "2015-09-07 17:34:06.000649"]]
4877
+  (0.4ms) RELEASE SAVEPOINT active_record_1
4878
+  (0.1ms) SAVEPOINT active_record_1
4879
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.008220"], ["resource_id", 1], ["state", "pending"], ["token", "5SWUnM9OasWViPbIgEAlJw=="], ["updated_at", "2015-09-07 17:34:06.008220"]]
4880
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4881
+ SQL (0.4ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'completed' WHERE "punto_pagos_rails_transactions"."id" = 1
4882
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
4883
+  (1.6ms) rollback transaction
4884
+  (0.1ms) begin transaction
4885
+  (0.1ms) SAVEPOINT active_record_1
4886
+ SQL (1.7ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.022896"], ["updated_at", "2015-09-07 17:34:06.022896"]]
4887
+  (0.4ms) RELEASE SAVEPOINT active_record_1
4888
+  (0.1ms) SAVEPOINT active_record_1
4889
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.033515"], ["resource_id", 1], ["state", "pending"], ["token", "ptTZBEyN1tmAPqBXXF0iAg=="], ["updated_at", "2015-09-07 17:34:06.033515"]]
4890
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4891
+  (0.1ms) SAVEPOINT active_record_1
4892
+ SQL (2.5ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:34:06.037525"]]
4893
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4894
+  (1.1ms) rollback transaction
4895
+  (0.1ms) begin transaction
4896
+  (0.1ms) SAVEPOINT active_record_1
4897
+ SQL (9.1ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.050849"], ["updated_at", "2015-09-07 17:34:06.050849"]]
4898
+  (0.3ms) RELEASE SAVEPOINT active_record_1
4899
+  (0.4ms) SAVEPOINT active_record_1
4900
+ SQL (0.8ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.069383"], ["resource_id", 1], ["state", "pending"], ["token", "p1bE3yNqXkrvOpKWt64EcQ=="], ["updated_at", "2015-09-07 17:34:06.069383"]]
4901
+  (0.4ms) RELEASE SAVEPOINT active_record_1
4902
+  (0.1ms) SAVEPOINT active_record_1
4903
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:34:06.084999"]]
4904
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4905
+  (3.1ms) rollback transaction
4906
+  (0.4ms) begin transaction
4907
+  (0.1ms) SAVEPOINT active_record_1
4908
+ SQL (0.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.100676"], ["updated_at", "2015-09-07 17:34:06.100676"]]
4909
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4910
+  (0.1ms) SAVEPOINT active_record_1
4911
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.105426"], ["resource_id", 1], ["state", "pending"], ["token", "zfblufzKZ3ywukGxXdlZOA=="], ["updated_at", "2015-09-07 17:34:06.105426"]]
4912
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4913
+  (0.1ms) SAVEPOINT active_record_1
4914
+ SQL (0.3ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:34:06.109074"]]
4915
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4916
+  (3.6ms) rollback transaction
4917
+  (0.1ms) begin transaction
4918
+  (0.3ms) SAVEPOINT active_record_1
4919
+ SQL (0.8ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.128951"], ["updated_at", "2015-09-07 17:34:06.128951"]]
4920
+  (0.3ms) RELEASE SAVEPOINT active_record_1
4921
+  (0.1ms) SAVEPOINT active_record_1
4922
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.146009"], ["resource_id", 1], ["state", "pending"], ["token", "4U202nTFnRHEg125DY1pYw=="], ["updated_at", "2015-09-07 17:34:06.146009"]]
4923
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4924
+  (0.1ms) SAVEPOINT active_record_1
4925
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:34:06.150058"]]
4926
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4927
+  (0.6ms) rollback transaction
4928
+  (0.1ms) begin transaction
4929
+  (0.2ms) SAVEPOINT active_record_1
4930
+ SQL (0.5ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.159273"], ["updated_at", "2015-09-07 17:34:06.159273"]]
4931
+  (0.3ms) RELEASE SAVEPOINT active_record_1
4932
+ Ticket Load (0.7ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4933
+  (0.4ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
4934
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4935
+  (0.0ms) SAVEPOINT active_record_1
4936
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.188071"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.188071"]]
4937
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4938
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4939
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4940
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
4941
+  (1.0ms) rollback transaction
4942
+  (0.1ms) begin transaction
4943
+  (0.1ms) SAVEPOINT active_record_1
4944
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.203576"], ["updated_at", "2015-09-07 17:34:06.203576"]]
4945
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4946
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4947
+  (0.0ms) SAVEPOINT active_record_1
4948
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.206226"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.206226"]]
4949
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4950
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4951
+  (0.2ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4952
+  (0.1ms) SAVEPOINT active_record_1
4953
+ SQL (0.5ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:34:06.213066"]]
4954
+  (0.3ms) RELEASE SAVEPOINT active_record_1
4955
+  (0.7ms) rollback transaction
4956
+  (0.1ms) begin transaction
4957
+  (0.1ms) SAVEPOINT active_record_1
4958
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.226445"], ["updated_at", "2015-09-07 17:34:06.226445"]]
4959
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4960
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4961
+  (0.1ms) SAVEPOINT active_record_1
4962
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.242833"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.242833"]]
4963
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4964
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4965
+  (0.4ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4966
+  (0.1ms) SAVEPOINT active_record_1
4967
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:34:06.248365"]]
4968
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4969
+  (0.6ms) rollback transaction
4970
+  (0.1ms) begin transaction
4971
+  (0.1ms) SAVEPOINT active_record_1
4972
+ SQL (0.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.256899"], ["updated_at", "2015-09-07 17:34:06.256899"]]
4973
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4974
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4975
+  (0.1ms) SAVEPOINT active_record_1
4976
+ SQL (2.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.262748"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.262748"]]
4977
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4978
+ Ticket Load (0.3ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4979
+  (0.4ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
4980
+  (0.3ms) SAVEPOINT active_record_1
4981
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:34:06.276558"]]
4982
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4983
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? ORDER BY "punto_pagos_rails_transactions"."id" DESC LIMIT 1 [["resource_id", 1]]
4984
+  (0.6ms) rollback transaction
4985
+  (0.1ms) begin transaction
4986
+  (0.1ms) SAVEPOINT active_record_1
4987
+ SQL (0.2ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.283438"], ["updated_at", "2015-09-07 17:34:06.283438"]]
4988
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4989
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4990
+  (0.0ms) SAVEPOINT active_record_1
4991
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.286501"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.286501"]]
4992
+  (0.0ms) RELEASE SAVEPOINT active_record_1
4993
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
4994
+  (0.6ms) rollback transaction
4995
+  (0.1ms) begin transaction
4996
+  (0.1ms) SAVEPOINT active_record_1
4997
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "state", "token", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.291610"], ["state", "pending"], ["token", "REPEATED_TOKEN"], ["updated_at", "2015-09-07 17:34:06.291610"]]
4998
+  (0.1ms) RELEASE SAVEPOINT active_record_1
4999
+  (0.1ms) SAVEPOINT active_record_1
5000
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.294228"], ["updated_at", "2015-09-07 17:34:06.294228"]]
5001
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5002
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5003
+  (0.0ms) SAVEPOINT active_record_1
5004
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.297132"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.297132"]]
5005
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5006
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5007
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'REPEATED_TOKEN'
5008
+  (0.5ms) rollback transaction
5009
+  (0.1ms) begin transaction
5010
+  (0.1ms) SAVEPOINT active_record_1
5011
+ SQL (1.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.308351"], ["updated_at", "2015-09-07 17:34:06.308351"]]
5012
+  (0.4ms) RELEASE SAVEPOINT active_record_1
5013
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5014
+  (0.1ms) SAVEPOINT active_record_1
5015
+ SQL (0.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.320685"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.320685"]]
5016
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5017
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5018
+  (0.6ms) rollback transaction
5019
+  (0.1ms) begin transaction
5020
+  (0.1ms) SAVEPOINT active_record_1
5021
+ SQL (0.5ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.329130"], ["updated_at", "2015-09-07 17:34:06.329130"]]
5022
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5023
+  (0.5ms) SAVEPOINT active_record_1
5024
+ SQL (0.6ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.355974"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:34:06.355974"]]
5025
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5026
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5027
+  (2.4ms) rollback transaction
5028
+  (0.2ms) begin transaction
5029
+  (0.5ms) SAVEPOINT active_record_1
5030
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.386430"], ["updated_at", "2015-09-07 17:34:06.386430"]]
5031
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5032
+  (0.0ms) SAVEPOINT active_record_1
5033
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.389167"], ["resource_id", 1], ["state", "pending"], ["token", "TJKjzwbwAy1bj10xVNqNNg=="], ["updated_at", "2015-09-07 17:34:06.389167"]]
5034
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5035
+ PuntoPagosRails::Transaction Load (0.3ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'TJKjzwbwAy1bj10xVNqNNg==' LIMIT 1
5036
+ Ticket Load (0.2ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5037
+  (0.1ms) SAVEPOINT active_record_1
5038
+ SQL (0.6ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:34:06.396650"]]
5039
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5040
+  (5.0ms) rollback transaction
5041
+  (0.2ms) begin transaction
5042
+  (0.3ms) SAVEPOINT active_record_1
5043
+ SQL (2.8ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.422435"], ["updated_at", "2015-09-07 17:34:06.422435"]]
5044
+  (0.5ms) RELEASE SAVEPOINT active_record_1
5045
+  (0.1ms) SAVEPOINT active_record_1
5046
+ SQL (1.1ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.429920"], ["resource_id", 1], ["state", "pending"], ["token", "wWVhrQtViUWLZJw7kBwz4w=="], ["updated_at", "2015-09-07 17:34:06.429920"]]
5047
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5048
+ PuntoPagosRails::Transaction Load (2.5ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'wWVhrQtViUWLZJw7kBwz4w==' LIMIT 1
5049
+ Ticket Load (0.4ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5050
+  (0.1ms) SAVEPOINT active_record_1
5051
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:34:06.460555"]]
5052
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5053
+  (0.5ms) rollback transaction
5054
+  (0.1ms) begin transaction
5055
+  (0.1ms) SAVEPOINT active_record_1
5056
+ SQL (0.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:34:06.469884"], ["updated_at", "2015-09-07 17:34:06.469884"]]
5057
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5058
+  (0.1ms) SAVEPOINT active_record_1
5059
+ SQL (4.6ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:34:06.473088"], ["resource_id", 1], ["state", "pending"], ["token", "KNh3treG4iZkLe8a6CM37g=="], ["updated_at", "2015-09-07 17:34:06.473088"]]
5060
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5061
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'KNh3treG4iZkLe8a6CM37g==' LIMIT 1
5062
+ Ticket Load (0.4ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5063
+  (0.1ms) SAVEPOINT active_record_1
5064
+ SQL (0.5ms) UPDATE "punto_pagos_rails_transactions" SET "error" = ?, "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["error", "Transaccion Incompleta"], ["state", "rejected"], ["updated_at", "2015-09-07 17:34:06.502711"]]
5065
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5066
+  (1.6ms) rollback transaction
5067
+  (0.2ms) begin transaction
5068
+  (0.3ms) rollback transaction
5069
+  (2.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
5070
+  (0.2ms) select sqlite_version(*)
5071
+  (1.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5072
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5073
+ Migrating to CreateTickets (20141026172010)
5074
+  (0.1ms) begin transaction
5075
+  (0.5ms) CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "message" varchar(255), "created_at" datetime, "updated_at" datetime)
5076
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141026172010"]]
5077
+  (0.7ms) commit transaction
5078
+ Migrating to CreatePuntoPagosRailsTransactions (20141026172011)
5079
+  (0.2ms) begin transaction
5080
+  (0.5ms) CREATE TABLE "punto_pagos_rails_transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_id" integer, "token" varchar(255), "amount" integer, "error" varchar(255), "state" varchar(255), "created_at" datetime, "updated_at" datetime)
5081
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141026172011"]]
5082
+  (1.0ms) commit transaction
5083
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
5084
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5085
+  (0.9ms) DROP TABLE "punto_pagos_rails_transactions"
5086
+  (0.9ms) CREATE TABLE "punto_pagos_rails_transactions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "resource_id" integer, "token" varchar(255), "amount" integer, "error" varchar(255), "state" varchar(255), "created_at" datetime, "updated_at" datetime) 
5087
+  (0.9ms) DROP TABLE "tickets"
5088
+  (0.9ms) CREATE TABLE "tickets" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "amount" integer, "message" varchar(255), "created_at" datetime, "updated_at" datetime) 
5089
+  (0.1ms) SELECT version FROM "schema_migrations"
5090
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140928003539')
5091
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5092
+  (0.3ms) begin transaction
5093
+  (0.1ms) rollback transaction
5094
+  (0.1ms) begin transaction
5095
+  (0.0ms) rollback transaction
5096
+  (0.0ms) begin transaction
5097
+  (0.1ms) SAVEPOINT active_record_1
5098
+ SQL (0.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.501027"], ["updated_at", "2015-09-07 17:36:42.501027"]]
5099
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5100
+  (0.1ms) SAVEPOINT active_record_1
5101
+ SQL (1.5ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.510726"], ["resource_id", 1], ["state", "pending"], ["token", "iC8HN487gVC5EYcDr5TZJQ=="], ["updated_at", "2015-09-07 17:36:42.510726"]]
5102
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5103
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'iC8HN487gVC5EYcDr5TZJQ==' LIMIT 1
5104
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5105
+  (0.1ms) SAVEPOINT active_record_1
5106
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:36:42.530065"]]
5107
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5108
+  (0.0ms) SAVEPOINT active_record_1
5109
+ SQL (0.1ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "successful payment! 1"], ["updated_at", "2015-09-07 17:36:42.531930"]]
5110
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5111
+  (0.7ms) rollback transaction
5112
+  (0.2ms) begin transaction
5113
+  (0.2ms) SAVEPOINT active_record_1
5114
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.543010"], ["updated_at", "2015-09-07 17:36:42.543010"]]
5115
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5116
+  (0.1ms) SAVEPOINT active_record_1
5117
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.546881"], ["resource_id", 1], ["state", "pending"], ["token", "yfBXMc9+PQ8wWj8s4kwbGw=="], ["updated_at", "2015-09-07 17:36:42.546881"]]
5118
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5119
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'yfBXMc9+PQ8wWj8s4kwbGw==' LIMIT 1
5120
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5121
+  (0.2ms) SAVEPOINT active_record_1
5122
+ SQL (0.3ms) UPDATE "punto_pagos_rails_transactions" SET "error" = ?, "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["error", "Transaccion Incompleta"], ["state", "rejected"], ["updated_at", "2015-09-07 17:36:42.558566"]]
5123
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5124
+  (0.1ms) SAVEPOINT active_record_1
5125
+ SQL (0.1ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "error paying ticket 1"], ["updated_at", "2015-09-07 17:36:42.561147"]]
5126
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5127
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5128
+  (0.6ms) rollback transaction
5129
+  (0.1ms) begin transaction
5130
+  (0.3ms) SAVEPOINT active_record_1
5131
+ SQL (0.5ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.569672"], ["updated_at", "2015-09-07 17:36:42.569672"]]
5132
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5133
+  (0.1ms) SAVEPOINT active_record_1
5134
+ SQL (0.7ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.578174"], ["resource_id", 1], ["state", "pending"], ["token", "M4JRkg/dOYB5oc+4AK/sWA=="], ["updated_at", "2015-09-07 17:36:42.578174"]]
5135
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5136
+ PuntoPagosRails::Transaction Load (0.8ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'M4JRkg/dOYB5oc+4AK/sWA==' LIMIT 1
5137
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5138
+  (0.0ms) SAVEPOINT active_record_1
5139
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:36:42.592322"]]
5140
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5141
+  (0.0ms) SAVEPOINT active_record_1
5142
+ SQL (0.1ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "successful payment! 1"], ["updated_at", "2015-09-07 17:36:42.593446"]]
5143
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5144
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5145
+  (0.8ms) rollback transaction
5146
+  (0.1ms) begin transaction
5147
+  (0.2ms) SAVEPOINT active_record_1
5148
+ SQL (0.7ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.603901"], ["updated_at", "2015-09-07 17:36:42.603901"]]
5149
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5150
+  (0.1ms) SAVEPOINT active_record_1
5151
+ SQL (0.6ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.611269"], ["resource_id", 1], ["state", "pending"], ["token", "8CXtdldJ/kRw6LWslIPg5A=="], ["updated_at", "2015-09-07 17:36:42.611269"]]
5152
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5153
+  (0.2ms) SAVEPOINT active_record_1
5154
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:36:42.620168"]]
5155
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5156
+  (0.3ms) SAVEPOINT active_record_1
5157
+ SQL (0.3ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "successful payment! 1"], ["updated_at", "2015-09-07 17:36:42.626119"]]
5158
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5159
+  (2.6ms) rollback transaction
5160
+  (0.2ms) begin transaction
5161
+  (0.2ms) SAVEPOINT active_record_1
5162
+ SQL (0.8ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.640321"], ["updated_at", "2015-09-07 17:36:42.640321"]]
5163
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5164
+  (0.1ms) SAVEPOINT active_record_1
5165
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.646588"], ["resource_id", 1], ["state", "pending"], ["token", "dLpu5LWfs5K3BGIYrGuZfg=="], ["updated_at", "2015-09-07 17:36:42.646588"]]
5166
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5167
+  (0.1ms) SAVEPOINT active_record_1
5168
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:36:42.650400"]]
5169
+  (1.8ms) RELEASE SAVEPOINT active_record_1
5170
+  (0.2ms) SAVEPOINT active_record_1
5171
+ SQL (0.1ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "error paying ticket 1"], ["updated_at", "2015-09-07 17:36:42.660275"]]
5172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5173
+  (0.7ms) rollback transaction
5174
+  (0.1ms) begin transaction
5175
+  (0.2ms) SAVEPOINT active_record_1
5176
+ SQL (0.8ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.667308"], ["updated_at", "2015-09-07 17:36:42.667308"]]
5177
+  (0.4ms) RELEASE SAVEPOINT active_record_1
5178
+  (0.1ms) SAVEPOINT active_record_1
5179
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.678792"], ["resource_id", 1], ["state", "pending"], ["token", "X19ApcUQI9Ojk0ImsK01OQ=="], ["updated_at", "2015-09-07 17:36:42.678792"]]
5180
+  (0.5ms) RELEASE SAVEPOINT active_record_1
5181
+  (0.3ms) SAVEPOINT active_record_1
5182
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "rejected"], ["updated_at", "2015-09-07 17:36:42.686334"]]
5183
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5184
+  (0.3ms) SAVEPOINT active_record_1
5185
+ SQL (0.1ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "error paying ticket 1"], ["updated_at", "2015-09-07 17:36:42.695012"]]
5186
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5187
+ PuntoPagosRails::Transaction Load (0.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
5188
+  (1.0ms) rollback transaction
5189
+  (0.3ms) begin transaction
5190
+  (0.6ms) SAVEPOINT active_record_1
5191
+ SQL (0.5ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.712686"], ["updated_at", "2015-09-07 17:36:42.712686"]]
5192
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5193
+  (0.1ms) SAVEPOINT active_record_1
5194
+ SQL (4.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.718659"], ["resource_id", 1], ["state", "pending"], ["token", "TYcxHwpyeLfLe+WKgJHa+Q=="], ["updated_at", "2015-09-07 17:36:42.718659"]]
5195
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5196
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'rejected' WHERE "punto_pagos_rails_transactions"."id" = 1
5197
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
5198
+  (0.9ms) rollback transaction
5199
+  (0.3ms) begin transaction
5200
+  (0.4ms) SAVEPOINT active_record_1
5201
+ SQL (0.7ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.744008"], ["updated_at", "2015-09-07 17:36:42.744008"]]
5202
+  (0.5ms) RELEASE SAVEPOINT active_record_1
5203
+  (0.5ms) SAVEPOINT active_record_1
5204
+ SQL (0.8ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.760416"], ["resource_id", 1], ["state", "pending"], ["token", "FLSfW2N3wFGo1KfB0vRH5g=="], ["updated_at", "2015-09-07 17:36:42.760416"]]
5205
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5206
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = 'completed' WHERE "punto_pagos_rails_transactions"."id" = 1
5207
+ PuntoPagosRails::Transaction Load (0.8ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
5208
+  (1.4ms) rollback transaction
5209
+  (0.1ms) begin transaction
5210
+  (1.3ms) SAVEPOINT active_record_1
5211
+ SQL (0.9ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.795984"], ["updated_at", "2015-09-07 17:36:42.795984"]]
5212
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5213
+  (0.2ms) SAVEPOINT active_record_1
5214
+ SQL (1.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.807155"], ["resource_id", 1], ["state", "pending"], ["token", "I1N4ElkQ7VCQq1jSaaolPQ=="], ["updated_at", "2015-09-07 17:36:42.807155"]]
5215
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5216
+  (0.1ms) SAVEPOINT active_record_1
5217
+ SQL (0.3ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:36:42.815803"]]
5218
+  (1.3ms) RELEASE SAVEPOINT active_record_1
5219
+  (0.3ms) SAVEPOINT active_record_1
5220
+ SQL (0.2ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "successful payment! 1"], ["updated_at", "2015-09-07 17:36:42.827658"]]
5221
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5222
+ PuntoPagosRails::Transaction Load (0.1ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."id" = ? LIMIT 1 [["id", 1]]
5223
+  (1.0ms) rollback transaction
5224
+  (0.1ms) begin transaction
5225
+  (0.1ms) SAVEPOINT active_record_1
5226
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.841049"], ["updated_at", "2015-09-07 17:36:42.841049"]]
5227
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5228
+  (0.1ms) SAVEPOINT active_record_1
5229
+ SQL (0.5ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "token", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.858949"], ["resource_id", 1], ["state", "pending"], ["token", "TEp3HKjWM6HGDSAxPdlyaw=="], ["updated_at", "2015-09-07 17:36:42.858949"]]
5230
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5231
+  (0.6ms) SAVEPOINT active_record_1
5232
+ SQL (0.1ms) UPDATE "punto_pagos_rails_transactions" SET "state" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["state", "completed"], ["updated_at", "2015-09-07 17:36:42.875929"]]
5233
+  (0.4ms) RELEASE SAVEPOINT active_record_1
5234
+  (0.3ms) SAVEPOINT active_record_1
5235
+ SQL (0.2ms) UPDATE "tickets" SET "message" = ?, "updated_at" = ? WHERE "tickets"."id" = 1 [["message", "successful payment! 1"], ["updated_at", "2015-09-07 17:36:42.881041"]]
5236
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5237
+  (0.6ms) rollback transaction
5238
+  (0.2ms) begin transaction
5239
+  (0.1ms) SAVEPOINT active_record_1
5240
+ SQL (1.0ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.898336"], ["updated_at", "2015-09-07 17:36:42.898336"]]
5241
+  (0.5ms) RELEASE SAVEPOINT active_record_1
5242
+ Ticket Load (0.3ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5243
+  (0.9ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
5244
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5245
+  (0.3ms) SAVEPOINT active_record_1
5246
+ SQL (0.3ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.936979"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:42.936979"]]
5247
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5248
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5249
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5250
+  (0.0ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? [["resource_id", 1]]
5251
+  (0.6ms) rollback transaction
5252
+  (0.1ms) begin transaction
5253
+  (0.1ms) SAVEPOINT active_record_1
5254
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.949097"], ["updated_at", "2015-09-07 17:36:42.949097"]]
5255
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5256
+  (0.7ms) SAVEPOINT active_record_1
5257
+ SQL (0.6ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.974486"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:42.974486"]]
5258
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5259
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5260
+  (0.5ms) rollback transaction
5261
+  (0.1ms) begin transaction
5262
+  (0.2ms) SAVEPOINT active_record_1
5263
+ SQL (1.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:42.989755"], ["updated_at", "2015-09-07 17:36:42.989755"]]
5264
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5265
+ Ticket Load (0.5ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5266
+  (0.1ms) SAVEPOINT active_record_1
5267
+ SQL (0.5ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:42.999729"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:42.999729"]]
5268
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5269
+ Ticket Load (0.2ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5270
+  (1.7ms) rollback transaction
5271
+  (0.1ms) begin transaction
5272
+  (0.2ms) SAVEPOINT active_record_1
5273
+ SQL (1.1ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "state", "token", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.090599"], ["state", "pending"], ["token", "REPEATED_TOKEN"], ["updated_at", "2015-09-07 17:36:43.090599"]]
5274
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5275
+  (0.1ms) SAVEPOINT active_record_1
5276
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:43.097459"], ["updated_at", "2015-09-07 17:36:43.097459"]]
5277
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5278
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5279
+  (0.0ms) SAVEPOINT active_record_1
5280
+ SQL (0.1ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.100644"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:43.100644"]]
5281
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5282
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5283
+  (0.5ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'REPEATED_TOKEN'
5284
+  (1.0ms) rollback transaction
5285
+  (0.1ms) begin transaction
5286
+  (0.1ms) SAVEPOINT active_record_1
5287
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:43.114200"], ["updated_at", "2015-09-07 17:36:43.114200"]]
5288
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5289
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5290
+  (0.5ms) SAVEPOINT active_record_1
5291
+ SQL (1.2ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.120155"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:43.120155"]]
5292
+  (0.3ms) RELEASE SAVEPOINT active_record_1
5293
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5294
+  (2.0ms) rollback transaction
5295
+  (0.4ms) begin transaction
5296
+  (0.1ms) SAVEPOINT active_record_1
5297
+ SQL (0.4ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:43.142177"], ["updated_at", "2015-09-07 17:36:43.142177"]]
5298
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5299
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5300
+  (0.1ms) SAVEPOINT active_record_1
5301
+ SQL (0.6ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.159801"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:43.159801"]]
5302
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5303
+ Ticket Load (0.1ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5304
+  (0.1ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
5305
+  (0.0ms) SAVEPOINT active_record_1
5306
+ SQL (0.2ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:36:43.166664"]]
5307
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5308
+ PuntoPagosRails::Transaction Load (1.2ms) SELECT "punto_pagos_rails_transactions".* FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."resource_id" = ? ORDER BY "punto_pagos_rails_transactions"."id" DESC LIMIT 1 [["resource_id", 1]]
5309
+  (2.1ms) rollback transaction
5310
+  (0.3ms) begin transaction
5311
+  (0.1ms) SAVEPOINT active_record_1
5312
+ SQL (0.3ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:43.189879"], ["updated_at", "2015-09-07 17:36:43.189879"]]
5313
+  (0.0ms) RELEASE SAVEPOINT active_record_1
5314
+ Ticket Load (0.0ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5315
+  (0.0ms) SAVEPOINT active_record_1
5316
+ SQL (0.5ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.193506"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:43.193506"]]
5317
+  (0.1ms) RELEASE SAVEPOINT active_record_1
5318
+ Ticket Load (0.2ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5319
+  (0.2ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
5320
+  (0.1ms) SAVEPOINT active_record_1
5321
+ SQL (0.4ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:36:43.201606"]]
5322
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5323
+  (1.1ms) rollback transaction
5324
+  (0.1ms) begin transaction
5325
+  (0.1ms) SAVEPOINT active_record_1
5326
+ SQL (5.0ms) INSERT INTO "tickets" ("amount", "created_at", "updated_at") VALUES (?, ?, ?) [["amount", 22], ["created_at", "2015-09-07 17:36:43.214661"], ["updated_at", "2015-09-07 17:36:43.214661"]]
5327
+  (0.4ms) RELEASE SAVEPOINT active_record_1
5328
+ Ticket Load (0.3ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5329
+  (0.1ms) SAVEPOINT active_record_1
5330
+ SQL (0.4ms) INSERT INTO "punto_pagos_rails_transactions" ("created_at", "resource_id", "state", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2015-09-07 17:36:43.245930"], ["resource_id", 1], ["state", "pending"], ["updated_at", "2015-09-07 17:36:43.245930"]]
5331
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5332
+ Ticket Load (0.2ms) SELECT "tickets".* FROM "tickets" WHERE "tickets"."id" = ? LIMIT 1 [["id", 1]]
5333
+  (0.3ms) SELECT COUNT(*) FROM "punto_pagos_rails_transactions" WHERE "punto_pagos_rails_transactions"."token" = 'XXXXX'
5334
+  (0.2ms) SAVEPOINT active_record_1
5335
+ SQL (0.6ms) UPDATE "punto_pagos_rails_transactions" SET "amount" = ?, "token" = ?, "updated_at" = ? WHERE "punto_pagos_rails_transactions"."id" = 1 [["amount", 22], ["token", "XXXXX"], ["updated_at", "2015-09-07 17:36:43.262026"]]
5336
+  (0.2ms) RELEASE SAVEPOINT active_record_1
5337
+  (0.7ms) rollback transaction
@@ -11,7 +11,8 @@ RSpec.describe TransactionService do
11
11
  let(:token) { 'XXXXX' }
12
12
  let(:payment_process_url) { double }
13
13
  let(:notification) { double }
14
- let(:transaction) { PuntoPagosRails::Transaction.create(resource: ticket) }
14
+ let(:status) { double }
15
+ let(:transaction) { PuntoPagosRails::Transaction.create(resource: ticket, token: SecureRandom.base64) }
15
16
 
16
17
  before do
17
18
  allow(PuntoPagos::Request).to receive(:new).and_return(request)
@@ -83,6 +84,45 @@ RSpec.describe TransactionService do
83
84
  end
84
85
  end
85
86
 
87
+ describe "#validate" do
88
+
89
+ before do
90
+ allow(PuntoPagos::Status).to receive(:new).and_return(status)
91
+ allow(status).to receive(:check).with(transaction.token, transaction.id.to_s, transaction.amount_to_s)
92
+ end
93
+
94
+ it "creates a status object" do
95
+ allow(status).to receive(:valid?).and_return(true)
96
+ TransactionService.validate(transaction.token, transaction)
97
+ expect(PuntoPagos::Status).to have_received(:new)
98
+ end
99
+
100
+ context "when the token is valid" do
101
+
102
+ it "runs callback after successful payment" do
103
+ allow(status).to receive(:valid?).and_return(true)
104
+ TransactionService.validate(transaction.token, transaction)
105
+ ticket.reload
106
+ expect(ticket.message).to eq("successful payment! #{ticket.id}")
107
+ end
108
+
109
+ end
110
+
111
+ context "when the token is invalid" do
112
+
113
+ it "runs error callback" do
114
+ allow(status).to receive(:valid?).and_return(false)
115
+ allow(status).to receive(:error).and_return("Transaccion Incompleta")
116
+ TransactionService.validate(transaction.token, transaction)
117
+ ticket.reload
118
+ expect(ticket.message).to eq("error paying ticket #{ticket.id}")
119
+ end
120
+
121
+ end
122
+
123
+
124
+ end
125
+
86
126
  describe "#notificate" do
87
127
 
88
128
  before do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punto_pagos_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Segovia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-28 00:00:00.000000000 Z
11
+ date: 2015-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails