nodebb-plugin-calendar-onekite 11.1.61 → 11.1.62

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.
package/lib/admin.js CHANGED
@@ -135,7 +135,7 @@ admin.approveReservation = async function (req, res) {
135
135
 
136
136
  // If admin configured a Shop form, we can't create a cart programmatically with the standard Checkout API.
137
137
  // We therefore redirect the user to the shop page so the transaction is recorded in the Shop form.
138
- if (settings.helloassoFormType === 'Shop' && settings.helloassoOrganizationSlug && settings.helloassoFormSlug) {
138
+ if (String(settings.helloassoFormType || '').toLowerCase() === 'shop' && settings.helloassoOrganizationSlug && settings.helloassoFormSlug) {
139
139
  const frontBase = (env === 'sandbox') ? 'https://www.helloasso-sandbox.com' : 'https://www.helloasso.com';
140
140
  // Add rid as UTM for easier manual reconciliation on HelloAsso side (may not be returned in webhooks).
141
141
  paymentUrl = `${frontBase}/associations/${encodeURIComponent(settings.helloassoOrganizationSlug)}/boutiques/${encodeURIComponent(settings.helloassoFormSlug)}?utm_source=nodebb&utm_medium=calendar&utm_campaign=location&utm_content=${encodeURIComponent(String(rid))}`;
package/lib/api.js CHANGED
@@ -398,7 +398,8 @@ api.approveReservation = async function (req, res) {
398
398
  r.expectedTotalAmount = cents;
399
399
 
400
400
  // If a Shop form is configured, redirect to the Shop page so the payment is recorded in the shop.
401
- if (settings2.helloassoFormType === 'Shop' && settings2.helloassoOrganizationSlug && settings2.helloassoFormSlug) {
401
+ // The stored value can vary in casing depending on the ACP select.
402
+ if (String(settings2.helloassoFormType || '').toLowerCase() === 'shop' && settings2.helloassoOrganizationSlug && settings2.helloassoFormSlug) {
402
403
  const frontBase = (env2 === 'sandbox') ? 'https://www.helloasso-sandbox.com' : 'https://www.helloasso.com';
403
404
  r.paymentUrl = `${frontBase}/associations/${encodeURIComponent(settings2.helloassoOrganizationSlug)}/boutiques/${encodeURIComponent(settings2.helloassoFormSlug)}?utm_source=nodebb&utm_medium=calendar&utm_campaign=location&utm_content=${encodeURIComponent(String(rid))}`;
404
405
  } else {
@@ -420,8 +420,9 @@ async function handler(req, res, next) {
420
420
  const formType = getFormTypeFromPayload(payload).toLowerCase();
421
421
  const formSlug = getFormSlugFromPayload(payload);
422
422
  if (formType === 'shop' && String(settings.helloassoFormType || '').toLowerCase() === 'shop') {
423
- // If a specific shop slug is configured, require it.
424
- if (!settings.helloassoFormSlug || String(settings.helloassoFormSlug) === String(formSlug)) {
423
+ // If a specific shop slug is configured, require it when the payload provides it.
424
+ // Some webhook payloads (notably Payment) may omit the formSlug.
425
+ if (!settings.helloassoFormSlug || !formSlug || String(settings.helloassoFormSlug) === String(formSlug)) {
425
426
  resolvedRid = await tryMatchShopOrderToReservation(payload);
426
427
  }
427
428
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-calendar-onekite",
3
- "version":"11.1.61",
3
+ "version":"11.1.62",
4
4
  "description": "FullCalendar-based equipment reservation workflow with admin approval & HelloAsso payment for NodeBB",
5
5
  "main": "library.js",
6
6
  "license": "MIT",