What was wrong. The ticket asks for a new prepaid coupon code for 50 dollars: BARECLC50. Before the PR the code was not known, so it was refused as invalid.
What the change does. BARECLC50 now maps to the same $50 coupon product as FREE50 and BARE50 (product 19). On the review app it is accepted on the quote and on the contract payment page, takes $50 off ($3,469.00 to $3,419.00 upfront; $150.79 to $148.70 monthly), survives a reload, swaps cleanly with other codes, and a Stripe TEST card charge was $3,419.00.
Not changed by this work. Your call.
- Case: codes are case-sensitive like every other code, so "bareclc50" is refused. Is that fine? (ASSUMPTION used: yes, same as all codes.)
- Expiry: the ticket gives no end date, so none was added. Other time-limited codes carry a "turn off" date in a comment. Is there one for BARECLC50?
- Spaces: a leading space (" BARECLC50") is refused because input is not trimmed. Same for all codes.
The ticket did not say. Please overrule anything you disagree with.
| # | The ticket said | What we did | Why |
|---|---|---|---|
| 1 | Nothing about how to test it. | Used FREE50 as the reference code, on equivalent fresh quotes. | The PR says both map to product 19. The PM can overrule it. |
| 2 | D-2: No HubSpot records were needed: prepaid quotes are made on the public page. The run tag R5 is in the first name "BDT4282 R5 Tester" instead. | ||
| 3 | D-3: The admin banner that shows the tester's work email was hidden in the recordings by CSS. | ||
Outside this ticket. We changed nothing here.
- On a review app, after a successful card payment, the browser goes to dev.bare.com.au/prepaid/quote, not back to the review app. The Stripe return URL is built from BARE_APP_DOMAIN (app/views/prepaid/payments/new.html.erb line 17), which is dev. The payment itself succeeded (database check). Not caused by the PR; not checked on dev without the PR. A dev may want to know: it makes the processed-payment page untestable on review apps.
- Coupons on a contract can only be changed on the payment page. Applying one resets the signature and sends the customer back to the review page to sign again. That is existing behaviour and the page says so.
- The login profile held a leftover "Impersonating" session from an earlier test run, which made the quote email field read-only. It was cancelled before each run.
Test apps and the HubSpot sandbox only.
- Review app baredev-pr-4711 (commit a5f1fc54c5ad), which shares dev's database.
- Fake prepaid quotes named "BDT4282 R5 Tester" with bdt4282-r5-*@example.com emails; two contracts for fake person "Test Manualtest". No real customer data.
- One Stripe TEST payment of $3,419.00 (card 4242, Stripe key pk_test) on a fake contract.
- No HubSpot records created. Nothing deleted.
So nobody thinks it was checked.
- The PR's unit test (test/data/coupon_codes_test.rb) was not run: the PR branch is not checked out here.
- The processed-payment page after paying was not seen: the redirect goes to dev (see Things we noticed).
- Behaviour on dev without the PR was not compared, apart from reading the code (the code was unknown before).
- Other brands, pre-need contract emails, PDFs and HubSpot sync: review apps do not do these, and the change does not touch them.
- Monthly (direct debit) payment was not paid, only priced.
Validated by us TJ-1 Apply BARECLC50 on a new prepaid quote Quote
A customer starts a prepaid quote and enters the new code.
Steps to repeat
- Dev admin, then Review App, then baredev-pr-4711 (tester logged in by hand).
- Open /prepaid/quote, fill a fake person, Continue.
- "Do you have a discount code?", enter BARECLC50, Apply code.
Prediction (written before the run)
Code accepted. A $50 discount: upfront $3,469.00 becomes $3,419.00. The quote's saved coupon is product 19.
Result
As predicted. Save request 200, banner "Your BARECLC50 discount code has been applied.", $3,419.00 (monthly $148.70). Database: the quote has coupon item 19 (coupon_50_20210501).
Your validation notes
Validated by us TJ-2 Control: FREE50 gives the same discount Quote
Shows BARECLC50 is the same as the existing $50 code.
Steps to repeat
- The same flow with FREE50 on a fresh quote.
Prediction (written before the run)
Same $50 discount, same total, same saved product 19.
Result
As predicted: $3,419.00 and coupon item 19.
Your validation notes
Validated by us TJ-3 Reload after applying Quote
The discount is saved on the server, not only shown by JavaScript.
Steps to repeat
- Apply BARECLC50, then reload the quote page.
Prediction (written before the run)
The banner and discounted price are still there, including in the server's first HTML.
Result
As predicted. The server HTML holds the banner; price still $3,419.00.
Your validation notes
Validated by us TJ-4 Apply BARECLC50 on a contract Contract
A customer who has already signed adds the code on the payment page.
Steps to repeat
- Quote with no code, upfront, fake details, sign the contract, Continue to Pay.
- On the payment page, enter BARECLC50, Apply code.
- Sign again, go back to the payment page.
Prediction (written before the run)
Discount applied; the signature is reset so the customer must sign again; the payment page then shows $3,419.00 and the code.
Result
As predicted. Request 303 to the review page, "Was $3,469.00, $3,419.00", signature box back to unsigned, payment page shows 'BARECLC50' and $3,419.00.
Your validation notes
Validated by us TJ-5 Swap codes Quote
BARECLC50, then BARE100, then BARECLC50 again.
Steps to repeat
- Apply the three codes in turn on one quote.
Prediction (written before the run)
Each code replaces the last; no stacking; final $50 off.
Result
As predicted: $3,419.00, then $3,369.00, then $3,419.00. Database: one coupon item (19).
Your validation notes
Validated by us TJ-6 Near-miss codes are refused Quote
bareclc50, " BARECLC50" (leading space), BARECLC51 and BARECLC.
Steps to repeat
- Enter each in turn on one quote.
Prediction (written before the run)
All refused with the usual message; no discount saved.
Result
As predicted: four 422 responses, "Discount code '…' is not valid", price stays $3,469.00, no banner, no coupon item in the database. Case and spaces: see Questions for the PM.
Your validation notes
Validated by us TJ-7 Pay with the Stripe test card Payment
The charge matches the discounted price.
Steps to repeat
- Quote with BARECLC50, upfront, fake details, sign, Continue to Pay.
- Card, Stripe TEST card 4242 4242 4242 4242, 12/34, 123, Pay and Complete.
Prediction (written before the run)
The charged amount equals the discounted total.
Result
As predicted. Stripe key is pk_test. Database payments row: 341900 cents ($3,419.00), succeeded, card. The browser then went to dev.bare.com.au, not the review app (the processed-payment page was not seen); see Things we noticed.














