Skip to content

fix(stripe): konfigurowalne metody płatności + p24 wyłączone domyślnie#36

Merged
nieprzecietny merged 1 commit intomasterfrom
fix/stripe-configurable-payment-methods
Mar 29, 2026
Merged

fix(stripe): konfigurowalne metody płatności + p24 wyłączone domyślnie#36
nieprzecietny merged 1 commit intomasterfrom
fix/stripe-configurable-payment-methods

Conversation

@rico-agent
Copy link
Copy Markdown
Contributor

Problem

p24 wymaga aktywacji w Stripe Dashboard — bez niej rzuca StripeException dla PLN.
Było hardkodowane ["card","blik","p24"].

Rozwiązanie

  • StripeServiceCaller przyjmuje opcjonalny IConfiguration
  • Metody płatności czytane z Stripe:AllowedPaymentMethods (gdy ustawione)
  • Fallback: GetPaymentMethodsForCurrency() — PLN: card+blik (bez p24)

Konfiguracja

"Stripe": {
  "AllowedPaymentMethods": ["card", "blik", "p24"]
}

lub env var: Stripe__AllowedPaymentMethods__0=card

Testy

✅ 378 passed, 0 failed

Problem: p24 wymaga aktywacji w Stripe Dashboard, bez niej rzuca
StripeException dla PLN. Było hardkodowane ['card','blik','p24'].

Zmiany w StripeServiceCaller:
- Dodano opcjonalny IConfiguration do konstruktora
- Metody płatności czytane z 'Stripe:AllowedPaymentMethods' (gdy niepuste)
- Fallback: GetPaymentMethodsForCurrency() — PLN: card+blik (bez p24)
- Łatwo włączyć p24 po aktywacji w Stripe Dashboard przez config

Przykład konfiguracji:
  appsettings.json:  'Stripe': { 'AllowedPaymentMethods': ['card','blik','p24'] }
  env var:           Stripe__AllowedPaymentMethods__0=card
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 22.22222% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.62%. Comparing base (f21d07e) to head (8caa8d0).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ed.Payments.Provider.Stripe/StripeServiceCaller.cs 22.22% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   54.81%   56.62%   +1.81%     
==========================================
  Files         101      101              
  Lines        3399     2877     -522     
  Branches      292      294       +2     
==========================================
- Hits         1863     1629     -234     
+ Misses       1459     1172     -287     
+ Partials       77       76       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nieprzecietny nieprzecietny merged commit 5d60b0d into master Mar 29, 2026
2 of 3 checks passed
@nieprzecietny nieprzecietny deleted the fix/stripe-configurable-payment-methods branch March 29, 2026 21:16
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.

2 participants