Feature/paypal & stripe integration#463
Conversation
added POST route for pagination to activity route, a count route, and modified Search and PaginatedList a bit to support lists without search fields (essentially just running an empty search). Visible by clicking on a user's name in the accounts tab.
just committing so I can pull on another device.
GET /users/:id, skips the usercache.
does the "tabs" seen on the invite tab (invite expiry/user expiry), and will be used in all other similar cases.
pass a string (new "id" field) or number to RadioBasedTabSelector.selected = x. setting an "id" for a tab is optional, if not set it's value defaults to the "name" value. Also added optional buttonHTML to put inside the button insetad of the given name.
RadioBasedTabs when clicking a username in the accounts tab, the details comes up with a copy of the row you clicked, so you can view logs and edit the user. Also decided not to use a RadioBasedTab here, instead providing a link to the activity tab with a search for the user (added the ability to do that, ?user=username). FIXME: handle deleting the user or just generally editing them.
tab content classes (e.g. settingsList, activityList) can implement "AsTab", "Navigatable" and or "PageEventBindable", the first giving them a tab name, a subpath and a reloader function, the second an "isURL" and "navigate" function for loading resources, the last giving them bind/unbindPageEvent methods. These are looped through in ts/admin.ts still crudely, maybe tabs.ts could accept "AsTab" implementers directly. "Search" class now has a ?search query param which just encodes the search box content, set when you perform a server search (hit enter or press the button). ?user queries from the accounts or activity tab will be converted to this form on loading.
searches are triggered by setting the search QP, and ran by a listener set on PageManager. same with details. Works surprisingly well, but i'm sure theres bugs.
* **Stripe Integration:**
* Implemented full payment flow for paid invites using Stripe Checkout.
* Added Price and Currency fields to Invites in backend and frontend.
* Updated api-stripe.go to handle callbacks correctly.
* Added PaymentStatus verification in api-users.go.
* **UI/UX Improvements:**
* Refactored Admin Create Invite form with aligned Price/Currency inputs.
* Added Payment Required modal to user registration flow.
* Improved Setup Wizard URL handling.
* **Fixes:**
* Corrected price handling (dollars vs cents).
* Fixed setup wizard redirection bugs.
…json:"labels". migrations.go: Updated the ombi.NotificationPref struct literals to use explicit keys (Agent:, UserID:, etc.). jf_activity_test.go: Updated the mediabrowser.Time struct literal to use the explicit key Time:. Dockerfile: Reverted to agnostic format.
- Implemented public store page (html/store.html) matched to system theme - Added Stripe checkout integration for invite generation - Updated webhook handler to process metadata (target_email, plan) - Refactored Docker build process and added .dockerignore - Fixed various struct literals and types for build stability
- Added 'Monthly Access' plan (.00/mo) to store page with shared email input - Implemented 'invoice.payment_succeeded' webhook to extend user expiry on renewal - Configured monthly invites to have strict 30-day expiry for auto-churn - Refactored HandleWebhook to return raw events for flexibility - Added cleanup for jfa-go binary in .gitignore
Adds an admin tab to set monthly price/currency and updates the store page UI to match. Removes the one-time 'Standard' plan entirely. Fixes a type assertion panic when saving config.
- Implemented full PayPal Monthly Subscription flow with webhooks. - Implemented Stripe Monthly Subscription flow with webhooks. - Added 'Store' tab to Admin UI for configuring both providers. - Redesigned Store Page for better UI/UX. - HARDENING: Added Idempotency checks (LastTransactionID) to prevent double-credit on retries. - HARDENING: Added Auto-Cancel logic for PayPal to prevent double-billing. - HARDENING: Added Smart Prevention to block active users from re-subscribing. - HARDENING: Added Re-enable logic for both providers to instantly unban disabled users upon payment.
👷 Deploy request for jfa-go pending review.Visit the deploys page to approve it
|
🛒 Store Configuration & Setup GuideThis update introduces dynamic pricing and a complete UI overhaul (tacking shit onto what is already functional) for the "Pay-to-Generate" feature, focusing exclusively on Monthly Subscriptions. 🎨 Store Redesign Overview
|
SummaryWe encountered some stability issues requiring a local rollback, but we have successfully re-implemented and hardened the integration. Status UpdateStripe (🟢 Fully Functional):
PayPal (🟡 Functional / Passive Mode):
i can see paypal being gutted entirely though. stripe works well UI/UX Notes
Ready for review. |
_loadLock set true when a load is happening, if another _load is called when this is happening, the method call is appended to _loadQueue. When a running _load finishes, it shift()s the _loadQueue and calls the method from it if there is one.
Navigatable has clearURL, which for Search clears "search" qp, and invites clears "invite" qp. Tab interfaces optionally include "contentObject: AsTab", and show/hide funcs are passed the contentObject of the previously loaded tab if one is available, so that they can call it's clearURL method. This means searches you typed for the accounts tab won't pop up when switching to activity.
uses the <tool-tip> tag now, and the setupTooltips() function in ui.ts must be called at any point in the pages load. added "below-center" position, showing below and centered horizontally. breakpoint tailwind lingo also now works (e.g. "below-center sm:right"). If a left or right-aligned tooltip clips off the screen, it will be shifted the appropriate amount left/right to avoid that automatically.
other content wasn't being hid when the message popped up, should now. For hrfee#455.
|
This is very big and I want to rework it to fit the style of the rest of the code so it'll take a long time. |
|
Also, don't worry about the review notes, those are for me. |
noted, congrats, new grad. |
computeScrollInfo wasn't being called before the first detectScroll call, because there is no search functionality (somehow, i think). Fixed by calling it if _scroll.rowHeight is 0.
enable watch_polling/"Use polling" if the usual PWR monitoring doesn't work for you (likely if you're using a network mount (SMB/NFS) or anything with FUSE.
|
would it also be possible to setup a section for crypto payments, maybe like BTCPay |
- Revert gratuitous HTML reformatting in admin.html (516 -> 35 changed lines) - Restore original ts/admin.ts, add only store tab registration - Add log message constants to logmessages.go for Stripe/PayPal - Replace all inline log strings with lm constants in api-stripe.go, api-paypal.go - Split large webhook handlers into sub-functions (handleStripeCheckoutCompleted, etc.) - Extract findUserByEmail helper to payments.go - Fix stripeEnabled default from true to false - Gate PayPal routes behind paypalEnabled check in router.go - Fix payment_success.html HTML structure (DOCTYPE, html, head tags) - Remove duplicate comments and dead code - Use emailEnabled var instead of config checks - Replace fmt.Printf with log.Printf in InitPayPal - Use lm constants in main.go for Stripe/PayPal init messages - Remove verbose Serving... prints from view functions
e792b43 to
457c595
Compare
…pe-integration # Conflicts: # ts/admin.ts
screen.webmthat's a great idea. in other news progress is going (need to setup smtp next for more testing) paypal gutted, btcpay integration added. XMR is integrated via the BTCPay Monero plugin but pending live stagenet testing due to network constraints with testnet on my end. still want to confirm lightning payments work and tweak the flow a bit as the invoice success page redirects back to jfa-go after a few seconds hence the need to verify the buyer's email is correctly passed to btcpay for invoice notifications. |
Remove all PayPal code (api-paypal.go, routes, config, templates). Add BTCPay Server integration supporting both BTC and XMR payments via the Greenfield API. Webhook triggers invite generation on settlement.
12ffb53 to
be02a9f
Compare












📦 Consolidated Update: Subscriptions & Store Overhaul
#460
#462
🚀 Overview
This PR implements PayPal Subscriptions, hardens our Stripe integration, and introduces a completely redesigned Storefront.
✨ Key Features
Storetab to set price and new Settings to manage API keys for PP and Stripe🛡️ Security & Hardening (Idempotency)
LastTransactionIDtracking to prevent duplicate account credits from retried webhooks.⚡ Stripe Enhancements
🛠 Technical Breakdown
View detailed changes
PAYMENT.SALE.COMPLETED)LastTransactionIDcolumn to enforce idempotency🧪 Testing Plan