Skip to content

fix: Implement Secure Payment Gateway and Payment Service#14

Closed
Mira-Mjodheim wants to merge 1 commit into
SecureBananaLabs:mainfrom
Mira-Mjodheim:mira-fix-4460635923-50639
Closed

fix: Implement Secure Payment Gateway and Payment Service#14
Mira-Mjodheim wants to merge 1 commit into
SecureBananaLabs:mainfrom
Mira-Mjodheim:mira-fix-4460635923-50639

Conversation

@Mira-Mjodheim
Copy link
Copy Markdown

@Mira-Mjodheim Mira-Mjodheim commented May 16, 2026

Fixes #1

FIXED

Three changes made:

paymentService.js

  • Added an early guard in getStripe(): throws "STRIPE_SECRET_KEY is not configured" instead of silently constructing Stripe("") and failing opaquely at call-time.
  • Removed the no-op try/catch wrapper that caught and immediately re-threw — dead code that obscured the intent.

paymentController.js

  • fail(res, error.message, error.statusCode ?? 400) — forwards the Stripe HTTP status code when present. Card errors (StripeCardError) carry statusCode: 402, rate limits 429, auth failures 401, connection errors 502. Collaps

Changed Files

  • apps/api/package.json
  • apps/api/src/controllers/paymentController.js
  • apps/api/src/services/paymentService.js
  • package-lock.json

FIXED

Three changes made:

**`paymentService.js`**
- Added an early guard in `getStripe()`: throws `"STRIPE_SECRET_KEY is not configured"` instead of silently constructing `Stripe("")` and failing op
github-actions Bot added a commit that referenced this pull request May 16, 2026
@Mira-Mjodheim
Copy link
Copy Markdown
Author

Closing — I'm not able to verify this bounty is legitimate.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Secure Payment Gateway and Payment Service

1 participant