fix: clear fake customer IDs from mock users so Asaas can create valid customer records
Build and Deploy (Gitea) / build-and-deploy (push) Has been cancelled
Details
Build and Deploy (Gitea) / build-and-deploy (push) Has been cancelled
Details
This commit is contained in:
parent
f495d94019
commit
8bc4226185
|
|
@ -333,7 +333,7 @@ app.post('/api/courses/:id/unlock', authenticateToken, checkoutRateLimiter, asyn
|
||||||
try {
|
try {
|
||||||
let customerId = user.asaasCustomerId;
|
let customerId = user.asaasCustomerId;
|
||||||
const apiKey = AsaasService.getApiKey();
|
const apiKey = AsaasService.getApiKey();
|
||||||
if (apiKey && (customerId?.startsWith('cus_sim_') || customerId?.startsWith('cus_fallback_'))) {
|
if (apiKey && (customerId?.startsWith('cus_sim_') || customerId?.startsWith('cus_fallback_') || ['cus_test', 'cus_00001', 'cus_00002', 'cus_00003', 'cus_00004'].includes(customerId || ''))) {
|
||||||
customerId = null;
|
customerId = null;
|
||||||
}
|
}
|
||||||
if (!customerId) {
|
if (!customerId) {
|
||||||
|
|
@ -517,7 +517,7 @@ app.post('/api/subscription/subscribe', authenticateToken, async (req: Authentic
|
||||||
try {
|
try {
|
||||||
let customerId = user.asaasCustomerId;
|
let customerId = user.asaasCustomerId;
|
||||||
const apiKey = AsaasService.getApiKey();
|
const apiKey = AsaasService.getApiKey();
|
||||||
if (apiKey && (customerId?.startsWith('cus_sim_') || customerId?.startsWith('cus_fallback_'))) {
|
if (apiKey && (customerId?.startsWith('cus_sim_') || customerId?.startsWith('cus_fallback_') || ['cus_test', 'cus_00001', 'cus_00002', 'cus_00003', 'cus_00004'].includes(customerId || ''))) {
|
||||||
customerId = null;
|
customerId = null;
|
||||||
}
|
}
|
||||||
if (!customerId) {
|
if (!customerId) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue