Skip to content

feat: instalments, one-click payment and lightbox on Thelia 3 themes - #26

Merged
anoziere merged 5 commits into
mainfrom
feat/flexy-payment-options
Oct 18, 2026
Merged

anoziere merged 5 commits into
mainfrom
feat/flexy-payment-options

Conversation

@anoziere

Copy link
Copy Markdown
Contributor

What

The front-office part of the module now works with Thelia 3 themes. The Smarty templates it rendered through the old order-invoice.* hooks are gone. Those hooks were no longer subscribed, so under Flexy only the plain hosted page was left, and that page sent the buyer back to Thelia 2 addresses.

  • Payment in instalments is published as a payment option on MODULE_PAYMENT_GET_OPTIONS (group payplug_multi_payment, option multi_payment), within the configured amount range. pay() reads the buyer's choice from the session key payment_module_option_choices and ignores it once the setting is turned off. This replaces the thelia_order_payment form extension.
  • One-click payment: a theme hook (checkout.payment.extra) names the saved card (if it has not expired) and links to its deletion.
  • Lightbox: in lightbox mode, layout.head.checkout-payment / layout.head.checkout-onepage load form.latest.js and a small vanilla script. When PayPlug is the chosen method, a click on the order button asks /checkout/pay in the background and opens the payment URL in the lightbox. jQuery is no longer needed, and a double click does not place the order twice.
  • Return, cancel and error addresses use getPaymentSuccessPageUrl() / getPaymentFailurePageUrl() instead of /order/placed and /order/failed, which no longer exist.

Removed: templates/frontOffice/default/PayPlugModule/*.html (3 files), Hook/FrontHookManager.php, EventListener/FormExtend/OrderFormListener.php. Version 3.2.0.

Needs thelia-templates/flexy#300 for the options and the hook.

Verified

  • PHPStan as in the module CI: no error.
  • Browser checks on Flexy with a test API key (no PayPlug account): the option appears only when enabled; when ticked, the order gets three rows in order_pay_plug_multi_payment before the API call, and none when it is not ticked; the saved card is shown; in lightbox mode the library loads, and the order button sends one XHR request and opens the address returned in the lightbox (PayPlug library stubbed). PayPlug rejects the fake key, and the buyer is sent to /checkout/failed.
  • Not played: a real payment, the real lightbox, the payment notification.

@anoziere
anoziere merged commit b3d7961 into main Oct 18, 2026
5 checks passed
@anoziere
anoziere deleted the feat/flexy-payment-options branch October 18, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant