Skip to content

Commit 9b91d45

Browse files
committed
Tweak risky payment check to try and reduce false positives
1 parent 9477538 commit 9b91d45

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/model/account/account-store.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ export class AccountStore {
152152
const selectedPlan: SubscriptionPlanCode | undefined = yield this.pickPlan();
153153
if (!selectedPlan) return;
154154

155-
const isRiskyPayment = this.subscriptionPlans[selectedPlan].prices?.currency === 'BRL';
155+
const alreadyLoggedIn = this.isLoggedIn;
156+
if (!alreadyLoggedIn) yield this.logIn();
156157

157-
if (!this.isLoggedIn && isRiskyPayment) {
158+
const isRiskyPayment = this.subscriptionPlans[selectedPlan].prices?.currency === 'BRL' &&
159+
this.userEmail?.endsWith('@gmail.com'); // So far, all chargebacks have been from gmail accounts
160+
161+
this.user.subscription
162+
163+
if (!alreadyLoggedIn && isRiskyPayment) {
158164
// This is annoying, I wish we didn't have to do this, but fraudulent BRL payments are now 80% of chargebacks,
159165
// and we need to tighten this up and block that somehow or payment platforms will eventually block
160166
// HTTP Toolkit globally. This error message is left intentionally vague to try and discourage fraudsters
@@ -172,8 +178,6 @@ export class AccountStore {
172178
return;
173179
}
174180

175-
if (!this.isLoggedIn) yield this.logIn();
176-
177181
// If we cancelled login, or we've already got a plan, we're done.
178182
if (!this.isLoggedIn || this.userHasSubscription) {
179183
if (this.isPastDueUser) this.goToSettings();

0 commit comments

Comments
 (0)