Skip to content

Unit tests + connected codebase fixes#14

Merged
mob-stuv merged 16 commits into
masterfrom
ppry-int-tests-fixes
Apr 11, 2026
Merged

Unit tests + connected codebase fixes#14
mob-stuv merged 16 commits into
masterfrom
ppry-int-tests-fixes

Conversation

@mob-stuv
Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ca1b22d-01e0-42c0-bd8a-0fcfdc36a93a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ppry-int-tests-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds/updates unit tests while aligning gateway implementations and shared error handling to match real provider API formats and improve exception details surfaced to callers.

Changes:

  • Update Stripe gateway to send form-encoded requests (and adjust tests accordingly), including capture method serialization.
  • Improve cross-gateway error parsing in AbstractGateway, and extend exceptions to carry structured details.
  • Adjust Robokassa request format/logging and add tests asserting richer error reporting; add sandbox-support annotations across gateways.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/Gateways/YooKassaGatewayTest.php Adds a basic create-customer test and aligns expected currency casing.
tests/Gateways/StripeGatewayTest.php Verifies Stripe requests are form-encoded with expected fields/headers.
tests/Gateways/StripeGatewayCaptureMethodTest.php Parses form body to assert capture_method without JSON decoding.
tests/Gateways/RobokassaGatewayTest.php Strengthens assertions for request format and error detail propagation.
tests/Gateways/PayPalGatewayTest.php Updates refund call shape to use params array.
src/Models/PaymentIntent.php Normalizes capture_method parsing from string values into the model’s boolean representation.
src/Gateways/YooKassaGateway.php Adds sandbox-support annotations; minor behavior documentation for unsupported ops.
src/Gateways/StripeGateway.php Implements form-urlencoded request building and serializes capture method correctly for Stripe.
src/Gateways/RobokassaGateway.php Sends JWT as JSON string, adds logging, improves error extraction, and adds sandbox-support annotations.
src/Gateways/PayPalGateway.php Adds sandbox-support annotations and updates some method docs/formatting.
src/Gateways/AbstractGateway.php Enhances error extraction and attaches raw response details to exceptions.
src/Exceptions/PaymentException.php Adds a details payload to carry structured context.
src/Exceptions/InvalidRequestException.php Plumbs details through to the base exception.
Comments suppressed due to low confidence (1)

src/Gateways/RobokassaGateway.php:403

  • PaymentException constructor now includes ?array $details before $code. Passing 500 as the 6th argument will cause a TypeError. Provide details (or null) as the 6th argument and move the HTTP status to the $code parameter.
        if ($this->password3 === null || $this->password3 === '') {
            throw new PaymentException(
                'Robokassa Refund API v2 requires Password#3 to be configured.',
                'robokassa_password3_required',
                'robokassa',
                null,
                null,
                500
            );

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Gateways/YooKassaGateway.php
Comment thread src/Gateways/PayPalGateway.php
Comment thread src/Gateways/PayPalGateway.php Outdated
Comment thread src/Gateways/RobokassaGateway.php Outdated
Comment thread tests/Gateways/StripeGatewayTest.php Outdated
Comment thread src/Gateways/PayPalGateway.php Outdated
Comment thread src/Gateways/RobokassaGateway.php
Comment thread src/Gateways/RobokassaGateway.php
Comment thread src/Gateways/RobokassaGateway.php
Comment thread src/Gateways/RobokassaGateway.php
@mob-stuv mob-stuv merged commit d6da0ca into master Apr 11, 2026
15 of 21 checks passed
@mob-stuv mob-stuv deleted the ppry-int-tests-fixes branch April 11, 2026 11:27
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.

3 participants