cmsbacklog-updates-apr2024 v 6.1 Release date: 30 Jun. 2021

Full Release Notes

BACKLOG

Gift Cards + Discount Codes on form payments and secure zone subscriptions

Gift Vouchers and Discount Codes can now be used with all form payments (general payment, paid Events, paid Secure Zone subscriptions).

For Secure Zone Recurring Discount Settings:

Add new settings to ‘eCommerce’ > ‘Settings’ > ‘Settings tab’:

“Recurring Settings”

  • Discount applies to
    • First Payment Only (default)
    • All Payments

Discount Code and Gift Voucher to forms:

Ability to add ’Discount Code’ and ’Gift Voucher’ fields to the form builder.

Generate following HTML on default form html:

Discount Code:

<label for="Payment_DiscountCode">Discount Code</label>
<input type="text" id="Payment_DiscountCode" name="Payment_DiscountCode">

Gift Voucher:

<label for="Payment_GiftVoucher">Gift Voucher</label>
<input type="text" id="Payment_GiftVoucher" name="Payment_GiftVoucher">

Do not allow to add Discount Code or Gift Voucher field to the form type="checkout". 

If attempted, show error: “<fieldName> doesn't allowed on this type of the form”

Do not allow to change the type of the form to type="checkout" if it contains Discount Code or Gift Voucher field.

If attempted, show same error as above.


When payment proceeds - apply following Discount and Gift Voucher like it works on shopping cart.

  • SKIP applying on from type="checkout"
  • APPLY on
    • Generic form
      • General payment
      • Secure zone recurring payment
    • SingleItem form

Default html code rework:

Replace: 

<input type="text" disabled="disabled" id="Payment_Amount" name="Payment_Amount" value=""/>

to:

<input type="text" disabled="disabled" id="PaymentTotalCost" value=""/>

JS implementation:

  • Add ’priceCalculation.js’ to the head section of the page if form contains Discount Code or Gift Voucher field.
  • Implement algorithm in JS that decreases price when Discount and/or Gift Voucher applies (trigger it on ’Payment_DiscountCode’, ’Payment_GiftVoucher’ or ’Payment_Amount’ field change event):
    • Take ’PaymentAmount’ form ’name="Payment_Amount"’.
    • Take value of ’GiftVoucherValue’ based on ’Payment_GiftVoucher’
    • Take value of ’DiscountCodeValue’ based on ’Payment_DiscountCode’
      • DiscountCodeValue = PaymentAmount * DiscountCodePercentageValue
        or
      • DiscountCodeValue = DiscountCodeAmountValue implement and use frontend API request to determine values of a discount code and a gift voucher.
        • Return validation errors for DiscountCode AND GiftVoucher (see shopping cart errors)
    • Calculate ’TotalCost’
      • TotalCost = PaymentAmount - DiscountCodeValue - GiftVoucherValue
      • if TotalCost < 0 
        • TotalCost = 0
    • Set ’TotalCost’ to <input id="PaymentTotalCost"/> of the current form


Discount payment flow:

  • If PaymentAmount matches the required payment amount for the current form (for Generic form with recurring secure zones - sum of all recurring subscription prices. For SingleItem - priceOfEvent*allocation)
    • If DiscountCode is applied AND (DiscountCode IS expired OR RedemptionQuantity == Expire After x Redemption OR DiscountCode IS disabled)
      • Show appropriate validation error (see shopping cart errors)
    • Else
      • Begin
        • Create Order. 
        • Set OrderLine price to PaymentAmount 
        • Apply Discount and/or Gift Voucher
        • DO Increase RedemptionQuantity for the Discount 
      • Then
        • Get TotalCost by the logic described above.
      • Then
        • If Discount applies to == First Payment Only
          • Create Recurring Payment
            • Set first payment Price to TotalCost  and recurring Price to PaymentAmount
        • elseif Discount applies to == All Payments
          • If DiscountCodePercentageValue == 100
            • Create secure zone subscriptions with expiration date 31-Dec-9999
            • Do NOT Create Recurring Payment
          • else
            • Create Recurring Payment
              Set first payment Price to TotalCostand recurring Price to
              PaymentAmount * (1-DiscountCodePercentageValue/100)
              • if TotalCost == PaymentAmount * (1-DiscountCodePercentageValue/100)
                • set general recurring payment with price == TotalCost
    • Then
      • if GiftVoucherValue > 0 and (PaymentAmount - DiscountCodeValue) > 0
        • GiftVoucherBalance = GiftVoucherValue - (PaymentAmount - DiscountCodeValue)
        • Apply GiftVoucherBalance to the GiftVoucher
  • else 
    • show current validation error message
  • Then
    • When recurring payment triggers webhook
      • Get Parent Order's DiscountCode
      • Get Parent Order's OrderLine
      • Create order using OrderLine and DiscountCode
      • DO NOT increase RedemptionQuantity for the DiscountCode

