Commit graph

644 commits

Author SHA1 Message Date
7ced344cb0 Update setup.py 2025-12-29 15:40:34 +00:00
5b648499fb Add Adyen payment config to development.ini 2025-12-23 17:07:18 -05:00
1d03d6aee4 Add PayPal settings form handler and pass keys to template, make API key inputs full-width 2025-12-22 18:41:04 -05:00
42241d79b7 Remove jQuery dependency, convert to vanilla JavaScript 2025-12-22 18:34:35 -05:00
4bc0c67e3a Add JavaScript documentation 2025-12-22 18:29:10 -05:00
a647d9798c Replace JS toggles with pure CSS using HTML details element for payment settings 2025-12-22 18:25:14 -05:00
b44942a4bc Add Adyen SDK to requirements 2025-12-22 17:38:25 -05:00
fe0482ac8a Merge branch 'feature/Paypal_checkout' into 'master'
paypal

See merge request engineering/make-post-sell/make_post_sell!57
2025-12-22 22:29:51 +00:00
4210bc1421 Add Adyen payment integration
- Add Adyen API credentials to Shop model (api_key, merchant_account,
  client_key, hmac_key, enabled)
- Add adyen_psp_reference to Invoice model for payment tracking
- Add Adyen checkout views (create-session, complete-checkout)
- Add Adyen webhook handler with HMAC verification
- Add shop settings UI for Adyen credentials
- Add request.adyen_enabled and request.adyen_globally_enabled
- Update ADYEN.md with verification details and implementation status
- Add 21 tests (8 unit, 5 integration, 5 functional + 3 invoice)
2025-12-22 17:16:54 -05:00
a2e2092a31 Add privacy warnings to PayPal docs, create Adyen integration doc
PayPal:
- Document invasive KYC requirements (face scanning, government ID)
- Note that crypto is the privacy-preserving alternative

Adyen:
- Document integration approach (similar to Stripe)
- Include Python library usage, webhooks, credentials needed
- Status: not yet implemented
2025-12-22 16:11:54 -05:00
ac2f586453 Add Stripe payment tracking and webhook resilience
- Add stripe_payment_intent_id and stripe_charge_id columns to Invoice
- Store payment references during checkout for traceability
- Use idempotency key to prevent duplicate charges on retry
- Add Stripe webhook handler for payment_intent.succeeded, payment_failed,
  charge.refunded, and charge.dispute.created events
- Consolidate PayPal webhooks into webhooks.py
- Add stripe.webhook_secret configuration for signature verification

Tests: 8 unit, 5 integration, 7 functional tests for Stripe functionality
2025-12-22 16:03:20 -05:00
0b89ab2bb3 Fix test_cart_checkout_for_shop to match current checkout flow
The checkout POST now returns a 200 OK directly (or with different
redirect count), so update the test to:
1. Use a while loop to follow any number of redirects
2. Update assertion text from "Please enter your payment information."
   to "Please confirm your order." to match current UI text
