Skip to content

Implement Stripe Payment Gateway and Payment Service (closes #1)#22

Open
CHXZDM wants to merge 1 commit into
SecureBananaLabs:mainfrom
CHXZDM:feature/implement-stripe-payment-intent
Open

Implement Stripe Payment Gateway and Payment Service (closes #1)#22
CHXZDM wants to merge 1 commit into
SecureBananaLabs:mainfrom
CHXZDM:feature/implement-stripe-payment-intent

Conversation

@CHXZDM
Copy link
Copy Markdown

@CHXZDM CHXZDM commented May 17, 2026

Summary

This PR implements the Stripe payment gateway integration as requested in issue #1.

Changes Made

  • Replaced the mock createPaymentIntent function with real Stripe SDK integration
  • Added parameter validation for amount (required, positive integer)
  • Added currency parameter with default value "usd"
  • Implemented Stripe error handling with original error messages preserved
  • Added unit tests for paymentService
  • Updated package.json to include stripe dependency

Technical Details

  • Uses stripe npm package for Stripe API integration
  • API key is read from STRIPE_SECRET_KEY environment variable (no hardcoded keys)
  • Returns clientSecret and paymentId from Stripe's PaymentIntent object

Testing

  • All unit tests pass (5/5)
  • Tests cover: required amount validation, positive integer validation, default currency, valid payload

Related Issue

Closes #1

…bs#1)

- Replace mock payment function with real Stripe SDK integration
- Add parameter validation for amount (required, positive integer)
- Add currency parameter with default value 'usd'
- Implement Stripe error handling with original error messages preserved
- Add unit tests for paymentService
- Update package.json to include stripe dependency

Closes SecureBananaLabs#1
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