mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 12:42:49 +00:00
fix(portal): avoid charge claims from cancelled return
Treat checkout return values as navigation hints rather than evidence of a completed or absent charge. Keep the cancelled message conditional and ignore unrecognised values. Change-source: pulse-maintainer
This commit is contained in:
@@ -3500,7 +3500,9 @@ without requiring a second restart; an unchanged visit stays silent. A stale
|
||||
panel is replaced only after the refreshed running plan is confirmed, never
|
||||
because the billing return URL says a change was made. When the return check
|
||||
finishes before the initial plan load, the panel may show that confirmed paid
|
||||
plan silently but must keep its second check for a later webhook. Regression
|
||||
plan silently but must keep its second check for a later webhook. A cancelled
|
||||
or unknown checkout return value must not assert whether a charge occurred.
|
||||
Regression
|
||||
coverage:
|
||||
`TestLoadConfig_ProviderHostedMSPPrefersRenewedLicense` in
|
||||
`internal/cloudcp/config_test.go`,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"source_hash": "a630a1a29019df3a176613efe21ad63fd006ea2a531bdb1d4cadc2bbb50b2158",
|
||||
"source_hash": "d5c69f37d9cf32a2e8ef727af6779bd44148235ed352fcb427967ef8a6a24859",
|
||||
"build_inputs": [
|
||||
"package.json",
|
||||
"tsconfig.json",
|
||||
|
||||
+2
-2
@@ -3043,8 +3043,8 @@
|
||||
pollAfterCheckout(0);
|
||||
} else if (returned === "billing") {
|
||||
checkAfterBillingReturn(0);
|
||||
} else {
|
||||
view.notice = "Checkout was cancelled. Nothing was charged.";
|
||||
} else if (returned === "cancelled") {
|
||||
view.notice = "Checkout was not completed here. Check your current plan below.";
|
||||
}
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -485,9 +485,15 @@ describe('installProviderPlan', () => {
|
||||
expect(controller.view().notice).toBe('');
|
||||
});
|
||||
|
||||
it('says nothing was charged when checkout is cancelled', () => {
|
||||
it('does not infer a charge outcome from a cancelled checkout return', () => {
|
||||
const { controller } = install(providerBootstrap(), '?provider_msp_checkout=cancelled');
|
||||
expect(controller.view().notice).toBe('Checkout was cancelled. Nothing was charged.');
|
||||
expect(controller.view().notice).toBe('Checkout was not completed here. Check your current plan below.');
|
||||
expect(api.refreshLicense).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('ignores an unrecognised checkout return value', () => {
|
||||
const { controller } = install(providerBootstrap(), '?provider_msp_checkout=unknown');
|
||||
expect(controller.view().notice).toBe('');
|
||||
expect(api.refreshLicense).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -488,8 +488,8 @@ export function installProviderPlan(deps: ProviderPlanDeps): ProviderPlanControl
|
||||
pollAfterCheckout(0);
|
||||
} else if (returned === 'billing') {
|
||||
checkAfterBillingReturn(0);
|
||||
} else {
|
||||
view.notice = 'Checkout was cancelled. Nothing was charged.';
|
||||
} else if (returned === 'cancelled') {
|
||||
view.notice = 'Checkout was not completed here. Check your current plan below.';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user