2025-12-22 15:32:55 -05:00
31592b6923 Add PayPal unit, integration, and sandbox functional tests 2025-12-22 15:21:46 -05:00
979c5117df Merge PayPal views into cart.py, delete paypal.py 2025-12-22 14:29:00 -05:00
8121772233 Rename and simplify PayPal docs 2025-12-22 14:21:24 -05:00
30c1e29aa8 Mark PayPal integration as released Dec 22, 2025 2:30 PM 2025-12-22 14:20:20 -05:00
261ad97c7b Remove PayPalPayment table, use Invoice columns instead
- Add paypal_order_id and paypal_capture_id columns to Invoice model
- Update migration to add columns to mps_invoice instead of creating separate table
- Remove PayPalPayment model (simpler architecture matching Stripe)
- Update paypal.py to store PayPal info directly on Invoice
- Update paypal_webhooks.py to query Invoice by paypal_order_id
- Update Invoice.payment_method property to detect PayPal payments
2025-12-22 12:51:07 -05:00
b5a32c797e Clean up PayPal docs: remove references to non-existent files 2025-12-22 12:43:35 -05:00
09e3873028 Update docs: single migration, tables auto-created 2025-12-22 12:41:45 -05:00
b43850d0c7 Add docs directory, CHANGELOG.rst, update README
- Create docs/ directory and move CHANGES_PAYPAL.md into it
- Add CHANGELOG.rst with unreleased section for PayPal integration
- Update README.rst to mention PayPal alongside other payment methods
2025-12-22 12:36:28 -05:00
66382c9ca2 Fix PayPal migrations: use proper revision IDs and remove table creation
- Rebased onto master to include grid_lanes_enabled and other changes
- Replaced fake revision IDs (a1b2c3d4...) with proper alembic-generated IDs
- Removed table creation migrations (auto-created)
- Removed obsolete merge migration
- Keep only shop column migration for paypal_client_id, paypal_secret, paypal_enabled
2025-12-22 12:27:17 -05:00
8a3b172c0a contains the class-to-table mappings that SQLAlchemy needs to know which table each model class belongs to. 2025-12-22 12:04:37 -05:00
ae8113b857 Update file development.ini 2025-12-22 12:04:37 -05:00
85c2bb5649 Update 9 files
- /make_post_sell/models/shop.py
- /make_post_sell/views/cart.py
- /make_post_sell/scripts/alembic/versions/a1b2c3d4e5f8_create_paypal_payment_table.py
- /make_post_sell/scripts/alembic/versions/a1b2c3d4e5f7_create_paypal_user_shop_table.py
- /make_post_sell/scripts/alembic/versions/a1b2c3d4e5f6_add_paypal_credentials_to_shop.py
- /make_post_sell/scripts/alembic/versions/1396317d0fc4_merge_paypal_and_default_theme_.py
- /make_post_sell/templates/shop_settings.j2
- /make_post_sell/request_methods.py
- /development.ini
2025-12-22 12:04:37 -05:00
557fdda9bc Update 3 files
- /make_post_sell/models/paypal_payment.py
- /make_post_sell/models/paypal_user_shop.py
- /make_post_sell/models/__init__.py
2025-12-22 12:04:37 -05:00
9eab6e0218 PayPal Saved Payment Methods:
- Add vault parameters to order creation for saving payment methods
  - Extract and store vault.id in PayPalUserShop after successful payment
  - Add "Save PayPal" checkbox to checkout page
  - Show saved status for returning customers
  - Add PayPal management section to billing page
  - Add disconnect PayPal functionality at /billing/disconnect-paypal

  - Refunds are handled externally by shop owners via PayPal dashboard
  - Platform does not track or process refunds
  - Update documentation to reflect external refund handling

  Documentation:

  - Update CHANGES_PAYPAL.md 

  No database migrations required - uses existing PayPalUserShop columns:
  - active_payment_token (stores vault.id)
  - payer_id (stores PayPal payer ID)
  EOF
  )"
2025-12-22 12:04:37 -05:00
22be720c53 - Added /billing/disconnect-paypal route 2025-12-22 12:04:37 -05:00
e8e0e52f40 make_post_sell/templates/cart_checkout.j2
- Added "Save PayPal for faster checkout" checkbox
    - Shows "PayPal saved" status for returning users
    - Sends save_paypal parameter to backend

make_post_sell/templates/billing.j2
    - Added PayPal management section
    - Shows connected status with PayPal logo
    - Added "Disconnect PayPal" button
2025-12-22 12:04:37 -05:00
4a6f7ebb3a make_post_sell/views/paypal.py
- Added vault parameters for saving PayPal payment methods

- Extract and store vault.id after successful payment

- Logs vault status (VAULTED vs APPROVED)

make_post_sell/views/billing.py
    - Added paypal_user_shop to template context
    - Added disconnect_paypal() view function
