Skip to content

fix: resolve bounty issue #1 — implement Stripe PaymentIntent#724

Open
bomlinux92-byte wants to merge 1 commit into
SecureBananaLabs:mainfrom
bomlinux92-byte:bounty-fix-1-2026-05-27
Open

fix: resolve bounty issue #1 — implement Stripe PaymentIntent#724
bomlinux92-byte wants to merge 1 commit into
SecureBananaLabs:mainfrom
bomlinux92-byte:bounty-fix-1-2026-05-27

Conversation

@bomlinux92-byte
Copy link
Copy Markdown

Summary

Fix for [BOUNTY $350] Implement Secure Payment Gateway and Payment Service — Issue #1

Root cause

The function in was a stub that returned fake payment IDs () instead of integrating with the Stripe API.

Fix

  • Replaced the stub with a real Stripe integration using the Stripe Node.js SDK
  • Added validation for (required, must be a positive integer in smallest currency unit)
  • Added currency default to when not provided (consistent with original behavior)
  • Returns (mapped from ) and (mapped from )
  • Catches and re-throws Stripe errors (, , etc.) with the original error message preserved
  • Added unit tests validating amount validation rules and currency default behavior
  • Installed npm package in

Changes

  • — Full implementation with Stripe SDK
  • — Unit tests for validation logic

Acceptance Criteria met

  • ✅ npm package installed, environment variable used — no hardcoded keys
  • ✅ is required and must be a positive integer; function throws with descriptive error if missing or invalid
  • ✅ defaults to if not provided
  • ✅ Real call with
  • ✅ Resolved value includes and
  • ✅ Stub id generation removed
  • ✅ Stripe errors caught and re-thrown with original message preserved
  • ✅ Unit tests verify correct arguments passed to

Closes #1

- Replace stub implementation with real Stripe PaymentIntent via Stripe Node.js SDK
- Add amount validation (required, positive integer in smallest currency unit)
- Add currency default to 'usd' if not provided
- Return clientSecret and paymentId from PaymentIntent
- Handle Stripe errors and re-throw with original error message preserved
- Add unit tests for validation logic
github-actions Bot added a commit that referenced this pull request May 26, 2026
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