tillbell 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: 64453d03230961cfa6f6180cbeee450d0124f72f9947aef1e1a116af24bf8de2
4
- data.tar.gz: b8ac7449bdcd2af96ae89c7a06ec7aa5817bf49cd044a16f7ef0f4bd83a8f4d0
3
+ metadata.gz: 1cd3d312b63c5e8b293a1381bf43b4aef6ca7030e7407f0454474ec262686c50
4
+ data.tar.gz: 6cef6679339865674594b82542277ce8aec7812112372483db4ae32d613ba2fa
5
5
  SHA512:
6
- metadata.gz: fdbee64852b3faf248bd5bc7de2a3f0831e0bb829b395cbd2296a49c297975e2bcca1e28fc1789dd4f779f6a06a09eb92fc61d2b4af33de4528fc857ee9aad71
7
- data.tar.gz: 0c1a24add17c38ac19a192bfebb0b7ff20e3b76706981f52341daaf53310c5c64db31cda1e7831848a7f8e89deaf6e785664771ee4035481735537b0f21a6cd7
6
+ metadata.gz: 6d4ec5e33704eb6297d3fc8359078c0d5fcabe1e8b508f1d670085fd2cd3fe8dffce0d61bc94c3cd9009f5d1c02203be3489e51a574cc46c21dc79edb50ebc5e
7
+ data.tar.gz: dfd416745023423068c3da11e1d5f0085548256a5e5e631a35718c7e52622e7ed61b30ca76ee8a8aeec67b1f08d8dbb628d6452cfd006a937d5c20ed381be7cd
data/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ All notable changes to this project are documented in this file. The format foll
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.1] - 2026-11-25
10
+
11
+ ### Upgrading
12
+
13
+ - Run `bin/rails tillbell:install:migrations db:migrate`: a migration adds the report attempts
14
+ below to `tillbell_external_transactions`.
15
+
16
+ ### Added
17
+
18
+ - `Tillbell::ExternalTransaction#report_attempts` and `#last_attempt_at`: how many times a
19
+ payment was sent to Google, and when last, for an admin page or an alert.
20
+
9
21
  ## [0.9.0] - 2026-11-25
10
22
 
11
23
  ### Added
@@ -29,11 +29,14 @@ module Tillbell
29
29
  # True once Google has the payment.
30
30
  def reported? = reported_at.present?
31
31
 
32
- # Reports the payment to Google, unless it already was. The error, if any, is kept in
33
- # +last_error+ and raised again for the caller to retry.
32
+ # Reports the payment to Google, unless it already was. Each call counts in
33
+ # +report_attempts+ and +last_attempt_at+; the error, if any, is kept in +last_error+ and
34
+ # raised again for the caller to retry.
34
35
  def report!
35
36
  return if reported?
36
37
 
38
+ # A SQL increment, so two jobs reporting the same payment at once count both attempts.
39
+ self.class.update_counters(id, report_attempts: 1, touch: :last_attempt_at)
37
40
  GooglePlay::ExternalTransactions.report(
38
41
  external_transaction_id: external_transaction_id, pre_tax_micros: pre_tax_micros, tax_micros: tax_micros,
39
42
  currency: currency, region_code: region_code, transaction_time: transaction_time, link_type: link_type,
@@ -0,0 +1,10 @@
1
+ # How many times a payment was sent to Google and when last, to tell a payment that keeps
2
+ # failing from one that was never tried.
3
+ class AddReportAttemptsToTillbellExternalTransactions < ActiveRecord::Migration[8.0]
4
+ def change
5
+ change_table :tillbell_external_transactions, bulk: true do |t|
6
+ t.integer :report_attempts, null: false, default: 0
7
+ t.datetime :last_attempt_at
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Tillbell
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tillbell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pmakerhq
@@ -147,6 +147,7 @@ files:
147
147
  - contract/restore.reply.json
148
148
  - contract/restore.request.json
149
149
  - db/migrate/20261125000000_create_tillbell_external_transactions.rb
150
+ - db/migrate/20261125170000_add_report_attempts_to_tillbell_external_transactions.rb
150
151
  - lib/generators/tillbell/install/install_generator.rb
151
152
  - lib/generators/tillbell/install/templates/initializer.rb
152
153
  - lib/generators/tillbell/install/templates/next_steps.txt