2025-12-22 12:04:37 -05:00
b3270eb369 Add CSS Grid Lanes support with toggleable shop setting
Implement CSS Grid Lanes (masonry layout) for product grids with graceful
fallback to standard CSS Grid for browsers that don't support it yet.

- Add grid_lanes_enabled column to Shop model (default: True)
- Add toggle in Shop Settings under Announcement Ribbon Settings
- Update product grid templates to conditionally apply grid-lanes-enabled class
- CSS uses @supports (display: grid-lanes) for progressive enhancement
- Mobile (160px min) and desktop (240px min) breakpoints supported

When enabled and browser supports Grid Lanes, products flow into a
waterfall/masonry layout where items fill the shortest column first,
creating a Pinterest-style layout that handles varying image heights.
2025-12-19 20:33:28 -05:00
3bf65966c5 Style video play overlay: red tint, add click-to-play text 2025-12-17 09:25:57 -05:00
f95daf02a8 Fix video play overlay visibility and positioning 2025-12-17 09:21:38 -05:00
f3a23ef2cf Add play button overlay on video thumbnails for unlocked content
Display a centered play button overlay on hero thumbnail images when
the product/content is a video file and the user has access to it.
Clicking opens the video in a new tab.

- Add CSS for .video-thumbnail-container and .video-play-overlay
- Support dark theme with appropriate contrast
- Show overlay on content.j2 for free video content
- Show overlay on product.j2 only when user has unlocked the product
2025-12-17 09:16:20 -05:00
82973e61a7 Increase meta description truncation to 500 chars 2025-12-15 07:58:54 -05:00
0777bfc051 Truncate meta descriptions to 200 chars for cleaner unfurl cards 2025-12-15 07:58:19 -05:00
d0a419afa1 Add Twitter card meta tags for proper link unfurling on Matrix/Discord
Links shared to Matrix/Discord were showing the logo instead of thumbnail1
because twitter:card and twitter:image meta tags were missing. Added
complete Twitter card support (summary_large_image) plus og:url and
og:site_name for better Open Graph compliance.
2025-12-15 07:57:04 -05:00
e4ec3e0d5e Improve OTP email visibility by making code the prominent h1 heading
- Move OTP code to top of email as large h1 element
- Increase font size to 3em for better readability
- Add letter spacing and bold styling for clarity
- Demote greeting text to regular paragraph
2025-11-01 11:48:34 -04:00
789acae6fa Merge branch 'fix/mobile-friendly-shop-editor' into 'master'
mobile-friendly-shop-editor

See merge request engineering/make-post-sell/make_post_sell!56
2025-11-01 13:58:49 +00:00
ca1a71bcce Fix detached instance errors in physical product handling test
The test was failing due to SQLAlchemy DetachedInstanceError when
accessing object properties after transaction.manager.commit().

Changes:
- Save cart and shop UUIDs before commit to avoid detached access
- Re-query cart from database after commit using get_cart_by_id
- Pass shop_id parameter in cart URL to properly set request.shop
- Use saved UUID variables instead of accessing detached objects

This ensures request.shop_location is correctly resolved so the
handling options (local pickup, delivery, shipping) render properly
in the cart template.

All 357 tests now pass including the physical product handling test.
2025-11-01 09:56:21 -04:00
f539323fb0 Update meta.py
Capitalized the human-readable visibility labels (Public, Private, Unlisted).
2025-10-28 23:03:54 +00:00
42da9d35fa Update common.css
Added .col-status { display: none; } and mobile portrait media rules to hide columns 3–6, show the new Status column, and size Sellable/Price/Size for mobile.

Enabled title wrapping, ensured consistent header fonts, tuned column widths (Sellable wider, Status fixed, Size narrower), and added status-line spacing plus decimal-dot styling.
2025-10-28 23:03:05 +00:00
0565342c8c Update shop_products.j2 - Added the mobile-only Status column markup with class="col-status".
Combined visibility emoji plus bundle/physical/ready indicators into stacked status rows.

