payola-payments 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjVkNzEyNTE1ZDMzNDgwMmJkOWNiYWQ4MTgyMzNiNmFjOTcyMGFkMA==
4
+ OGQyNWRjNTdhYmQyNGU4MjFkNzM4MzY0MzZjNWM4YjU2NzRhMWU2MA==
5
5
  data.tar.gz: !binary |-
6
- OTAzZjY5MjRkNjEyNzUwNjZiMTQyOWMxNDI5ODE4ZDI1YWFlNzk3Nw==
6
+ N2Q0MmIyZmJiOGJhYThjOWUyYTlhM2Q4NTc4Mjg3MWQxMGFiMDQ2Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjQzOTg1YzNmZTM5MTRkNjIyYTVlNGU2MWYzMjc4NzJjNDA0MWMzNTcxZTlm
10
- Nzg4OTgxNTBhYTAzMTZlMjRiZmZlMjIyMTI3Y2E0ZDQzMjczOWZjMDNiODcw
11
- YzIxYzNiODMyNTQzMGU5YmMzMjM3MjNlNjMxOTMwMTcxY2UwODc=
9
+ NDE0NjlkYmJkMzkyYjI5MGQ2ZGI5ODg0ODU4ZWUxM2IwNzhkODQ4MjVlYTQy
10
+ MTU1NmM2NzcyMTAzZDllOThhNzE2MTIwZGJhYzkzY2UyZjNkMmFkZGIzMzNi
11
+ ZTU1MDIzOWFkNmE3M2Y0ODJhNDU0Y2E4YmJiMDQ4M2IwNzVhYWU=
12
12
  data.tar.gz: !binary |-
13
- OTg2YzcxMmJmNGJhNmU1MmVmMGZmMmE5MWQ4MGMyZWMzM2I3MDdjM2ZmODY2
14
- ZjI0NTc2NTk4ZWU3ZWI4NjM4YzI5MGM3NjliYmY5ODRmNThlNjI4MWMwMzc4
15
- NDQyOWJlODZjNDBmMmE4ZjU0ODNkZWRjMjMxN2NiNGVhMmFiNzM=
13
+ ZDc2YzBjYmExZTYzM2Y2MGQyNDJlYzAwZWZmZTBlYmQ2Nzg2MmFkMWZmODFm
14
+ MzY4ZTdlNjU2ZGJkYmJkMDQ2OTcwNTk0YTBlMjYzNjE0ZDI2YWMzYTJlZWE3
15
+ MTM3M2ZhMDExY2UyMDNmMTk0YjRmZjhkMWRiMWI2MjMxOTMxZDA=
@@ -17,7 +17,7 @@ module Payola
17
17
  currency: sale.currency,
18
18
  customer: customer.id,
19
19
  description: sale.guid,
20
- }.merge(Payola.additional_charge_attributes.call(sale))
20
+ }.merge(Payola.additional_charge_attributes.call(sale, customer))
21
21
 
22
22
  charge = Stripe::Charge.create(charge_attributes, secret_key)
23
23
 
data/lib/payola.rb CHANGED
@@ -70,7 +70,7 @@ module Payola
70
70
  self.support_email = 'sales@example.com'
71
71
  self.default_currency = 'usd'
72
72
  self.sellables = {}
73
- self.additional_charge_attributes = lambda { |sale| { } }
73
+ self.additional_charge_attributes = lambda { |sale, customer| { } }
74
74
  self.pdf_receipt = false
75
75
  end
76
76
 
@@ -1,3 +1,3 @@
1
1
  module Payola
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -35329,3 +35329,574 @@ Completed 400 Bad Request in 2ms (Views: 0.2ms | ActiveRecord: 0.3ms)
35329
35329
   (0.0ms) rollback transaction
35330
35330
   (0.0ms) begin transaction
35331
35331
   (0.1ms) rollback transaction
