File tree Expand file tree Collapse file tree
ui/src/lib/client/components/ChurnStaySubscribed Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,15 +148,24 @@ export type Outcome =
148148 | 'error' ;
149149
150150export const ErrorReasons = [
151+ 'already_canceling_at_period_end' ,
152+ 'current_interval_not_found' ,
151153 'customer_mismatch' ,
152154 'discount_already_applied' ,
155+ 'failed_to_redeem_coupon' ,
153156 'general_error' ,
157+ 'no_cancel_interstitial_offer_found' ,
154158 'no_churn_intervention_found' ,
159+ 'no_upgrade_plan_found' ,
160+ 'not_eligible_for_upgrade_interval' ,
161+ 'offering_id_not_found' ,
162+ 'operation_denied' ,
155163 'redemption_limit_exceeded' ,
164+ 'stripe_price_id_not_found' ,
165+ 'stripe_subscription_update_failed' ,
156166 'subscription_not_active' ,
157167 'subscription_not_found' ,
158168 'subscription_still_active' ,
159- 'operation_denied' ,
160169 'unexpected_exception' ,
161170] as const ;
162171
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ describe('mapErrorReason', () => {
99 expect ( mapErrorReason ( 'customer_mismatch' ) ) . toEqual ( 'customer_mismatch' ) ;
1010 } ) ;
1111
12+ it ( 'should return the value for an interstitial offer ErrorReason' , ( ) => {
13+ expect ( mapErrorReason ( 'no_upgrade_plan_found' ) ) . toEqual ( 'no_upgrade_plan_found' ) ;
14+ } ) ;
15+
1216 it ( 'should return general_error for an invalid value' , ( ) => {
1317 expect ( mapErrorReason ( 'not_a_real_reason' ) ) . toEqual ( 'general_error' ) ;
1418 } ) ;
Original file line number Diff line number Diff line change @@ -101,7 +101,9 @@ export function ChurnStaySubscribed({
101101 eligibilityStatus : 'stay' as const ,
102102 offeringId : apiIdentifier ,
103103 interval : interval as Interval ,
104- entrypoint : searchParams . get ( 'entrypoint' ) ?? undefined ,
104+ entrypoint :
105+ searchParams . get ( 'entrypoint' ) ??
106+ ( searchParams . get ( 'utm_medium' ) === 'email' ? 'email' : undefined ) ,
105107 utmSource : searchParams . get ( 'utm_source' ) ?? undefined ,
106108 utmMedium : searchParams . get ( 'utm_medium' ) ?? undefined ,
107109 utmCampaign : searchParams . get ( 'utm_campaign' ) ?? undefined ,
You can’t perform that action at this time.
0 commit comments