Wrapped price and size values so decimal points render through span.decimal-dot for bold dots.
2025-10-28 23:00:26 +00:00
fd8e8b6b4f Add functional test for physical product handling option CSRF
This test closes the coverage gap that allowed the CSRF token bug to
reach production. The handling option form requires CSRF protection but
no test exercised this code path because all existing functional tests
use digital products.

New test verifies:
- Physical product handling option form renders correctly
- CSRF token is present and accepted by the view
- All handling options work (pickup, delivery, local/intl shipping)
- Form submission succeeds without 400 Bad CSRF Token error

Closes test coverage gap for make_post_sell/views/cart.py:404
2025-10-16 10:52:26 -04:00
e001836f4b Fix CSRF token error for cart handling option selection
The handling option form was missing the CSRF token include, causing
a "400 Bad CSRF Token" error when users tried to select shipping
options. Added the missing {% include "snippets/csrf.j2" %} to match
the pattern used by all other POST forms in the cart template.

Fixes cart.j2:144 - handling option form now includes CSRF protection
2025-10-16 09:14:53 -04:00
30ee39bbe5 Merge branch 'freebies' into 'master'
Add checkout confirmation button for free carts with coupons

See merge request engineering/make-post-sell/make_post_sell!55
2025-10-15 13:14:00 +00:00
400b4c042b Add checkout confirmation button for free carts with coupons
When coupons reduced cart total to $0, the checkout page displayed no
button to finalize the order. This occurred because the Stripe button
only appears with active_card, and crypto buttons only appear when
cart.requires_payment is True. Users without saved payment methods
were unable to complete free orders.

Added dedicated "Confirm Free Checkout" button that displays when
cart.requires_payment is False, allowing users to finalize free orders.
Enhanced test coverage to verify button appears in checkout page HTML.
2025-10-15 09:08:47 -04:00
c9afd3b893 Fix session cookie bloat from crypto payment status tracking
Remove session-based status tracking that was storing crypto_payment_status_{payment_id}
for every payment, causing cookie size to exceed 4KB limit with 35+ payments.

- Remove: request.session[session_key] = current_status
- Remove: previous_status tracking via session
- Keep: Flash messages for status notifications (they don't bloat cookies)

Flash messages now trigger on every poll instead of just transitions, but this
prevents the cookie bloat issue. Client-side can handle transition detection if needed.
2025-10-11 19:41:15 -04:00
fcde8d94cf Fix crypto payment quote UI to hide QR/buttons immediately on received status
The removePaymentElements() and replaceButtonsWithInvoiceLink() JavaScript
functions were using incorrect CSS selectors that tried to match hardcoded
inline style attributes (e.g., div[style*="grid-template-columns: 1fr 1fr 1fr"])
which don't exist in the actual template HTML.

Updated both functions to use the correct CSS class selectors:
- '.payment-grid' for QR code and payment instructions
- '.payment-buttons' for copy buttons and wallet links

This ensures that when a payment transitions to 'received' status, the polling
mechanism immediately hides the payment UI elements without requiring a page
refresh, preventing potential duplicate payments.

Fixed selectors in crypto_checkout.j2:150-162 and crypto_checkout.j2:165-206
2025-10-11 13:17:41 -04:00
b5a93e7a7a Enhance product edit interface and improve cart layout
- Add file metadata display (type, size) for product files and thumbnails
- Add human_file_bytes method to Product model for flexible file size formatting
- Add file statistics section showing total capacity
- Reorganize cart layout with "New" button in header and "View Saved Carts" below checkout
2025-10-09 11:00:52 -04:00
3f17933130 Hide shipping address section for digital-only checkouts
Only show the "Active Shipping Address" section on checkout page when cart contains physical products that require shipping.
2025-10-08 15:49:39 -04:00