For Stripe:

For recurring payment if payment gateway is STRIPE

If Discount applies to == All Payments AND applied DiscountCode and GiftVoucher - show validation message:

“Current site settings doesn't allow applying Discount Code and Gift Voucher at the same time for recurring payments”

Examples:

Examples of secure zone subscription purchase (Discount applies to == First Payment Only):

1. For % off discount, it should be a one-time discount. So that the renewal is at the normal rate for that subscription.

For instance:

  • subscription cost $100
  • 50% discount

Result

  • first payment: 100*0.5 = $50
  • recurring payments: $100

2. For dollar amount discount, it would work the same way - on the initial purchase only. All recurring invoices would not use the discount.

For instance:

  • $100 subscription
  • $50 discount
  • $30 gift voucher

Result

  • first payment 100-50-30 = $20
  • all recurring payments: $100

BACKLOG

Stripe Customer Portal

Implement Stripe Customer Portal Page
(What is this? https://stripe.com/docs/billing/subscriptions/customer-portal)

Liquid:

Add link for the Stripe Customer Portal into the request member object:

‘request.currentmember.StripeCustomerPortalLink’

When clicking on the link:

  • if current logged in user == null
    • Render content of 401 System Page
  • Else, verify if current logged in user equals to order's CRM contact
    • If true:
      Open Stripe Customer Portal page
    • Else:
      Render content of 403 System Page

Implement Flows triggered by the Stripe Customer Portal 

Cancel Recurring Flow:

  • If subscription canceled from Stripe Customer Portal - cancel subscription in the CMS

Change Subscription (that contains only one Plan):

  • If subscription plan was changed from Stripe Customer Portal - sync plan on the subscription in CMS

Change Email Address:

  • If email address changed from Stripe Customer Portal - begin change of  CRM Contact -> Email property:
    • Create request to change email
    • send confirmation email to new email address
    • if confirmed - change email
    • else - do nothing

Change Billing Address:

  • If Billing Address changed from Stripe Customer Portal - change CRM Contact -> Billing Address accordingly

Change Phone Number:

  • If Phone changed from Stripe Customer Portal - change CRM Contact -> Phone property

BACKLOG

Custom Reports: Customer And Order logic extending

Add following ”view” and ”filter” options to ”Customer And Order” report type allowing further order and individual product reporting/filtering:

  • Product Name
    - Show dropdown of ALL product names on filter
  • Product Attributes
    - General string field on filter
  • SKU Code
    - General string field on filter
  • Product Quantity
    - Number field on filter
  • Product Price
    - Number field on filter
  • Product Total Price
    - Number field on filter
  • Order Discount Price
    - Number field on filter
  • Order Discount Code
    - General string field on filter
  • Order Gift Voucher Price
    - Number field on filter
  • Order Gift Voucher 
    - General string field on filter
  • Order Shipping Price
    - Number field on filter

BC example: http://prntscr.com/15dpmrd

When the following fields are selected for viewing - show each product data on a separate row.

Order and Customer data should be repeated in each row where product data listed.

Example: https://www.screencast.com/t/aX5hWFlz

BACKLOG

“| truncate” filter fix

Fix for the Liquid ‘| truncate’ filter

If string length bigger than (limitValue - ellipsis length) - do not show ellipsis at the end of the string

Before: http://prntscr.com/16bd9c7

After: http://prntscr.com/16bdidy

BACKLOG

Add form alias to system page redirect URL

Change default system page URL for form submissions to include the form alias as URL parameter (for GA tracking purposes):

/form-submission-results?form=[form.Alias]

So it will be similar to previous implementation:

/forms/cases.ashx?form=[form.Alias]

Feature Flags

Feature flags changes (v6.1)

Move flags to ”internal” and set to true:

  • Anti-spam protection