Skip to content

Implement withdrawal feature with notifications #1345

Description

@NamFra

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.

Decree No. 2026-3 mandates a one-click withdrawal feature for digital services. Currently, Joanie does not support:

  • Recording withdrawal requests from Richie
  • Automatically sending acknowledgment emails to users
  • Specific rules for credentials (automatic cancellation) and certificates (manual validation)

Describe the solution you'd like

1. Withdrawal API

Create a dedicated endpoint to:

  • Receive withdrawal requests from Richie
  • Validate data (first name, last name, email, order/reference ID, date/time)

Processing logic:

has_waived_withdrawal_right Trainings (credentials) Certificates
True (✅ checked) Withdrawal button hidden on Richie Notification sent to the FUN team for manual processing
False (❌ unchecked) Automatic order cancellation Automatic order cancellation + Notification to the FUN team for processing

Simplified option: All certificate-related requests could be processed manually if distinguishing between cancellation types adds too much complexity!


2. Emails: acknowledgment and notifications

FOR THE USER:

If the cancelation is automatic (see table above), send two consecutive emails.
Alternative (if consecutive emails are not possible): use a daily cron job to process cancellations and send confirmations .

1. Acknowledgment of the cancellation request

  • Immediate acknowledgment email (for all requests):
    • Includes: first name, last name, email, order reference, course title and code, date/time.
    • Sent immediately for both credentials and certificates.

2. Confirmation of cancellation (if automatic cancellation applies):

  • Customized follow-up messages:
    • Trainings (credentials): send a confirmation email that indicates that the order has been cancelled
    • Certificates: send a confirmation email that indicates that the order is being processed by the FUN team for refund

FOR FUN SUPPORT:

  • Certificates only:
    • Notification sent to contact[at]fun-mooc.fr with request details and a direct link to the back-office (order or withdrawal entry, see 3. below).

FOR ORGANIZATIONS ASSIGNED TO THE ORDER (credentials only - if possible):

  • Notification to organization administrators (registered in Joanie):
    • Sent for automatic cancellations of credentials.
    • Exception: If no administrator is assigned, no notification is sent.

3. Admin interface (BO)

  • Dedicated view:

    • List of requests (name, email, product, date, type, status)
    • Filters by status, type, or date
    • Option to manually process (cancel from the back-office)
  • Alternative:

    • Integration into the "Orders" view with a distinct column or status for withdrawals, exportable to CSV

4. Withdrawal deadline verification

  • Use existing logic for a 16-day deadline (equivalent to 14 business days), but adapt the start of the withdrawal period based on the product type:
    • For training programs (credentials): the withdrawal period starts from the contract signature date.
      • Note: The first payment will not be debited before the end of the withdrawal period. If the learner waives their right to withdraw, the option will not be displayed.
    • For certificates: the withdrawal period starts from the payment completion date.

def _withdrawal_limit_date(signed_contract_date, course_start_date):
"""
Return the withdrawal limit date for the order.
On the withdrawal period of 14 days after the signing of the contract,
it is counted as follows (article L 221-19 of the Consumer Code):
- The day of the signing of the contract is not counted in the period;
the countdown therefore begins the day after the contract is signed.
- The period begins to run at the start of the first hour of the first
day and ends at the expiration of the last hour of the last day of the period.
- If the period expires on a Saturday, a Sunday or a public holiday or non-working day,
it is extended until the next working day.
The two first rules can be simplified with adding 16 days to the start date.
So, the withdrawal limit date is the start date + 16 days.
If the withdrawal limit date is after the course start date, the withdrawal limit
date is set to the signed contract date to allow the user to starts the course
immediately.
"""
calendar = get_country_calendar()
withdrawal_date = signed_contract_date + timedelta(
days=settings.JOANIE_WITHDRAWAL_PERIOD_DAYS
)
if not calendar.is_working_day(withdrawal_date):
withdrawal_date = calendar.add_working_days(
withdrawal_date, 1, keep_datetime=True
)
return (
withdrawal_date if withdrawal_date < course_start_date else signed_contract_date
)

  • The withdrawal button will not appear on Richie if the deadline has passed

Discovery, Documentation, Adoption, Migration Strategy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions