pay-whop 0.1.0.alpha.5 → 0.1.0.alpha.6

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: d181dedf94c5f676f9678fa0eb452888cd4b9b17bc5491a77fa0edc05538f048
4
- data.tar.gz: 4d63466ec62eabc795197d1e2a7cdc4476b3b0a3daf15f6d10ca4b621da64fe0
3
+ metadata.gz: ccdbe57fe6f99a81d26c66f9f744099b29e49816c0182819a5dadafe3cc20396
4
+ data.tar.gz: 13f5a269c1885aaaa46beedcdaf3b20a05ca203d76510bed9cb0b41278358f85
5
5
  SHA512:
6
- metadata.gz: 95806d6bfb6bd3e27d5f49e91e985ba4f6c7da3f0e1518ee75ceadb4305c54c3ff1610b8c862ee29ed7f2f85ac9ffc5f32d2b9d3a38b8c46250f34beec3a9e74
7
- data.tar.gz: f2224d7bed6966f059057b44619e7e529fe52e23e35188970614688c88318799f27958957bee27fa7a669058051c6fafee0fe59a19a2b485ed954cf4921383b1
6
+ metadata.gz: 7ae30edc8d90437129870e5208c959c336a065e41880f9b780fa20963321218322152c90f7ebc0e12ef4f990d7cfafb706bdd08aa6ae4ce2b798e2a4125da14a
7
+ data.tar.gz: 22439cf8c6e5f99fd5e7c30a493eafab8e261ef6b662a8831ef47fdf78e8c49fee925c5916a8fa3a1e7d5c8f982bb8e6029594da275d08ca619beae05d7a5b8e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0.alpha.6
4
+
5
+ - Support Pay 12.3 through 13.x and Whop SDK 2.7/2.8, with CI covering Pay 13 and the minimum SDK version.
6
+ - Refresh the canonical payment after an idempotent saved-card charge returns a cached pending response.
7
+ - Preserve a saved payment method's default flag when it is selected again.
8
+ - Continue customer reconciliation and subscription refresh after a historical resource returns HTTP 404; permission and other API failures still surface.
9
+ - Include the sandbox checkout, refund and deployment fixes shipped since the previous gem release.
10
+
3
11
  ## 0.1.0.alpha.5
4
12
 
5
13
  - Preserve explicit adaptive-pricing settings on inline checkouts instead of losing them in SDK serialization.
data/README.md CHANGED
@@ -2,18 +2,22 @@
2
2
 