35332
+  (1.3ms) CREATE TABLE "owners" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime, "updated_at" datetime) 
35333
+  (0.9ms) CREATE TABLE "payola_affiliates" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "email" varchar(255), "percent" integer, "created_at" datetime, "updated_at" datetime)
35334
+  (0.9ms) CREATE TABLE "payola_coupons" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "code" varchar(255), "percent_off" integer, "created_at" datetime, "updated_at" datetime) 
35335
+  (0.9ms) CREATE TABLE "payola_sales" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255), "guid" varchar(255), "product_id" integer, "product_type" varchar(255), "created_at" datetime, "updated_at" datetime, "state" varchar(255), "stripe_id" varchar(255), "stripe_token" varchar(255), "card_last4" varchar(255), "card_expiration" date, "card_type" varchar(255), "error" text, "amount" integer, "fee_amount" integer, "coupon_id" integer, "opt_in" boolean, "download_count" integer, "affiliate_id" integer, "customer_address" text, "business_address" text, "stripe_customer_id" varchar(255), "currency" varchar(255), "signed_custom_fields" text, "owner_id" integer, "owner_type" varchar(255))
35336
+  (0.2ms) select sqlite_version(*)
35337
+  (1.0ms) CREATE INDEX "index_payola_sales_on_coupon_id" ON "payola_sales" ("coupon_id")
35338
+  (0.1ms)  SELECT sql
35339
+ FROM sqlite_master
35340
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35341
+ UNION ALL
35342
+ SELECT sql
35343
+ FROM sqlite_temp_master
35344
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35345
+ 
35346
+  (0.8ms) CREATE INDEX "index_payola_sales_on_email" ON "payola_sales" ("email")
35347
+  (0.1ms)  SELECT sql
35348
+ FROM sqlite_master
35349
+ WHERE name='index_payola_sales_on_email' AND type='index'
35350
+ UNION ALL
35351
+ SELECT sql
35352
+ FROM sqlite_temp_master
35353
+ WHERE name='index_payola_sales_on_email' AND type='index'
35354
+ 
35355
+  (0.1ms) SELECT sql
35356
+ FROM sqlite_master
35357
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35358
+ UNION ALL
35359
+ SELECT sql
35360
+ FROM sqlite_temp_master
35361
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35362
+
35363
+  (0.8ms) CREATE INDEX "index_payola_sales_on_guid" ON "payola_sales" ("guid")
35364
+  (0.1ms) SELECT sql
35365
+ FROM sqlite_master
35366
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35367
+ UNION ALL
35368
+ SELECT sql
35369
+ FROM sqlite_temp_master
35370
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35371
+
35372
+  (0.1ms)  SELECT sql
35373
+ FROM sqlite_master
35374
+ WHERE name='index_payola_sales_on_email' AND type='index'
35375
+ UNION ALL
35376
+ SELECT sql
35377
+ FROM sqlite_temp_master
35378
+ WHERE name='index_payola_sales_on_email' AND type='index'
35379
+ 
35380
+  (0.1ms) SELECT sql
35381
+ FROM sqlite_master
35382
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35383
+ UNION ALL
35384
+ SELECT sql
35385
+ FROM sqlite_temp_master
35386
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35387
+
35388
+  (0.8ms) CREATE INDEX "index_payola_sales_on_owner_id_and_owner_type" ON "payola_sales" ("owner_id", "owner_type")
35389
+  (0.1ms) SELECT sql
35390
+ FROM sqlite_master
35391
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
35392
+ UNION ALL
35393
+ SELECT sql
35394
+ FROM sqlite_temp_master
35395
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
35396
+
35397
+  (0.1ms)  SELECT sql
35398
+ FROM sqlite_master
35399
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35400
+ UNION ALL
35401
+ SELECT sql
35402
+ FROM sqlite_temp_master
35403
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35404
+ 
35405
+  (0.1ms) SELECT sql
35406
+ FROM sqlite_master
35407
+ WHERE name='index_payola_sales_on_email' AND type='index'
35408
+ UNION ALL
35409
+ SELECT sql
35410
+ FROM sqlite_temp_master
35411
+ WHERE name='index_payola_sales_on_email' AND type='index'
35412
+
35413
+  (0.1ms)  SELECT sql
35414
+ FROM sqlite_master
35415
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35416
+ UNION ALL
35417
+ SELECT sql
35418
+ FROM sqlite_temp_master
35419
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35420
+ 
35421
+  (0.8ms) CREATE INDEX "index_payola_sales_on_product" ON "payola_sales" ("product_id", "product_type")
35422
+  (0.1ms)  SELECT sql
35423
+ FROM sqlite_master
35424
+ WHERE name='index_payola_sales_on_product' AND type='index'
35425
+ UNION ALL
35426
+ SELECT sql
35427
+ FROM sqlite_temp_master
35428
+ WHERE name='index_payola_sales_on_product' AND type='index'
35429
+ 
35430
+  (0.1ms) SELECT sql
35431
+ FROM sqlite_master
35432
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
35433
+ UNION ALL
35434
+ SELECT sql
35435
+ FROM sqlite_temp_master
35436
+ WHERE name='index_payola_sales_on_owner_id_and_owner_type' AND type='index'
35437
+
35438
+  (0.1ms)  SELECT sql
35439
+ FROM sqlite_master
35440
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35441
+ UNION ALL
35442
+ SELECT sql
35443
+ FROM sqlite_temp_master
35444
+ WHERE name='index_payola_sales_on_guid' AND type='index'
35445
+ 
35446
+  (0.1ms) SELECT sql
35447
+ FROM sqlite_master
35448
+ WHERE name='index_payola_sales_on_email' AND type='index'
35449
+ UNION ALL
35450
+ SELECT sql
35451
+ FROM sqlite_temp_master
35452
+ WHERE name='index_payola_sales_on_email' AND type='index'
35453
+
35454
+  (0.1ms)  SELECT sql
35455
+ FROM sqlite_master
35456
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35457
+ UNION ALL
35458
+ SELECT sql
35459
+ FROM sqlite_temp_master
35460
+ WHERE name='index_payola_sales_on_coupon_id' AND type='index'
35461
+ 
35462
+  (0.9ms) CREATE INDEX "index_payola_sales_on_stripe_customer_id" ON "payola_sales" ("stripe_customer_id")
35463
+  (0.7ms) CREATE TABLE "payola_stripe_webhooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "stripe_id" varchar(255), "created_at" datetime, "updated_at" datetime) 
35464
+  (1.0ms) CREATE TABLE "products" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "permalink" varchar(255), "price" integer, "created_at" datetime, "updated_at" datetime)
35465
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
35466
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
35467
+  (0.1ms) SELECT version FROM "schema_migrations"
35468
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029140518')
35469
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001230848')
35470
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001170138')
35471
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141001203541')
35472
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013618')
35473
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002013701')
35474
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141002203725')
35475
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141017233304')
35476
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026101628')
35477
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141026144800')
35478
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20141029135848')
35479
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
35480
+  (0.1ms) begin transaction
35481
+  (0.1ms) rollback transaction
35482
+  (0.1ms) begin transaction
35483
+  (0.1ms) rollback transaction
35484
+  (0.1ms) begin transaction
35485
+  (0.1ms) rollback transaction
35486
+  (0.1ms) begin transaction
35487
+  (0.1ms) rollback transaction
35488
+  (0.0ms) begin transaction
35489
+  (0.0ms) SAVEPOINT active_record_1
35490
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
35491
+ SQL (0.6ms) INSERT INTO "payola_stripe_webhooks" ("created_at", "stripe_id", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-11-07 18:57:48.755668"], ["stripe_id", "test_id"], ["updated_at", "2014-11-07 18:57:48.755668"]]
35492
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35493
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
35494
+  (0.4ms) rollback transaction
35495
+  (0.0ms) begin transaction
35496
+ Payola::StripeWebhook Exists (0.1ms) SELECT 1 AS one FROM "payola_stripe_webhooks" WHERE "payola_stripe_webhooks"."stripe_id" = 'test_id' LIMIT 1
35497
+  (0.1ms) rollback transaction
35498
+  (0.0ms) begin transaction
35499
+  (0.1ms) rollback transaction
35500
+  (0.1ms) begin transaction
35501
+  (0.1ms) rollback transaction
35502
+  (0.0ms) begin transaction
35503
+  (0.0ms) rollback transaction
35504
+  (0.0ms) begin transaction
35505
+  (0.0ms) rollback transaction
35506
+  (0.0ms) begin transaction
35507
+  (0.0ms) rollback transaction
35508
+  (0.0ms) begin transaction
35509
+  (0.0ms) rollback transaction
35510
+  (0.0ms) begin transaction
35511
+  (0.0ms) rollback transaction
35512
+  (0.0ms) begin transaction
35513
+  (0.0ms) rollback transaction
35514
+  (0.0ms) begin transaction
35515
+  (0.0ms) rollback transaction
35516
+  (0.0ms) begin transaction
35517
+  (0.0ms) rollback transaction
35518
+  (0.0ms) begin transaction
35519
+  (0.0ms) rollback transaction
35520
+  (0.0ms) begin transaction
35521
+  (0.0ms) SAVEPOINT active_record_1
35522
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-1' LIMIT 1
35523
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.880534"], ["name", "Foo"], ["permalink", "foo-1"], ["price", 100], ["updated_at", "2014-11-07 18:57:48.880534"]]
35524
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35525
+  (0.1ms) SAVEPOINT active_record_1
35526
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35527
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35528
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '8kblu2' LIMIT 1
35529
+ SQL (1.0ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.893047"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "8kblu2"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:48.893047"]]
35530
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35531
+  (0.0ms) SAVEPOINT active_record_1
35532
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '8kblu2' AND "payola_sales"."id" != 1) LIMIT 1
35533
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35534
+  (0.1ms) SAVEPOINT active_record_1
35535
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '8kblu2' AND "payola_sales"."id" != 1) LIMIT 1
35536
+ SQL (0.2ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-11-07 18:57:48.899671"]]
35537
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35538
+  (0.0ms) SAVEPOINT active_record_1
35539
+ SQL (0.2ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
35540
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35541
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35542
+  (0.6ms) rollback transaction
35543
+  (0.1ms) begin transaction
35544
+  (0.0ms) SAVEPOINT active_record_1
35545
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-2' LIMIT 1
35546
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.952237"], ["name", "Foo"], ["permalink", "foo-2"], ["price", 100], ["updated_at", "2014-11-07 18:57:48.952237"]]
35547
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35548
+  (0.0ms) SAVEPOINT active_record_1
35549
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35550
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35551
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '2gvmp6' LIMIT 1
35552
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.955386"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "2gvmp6"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:48.955386"]]
35553
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35554
+  (0.0ms) SAVEPOINT active_record_1
35555
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '2gvmp6' AND "payola_sales"."id" != 1) LIMIT 1
35556
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35557
+  (0.0ms) SAVEPOINT active_record_1
35558
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '2gvmp6' AND "payola_sales"."id" != 1) LIMIT 1
35559
+ SQL (0.1ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-11-07 18:57:48.959487"]]
35560
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35561
+  (0.0ms) SAVEPOINT active_record_1
35562
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
35563
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35564
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35565
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35566
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35567
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35568
+  (0.6ms) rollback transaction
35569
+  (0.1ms) begin transaction
35570
+  (0.0ms) SAVEPOINT active_record_1
35571
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-3' LIMIT 1
35572
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.966251"], ["name", "Foo"], ["permalink", "foo-3"], ["price", 100], ["updated_at", "2014-11-07 18:57:48.966251"]]
35573
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35574
+  (0.0ms) SAVEPOINT active_record_1
35575
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35576
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35577
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'kusauj' LIMIT 1
35578
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.968895"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "kusauj"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:48.968895"]]
35579
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35580
+  (0.0ms) SAVEPOINT active_record_1
35581
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'kusauj' AND "payola_sales"."id" != 1) LIMIT 1
35582
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35583
+  (0.0ms) SAVEPOINT active_record_1
35584
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'kusauj' AND "payola_sales"."id" != 1) LIMIT 1
35585
+ SQL (0.3ms) UPDATE "payola_sales" SET "card_expiration" = ?, "card_last4" = ?, "card_type" = ?, "fee_amount" = ?, "stripe_customer_id" = ?, "stripe_id" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["card_expiration", "2013-12-01"], ["card_last4", "4242"], ["card_type", "Visa"], ["fee_amount", 0], ["stripe_customer_id", "test_cus_1"], ["stripe_id", "test_ch_3"], ["updated_at", "2014-11-07 18:57:48.972658"]]
35586
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35587
+  (0.1ms) SAVEPOINT active_record_1
35588
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
35589
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35590
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35591
+  (0.7ms) rollback transaction
35592
+  (0.0ms) begin transaction
35593
+  (0.0ms) SAVEPOINT active_record_1
35594
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-4' LIMIT 1
35595
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.980870"], ["name", "Foo"], ["permalink", "foo-4"], ["price", 100], ["updated_at", "2014-11-07 18:57:48.980870"]]
35596
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35597
+  (0.0ms) SAVEPOINT active_record_1
35598
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35599
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35600
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'f2kj86' LIMIT 1
35601
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.983472"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "f2kj86"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:48.983472"]]
35602
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35603
+  (0.0ms) SAVEPOINT active_record_1
35604
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'f2kj86' AND "payola_sales"."id" != 1) LIMIT 1
35605
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35606
+  (0.0ms) SAVEPOINT active_record_1
35607
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'f2kj86' AND "payola_sales"."id" != 1) LIMIT 1
35608
+ SQL (0.1ms) UPDATE "payola_sales" SET "error" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["error", "The card was declined"], ["updated_at", "2014-11-07 18:57:48.986937"]]
35609
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35610
+  (0.0ms) SAVEPOINT active_record_1
35611
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
35612
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35613
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35614
+  (0.6ms) rollback transaction
35615
+  (0.0ms) begin transaction
35616
+  (0.0ms) rollback transaction
35617
+  (0.0ms) begin transaction
35618
+  (0.0ms) SAVEPOINT active_record_1
35619
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-5' LIMIT 1
35620
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:48.993268"], ["name", "Foo"], ["permalink", "foo-5"], ["price", 100], ["updated_at", "2014-11-07 18:57:48.993268"]]
35621
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35622
+  (0.1ms) SAVEPOINT active_record_1
35623
+ Payola::Affiliate Exists (0.1ms) SELECT 1 AS one FROM "payola_affiliates" WHERE "payola_affiliates"."code" = 'MyString' LIMIT 1
35624
+ SQL (0.3ms) INSERT INTO "payola_affiliates" ("code", "created_at", "email", "percent", "updated_at") VALUES (?, ?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-11-07 18:57:49.002103"], ["email", "foo@example.com"], ["percent", 100], ["updated_at", "2014-11-07 18:57:49.002103"]]
35625
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35626
+ Payola::Affiliate Load (0.1ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE "payola_affiliates"."id" = ? LIMIT 1 [["id", 1]]
35627
+  (0.5ms) rollback transaction
35628
+  (0.1ms) begin transaction
35629
+  (0.1ms) SAVEPOINT active_record_1
35630
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-6' LIMIT 1
35631
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.011572"], ["name", "Foo"], ["permalink", "foo-6"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.011572"]]
35632
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35633
+  (0.4ms) rollback transaction
35634
+  (0.1ms) begin transaction
35635
+  (0.0ms) SAVEPOINT active_record_1
35636
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-7' LIMIT 1
35637
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.016340"], ["name", "Foo"], ["permalink", "foo-7"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.016340"]]
35638
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35639
+  (0.0ms) SAVEPOINT active_record_1
35640
+ Payola::Coupon Exists (0.1ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
35641
+ SQL (0.3ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-11-07 18:57:49.024189"], ["percent_off", 1], ["updated_at", "2014-11-07 18:57:49.024189"]]
35642
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35643
+  (0.3ms) rollback transaction
35644
+  (0.0ms) begin transaction
35645
+  (0.0ms) SAVEPOINT active_record_1
35646
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-8' LIMIT 1
35647
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.029897"], ["name", "Foo"], ["permalink", "foo-8"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.029897"]]
35648
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35649
+  (0.0ms) SAVEPOINT active_record_1
35650
+ Payola::Coupon Exists (0.0ms) SELECT 1 AS one FROM "payola_coupons" WHERE "payola_coupons"."code" = 'MyString' LIMIT 1
35651
+ SQL (0.2ms) INSERT INTO "payola_coupons" ("code", "created_at", "percent_off", "updated_at") VALUES (?, ?, ?, ?) [["code", "MyString"], ["created_at", "2014-11-07 18:57:49.031639"], ["percent_off", 1], ["updated_at", "2014-11-07 18:57:49.031639"]]
35652
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35653
+  (0.4ms) rollback transaction
35654
+  (0.0ms) begin transaction
35655
+  (0.0ms) rollback transaction
35656
+  (0.0ms) begin transaction
35657
+  (0.0ms) rollback transaction
35658
+  (0.0ms) begin transaction
35659
+  (0.0ms) rollback transaction
35660
+  (0.0ms) begin transaction
35661
+  (0.1ms) rollback transaction
35662
+  (0.0ms) begin transaction
35663
+  (0.0ms) SAVEPOINT active_record_1
35664
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-9' LIMIT 1
35665
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.042712"], ["name", "Foo"], ["permalink", "foo-9"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.042712"]]
35666
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35667
+ Processing by Payola::TransactionsController#create as HTML
35668
+ Parameters: {"product_class"=>"product", "permalink"=>"foo-9"}
35669
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."permalink" = 'foo-9' LIMIT 1
35670
+ Payola::Coupon Load (0.1ms) SELECT "payola_coupons".* FROM "payola_coupons" WHERE (lower(code) = lower(NULL)) ORDER BY "payola_coupons"."id" ASC LIMIT 1
35671
+ Payola::Affiliate Load (0.1ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE (lower(code) = lower(NULL)) ORDER BY "payola_affiliates"."id" ASC LIMIT 1
35672
+ Completed 200 OK in 4ms (Views: 0.3ms | ActiveRecord: 0.3ms)
35673
+  (0.4ms) rollback transaction
35674
+  (0.0ms) begin transaction
35675
+  (0.1ms) SAVEPOINT active_record_1
35676
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-10' LIMIT 1
35677
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.055391"], ["name", "Foo"], ["permalink", "foo-10"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.055391"]]
35678
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35679
+ Processing by Payola::TransactionsController#create as HTML
35680
+ Parameters: {"product_class"=>"product", "permalink"=>"foo-10"}
35681
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."permalink" = 'foo-10' LIMIT 1
35682
+ Payola::Coupon Load (0.1ms) SELECT "payola_coupons".* FROM "payola_coupons" WHERE (lower(code) = lower(NULL)) ORDER BY "payola_coupons"."id" ASC LIMIT 1
35683
+ Payola::Affiliate Load (0.1ms) SELECT "payola_affiliates".* FROM "payola_affiliates" WHERE (lower(code) = lower(NULL)) ORDER BY "payola_affiliates"."id" ASC LIMIT 1
35684
+ Completed 400 Bad Request in 2ms (Views: 0.2ms | ActiveRecord: 0.2ms)
35685
+  (0.4ms) rollback transaction
35686
+  (0.0ms) begin transaction
35687
+  (0.1ms) SAVEPOINT active_record_1
35688
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-11' LIMIT 1
35689
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.064590"], ["name", "Foo"], ["permalink", "foo-11"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.064590"]]
35690
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35691
+  (0.1ms) SAVEPOINT active_record_1
35692
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-12' LIMIT 1
35693
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.067977"], ["name", "Foo"], ["permalink", "foo-12"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.067977"]]
35694
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35695
+  (0.0ms) SAVEPOINT active_record_1
35696
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35697
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35698
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '7vq4pg' LIMIT 1
35699
+ SQL (0.2ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.071000"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "7vq4pg"], ["product_id", 2], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.071000"]]
35700
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35701
+ Processing by Payola::TransactionsController#status as HTML
35702
+ Parameters: {"guid"=>"7vq4pg"}
35703
+ Payola::Sale Load (0.2ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."guid" = '7vq4pg' ORDER BY "payola_sales"."id" ASC LIMIT 1
35704
+ Completed 200 OK in 1ms (Views: 0.2ms | ActiveRecord: 0.2ms)
35705
+  (0.5ms) rollback transaction
35706
+  (0.1ms) begin transaction
35707
+  (0.1ms) SAVEPOINT active_record_1
35708
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-13' LIMIT 1
35709
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.079192"], ["name", "Foo"], ["permalink", "foo-13"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.079192"]]
35710
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35711
+ Processing by Payola::TransactionsController#status as HTML
35712
+ Parameters: {"guid"=>"doesnotexist"}
35713
+ Payola::Sale Load (0.1ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."guid" = 'doesnotexist' ORDER BY "payola_sales"."id" ASC LIMIT 1
35714
+ Completed 404 Not Found in 7ms (Views: 6.2ms | ActiveRecord: 0.1ms)
35715
+  (0.4ms) rollback transaction
35716
+  (0.1ms) begin transaction
35717
+  (0.1ms) SAVEPOINT active_record_1
35718
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-14' LIMIT 1
35719
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.093266"], ["name", "Foo"], ["permalink", "foo-14"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.093266"]]
35720
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35721
+  (0.0ms) SAVEPOINT active_record_1
35722
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-15' LIMIT 1
35723
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.095822"], ["name", "Foo"], ["permalink", "foo-15"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.095822"]]
35724
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35725
+  (0.0ms) SAVEPOINT active_record_1
35726
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35727
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35728
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'dvr74o' LIMIT 1
35729
+ SQL (0.2ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.098928"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "dvr74o"], ["product_id", 2], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.098928"]]
35730
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35731
+ Processing by Payola::TransactionsController#show as HTML
35732
+ Parameters: {"guid"=>"dvr74o"}
35733
+ Payola::Sale Load (0.2ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."guid" = 'dvr74o' LIMIT 1
35734
+ Product Load (0.1ms) SELECT "products".* FROM "products" WHERE "products"."id" = ? LIMIT 1 [["id", 2]]
35735
+ Redirected to http://test.host/
35736
+ Completed 302 Found in 2ms (ActiveRecord: 0.3ms)
35737
+  (0.6ms) rollback transaction
35738
+  (0.1ms) begin transaction
35739
+  (0.1ms) rollback transaction
35740
+  (0.0ms) begin transaction
35741
+  (0.0ms) rollback transaction
35742
+  (0.0ms) begin transaction
35743
+  (0.0ms) rollback transaction
35744
+  (0.0ms) begin transaction
35745
+  (0.0ms) rollback transaction
35746
+  (0.0ms) begin transaction
35747
+  (0.0ms) rollback transaction
35748
+  (0.0ms) begin transaction
35749
+  (0.0ms) rollback transaction
35750
+  (0.0ms) begin transaction
35751
+  (0.0ms) SAVEPOINT active_record_1
35752
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-16' LIMIT 1
35753
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.113983"], ["name", "Foo"], ["permalink", "foo-16"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.113983"]]
35754
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35755
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35756
+  (0.5ms) rollback transaction
35757
+  (0.1ms) begin transaction
35758
+  (0.1ms) SAVEPOINT active_record_1
35759
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-17' LIMIT 1
35760
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.121148"], ["name", "Foo"], ["permalink", "foo-17"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.121148"]]
35761
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35762
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35763
+  (0.4ms) rollback transaction
35764
+  (0.0ms) begin transaction
35765
+  (0.1ms) SAVEPOINT active_record_1
35766
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-18' LIMIT 1
35767
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.126975"], ["name", "Foo"], ["permalink", "foo-18"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.126975"]]
35768
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35769
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35770
+  (0.4ms) rollback transaction
35771
+  (0.0ms) begin transaction
35772
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35773
+  (0.1ms) rollback transaction
35774
+  (0.0ms) begin transaction
35775
+  (0.0ms) SAVEPOINT active_record_1
35776
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-19' LIMIT 1
35777
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.135385"], ["name", "Foo"], ["permalink", "foo-19"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.135385"]]
35778
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35779
+  (0.0ms) SAVEPOINT active_record_1
35780
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35781
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35782
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '624mbv' LIMIT 1
35783
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.138017"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "624mbv"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.138017"]]
35784
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35785
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '624mbv' AND "payola_sales"."id" != 1) LIMIT 1
35786
+  (0.0ms) SAVEPOINT active_record_1
35787
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-20' LIMIT 1
35788
+ SQL (0.1ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.141153"], ["name", "Foo"], ["permalink", "foo-20"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.141153"]]
35789
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35790
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '624mbv' LIMIT 1
35791
+  (0.5ms) rollback transaction
35792
+  (0.0ms) begin transaction
35793
+  (0.0ms) SAVEPOINT active_record_1
35794
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-21' LIMIT 1
35795
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.146310"], ["name", "Foo"], ["permalink", "foo-21"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.146310"]]
35796
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35797
+  (0.0ms) SAVEPOINT active_record_1
35798
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35799
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35800
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = '8b7hmm' LIMIT 1
35801
+ SQL (0.4ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.193521"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "8b7hmm"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.193521"]]
35802
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35803
+  (0.0ms) SAVEPOINT active_record_1
35804
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = '8b7hmm' AND "payola_sales"."id" != 1) LIMIT 1
35805
+ SQL (0.1ms) UPDATE "payola_sales" SET "signed_custom_fields" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["signed_custom_fields", "BAh7BkkiCmZpZWxkBjoGRUZJIgp2YWx1ZQY7AEY=--5d721d50404afc54672ec88747e606e4226813b1fdb826dff62844c014ca61fc"], ["updated_at", "2014-11-07 18:57:49.195565"]]
35806
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35807
+ Payola::Sale Load (0.0ms) SELECT "payola_sales".* FROM "payola_sales" WHERE "payola_sales"."id" = ? LIMIT 1 [["id", 1]]
35808
+  (0.6ms) rollback transaction
35809
+  (0.0ms) begin transaction
35810
+  (0.0ms) SAVEPOINT active_record_1
35811
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-22' LIMIT 1
35812
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.199930"], ["name", "Foo"], ["permalink", "foo-22"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.199930"]]
35813
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35814
+  (0.0ms) SAVEPOINT active_record_1
35815
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35816
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35817
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'i2hdf' LIMIT 1
35818
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.202555"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "i2hdf"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.202555"]]
35819
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35820
+  (0.0ms) SAVEPOINT active_record_1
35821
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'errored' WHERE "payola_sales"."id" = 1
35822
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35823
+  (0.5ms) rollback transaction
35824
+  (0.1ms) begin transaction
35825
+  (0.0ms) SAVEPOINT active_record_1
35826
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-23' LIMIT 1
35827
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.208568"], ["name", "Foo"], ["permalink", "foo-23"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.208568"]]
35828
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35829
+  (0.0ms) SAVEPOINT active_record_1
35830
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35831
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35832
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'hndkqj' LIMIT 1
35833
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.211164"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "hndkqj"], ["product_id", 1], ["product_type", "Product"], ["state", "processing"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.211164"]]
35834
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35835
+  (0.0ms) SAVEPOINT active_record_1
35836
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'finished' WHERE "payola_sales"."id" = 1
35837
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35838
+  (0.7ms) rollback transaction
35839
+  (0.1ms) begin transaction
35840
+  (0.1ms) SAVEPOINT active_record_1
35841
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-24' LIMIT 1
35842
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.218885"], ["name", "Foo"], ["permalink", "foo-24"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.218885"]]
35843
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35844
+  (0.0ms) SAVEPOINT active_record_1
35845
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35846
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35847
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'g0h3vg' LIMIT 1
35848
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.221702"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "g0h3vg"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.221702"]]
35849
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35850
+  (0.0ms) SAVEPOINT active_record_1
35851
+ SQL (0.1ms) INSERT INTO "owners" ("created_at", "updated_at") VALUES (?, ?) [["created_at", "2014-11-07 18:57:49.225441"], ["updated_at", "2014-11-07 18:57:49.225441"]]
35852
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35853
+  (0.0ms) SAVEPOINT active_record_1
35854
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE ("payola_sales"."guid" = 'g0h3vg' AND "payola_sales"."id" != 1) LIMIT 1
35855
+ SQL (0.1ms) UPDATE "payola_sales" SET "owner_id" = ?, "owner_type" = ?, "updated_at" = ? WHERE "payola_sales"."id" = 1 [["owner_id", 1], ["owner_type", "Owner"], ["updated_at", "2014-11-07 18:57:49.229413"]]
35856
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35857
+  (0.5ms) rollback transaction
35858
+  (0.1ms) begin transaction
35859
+  (0.1ms) SAVEPOINT active_record_1
35860
+ Product Exists (0.2ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-25' LIMIT 1
35861
+ SQL (0.3ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.234889"], ["name", "Foo"], ["permalink", "foo-25"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.234889"]]
35862
+  (0.1ms) RELEASE SAVEPOINT active_record_1
35863
+  (0.0ms) SAVEPOINT active_record_1
35864
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35865
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35866
+ Payola::Sale Exists (0.1ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'jrtp5r' LIMIT 1
35867
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.238868"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "jrtp5r"], ["product_id", 1], ["product_type", "Product"], ["state", "finished"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.238868"]]
35868
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35869
+  (0.0ms) SAVEPOINT active_record_1
35870
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'refunded' WHERE "payola_sales"."id" = 1
35871
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35872
+  (0.6ms) rollback transaction
35873
+  (0.0ms) begin transaction
35874
+  (0.0ms) SAVEPOINT active_record_1
35875
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-26' LIMIT 1
35876
+ SQL (0.2ms) INSERT INTO "products" ("created_at", "name", "permalink", "price", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.245110"], ["name", "Foo"], ["permalink", "foo-26"], ["price", 100], ["updated_at", "2014-11-07 18:57:49.245110"]]
35877
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35878
+  (0.0ms) SAVEPOINT active_record_1
35879
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35880
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" IS NULL LIMIT 1
35881
+ Payola::Sale Exists (0.0ms) SELECT 1 AS one FROM "payola_sales" WHERE "payola_sales"."guid" = 'g233a5' LIMIT 1
35882
+ SQL (0.3ms) INSERT INTO "payola_sales" ("created_at", "currency", "email", "guid", "product_id", "product_type", "state", "stripe_token", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", "2014-11-07 18:57:49.247687"], ["currency", "usd"], ["email", "test@example.com"], ["guid", "g233a5"], ["product_id", 1], ["product_type", "Product"], ["state", "pending"], ["stripe_token", "tok_test"], ["updated_at", "2014-11-07 18:57:49.247687"]]
35883
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35884
+  (0.0ms) SAVEPOINT active_record_1
35885
+ SQL (0.1ms) UPDATE "payola_sales" SET "state" = 'processing' WHERE "payola_sales"."id" = 1
35886
+  (0.0ms) RELEASE SAVEPOINT active_record_1
35887
+  (0.6ms) rollback transaction
35888
+  (0.1ms) begin transaction
35889
+  (0.1ms) rollback transaction
35890
+  (0.1ms) begin transaction
35891
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-27' LIMIT 1
35892
+  (0.1ms) rollback transaction
35893
+  (0.0ms) begin transaction
35894
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'foo-28' LIMIT 1
35895
+  (0.1ms) rollback transaction
35896
+  (0.0ms) begin transaction
35897
+ Product Exists (0.1ms) SELECT 1 AS one FROM "products" WHERE "products"."permalink" = 'f' LIMIT 1
35898
+  (0.0ms) rollback transaction
35899
+  (0.0ms) begin transaction
35900
+  (0.0ms) rollback transaction
35901
+  (0.0ms) begin transaction
35902
+  (0.0ms) rollback transaction
data/spec/payola_spec.rb CHANGED
@@ -133,7 +133,8 @@ module Payola
133
133
  describe '#additional_charge_attributes' do
134
134
  it "should return a hash" do
135
135
  sale = double
136
- expect(Payola.additional_charge_attributes.call(sale)).to eq({})
136
+ customer = double
137
+ expect(Payola.additional_charge_attributes.call(sale, customer)).to eq({})
137
138
  end
138
139
  end
139
140
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payola-payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Keen