Skip to content

Handle card-link fail cases in CloudPayments#645

Open
neSpecc wants to merge 5 commits intomasterfrom
fix-card-linking
Open

Handle card-link fail cases in CloudPayments#645
neSpecc wants to merge 5 commits intomasterfrom
fix-card-linking

Conversation

@neSpecc
Copy link
Copy Markdown
Member

@neSpecc neSpecc commented Apr 23, 2026

Update CloudPayments /fail handling

Allow missing tariffPlanId when isCardLinkOperation is true (tariff is taken from workspace). Adjust error responses accordingly.

Improve logs: separate statements

neSpecc and others added 4 commits April 23, 2026 15:32
Update CloudPayments /fail handling to support card-linking flows: replace PlanProlongationPayload with PaymentData, validate workspaceId and userId separately, and allow missing tariffPlanId when isCardLinkOperation is true (tariff is taken from workspace). Adjust error responses accordingly and keep previous validations for non-card-link operations.

Tests updated to cover both scenarios: add a test that ensures a card-linking fail without tariffPlanId marks the business operation as Rejected, and a test that a non-card-link payload without tariffPlanId does not change the operation (remains Pending). Also remove an unused import and add jwt import for checksum generation in tests.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.97%. Comparing base (0f8dad9) to head (3c85db4).
⚠️ Report is 42 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #645       +/-   ##
===========================================
- Coverage   58.30%   41.97%   -16.33%     
===========================================
  Files          19       44       +25     
  Lines         518     2213     +1695     
  Branches       95      504      +409     
===========================================
+ Hits          302      929      +627     
- Misses        216     1216     +1000     
- Partials        0       68       +68     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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