3
3
  **Whop payments for Ruby on Rails, through [Pay](https://github.com/pay-rails/pay).**
4
4
 
5
- [![CI](https://github.com/yshmarov/pay-whop/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/yshmarov/pay-whop/actions/workflows/ci.yml)
6
- [![RubyGems alpha](https://img.shields.io/gem/v/pay-whop?include_prereleases&label=RubyGems)](https://rubygems.org/gems/pay-whop)
5
+ [![CI](https://github.com/whoptools/pay-whop/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/whoptools/pay-whop/actions/workflows/ci.yml)
6
+ [![Gem version](https://img.shields.io/gem/v/pay-whop?include_prereleases&label=gem)](https://rubygems.org/gems/pay-whop)
7
+ [![Gem downloads](https://img.shields.io/gem/dt/pay-whop?label=downloads)](https://rubygems.org/gems/pay-whop)
7
8
  [![Ruby 3.3+](https://img.shields.io/badge/Ruby-3.3%2B-CC342D)](pay-whop.gemspec)
8
- [![MIT license](https://img.shields.io/github/license/yshmarov/pay-whop)](LICENSE)
9
+ [![MIT license](https://img.shields.io/github/license/whoptools/pay-whop)](LICENSE)
10
+ [![Live demo](https://img.shields.io/badge/live_demo-pay--rails.whoptools.com-fa4616)](https://pay-rails.whoptools.com/)
9
11
 
10
12
  Hosted checkout, subscriptions, saved payment methods, refunds and marketplace subaccounts using familiar Pay models and Whop's official Ruby SDK.
11
13
 
12
- [**Try the live demo**](https://pay-whop.onrender.com/) · [Install](#installation) · [Usage guide](docs/advanced-usage.md) · [Compatibility](docs/compatibility.md) · [Changelog](CHANGELOG.md)
14
+ <a href="https://whop.com/start/?code=CAKARK" rel="sponsored"><img src=".github/create-whop-account.svg" alt="Create a Whop account" height="40"></a>
13
15
 
14
- [![The deployed Rails playground with Whop subscription, one-time and marketplace checkout controls and its Ruby integration example](.github/images/demo-overview.jpg)](https://pay-whop.onrender.com/)
16
+ [**Try the live demo**](https://pay-rails.whoptools.com/) · [Install](#installation) · [Usage guide](docs/advanced-usage.md) · [Compatibility](docs/compatibility.md) · [Changelog](CHANGELOG.md)
15
17
 
16
- **Community alpha.** Published on RubyGems as `0.1.0.alpha.5`. Independently maintained; not an official Whop or Pay integration. Start in the sandbox and review the [verification evidence](docs/verification.md) before production use.
18
+ [![The deployed Rails playground with Whop subscription, one-time and marketplace checkout controls and its Ruby integration example](.github/images/demo-overview.jpg)](https://pay-rails.whoptools.com/)
19
+
20
+ **Community alpha.** Independently maintained; not an official Whop or Pay integration. Start in the sandbox and review the [verification evidence](docs/verification.md) before production use.
17
21
 
18
22
  ## What you can build
19
23
 
@@ -31,8 +35,8 @@ See the [full compatibility matrix](docs/compatibility.md) for Pay method covera
31
35
 
32
36
  ## Tested, with evidence
33
37
 
34
- - **12 CI combinations:** Ruby 3.3 / 3.4 / 4.0 × Pay 12.3 / 12.4 × SQLite / PostgreSQL, using Rails 8.1.
35
- - **109 tests, 423 assertions** in the `0.1.0.alpha.5` release suite, plus Standard Ruby linting. Tests exercise real Pay models, signed webhook requests and the SDK/HTTP boundary without payment credentials.
38
+ - **19 CI combinations:** Ruby 3.3 / 3.4 / 4.0 × Pay 12.3 / 12.4 / 13.0 × SQLite / PostgreSQL, plus the minimum Whop SDK, using Rails 8.1.
39
+ - **117 tests, 473 assertions** in the `0.1.0.alpha.6` suite, plus Standard Ruby linting. Tests exercise real Pay models, signed webhook requests and the SDK/HTTP boundary without payment credentials.
36
40
  - **Fresh-app installation:** the published gem was downloaded, its SHA-256 checked against the release artifact, and installed/migrated/eager-loaded in a separate Rails application.
37
41
  - **Actual sandbox runs:** recurring and one-time checkout, marketplace fees, cancellation, full/partial refunds, saved methods, authorization/capture/void and signed child webhooks. [Observed results and remaining gaps →](docs/verification.md)
38
42
 
@@ -52,17 +56,17 @@ Captured from the deployed demo on 12 November 2026. Synthetic customer records
52
56
 
53
57
  ![Amber-labelled invoice and transfer simulations showing their local activity history and simulated outcomes](.github/images/demo-simulations.jpg)
54
58
 
55
- [Try these simulations](https://pay-whop.onrender.com/#simulations) without a Whop account or KYC. They update separate local demo records, with `sim_` references and a resettable history. They never call Whop, create Pay charges, grant access or move funds. A simulated outcome does not verify real invoice issuance or transfer settlement.
59
+ [Try these simulations](https://pay-rails.whoptools.com/#simulations) without a Whop account or KYC. They update separate local demo records, with `sim_` references and a resettable history. They never call Whop, create Pay charges, grant access or move funds. A simulated outcome does not verify real invoice issuance or transfer settlement.
56
60
 
57
61
  </details>
58
62
 
59
63
  ## Installation
60
64
 
61
- Requires Ruby 3.3+, Pay 12.3–12.x and Whop Ruby SDK 2.7.x. The demo and installation smoke test use Rails 8.1. Requests are pinned to Whop API date `2026-10-28-1`.
65
+ Requires Ruby 3.3+, Pay 12.3–13.x and Whop Ruby SDK 2.7–2.8. The demo and installation smoke test use Rails 8.1. Requests are pinned to Whop API date `2026-10-28-1`.
62
66
 
63
67
  ```ruby
64
68
  # Gemfile
65
- gem "pay-whop", "0.1.0.alpha.5"
69
+ gem "pay-whop", "0.1.0.alpha.6"
66
70
  ```
67
71
 
68
72
  Install both engines' missing migrations, including Pay's STI and object columns:
@@ -148,14 +152,28 @@ Monitor pending deliveries and `delivery_failed.pay_whop`. A successful webhook
148
152
 
149
153
  | Resource | What you will find |
150
154
  | --- | --- |
151
- | [Live sandbox playground](https://pay-whop.onrender.com/) | Test checkout, saved methods, refunds and session-scoped billing. Free hosting may take about a minute to wake up. |
152
- | [Run or deploy the demo](docs/demo.md) | Local setup, HTTPS returns, webhook configuration and Render/Neon hosting |
155
+ | [Live sandbox playground](https://pay-rails.whoptools.com/) | Test checkout, saved methods, refunds and session-scoped billing. Hosted on the shared WhopTools Hetzner server. |
156
+ | [Run or deploy the demo](docs/demo.md) | Local setup, HTTPS returns, webhook configuration and Hetzner deployment |
153
157
  | [Advanced usage](docs/advanced-usage.md) | Billing, marketplaces, invoices, disputes, retries, permissions and recovery |
154
158
  | [Compatibility matrix](docs/compatibility.md) | Supported Pay operations and differences from Stripe |
155
159
  | [Verification evidence](docs/verification.md) | Tested versions, actual sandbox results and open validation gaps |
156
160
  | [Contributing](CONTRIBUTING.md) | Development setup, test commands and useful bug reports |
157
- | [Report a bug](https://github.com/yshmarov/pay-whop/issues/new/choose) | Reproduction and environment details, without credentials or buyer data |
161
+ | [Report a bug](https://github.com/whoptools/pay-whop/issues/new/choose) | Reproduction and environment details, without credentials or buyer data |
158
162
  | [Security reporting](SECURITY.md) | Private vulnerability reports |
159
- | [Releases](https://github.com/yshmarov/pay-whop/releases) | Changelog and downloadable gem artifacts |
163
+ | [Releases](https://github.com/whoptools/pay-whop/releases) | Changelog and downloadable gem artifacts |
160
164
 
161
165
  Maintained by [Yaroslav Shmarov](https://github.com/yshmarov). Built on [Pay](https://github.com/pay-rails/pay) and [Whop's official Ruby SDK](https://github.com/whopio/whopsdk-ruby). Available under the [MIT license](LICENSE).
166
+
167
+ ## Demo appearance
168
+
169
+ The Rails playground uses the shared WhopTools kit in `examples/rails/public/whoptools` (Frosted UI colors, Inter, shared header and footer), vendored from [whoptools.com](https://github.com/whoptools/whoptools.com). Its colors follow the system light/dark preference automatically; there is no theme switch or saved override.
170
+
171
+ ## Part of WhopTools
172
+
173
+ Open-source Whop integrations. More at [whoptools.com](https://whoptools.com).
174
+
175
+ | Project | Live demo | Source |
176
+ | --- | --- | --- |
177
+ | Whop Checkout for Webflow | [webflow-checkout.whoptools.com](https://webflow-checkout.whoptools.com/) | [webflow-whop](https://github.com/whoptools/webflow-whop) |
178
+ | OmniAuth Whop | [omniauth-ruby.whoptools.com](https://omniauth-ruby.whoptools.com/) | [omniauth-whop](https://github.com/whoptools/omniauth-whop) |
179
+ | Pay Whop | [pay-rails.whoptools.com](https://pay-rails.whoptools.com/) | [pay-whop](https://github.com/whoptools/pay-whop) |
@@ -181,6 +181,7 @@ module Pay
181
181
 
182
182
  def confirmed_charge(result)
183
183
  verify_resource!(Whop.api_attributes(result))
184
+ result = payment(result.id) unless result.status == "paid"
184
185
  raise PaymentIncomplete, result unless result.status == "paid"
185
186
  Charge.sync(result.id, account_id: account_id)
186
187
  end
@@ -209,6 +210,9 @@ module Pay
209
210
  next if Whop.allow_shared_members && reference && reference != self
210
211
  verify_resource!(object)
211
212
  Subscription.sync(object.fetch("id"), account_id: account_id)
213
+ rescue ApiError => error
214
+ raise unless error.status == 404
215
+ ActiveSupport::Notifications.instrument("reconciliation_skipped.pay_whop", customer_id: id, resource_id: object.fetch("id"), resource_type: :memberships)
212
216
  end
213
217
  subscriptions.reload
214
218
  end
@@ -229,10 +233,17 @@ module Pay
229
233
  next
230
234
  end
231
235
  verify_resource!(object)
232
- case kind
233
- when :memberships then Subscription.sync(object.fetch("id"), account_id: account_id)
234
- when :payments then Charge.sync(object.fetch("id"), account_id: account_id)
235
- when :invoices then Invoice.sync(object.fetch("id"), account_id: account_id)
236
+ begin
237
+ case kind
238
+ when :memberships then Subscription.sync(object.fetch("id"), account_id: account_id)
239
+ when :payments then Charge.sync(object.fetch("id"), account_id: account_id)
240
+ when :invoices then Invoice.sync(object.fetch("id"), account_id: account_id)
241
+ end
242
+ rescue ApiError => error
243
+ raise unless error.status == 404
244
+ counts[:skipped] += 1
245
+ ActiveSupport::Notifications.instrument("reconciliation_skipped.pay_whop", customer_id: id, resource_id: object.fetch("id"), resource_type: kind)
246
+ next
236
247
  end
237
248
  counts[kind] += 1
238
249
  end
@@ -14,7 +14,7 @@ module Pay
14
14
  def make_default!
15
15
  customer.verify_configuration!
16
16
  customer.with_lock do
17
- customer.payment_methods.update_all(default: false)
17
+ customer.payment_methods.where.not(id: id).update_all(default: false)
18
18
  update!(default: true)
19
19
  end
20
20
  end
data/docs/demo.md CHANGED
@@ -25,7 +25,10 @@ bundle exec examples/rails/bin/reconcile
25
25
 
26
26
  ## Deploy the playground
27
27
 
28
- `render.yaml` defines a free Rails web service. Supply a separate persistent PostgreSQL database (for example, Neon Free); Render’s free database expires after 30 days. The app uses GoodJob with PostgreSQL-backed jobs, bounded retries and a recovery job for pending deliveries. It only boots against Whop sandbox. Free hosting has usage limits and the web service sleeps when idle.
28
+ The public playground uses Docker on the shared Hetzner server with a dedicated
29
+ PostgreSQL database. See [the deployment runbook](hetzner.md). GoodJob runs
30
+ PostgreSQL-backed jobs, bounded retries and recovery for pending deliveries.
31
+ The app only boots against Whop sandbox.
29
32
 
30
33
  Set the listed environment variables in the host’s secret settings. Optionally set `DEMO_MERCHANT_ID` to a registered sandbox subaccount to show marketplace checkout, and `WHOP_ONE_TIME_VARIANT_ID` to a USD 5.00 one-time variant to show draft invoices. Set `WHOP_RETURN_URL` to the public HTTPS root URL, register `/pay/whop/webhooks` with Whop using the adapter’s event list and dated API version, then set `WHOP_WEBHOOK_SECRET`. `examples/rails/bin/start` applies migrations and starts Puma. Keep a stable `SECRET_KEY_BASE`: changing it invalidates sessions and the customer references already stored in Whop.
31
34
 
@@ -34,3 +37,5 @@ Never expose the local developer database or reuse a production Whop API key for
34
37
  ## Screenshots
35
38
 
36
39
  Repository screenshots were captured from the deployed sandbox on 12 November 2026. Billing screenshots show synthetic customers and Whop test payments; they contain no API keys, buyer contact details or live-money transactions. Tax can make a USD 5.00 checkout appear as USD 6.00 in the billing table. The amber invoice/transfer section uses separate local simulation records.
40
+
41
+ The public playground at https://pay-rails.whoptools.com now runs on Hetzner. See [the deployment runbook](hetzner.md) for its shared-server setup.
data/docs/hetzner.md ADDED
@@ -0,0 +1,104 @@
1
+ # Shared Hetzner deployment
2
+
3
+ The playground runs at https://pay-rails.whoptools.com on the existing Corsego server
4
+ (`188.245.75.73`), alongside the Webflow integration. Each app has its own container
5
+ and hostname behind Kamal Proxy. The playground uses a dedicated PostgreSQL 17 container on the same host. It
6
+ started with a fresh sandbox database on November 17, 2026; Neon data was not
7
+ imported. The former Neon project and Render service have been deleted.
8
+
9
+ ## Layout
10
+
11
+ - Releases: `/opt/pay-whop/releases/<commit>`
12
+ - Active release: `/opt/pay-whop/current`
13
+ - Runtime environment: `/opt/pay-whop/shared/runtime.env` (root-owned, mode 0600)
14
+ - Container: `pay-whop-app`, private port 3001, external Docker network `kamal`
15
+ - App limits: 512 MB RAM and half a CPU; bounded Docker logs; automatic restart
16
+ - Database: `pay-whop-db`, volume `pay-whop_postgres_data`, 256 MB RAM
17
+ - Private database network: `pay-whop-database`; no published database port
18
+ - Database definition: `/opt/pay-whop/shared/postgres.yaml` from `deploy/postgres.yaml`
19
+
20
+ Keep `SECRET_KEY_BASE`, `DATABASE_URL` and the sandbox Whop settings stable. Never
21
+ commit runtime secrets or include them in the Docker build context. The app
22
+ refuses to boot with a live Whop environment.
23
+
24
+ ## Database
25
+
26
+ The database is managed separately from application releases:
27
+
28
+ ```sh
29
+ docker compose -f /opt/pay-whop/shared/postgres.yaml up -d --wait db
30
+ ```
31
+
32
+ The database password lives in `/opt/pay-whop/shared/postgres-password` (mode
33
+ 0600). The app connects through the private Docker network using its protected
34
+ `DATABASE_URL`. Do not publish PostgreSQL ports or reuse the Corsego database.
35
+ Never delete `pay-whop_postgres_data` during an application deployment.
36
+
37
+ This sandbox demo has no scheduled or deployment-time database backups, by
38
+ owner decision on November 17, 2026. Stored database dumps and backup timers
39
+ were removed. Persistent storage still survives application deployments.
40
+
41
+ The initial database reset also rotated `SECRET_KEY_BASE`, invalidating old
42
+ browser sessions before numeric IDs could be reused. Keep the new secret stable
43
+ for subsequent deployments. The sandbox seller mapping was restored from its
44
+ verified Whop child account; old users, payments and subscriptions were not
45
+ imported. Whop's own sandbox records remain at Whop.
46
+
47
+ ## Automatic deployments
48
+
49
+ Pushes to `main` run the complete CI matrix. Only a successful matrix starts the
50
+ Hetzner deployment job. Pull requests never receive the deployment key. Deploys
51
+ are serialized, and a superseded commit is skipped before build and activation.
52
+
53
+ GitHub secrets `HETZNER_DEPLOY_KEY` and `HETZNER_KNOWN_HOSTS` hold a dedicated SSH
54
+ key and the pinned server host key. The Unix account `pay-whop-deploy` has a forced
55
+ SSH command and no forwarding or interactive shell access through that key.
56
+ Its only sudo command is `/usr/local/sbin/pay-whop-deploy`, installed from
57
+ `deploy/hetzner.sh`. That root-owned script accepts only `deploy <commit SHA>` and
58
+ fetches that exact revision from `whoptools/pay-whop` after checking it is current
59
+ `main`. Application credentials remain on the server.
60
+
61
+ The server builds with its dedicated resource-limited `pay-whop-builder`, stops
62
+ the builder, then replaces the app container. It checks container health and
63
+ HTTPS before advancing `current`. Activation failure restores the previous app
64
+ image. The shared proxy, Webflow app and database are not restarted. This is a
65
+ single-container deployment, so replacement can briefly interrupt requests.
66
+
67
+ Monitor the **Deploy to Hetzner** job in the repository's CI workflow. To retry a
68
+ failed deployment, rerun the failed GitHub Actions jobs. A newer main revision
69
+ will supersede an older retry. Keep releases and images needed for rollback.
70
+
71
+ ## Operator access
72
+
73
+ For a manual deployment of the current, CI-verified main commit:
74
+
75
+ ```sh
76
+ ssh root@188.245.75.73 "/usr/local/sbin/pay-whop-deploy 'deploy <40-character SHA>'"
77
+ ```
78
+
79
+ Changes to the deployment script itself require an operator to install the
80
+ reviewed `deploy/hetzner.sh` at `/usr/local/sbin/pay-whop-deploy` (root-owned, mode
81
+ 0755). The restricted CI account cannot replace that script or rotate its key.
82
+ The build context excludes private environment files, Git history and temporary
83
+ files. The app start command applies migrations and starts Puma with embedded
84
+ GoodJob; it refuses to boot with a live Whop environment.
85
+
86
+ ## Webhooks and rollback
87
+
88
+ The Whop webhook endpoint may use either `https://pay-rails.whoptools.com/pay/whop/webhooks`
89
+ or the legacy `https://pay.whoptools.com/pay/whop/webhooks`; both are served in place.
90
+ Preserve the existing endpoint's event list, dated API version, signing secret and
91
+ child-event setting when moving its URL.
92
+
93
+ ## Hostnames
94
+
95
+ `pay-rails.whoptools.com` is canonical (`DEMO_HOST`). The previous hostname,
96
+ `pay.whoptools.com`, remains routed by Kamal Proxy and listed in `LEGACY_HOSTS`:
97
+ browser GET/HEAD requests receive a 301 to the canonical host, while webhook POSTs
98
+ and `/up` are served in place. Both hostnames are DNS-only Cloudflare A records.
99
+ The cutover on November 18, 2026 installed the two-host deploy script and set
100
+ `DEMO_HOST`, `LEGACY_HOSTS` and `WHOP_RETURN_URL` in the runtime environment.
101
+
102
+ The former Render service and Neon database are retired. Application rollback
103
+ uses previous Hetzner images with the current database; it does not restore
104
+ older data or reverse migrations. Demo records are disposable.
data/docs/releasing.md CHANGED
@@ -1,12 +1,10 @@
1
- # Releasing
1
+ # Releases
2
2
 
3
- The current published alpha is [`0.1.0.alpha.5`](https://rubygems.org/gems/pay-whop/versions/0.1.0.alpha.5). Its [GitHub prerelease](https://github.com/yshmarov/pay-whop/releases/tag/v0.1.0.alpha.5) contains the matching gem artifact.
3
+ The latest published version is listed on [RubyGems](https://rubygems.org/gems/pay-whop).
4
4
 
5
- 1. Update the version, lockfile, changelog and verification evidence together.
6
- 2. Run `bin/test`, the PostgreSQL suite, and `bundle exec ruby bin/install-smoke`. Confirm the GitHub CI matrix is green.
7
- 3. Build with `gem build pay-whop.gemspec --output pkg/pay-whop-0.1.0.alpha.5.gem` (create `pkg` first).
8
- 4. Inspect `gem specification pkg/pay-whop-0.1.0.alpha.5.gem files` and ensure no credentials, private fixtures or developer environment files are packaged.
9
- 5. A gem owner publishes with `gem push pkg/pay-whop-0.1.0.alpha.5.gem`. RubyGems MFA is required by the gem metadata. Configure credentials locally; never commit or paste an API key.
10
- 6. Create the matching GitHub prerelease with the built artifact and release notes. Register the deployed adapter's current webhook event list only after deploying the compatible code.
5
+ 1. Update the version constant and changelog in a pull request. Run `bin/test` and `bundle exec ruby bin/install-smoke`, and inspect the packaged files for credentials or private fixtures.
6
+ 2. After review, merge approval and passing CI, create and push `vVERSION` from the intended clean `main` commit. The tag must match `Pay::Whop::VERSION`.
7
+ 3. Watch the [Release workflow](https://github.com/whoptools/pay-whop/actions/workflows/release.yml). It runs CI, verifies that the tagged commit belongs to `main`, and publishes using RubyGems Trusted Publishing. No local RubyGems key or OTP is needed.
8
+ 4. Verify the published version and its SHA-256 on RubyGems, install that exact artifact in the consumer app, and publish matching GitHub release notes.
11
9
 
12
- Do not label this production-ready while real invoice issuance, transfers and bank payouts lack provider validation. Keep sandbox-only demo simulations visibly separate from real adapter behavior.
10
+ If publishing fails, check whether RubyGems already accepted the version before retrying. Published versions cannot be overwritten; do not move an existing release tag.
@@ -8,6 +8,8 @@ Pay::Whop.allow_shared_members = true
8
8
 
9
9
  The default remains `false`. Install and run the new `AllowSharedWhopMembers` engine migration first. It keeps Pay's processor/member uniqueness constraint for other processors and adds a nonunique Whop member lookup index.
10
10
 
11
+ Shared buyers require PostgreSQL or SQLite. The migration relies on partial indexes, and Rails silently drops their `WHERE` clause on MySQL, so the unique constraint keeps covering Whop customers there. Enabling sharing on MySQL raises a uniqueness error when a second customer links the same member; it does not corrupt data.
12
+
11
13
  With sharing enabled, signed checkout metadata selects the exact Pay customer. Both customers can retain the same provider member ID; neither customer's owner, seller or environment changes. Existing customer-to-member links remain immutable. When more than one matching customer exists, an event without a signed reference is rejected instead of choosing an organization. Invalid signatures never fall back to a member lookup.
12
14
 
13
15
  Every checkout, payment and recurring membership must preserve the adapter's `pay_customer` metadata. Use separate Whop seller/account contexts for unrelated applications. Sharing a buyer within one application does not make signatures from another Rails application valid.
data/docs/verification.md CHANGED
@@ -4,15 +4,15 @@ Provider payment-flow verification: 7 November 2026. Expanded adapter, read-only
4
4
 
5
5
  ## Versions and automated coverage
6
6
 
7
- Ruby 4.0.9, Rails 8.1.4.1, Pay 12.4.0, Whop Ruby SDK 2.7.0, and Whop API date `2026-10-28-1`. The demo runs PostgreSQL and GoodJob on Render Free / Neon Free. Unit and integration tests use SQLite and PostgreSQL, with WebMock at the SDK/HTTP boundary. No test credentials or captured customer payloads are committed.
7
+ Release-candidate checks on 27 November 2026: Ruby 4.0.9, Rails 8.1.4.1, Pay 13.0.1, Whop Ruby SDK 2.8.1, and Whop API date `2026-10-28-1`. The demo runs PostgreSQL and GoodJob on the shared Hetzner server, with PostgreSQL on the same host. Unit and integration tests use SQLite and PostgreSQL, with WebMock at the SDK/HTTP boundary. No test credentials or captured customer payloads are committed.
8
8
 
9
- The local suite passes **109 tests / 423 assertions** and Standard Ruby linting. The local suite also passes with Pay 12.3.0; installation from the built gem into a fresh Rails application passes. GitHub Actions runs Ruby 3.3/3.4/4.0 × Pay 12.3.0/12.4.0 × SQLite/PostgreSQL; see [CI runs](https://github.com/yshmarov/pay-whop/actions/workflows/ci.yml).
9
+ The local suite passes **117 tests / 473 assertions** and Standard Ruby linting. The local suite also passes with Pay 12.3.0; installation from the built gem into a fresh Rails application passes. GitHub Actions runs Ruby 3.3/3.4/4.0 × Pay 12.3.0/12.4.0/13.0.1 × SQLite/PostgreSQL, plus a minimum-SDK 2.7.0 job; see [CI runs](https://github.com/whoptools/pay-whop/actions/workflows/ci.yml).
10
10
 
11
11
  Coverage includes signed owner mapping, environment and seller isolation, conflicting identities, forged references, webhook authentication/replays/collisions, duplicate processing, pending-event recovery, enqueue refusal, stale snapshots, exact money conversion, full/partial refunds, asynchronous direct payments, saved methods, setup intents, invoice/dispute summaries, marketplace registration and transfers, terminal transfer-state protection, pause/access semantics, trial and past-due state mapping, and browser-session/CSRF/cross-customer boundaries. Expanded tests cover existing-payment retries without duplicate charges, renewal restrictions, normalized API errors including lazy pagination/timeouts, application callback failure recovery, payout ownership/pagination/reversals, merchant capabilities, decimal balances and linked-customer reconciliation.
12
12
 
13
13
  ## Actual sandbox evidence
14
14
 
15
- The [hosted playground](https://pay-whop.onrender.com/) uses the adapter and receives actual signed Whop events. Its database persists across deployments and idle shutdowns. The app is sandbox-only; no live-money transactions were performed.
15
+ The [hosted playground](https://pay-rails.whoptools.com/) uses the adapter and receives actual signed Whop events. Its database persists across deployments and idle shutdowns. The app is sandbox-only; no live-money transactions were performed.
16
16
 
17
17
  | Flow | Observed result |
18
18
  | --- | --- |
@@ -1,5 +1,5 @@
1
1
  module Pay
2
2
  module Whop
3
- VERSION = "0.1.0.alpha.5"
3
+ VERSION = "0.1.0.alpha.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,44 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pay-whop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.5
4
+ version: 0.1.0.alpha.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-11-27 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: pay
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - "~>"
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: '12.3'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '14.0'
19
23
  type: :runtime
20
24
  prerelease: false
21
25
  version_requirements: !ruby/object:Gem::Requirement
22
26
  requirements:
23
- - - "~>"
27
+ - - ">="
24
28
  - !ruby/object:Gem::Version
25
29
  version: '12.3'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '14.0'
26
33
  - !ruby/object:Gem::Dependency
27
34
  name: whop_sdk
28
35
  requirement: !ruby/object:Gem::Requirement
29
36
  requirements:
30
- - - "~>"
37
+ - - ">="
31
38
  - !ruby/object:Gem::Version
32
- version: 2.7.0
39
+ version: '2.7'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.9'
33
43
  type: :runtime
34
44
  prerelease: false
35
45
  version_requirements: !ruby/object:Gem::Requirement
36
46
  requirements:
37
- - - "~>"
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '2.7'
50
+ - - "<"
38
51
  - !ruby/object:Gem::Version
39
- version: 2.7.0
52
+ version: '2.9'
40
53
  description: A community Pay adapter for Whop checkout, subscriptions, saved methods,
41
54
  invoices, refunds, marketplace subaccounts and verified webhooks.
55
+ email:
42
56
  executables: []
43
57
  extensions: []
44
58
  extra_rdoc_files: []
@@ -68,6 +82,7 @@ files:
68
82
  - docs/advanced-usage.md
69
83
  - docs/compatibility.md
70
84
  - docs/demo.md
85
+ - docs/hetzner.md
71
86
  - docs/qa-2026-11-12.md
72
87
  - docs/releasing.md
73
88
  - docs/shared-buyers.md
@@ -81,13 +96,14 @@ files:
81
96
  - lib/pay/whop/api_proxy.rb
82
97
  - lib/pay/whop/engine.rb
83
98
  - lib/pay/whop/version.rb
84
- homepage: https://github.com/yshmarov/pay-whop
99
+ homepage: https://github.com/whoptools/pay-whop
85
100
  licenses:
86
101
  - MIT
87
102
  metadata:
88
- source_code_uri: https://github.com/yshmarov/pay-whop
89
- changelog_uri: https://github.com/yshmarov/pay-whop/blob/main/CHANGELOG.md
103
+ source_code_uri: https://github.com/whoptools/pay-whop
104
+ changelog_uri: https://github.com/whoptools/pay-whop/blob/main/CHANGELOG.md
90
105
  rubygems_mfa_required: 'true'
106
+ post_install_message:
91
107
  rdoc_options: []
92
108
  require_paths:
93
109
  - lib
@@ -102,7 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
118
  - !ruby/object:Gem::Version
103
119
  version: '0'
104
120
  requirements: []
105
- rubygems_version: 4.0.20
121
+ rubygems_version: 3.5.22
122
+ signing_key:
106
123
  specification_version: 4
107
124
  summary: Whop payments for the Pay Rails engine
108
125
  test_files: []